├── .gitignore ├── DemoScene.meta ├── DemoScene ├── DancingGirl.fbx ├── DancingGirl.fbx.meta ├── DancingGirl.mat ├── DancingGirl.mat.meta ├── LocalLight.meta ├── LocalLight.unity ├── LocalLight.unity.meta ├── LocalLight │ ├── Global Volume Profile.asset │ ├── Global Volume Profile.asset.meta │ ├── LightingData.asset │ ├── LightingData.asset.meta │ ├── ReflectionProbe-0.exr │ ├── ReflectionProbe-0.exr.meta │ ├── ReflectionProbe-1.exr │ └── ReflectionProbe-1.exr.meta ├── New Material.mat ├── New Material.mat.meta ├── Sky.mat ├── Sky.mat.meta ├── Textures.meta └── Textures │ ├── DancingGirl_curvature.png │ ├── DancingGirl_curvature.png.meta │ ├── DancingGirl_normals.png │ ├── DancingGirl_normals.png.meta │ ├── DancingGirl_occlusion.png │ └── DancingGirl_occlusion.png.meta ├── LICENSE ├── Prefabs.meta ├── Prefabs ├── LightManager.prefab └── LightManager.prefab.meta ├── README.md ├── Runtime.meta ├── Runtime ├── FogLight.cs ├── FogLight.cs.meta ├── FogQualityParameter.cs ├── FogQualityParameter.cs.meta ├── LightManager.cs ├── LightManager.cs.meta ├── LightManagerFogLights.cs ├── LightManagerFogLights.cs.meta ├── LightOverride.cs ├── LightOverride.cs.meta ├── Resources.meta ├── Resources │ ├── ApplyToOpaque.shader │ ├── ApplyToOpaque.shader.meta │ ├── ExponentHeightFog.hlsl │ ├── ExponentHeightFog.hlsl.meta │ ├── InjectLightingAndDensity.compute │ ├── InjectLightingAndDensity.compute.meta │ ├── Scatter.compute │ ├── Scatter.compute.meta │ ├── VolumetricFog.cginc │ ├── VolumetricFog.cginc.meta │ ├── VolumetricFog.hlsl │ ├── VolumetricFog.hlsl.meta │ ├── noise.png │ └── noise.png.meta ├── Volumetric.cs ├── Volumetric.cs.meta ├── VolumetricFeature.cs └── VolumetricFeature.cs.meta └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Asset meta data should only be ignored when the corresponding asset is also ignored 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | -------------------------------------------------------------------------------- /DemoScene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4719c2b161579143af4ec47c2dbbf5d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DemoScene/DancingGirl.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladesero/Volumetrics_URP/050d405f217567a7143ed9501511bfe30ceb30cc/DemoScene/DancingGirl.fbx -------------------------------------------------------------------------------- /DemoScene/DancingGirl.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 362fb55f7d3ee1143b68d09b5f8b8a9a 3 | ModelImporter: 4 | serializedVersion: 21202 5 | internalIDToNameTable: [] 6 | externalObjects: 7 | - first: 8 | type: UnityEngine:Material 9 | assembly: UnityEngine.CoreModule 10 | name: DancingGirl 11 | second: {fileID: 2100000, guid: 15ad3e987dd704e45ba270ee2db0b8df, type: 2} 12 | materials: 13 | materialImportMode: 2 14 | materialName: 0 15 | materialSearch: 1 16 | materialLocation: 1 17 | animations: 18 | legacyGenerateAnimations: 4 19 | bakeSimulation: 0 20 | resampleCurves: 1 21 | optimizeGameObjects: 0 22 | removeConstantScaleCurves: 1 23 | motionNodeName: 24 | rigImportErrors: 25 | rigImportWarnings: 26 | animationImportErrors: 27 | animationImportWarnings: 28 | animationRetargetingWarnings: 29 | animationDoRetargetingWarnings: 0 30 | importAnimatedCustomProperties: 0 31 | importConstraints: 0 32 | animationCompression: 1 33 | animationRotationError: 0.5 34 | animationPositionError: 0.5 35 | animationScaleError: 0.5 36 | animationWrapMode: 0 37 | extraExposedTransformPaths: [] 38 | extraUserProperties: [] 39 | clipAnimations: [] 40 | isReadable: 0 41 | meshes: 42 | lODScreenPercentages: [] 43 | globalScale: 1 44 | meshCompression: 0 45 | addColliders: 0 46 | useSRGBMaterialColor: 1 47 | sortHierarchyByName: 1 48 | importVisibility: 1 49 | importBlendShapes: 1 50 | importCameras: 1 51 | importLights: 1 52 | nodeNameCollisionStrategy: 1 53 | fileIdsGeneration: 2 54 | swapUVChannels: 0 55 | generateSecondaryUV: 0 56 | useFileUnits: 1 57 | keepQuads: 0 58 | weldVertices: 1 59 | bakeAxisConversion: 0 60 | preserveHierarchy: 0 61 | skinWeightsMode: 0 62 | maxBonesPerVertex: 4 63 | minBoneWeight: 0.001 64 | optimizeBones: 0 65 | meshOptimizationFlags: -1 66 | indexFormat: 0 67 | secondaryUVAngleDistortion: 8 68 | secondaryUVAreaDistortion: 15.000001 69 | secondaryUVHardAngle: 88 70 | secondaryUVMarginMethod: 1 71 | secondaryUVMinLightmapResolution: 40 72 | secondaryUVMinObjectScale: 1 73 | secondaryUVPackMargin: 4 74 | useFileScale: 1 75 | tangentSpace: 76 | normalSmoothAngle: 60 77 | normalImportMode: 0 78 | tangentImportMode: 3 79 | normalCalculationMode: 4 80 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 81 | blendShapeNormalImportMode: 1 82 | normalSmoothingSource: 0 83 | referencedClips: [] 84 | importAnimation: 1 85 | humanDescription: 86 | serializedVersion: 3 87 | human: [] 88 | skeleton: [] 89 | armTwist: 0.5 90 | foreArmTwist: 0.5 91 | upperLegTwist: 0.5 92 | legTwist: 0.5 93 | armStretch: 0.05 94 | legStretch: 0.05 95 | feetSpacing: 0 96 | globalScale: 1 97 | rootMotionBoneName: 98 | hasTranslationDoF: 0 99 | hasExtraRoot: 0 100 | skeletonHasParents: 1 101 | lastHumanDescriptionAvatarSource: {instanceID: 0} 102 | autoGenerateAvatarMappingIfUnspecified: 1 103 | animationType: 2 104 | humanoidOversampling: 1 105 | avatarSetup: 0 106 | addHumanoidExtraRootOnlyWhenUsingAvatar: 1 107 | additionalBone: 0 108 | userData: 109 | assetBundleName: 110 | assetBundleVariant: 111 | -------------------------------------------------------------------------------- /DemoScene/DancingGirl.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-7461023854365402521 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 11 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | version: 5 16 | --- !u!21 &2100000 17 | Material: 18 | serializedVersion: 6 19 | m_ObjectHideFlags: 0 20 | m_CorrespondingSourceObject: {fileID: 0} 21 | m_PrefabInstance: {fileID: 0} 22 | m_PrefabAsset: {fileID: 0} 23 | m_Name: DancingGirl 24 | m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} 25 | m_ShaderKeywords: _NORMALMAP _OCCLUSIONMAP 26 | m_LightmapFlags: 4 27 | m_EnableInstancingVariants: 0 28 | m_DoubleSidedGI: 0 29 | m_CustomRenderQueue: -1 30 | stringTagMap: 31 | RenderType: Opaque 32 | disabledShaderPasses: [] 33 | m_SavedProperties: 34 | serializedVersion: 3 35 | m_TexEnvs: 36 | - _BaseMap: 37 | m_Texture: {fileID: 0} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | - _BumpMap: 41 | m_Texture: {fileID: 2800000, guid: 470c40004b504b44d81b18dc675f9941, type: 3} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | - _DetailAlbedoMap: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - _DetailMask: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | - _DetailNormalMap: 53 | m_Texture: {fileID: 0} 54 | m_Scale: {x: 1, y: 1} 55 | m_Offset: {x: 0, y: 0} 56 | - _EmissionMap: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - _MainTex: 61 | m_Texture: {fileID: 0} 62 | m_Scale: {x: 1, y: 1} 63 | m_Offset: {x: 0, y: 0} 64 | - _MetallicGlossMap: 65 | m_Texture: {fileID: 0} 66 | m_Scale: {x: 1, y: 1} 67 | m_Offset: {x: 0, y: 0} 68 | - _OcclusionMap: 69 | m_Texture: {fileID: 2800000, guid: 66b65b33bc005a2438552ff5e3d8c845, type: 3} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | - _ParallaxMap: 73 | m_Texture: {fileID: 0} 74 | m_Scale: {x: 1, y: 1} 75 | m_Offset: {x: 0, y: 0} 76 | - _SpecGlossMap: 77 | m_Texture: {fileID: 0} 78 | m_Scale: {x: 1, y: 1} 79 | m_Offset: {x: 0, y: 0} 80 | - unity_Lightmaps: 81 | m_Texture: {fileID: 0} 82 | m_Scale: {x: 1, y: 1} 83 | m_Offset: {x: 0, y: 0} 84 | - unity_LightmapsInd: 85 | m_Texture: {fileID: 0} 86 | m_Scale: {x: 1, y: 1} 87 | m_Offset: {x: 0, y: 0} 88 | - unity_ShadowMasks: 89 | m_Texture: {fileID: 0} 90 | m_Scale: {x: 1, y: 1} 91 | m_Offset: {x: 0, y: 0} 92 | m_Ints: [] 93 | m_Floats: 94 | - _AlphaClip: 0 95 | - _Blend: 0 96 | - _BumpScale: 1 97 | - _ClearCoatMask: 0 98 | - _ClearCoatSmoothness: 0 99 | - _Cull: 2 100 | - _Cutoff: 0.5 101 | - _DetailAlbedoMapScale: 1 102 | - _DetailNormalMapScale: 1 103 | - _DstBlend: 0 104 | - _EnvironmentReflections: 1 105 | - _GlossMapScale: 1 106 | - _Glossiness: 0 107 | - _GlossyReflections: 1 108 | - _Metallic: 0 109 | - _Mode: 0 110 | - _OcclusionStrength: 1 111 | - _Parallax: 0.02 112 | - _QueueOffset: 0 113 | - _ReceiveShadows: 1 114 | - _Smoothness: 0.34 115 | - _SmoothnessTextureChannel: 0 116 | - _SpecularHighlights: 1 117 | - _SrcBlend: 1 118 | - _Surface: 0 119 | - _UVSec: 0 120 | - _WorkflowMode: 1 121 | - _ZWrite: 1 122 | m_Colors: 123 | - _BaseColor: {r: 0.6886792, g: 0.6886792, b: 0.6886792, a: 1} 124 | - _Color: {r: 0.6886792, g: 0.6886792, b: 0.6886792, a: 1} 125 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 126 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 127 | m_BuildTextureStacks: [] 128 | -------------------------------------------------------------------------------- /DemoScene/DancingGirl.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15ad3e987dd704e45ba270ee2db0b8df 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DemoScene/LocalLight.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbf2831dc21fcb3478c57af7cd860551 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DemoScene/LocalLight.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 2100000, guid: d5892c30f85c3074e9ae0c21aa08fe3a, type: 2} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 112000000, guid: b7e894dbe3d5547418e2b1635340269b, 101 | type: 2} 102 | m_LightingSettings: {fileID: 0} 103 | --- !u!196 &4 104 | NavMeshSettings: 105 | serializedVersion: 2 106 | m_ObjectHideFlags: 0 107 | m_BuildSettings: 108 | serializedVersion: 2 109 | agentTypeID: 0 110 | agentRadius: 0.5 111 | agentHeight: 2 112 | agentSlope: 45 113 | agentClimb: 0.4 114 | ledgeDropHeight: 0 115 | maxJumpAcrossDistance: 0 116 | minRegionArea: 2 117 | manualCellSize: 0 118 | cellSize: 0.16666667 119 | manualTileSize: 0 120 | tileSize: 256 121 | accuratePlacement: 0 122 | maxJobWorkers: 0 123 | preserveTilesOutsideBounds: 0 124 | debug: 125 | m_Flags: 0 126 | m_NavMeshData: {fileID: 0} 127 | --- !u!1 &290040970 128 | GameObject: 129 | m_ObjectHideFlags: 0 130 | m_CorrespondingSourceObject: {fileID: 0} 131 | m_PrefabInstance: {fileID: 0} 132 | m_PrefabAsset: {fileID: 0} 133 | serializedVersion: 6 134 | m_Component: 135 | - component: {fileID: 290040972} 136 | - component: {fileID: 290040971} 137 | m_Layer: 0 138 | m_Name: Global Volume 139 | m_TagString: Untagged 140 | m_Icon: {fileID: 0} 141 | m_NavMeshLayer: 0 142 | m_StaticEditorFlags: 0 143 | m_IsActive: 1 144 | --- !u!114 &290040971 145 | MonoBehaviour: 146 | m_ObjectHideFlags: 0 147 | m_CorrespondingSourceObject: {fileID: 0} 148 | m_PrefabInstance: {fileID: 0} 149 | m_PrefabAsset: {fileID: 0} 150 | m_GameObject: {fileID: 290040970} 151 | m_Enabled: 1 152 | m_EditorHideFlags: 0 153 | m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} 154 | m_Name: 155 | m_EditorClassIdentifier: 156 | m_IsGlobal: 1 157 | priority: 0 158 | blendDistance: 0 159 | weight: 1 160 | sharedProfile: {fileID: 11400000, guid: 40dbf4b36cc64e049bb098588d3bb8bd, type: 2} 161 | --- !u!4 &290040972 162 | Transform: 163 | m_ObjectHideFlags: 0 164 | m_CorrespondingSourceObject: {fileID: 0} 165 | m_PrefabInstance: {fileID: 0} 166 | m_PrefabAsset: {fileID: 0} 167 | m_GameObject: {fileID: 290040970} 168 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 169 | m_LocalPosition: {x: -0.1281848, y: -3.7632413, z: -19.409252} 170 | m_LocalScale: {x: 1, y: 1, z: 1} 171 | m_ConstrainProportionsScale: 0 172 | m_Children: [] 173 | m_Father: {fileID: 0} 174 | m_RootOrder: 3 175 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 176 | --- !u!1 &293642539 177 | GameObject: 178 | m_ObjectHideFlags: 0 179 | m_CorrespondingSourceObject: {fileID: 0} 180 | m_PrefabInstance: {fileID: 0} 181 | m_PrefabAsset: {fileID: 0} 182 | serializedVersion: 6 183 | m_Component: 184 | - component: {fileID: 293642542} 185 | - component: {fileID: 293642541} 186 | - component: {fileID: 293642540} 187 | - component: {fileID: 293642543} 188 | m_Layer: 0 189 | m_Name: Main Camera 190 | m_TagString: MainCamera 191 | m_Icon: {fileID: 0} 192 | m_NavMeshLayer: 0 193 | m_StaticEditorFlags: 0 194 | m_IsActive: 1 195 | --- !u!81 &293642540 196 | AudioListener: 197 | m_ObjectHideFlags: 0 198 | m_CorrespondingSourceObject: {fileID: 0} 199 | m_PrefabInstance: {fileID: 0} 200 | m_PrefabAsset: {fileID: 0} 201 | m_GameObject: {fileID: 293642539} 202 | m_Enabled: 1 203 | --- !u!20 &293642541 204 | Camera: 205 | m_ObjectHideFlags: 0 206 | m_CorrespondingSourceObject: {fileID: 0} 207 | m_PrefabInstance: {fileID: 0} 208 | m_PrefabAsset: {fileID: 0} 209 | m_GameObject: {fileID: 293642539} 210 | m_Enabled: 1 211 | serializedVersion: 2 212 | m_ClearFlags: 1 213 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 214 | m_projectionMatrixMode: 1 215 | m_GateFitMode: 2 216 | m_FOVAxisMode: 0 217 | m_SensorSize: {x: 36, y: 24} 218 | m_LensShift: {x: 0, y: 0} 219 | m_FocalLength: 50 220 | m_NormalizedViewPortRect: 221 | serializedVersion: 2 222 | x: 0 223 | y: 0 224 | width: 1 225 | height: 1 226 | near clip plane: 0.3 227 | far clip plane: 1000 228 | field of view: 41.4 229 | orthographic: 0 230 | orthographic size: 5 231 | m_Depth: -1 232 | m_CullingMask: 233 | serializedVersion: 2 234 | m_Bits: 4294967295 235 | m_RenderingPath: -1 236 | m_TargetTexture: {fileID: 0} 237 | m_TargetDisplay: 0 238 | m_TargetEye: 3 239 | m_HDR: 1 240 | m_AllowMSAA: 1 241 | m_AllowDynamicResolution: 0 242 | m_ForceIntoRT: 0 243 | m_OcclusionCulling: 1 244 | m_StereoConvergence: 10 245 | m_StereoSeparation: 0.022 246 | --- !u!4 &293642542 247 | Transform: 248 | m_ObjectHideFlags: 0 249 | m_CorrespondingSourceObject: {fileID: 0} 250 | m_PrefabInstance: {fileID: 0} 251 | m_PrefabAsset: {fileID: 0} 252 | m_GameObject: {fileID: 293642539} 253 | m_LocalRotation: {x: 0.0013793714, y: 0.9990034, z: 0.044169318, w: -0.006274216} 254 | m_LocalPosition: {x: 0.3229012, y: 0.66, z: 3.5891953} 255 | m_LocalScale: {x: 1, y: 1, z: 1} 256 | m_ConstrainProportionsScale: 0 257 | m_Children: [] 258 | m_Father: {fileID: 0} 259 | m_RootOrder: 0 260 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 261 | --- !u!114 &293642543 262 | MonoBehaviour: 263 | m_ObjectHideFlags: 0 264 | m_CorrespondingSourceObject: {fileID: 0} 265 | m_PrefabInstance: {fileID: 0} 266 | m_PrefabAsset: {fileID: 0} 267 | m_GameObject: {fileID: 293642539} 268 | m_Enabled: 1 269 | m_EditorHideFlags: 0 270 | m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} 271 | m_Name: 272 | m_EditorClassIdentifier: 273 | m_RenderShadows: 1 274 | m_RequiresDepthTextureOption: 2 275 | m_RequiresOpaqueTextureOption: 2 276 | m_CameraType: 0 277 | m_Cameras: [] 278 | m_RendererIndex: -1 279 | m_VolumeLayerMask: 280 | serializedVersion: 2 281 | m_Bits: 1 282 | m_VolumeTrigger: {fileID: 0} 283 | m_VolumeFrameworkUpdateModeOption: 2 284 | m_RenderPostProcessing: 1 285 | m_Antialiasing: 1 286 | m_AntialiasingQuality: 2 287 | m_StopNaN: 0 288 | m_Dithering: 0 289 | m_ClearDepth: 1 290 | m_AllowXRRendering: 1 291 | m_RequiresDepthTexture: 0 292 | m_RequiresColorTexture: 0 293 | m_Version: 2 294 | --- !u!1 &331570208 295 | GameObject: 296 | m_ObjectHideFlags: 0 297 | m_CorrespondingSourceObject: {fileID: 0} 298 | m_PrefabInstance: {fileID: 0} 299 | m_PrefabAsset: {fileID: 0} 300 | serializedVersion: 6 301 | m_Component: 302 | - component: {fileID: 331570212} 303 | - component: {fileID: 331570211} 304 | - component: {fileID: 331570210} 305 | - component: {fileID: 331570209} 306 | m_Layer: 0 307 | m_Name: Point Light (1) 308 | m_TagString: Untagged 309 | m_Icon: {fileID: 0} 310 | m_NavMeshLayer: 0 311 | m_StaticEditorFlags: 0 312 | m_IsActive: 1 313 | --- !u!114 &331570209 314 | MonoBehaviour: 315 | m_ObjectHideFlags: 0 316 | m_CorrespondingSourceObject: {fileID: 0} 317 | m_PrefabInstance: {fileID: 0} 318 | m_PrefabAsset: {fileID: 0} 319 | m_GameObject: {fileID: 331570208} 320 | m_Enabled: 1 321 | m_EditorHideFlags: 0 322 | m_Script: {fileID: 11500000, guid: f73d813f820f2544da617d01be754e94, type: 3} 323 | m_Name: 324 | m_EditorClassIdentifier: 325 | m_IntensityMult: 13.7 326 | m_RangeMult: 1.33 327 | m_ForceOnForFog: 0 328 | m_Shadows: 0 329 | m_ShadowmapRes: 256 330 | m_BlurIterations: 0 331 | m_BlurSize: 1 332 | m_ESMExponent: 40 333 | m_Bounded: 1 334 | --- !u!114 &331570210 335 | MonoBehaviour: 336 | m_ObjectHideFlags: 0 337 | m_CorrespondingSourceObject: {fileID: 0} 338 | m_PrefabInstance: {fileID: 0} 339 | m_PrefabAsset: {fileID: 0} 340 | m_GameObject: {fileID: 331570208} 341 | m_Enabled: 1 342 | m_EditorHideFlags: 0 343 | m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} 344 | m_Name: 345 | m_EditorClassIdentifier: 346 | m_Version: 1 347 | m_UsePipelineSettings: 1 348 | m_AdditionalLightsShadowResolutionTier: 2 349 | m_LightLayerMask: 1 350 | m_CustomShadowLayers: 0 351 | m_ShadowLayerMask: 1 352 | m_LightCookieSize: {x: 1, y: 1} 353 | m_LightCookieOffset: {x: 0, y: 0} 354 | --- !u!108 &331570211 355 | Light: 356 | m_ObjectHideFlags: 0 357 | m_CorrespondingSourceObject: {fileID: 0} 358 | m_PrefabInstance: {fileID: 0} 359 | m_PrefabAsset: {fileID: 0} 360 | m_GameObject: {fileID: 331570208} 361 | m_Enabled: 1 362 | serializedVersion: 10 363 | m_Type: 2 364 | m_Shape: 0 365 | m_Color: {r: 0.13705935, g: 0.36466092, b: 0.990566, a: 1} 366 | m_Intensity: 4 367 | m_Range: 1.7960402 368 | m_SpotAngle: 30 369 | m_InnerSpotAngle: 21.80208 370 | m_CookieSize: 10 371 | m_Shadows: 372 | m_Type: 2 373 | m_Resolution: -1 374 | m_CustomResolution: -1 375 | m_Strength: 1 376 | m_Bias: 0.02 377 | m_NormalBias: 0.1 378 | m_NearPlane: 0.1 379 | m_CullingMatrixOverride: 380 | e00: 1 381 | e01: 0 382 | e02: 0 383 | e03: 0 384 | e10: 0 385 | e11: 1 386 | e12: 0 387 | e13: 0 388 | e20: 0 389 | e21: 0 390 | e22: 1 391 | e23: 0 392 | e30: 0 393 | e31: 0 394 | e32: 0 395 | e33: 1 396 | m_UseCullingMatrixOverride: 0 397 | m_Cookie: {fileID: 0} 398 | m_DrawHalo: 0 399 | m_Flare: {fileID: 0} 400 | m_RenderMode: 0 401 | m_CullingMask: 402 | serializedVersion: 2 403 | m_Bits: 4294967295 404 | m_RenderingLayerMask: 1 405 | m_Lightmapping: 4 406 | m_LightShadowCasterMode: 0 407 | m_AreaSize: {x: 1, y: 1} 408 | m_BounceIntensity: 1 409 | m_ColorTemperature: 6570 410 | m_UseColorTemperature: 0 411 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 412 | m_UseBoundingSphereOverride: 0 413 | m_UseViewFrustumForShadowCasterCull: 1 414 | m_ShadowRadius: 0 415 | m_ShadowAngle: 0 416 | --- !u!4 &331570212 417 | Transform: 418 | m_ObjectHideFlags: 0 419 | m_CorrespondingSourceObject: {fileID: 0} 420 | m_PrefabInstance: {fileID: 0} 421 | m_PrefabAsset: {fileID: 0} 422 | m_GameObject: {fileID: 331570208} 423 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 424 | m_LocalPosition: {x: -1.374, y: 0.625, z: 0} 425 | m_LocalScale: {x: 1, y: 1, z: 1} 426 | m_ConstrainProportionsScale: 0 427 | m_Children: [] 428 | m_Father: {fileID: 0} 429 | m_RootOrder: 7 430 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 431 | --- !u!1 &567517609 432 | GameObject: 433 | m_ObjectHideFlags: 0 434 | m_CorrespondingSourceObject: {fileID: 0} 435 | m_PrefabInstance: {fileID: 0} 436 | m_PrefabAsset: {fileID: 0} 437 | serializedVersion: 6 438 | m_Component: 439 | - component: {fileID: 567517611} 440 | - component: {fileID: 567517610} 441 | m_Layer: 0 442 | m_Name: Reflection Probe 443 | m_TagString: Untagged 444 | m_Icon: {fileID: 0} 445 | m_NavMeshLayer: 0 446 | m_StaticEditorFlags: 0 447 | m_IsActive: 1 448 | --- !u!215 &567517610 449 | ReflectionProbe: 450 | m_ObjectHideFlags: 0 451 | m_CorrespondingSourceObject: {fileID: 0} 452 | m_PrefabInstance: {fileID: 0} 453 | m_PrefabAsset: {fileID: 0} 454 | m_GameObject: {fileID: 567517609} 455 | m_Enabled: 1 456 | serializedVersion: 2 457 | m_Type: 0 458 | m_Mode: 0 459 | m_RefreshMode: 0 460 | m_TimeSlicingMode: 0 461 | m_Resolution: 32 462 | m_UpdateFrequency: 0 463 | m_BoxSize: {x: 80, y: 80, z: 80} 464 | m_BoxOffset: {x: 0, y: 0, z: 0} 465 | m_NearClip: 0.3 466 | m_FarClip: 1000 467 | m_ShadowDistance: 100 468 | m_ClearFlags: 1 469 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 470 | m_CullingMask: 471 | serializedVersion: 2 472 | m_Bits: 4294967295 473 | m_IntensityMultiplier: 1 474 | m_BlendDistance: 1 475 | m_HDR: 1 476 | m_BoxProjection: 0 477 | m_RenderDynamicObjects: 0 478 | m_UseOcclusionCulling: 1 479 | m_Importance: 1 480 | m_CustomBakedTexture: {fileID: 0} 481 | --- !u!4 &567517611 482 | Transform: 483 | m_ObjectHideFlags: 0 484 | m_CorrespondingSourceObject: {fileID: 0} 485 | m_PrefabInstance: {fileID: 0} 486 | m_PrefabAsset: {fileID: 0} 487 | m_GameObject: {fileID: 567517609} 488 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 489 | m_LocalPosition: {x: -0.04, y: 1.04, z: 1.14} 490 | m_LocalScale: {x: 1, y: 1, z: 1} 491 | m_ConstrainProportionsScale: 0 492 | m_Children: [] 493 | m_Father: {fileID: 0} 494 | m_RootOrder: 6 495 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 496 | --- !u!1 &1134571431 497 | GameObject: 498 | m_ObjectHideFlags: 0 499 | m_CorrespondingSourceObject: {fileID: 0} 500 | m_PrefabInstance: {fileID: 0} 501 | m_PrefabAsset: {fileID: 0} 502 | serializedVersion: 6 503 | m_Component: 504 | - component: {fileID: 1134571434} 505 | - component: {fileID: 1134571433} 506 | - component: {fileID: 1134571432} 507 | m_Layer: 0 508 | m_Name: Spot Light 509 | m_TagString: Untagged 510 | m_Icon: {fileID: 0} 511 | m_NavMeshLayer: 0 512 | m_StaticEditorFlags: 0 513 | m_IsActive: 1 514 | --- !u!114 &1134571432 515 | MonoBehaviour: 516 | m_ObjectHideFlags: 0 517 | m_CorrespondingSourceObject: {fileID: 0} 518 | m_PrefabInstance: {fileID: 0} 519 | m_PrefabAsset: {fileID: 0} 520 | m_GameObject: {fileID: 1134571431} 521 | m_Enabled: 1 522 | m_EditorHideFlags: 0 523 | m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} 524 | m_Name: 525 | m_EditorClassIdentifier: 526 | m_Version: 1 527 | m_UsePipelineSettings: 1 528 | m_AdditionalLightsShadowResolutionTier: 2 529 | m_LightLayerMask: 1 530 | m_CustomShadowLayers: 0 531 | m_ShadowLayerMask: 1 532 | m_LightCookieSize: {x: 1, y: 1} 533 | m_LightCookieOffset: {x: 0, y: 0} 534 | --- !u!108 &1134571433 535 | Light: 536 | m_ObjectHideFlags: 0 537 | m_CorrespondingSourceObject: {fileID: 0} 538 | m_PrefabInstance: {fileID: 0} 539 | m_PrefabAsset: {fileID: 0} 540 | m_GameObject: {fileID: 1134571431} 541 | m_Enabled: 1 542 | serializedVersion: 10 543 | m_Type: 0 544 | m_Shape: 0 545 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 546 | m_Intensity: 2 547 | m_Range: 10 548 | m_SpotAngle: 30 549 | m_InnerSpotAngle: 21.80208 550 | m_CookieSize: 10 551 | m_Shadows: 552 | m_Type: 2 553 | m_Resolution: -1 554 | m_CustomResolution: -1 555 | m_Strength: 1 556 | m_Bias: 0.02 557 | m_NormalBias: 0.1 558 | m_NearPlane: 0.1 559 | m_CullingMatrixOverride: 560 | e00: 1 561 | e01: 0 562 | e02: 0 563 | e03: 0 564 | e10: 0 565 | e11: 1 566 | e12: 0 567 | e13: 0 568 | e20: 0 569 | e21: 0 570 | e22: 1 571 | e23: 0 572 | e30: 0 573 | e31: 0 574 | e32: 0 575 | e33: 1 576 | m_UseCullingMatrixOverride: 0 577 | m_Cookie: {fileID: 0} 578 | m_DrawHalo: 0 579 | m_Flare: {fileID: 0} 580 | m_RenderMode: 0 581 | m_CullingMask: 582 | serializedVersion: 2 583 | m_Bits: 4294967295 584 | m_RenderingLayerMask: 1 585 | m_Lightmapping: 4 586 | m_LightShadowCasterMode: 0 587 | m_AreaSize: {x: 1, y: 1} 588 | m_BounceIntensity: 1 589 | m_ColorTemperature: 6570 590 | m_UseColorTemperature: 0 591 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 592 | m_UseBoundingSphereOverride: 0 593 | m_UseViewFrustumForShadowCasterCull: 1 594 | m_ShadowRadius: 0 595 | m_ShadowAngle: 0 596 | --- !u!4 &1134571434 597 | Transform: 598 | m_ObjectHideFlags: 0 599 | m_CorrespondingSourceObject: {fileID: 0} 600 | m_PrefabInstance: {fileID: 0} 601 | m_PrefabAsset: {fileID: 0} 602 | m_GameObject: {fileID: 1134571431} 603 | m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} 604 | m_LocalPosition: {x: 0.7982065, y: -0.32226372, z: -21.84378} 605 | m_LocalScale: {x: 1, y: 1, z: 1} 606 | m_ConstrainProportionsScale: 0 607 | m_Children: [] 608 | m_Father: {fileID: 0} 609 | m_RootOrder: 8 610 | m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} 611 | --- !u!1 &1234901161 612 | GameObject: 613 | m_ObjectHideFlags: 0 614 | m_CorrespondingSourceObject: {fileID: 0} 615 | m_PrefabInstance: {fileID: 0} 616 | m_PrefabAsset: {fileID: 0} 617 | serializedVersion: 6 618 | m_Component: 619 | - component: {fileID: 1234901165} 620 | - component: {fileID: 1234901164} 621 | - component: {fileID: 1234901163} 622 | - component: {fileID: 1234901162} 623 | m_Layer: 0 624 | m_Name: Spot Light (1) 625 | m_TagString: Untagged 626 | m_Icon: {fileID: 0} 627 | m_NavMeshLayer: 0 628 | m_StaticEditorFlags: 0 629 | m_IsActive: 1 630 | --- !u!114 &1234901162 631 | MonoBehaviour: 632 | m_ObjectHideFlags: 0 633 | m_CorrespondingSourceObject: {fileID: 0} 634 | m_PrefabInstance: {fileID: 0} 635 | m_PrefabAsset: {fileID: 0} 636 | m_GameObject: {fileID: 1234901161} 637 | m_Enabled: 1 638 | m_EditorHideFlags: 0 639 | m_Script: {fileID: 11500000, guid: f73d813f820f2544da617d01be754e94, type: 3} 640 | m_Name: 641 | m_EditorClassIdentifier: 642 | m_IntensityMult: 18 643 | m_RangeMult: 1 644 | m_ForceOnForFog: 0 645 | m_Shadows: 0 646 | m_ShadowmapRes: 256 647 | m_BlurIterations: 0 648 | m_BlurSize: 1 649 | m_ESMExponent: 40 650 | m_Bounded: 1 651 | --- !u!114 &1234901163 652 | MonoBehaviour: 653 | m_ObjectHideFlags: 0 654 | m_CorrespondingSourceObject: {fileID: 0} 655 | m_PrefabInstance: {fileID: 0} 656 | m_PrefabAsset: {fileID: 0} 657 | m_GameObject: {fileID: 1234901161} 658 | m_Enabled: 1 659 | m_EditorHideFlags: 0 660 | m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} 661 | m_Name: 662 | m_EditorClassIdentifier: 663 | m_Version: 1 664 | m_UsePipelineSettings: 1 665 | m_AdditionalLightsShadowResolutionTier: 2 666 | m_LightLayerMask: 1 667 | m_CustomShadowLayers: 0 668 | m_ShadowLayerMask: 1 669 | m_LightCookieSize: {x: 1, y: 1} 670 | m_LightCookieOffset: {x: 0, y: 0} 671 | --- !u!108 &1234901164 672 | Light: 673 | m_ObjectHideFlags: 0 674 | m_CorrespondingSourceObject: {fileID: 0} 675 | m_PrefabInstance: {fileID: 0} 676 | m_PrefabAsset: {fileID: 0} 677 | m_GameObject: {fileID: 1234901161} 678 | m_Enabled: 1 679 | serializedVersion: 10 680 | m_Type: 0 681 | m_Shape: 0 682 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 683 | m_Intensity: 4 684 | m_Range: 10 685 | m_SpotAngle: 62.570934 686 | m_InnerSpotAngle: 52.797005 687 | m_CookieSize: 10 688 | m_Shadows: 689 | m_Type: 2 690 | m_Resolution: -1 691 | m_CustomResolution: -1 692 | m_Strength: 1 693 | m_Bias: 0.02 694 | m_NormalBias: 0.1 695 | m_NearPlane: 0.1 696 | m_CullingMatrixOverride: 697 | e00: 1 698 | e01: 0 699 | e02: 0 700 | e03: 0 701 | e10: 0 702 | e11: 1 703 | e12: 0 704 | e13: 0 705 | e20: 0 706 | e21: 0 707 | e22: 1 708 | e23: 0 709 | e30: 0 710 | e31: 0 711 | e32: 0 712 | e33: 1 713 | m_UseCullingMatrixOverride: 0 714 | m_Cookie: {fileID: 0} 715 | m_DrawHalo: 0 716 | m_Flare: {fileID: 0} 717 | m_RenderMode: 0 718 | m_CullingMask: 719 | serializedVersion: 2 720 | m_Bits: 4294967295 721 | m_RenderingLayerMask: 1 722 | m_Lightmapping: 4 723 | m_LightShadowCasterMode: 0 724 | m_AreaSize: {x: 1, y: 1} 725 | m_BounceIntensity: 1 726 | m_ColorTemperature: 6570 727 | m_UseColorTemperature: 0 728 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 729 | m_UseBoundingSphereOverride: 0 730 | m_UseViewFrustumForShadowCasterCull: 1 731 | m_ShadowRadius: 0 732 | m_ShadowAngle: 0 733 | --- !u!4 &1234901165 734 | Transform: 735 | m_ObjectHideFlags: 0 736 | m_CorrespondingSourceObject: {fileID: 0} 737 | m_PrefabInstance: {fileID: 0} 738 | m_PrefabAsset: {fileID: 0} 739 | m_GameObject: {fileID: 1234901161} 740 | m_LocalRotation: {x: 0.7875166, y: 0.031997327, z: 0.044178274, w: 0.6138747} 741 | m_LocalPosition: {x: 0.08, y: 3.04, z: 0.53} 742 | m_LocalScale: {x: 1, y: 1, z: 1} 743 | m_ConstrainProportionsScale: 0 744 | m_Children: [] 745 | m_Father: {fileID: 0} 746 | m_RootOrder: 9 747 | m_LocalEulerAnglesHint: {x: 74.589, y: 155.815, z: 156.811} 748 | --- !u!1 &1406627730 749 | GameObject: 750 | m_ObjectHideFlags: 0 751 | m_CorrespondingSourceObject: {fileID: 0} 752 | m_PrefabInstance: {fileID: 0} 753 | m_PrefabAsset: {fileID: 0} 754 | serializedVersion: 6 755 | m_Component: 756 | - component: {fileID: 1406627734} 757 | - component: {fileID: 1406627733} 758 | - component: {fileID: 1406627732} 759 | - component: {fileID: 1406627731} 760 | m_Layer: 0 761 | m_Name: Plane 762 | m_TagString: Untagged 763 | m_Icon: {fileID: 0} 764 | m_NavMeshLayer: 0 765 | m_StaticEditorFlags: 64 766 | m_IsActive: 1 767 | --- !u!64 &1406627731 768 | MeshCollider: 769 | m_ObjectHideFlags: 0 770 | m_CorrespondingSourceObject: {fileID: 0} 771 | m_PrefabInstance: {fileID: 0} 772 | m_PrefabAsset: {fileID: 0} 773 | m_GameObject: {fileID: 1406627730} 774 | m_Material: {fileID: 0} 775 | m_IsTrigger: 0 776 | m_Enabled: 1 777 | serializedVersion: 4 778 | m_Convex: 0 779 | m_CookingOptions: 30 780 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 781 | --- !u!23 &1406627732 782 | MeshRenderer: 783 | m_ObjectHideFlags: 0 784 | m_CorrespondingSourceObject: {fileID: 0} 785 | m_PrefabInstance: {fileID: 0} 786 | m_PrefabAsset: {fileID: 0} 787 | m_GameObject: {fileID: 1406627730} 788 | m_Enabled: 1 789 | m_CastShadows: 1 790 | m_ReceiveShadows: 1 791 | m_DynamicOccludee: 1 792 | m_StaticShadowCaster: 0 793 | m_MotionVectors: 1 794 | m_LightProbeUsage: 1 795 | m_ReflectionProbeUsage: 1 796 | m_RayTracingMode: 2 797 | m_RayTraceProcedural: 0 798 | m_RenderingLayerMask: 1 799 | m_RendererPriority: 0 800 | m_Materials: 801 | - {fileID: 2100000, guid: bb2aed7298ecbb14eafde0ed5a2d04ef, type: 2} 802 | m_StaticBatchInfo: 803 | firstSubMesh: 0 804 | subMeshCount: 0 805 | m_StaticBatchRoot: {fileID: 0} 806 | m_ProbeAnchor: {fileID: 0} 807 | m_LightProbeVolumeOverride: {fileID: 0} 808 | m_ScaleInLightmap: 1 809 | m_ReceiveGI: 1 810 | m_PreserveUVs: 0 811 | m_IgnoreNormalsForChartDetection: 0 812 | m_ImportantGI: 0 813 | m_StitchLightmapSeams: 1 814 | m_SelectedEditorRenderState: 3 815 | m_MinimumChartSize: 4 816 | m_AutoUVMaxDistance: 0.5 817 | m_AutoUVMaxAngle: 89 818 | m_LightmapParameters: {fileID: 0} 819 | m_SortingLayerID: 0 820 | m_SortingLayer: 0 821 | m_SortingOrder: 0 822 | m_AdditionalVertexStreams: {fileID: 0} 823 | --- !u!33 &1406627733 824 | MeshFilter: 825 | m_ObjectHideFlags: 0 826 | m_CorrespondingSourceObject: {fileID: 0} 827 | m_PrefabInstance: {fileID: 0} 828 | m_PrefabAsset: {fileID: 0} 829 | m_GameObject: {fileID: 1406627730} 830 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 831 | --- !u!4 &1406627734 832 | Transform: 833 | m_ObjectHideFlags: 0 834 | m_CorrespondingSourceObject: {fileID: 0} 835 | m_PrefabInstance: {fileID: 0} 836 | m_PrefabAsset: {fileID: 0} 837 | m_GameObject: {fileID: 1406627730} 838 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 839 | m_LocalPosition: {x: 0, y: 0, z: 0} 840 | m_LocalScale: {x: 100, y: 100, z: 100} 841 | m_ConstrainProportionsScale: 1 842 | m_Children: [] 843 | m_Father: {fileID: 0} 844 | m_RootOrder: 2 845 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 846 | --- !u!1 &1576269707 847 | GameObject: 848 | m_ObjectHideFlags: 0 849 | m_CorrespondingSourceObject: {fileID: 0} 850 | m_PrefabInstance: {fileID: 0} 851 | m_PrefabAsset: {fileID: 0} 852 | serializedVersion: 6 853 | m_Component: 854 | - component: {fileID: 1576269711} 855 | - component: {fileID: 1576269710} 856 | - component: {fileID: 1576269709} 857 | - component: {fileID: 1576269708} 858 | m_Layer: 0 859 | m_Name: Point Light 860 | m_TagString: Untagged 861 | m_Icon: {fileID: 0} 862 | m_NavMeshLayer: 0 863 | m_StaticEditorFlags: 0 864 | m_IsActive: 1 865 | --- !u!114 &1576269708 866 | MonoBehaviour: 867 | m_ObjectHideFlags: 0 868 | m_CorrespondingSourceObject: {fileID: 0} 869 | m_PrefabInstance: {fileID: 0} 870 | m_PrefabAsset: {fileID: 0} 871 | m_GameObject: {fileID: 1576269707} 872 | m_Enabled: 1 873 | m_EditorHideFlags: 0 874 | m_Script: {fileID: 11500000, guid: f73d813f820f2544da617d01be754e94, type: 3} 875 | m_Name: 876 | m_EditorClassIdentifier: 877 | m_IntensityMult: 13.7 878 | m_RangeMult: 1.56 879 | m_ForceOnForFog: 0 880 | m_Shadows: 0 881 | m_ShadowmapRes: 256 882 | m_BlurIterations: 0 883 | m_BlurSize: 1 884 | m_ESMExponent: 40 885 | m_Bounded: 1 886 | --- !u!114 &1576269709 887 | MonoBehaviour: 888 | m_ObjectHideFlags: 0 889 | m_CorrespondingSourceObject: {fileID: 0} 890 | m_PrefabInstance: {fileID: 0} 891 | m_PrefabAsset: {fileID: 0} 892 | m_GameObject: {fileID: 1576269707} 893 | m_Enabled: 1 894 | m_EditorHideFlags: 0 895 | m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} 896 | m_Name: 897 | m_EditorClassIdentifier: 898 | m_Version: 1 899 | m_UsePipelineSettings: 1 900 | m_AdditionalLightsShadowResolutionTier: 2 901 | m_LightLayerMask: 1 902 | m_CustomShadowLayers: 0 903 | m_ShadowLayerMask: 1 904 | m_LightCookieSize: {x: 1, y: 1} 905 | m_LightCookieOffset: {x: 0, y: 0} 906 | --- !u!108 &1576269710 907 | Light: 908 | m_ObjectHideFlags: 0 909 | m_CorrespondingSourceObject: {fileID: 0} 910 | m_PrefabInstance: {fileID: 0} 911 | m_PrefabAsset: {fileID: 0} 912 | m_GameObject: {fileID: 1576269707} 913 | m_Enabled: 1 914 | serializedVersion: 10 915 | m_Type: 2 916 | m_Shape: 0 917 | m_Color: {r: 1, g: 0.1364174, b: 0, a: 1} 918 | m_Intensity: 4.84 919 | m_Range: 1.7960402 920 | m_SpotAngle: 30 921 | m_InnerSpotAngle: 21.80208 922 | m_CookieSize: 10 923 | m_Shadows: 924 | m_Type: 2 925 | m_Resolution: -1 926 | m_CustomResolution: -1 927 | m_Strength: 1 928 | m_Bias: 0.02 929 | m_NormalBias: 0.1 930 | m_NearPlane: 0.1 931 | m_CullingMatrixOverride: 932 | e00: 1 933 | e01: 0 934 | e02: 0 935 | e03: 0 936 | e10: 0 937 | e11: 1 938 | e12: 0 939 | e13: 0 940 | e20: 0 941 | e21: 0 942 | e22: 1 943 | e23: 0 944 | e30: 0 945 | e31: 0 946 | e32: 0 947 | e33: 1 948 | m_UseCullingMatrixOverride: 0 949 | m_Cookie: {fileID: 0} 950 | m_DrawHalo: 0 951 | m_Flare: {fileID: 0} 952 | m_RenderMode: 0 953 | m_CullingMask: 954 | serializedVersion: 2 955 | m_Bits: 4294967295 956 | m_RenderingLayerMask: 1 957 | m_Lightmapping: 4 958 | m_LightShadowCasterMode: 0 959 | m_AreaSize: {x: 1, y: 1} 960 | m_BounceIntensity: 1 961 | m_ColorTemperature: 6570 962 | m_UseColorTemperature: 0 963 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 964 | m_UseBoundingSphereOverride: 0 965 | m_UseViewFrustumForShadowCasterCull: 1 966 | m_ShadowRadius: 0 967 | m_ShadowAngle: 0 968 | --- !u!4 &1576269711 969 | Transform: 970 | m_ObjectHideFlags: 0 971 | m_CorrespondingSourceObject: {fileID: 0} 972 | m_PrefabInstance: {fileID: 0} 973 | m_PrefabAsset: {fileID: 0} 974 | m_GameObject: {fileID: 1576269707} 975 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 976 | m_LocalPosition: {x: 1.86, y: 1.92, z: 0} 977 | m_LocalScale: {x: 1, y: 1, z: 1} 978 | m_ConstrainProportionsScale: 0 979 | m_Children: [] 980 | m_Father: {fileID: 0} 981 | m_RootOrder: 5 982 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 983 | --- !u!1001 &1723220330 984 | PrefabInstance: 985 | m_ObjectHideFlags: 0 986 | serializedVersion: 2 987 | m_Modification: 988 | m_TransformParent: {fileID: 0} 989 | m_Modifications: 990 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 991 | type: 3} 992 | propertyPath: m_RootOrder 993 | value: 1 994 | objectReference: {fileID: 0} 995 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 996 | type: 3} 997 | propertyPath: m_LocalScale.x 998 | value: 100 999 | objectReference: {fileID: 0} 1000 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1001 | type: 3} 1002 | propertyPath: m_LocalScale.y 1003 | value: 100 1004 | objectReference: {fileID: 0} 1005 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1006 | type: 3} 1007 | propertyPath: m_LocalScale.z 1008 | value: 100 1009 | objectReference: {fileID: 0} 1010 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1011 | type: 3} 1012 | propertyPath: m_LocalPosition.x 1013 | value: 0.34163046 1014 | objectReference: {fileID: 0} 1015 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1016 | type: 3} 1017 | propertyPath: m_LocalPosition.y 1018 | value: 0 1019 | objectReference: {fileID: 0} 1020 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1021 | type: 3} 1022 | propertyPath: m_LocalPosition.z 1023 | value: 0.029880881 1024 | objectReference: {fileID: 0} 1025 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1026 | type: 3} 1027 | propertyPath: m_LocalRotation.w 1028 | value: 1 1029 | objectReference: {fileID: 0} 1030 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1031 | type: 3} 1032 | propertyPath: m_LocalRotation.x 1033 | value: 0 1034 | objectReference: {fileID: 0} 1035 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1036 | type: 3} 1037 | propertyPath: m_LocalRotation.y 1038 | value: -0 1039 | objectReference: {fileID: 0} 1040 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1041 | type: 3} 1042 | propertyPath: m_LocalRotation.z 1043 | value: -0 1044 | objectReference: {fileID: 0} 1045 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1046 | type: 3} 1047 | propertyPath: m_LocalEulerAnglesHint.x 1048 | value: 0 1049 | objectReference: {fileID: 0} 1050 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1051 | type: 3} 1052 | propertyPath: m_LocalEulerAnglesHint.y 1053 | value: 0 1054 | objectReference: {fileID: 0} 1055 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1056 | type: 3} 1057 | propertyPath: m_LocalEulerAnglesHint.z 1058 | value: 0 1059 | objectReference: {fileID: 0} 1060 | - target: {fileID: -8679921383154817045, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1061 | type: 3} 1062 | propertyPath: m_ConstrainProportionsScale 1063 | value: 1 1064 | objectReference: {fileID: 0} 1065 | - target: {fileID: 919132149155446097, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, 1066 | type: 3} 1067 | propertyPath: m_Name 1068 | value: DancingGirl 1069 | objectReference: {fileID: 0} 1070 | m_RemovedComponents: [] 1071 | m_SourcePrefab: {fileID: 100100000, guid: 362fb55f7d3ee1143b68d09b5f8b8a9a, type: 3} 1072 | --- !u!1001 &1881773213 1073 | PrefabInstance: 1074 | m_ObjectHideFlags: 0 1075 | serializedVersion: 2 1076 | m_Modification: 1077 | m_TransformParent: {fileID: 0} 1078 | m_Modifications: 1079 | - target: {fileID: 6017331181115198087, guid: 9417d4a0a49de4f4d972b8112296a7a0, 1080 | type: 3} 1081 | propertyPath: m_Name 1082 | value: LightManager 1083 | objectReference: {fileID: 0} 1084 | - target: {fileID: 6134180004556011575, guid: 9417d4a0a49de4f4d972b8112296a7a0, 1085 | type: 3} 1086 | propertyPath: m_RootOrder 1087 | value: 4 1088 | objectReference: {fileID: 0} 1089 | - target: {fileID: 6134180004556011575, guid: 9417d4a0a49de4f4d972b8112296a7a0, 1090 | type: 3} 1091 | propertyPath: m_LocalPosition.x 1092 | value: 0 1093 | objectReference: {fileID: 0} 1094 | - target: {fileID: 6134180004556011575, guid: 9417d4a0a49de4f4d972b8112296a7a0, 1095 | type: 3} 1096 | propertyPath: m_LocalPosition.y 1097 | value: 0 1098 | objectReference: {fileID: 0} 1099 | - target: {fileID: 6134180004556011575, guid: 9417d4a0a49de4f4d972b8112296a7a0, 1100 | type: 3} 1101 | propertyPath: m_LocalPosition.z 1102 | value: 0 1103 | objectReference: {fileID: 0} 1104 | - target: {fileID: 6134180004556011575, guid: 9417d4a0a49de4f4d972b8112296a7a0, 1105 | type: 3} 1106 | propertyPath: m_LocalRotation.w 1107 | value: 1 1108 | objectReference: {fileID: 0} 1109 | - target: {fileID: 6134180004556011575, guid: 9417d4a0a49de4f4d972b8112296a7a0, 1110 | type: 3} 1111 | propertyPath: m_LocalRotation.x 1112 | value: 0 1113 | objectReference: {fileID: 0} 1114 | - target: {fileID: 6134180004556011575, guid: 9417d4a0a49de4f4d972b8112296a7a0, 1115 | type: 3} 1116 | propertyPath: m_LocalRotation.y 1117 | value: 0 1118 | objectReference: {fileID: 0} 1119 | - target: {fileID: 6134180004556011575, guid: 9417d4a0a49de4f4d972b8112296a7a0, 1120 | type: 3} 1121 | propertyPath: m_LocalRotation.z 1122 | value: 0 1123 | objectReference: {fileID: 0} 1124 | - target: {fileID: 6134180004556011575, guid: 9417d4a0a49de4f4d972b8112296a7a0, 1125 | type: 3} 1126 | propertyPath: m_LocalEulerAnglesHint.x 1127 | value: 0 1128 | objectReference: {fileID: 0} 1129 | - target: {fileID: 6134180004556011575, guid: 9417d4a0a49de4f4d972b8112296a7a0, 1130 | type: 3} 1131 | propertyPath: m_LocalEulerAnglesHint.y 1132 | value: 0 1133 | objectReference: {fileID: 0} 1134 | - target: {fileID: 6134180004556011575, guid: 9417d4a0a49de4f4d972b8112296a7a0, 1135 | type: 3} 1136 | propertyPath: m_LocalEulerAnglesHint.z 1137 | value: 0 1138 | objectReference: {fileID: 0} 1139 | m_RemovedComponents: [] 1140 | m_SourcePrefab: {fileID: 100100000, guid: 9417d4a0a49de4f4d972b8112296a7a0, type: 3} 1141 | -------------------------------------------------------------------------------- /DemoScene/LocalLight.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0c6bdded9dfa9749a36b261f528e0f9 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /DemoScene/LocalLight/Global Volume Profile.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-5314134068567666882 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 3 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 899c54efeace73346a0a16faa3afe726, type: 3} 13 | m_Name: Vignette 14 | m_EditorClassIdentifier: 15 | active: 1 16 | color: 17 | m_OverrideState: 0 18 | m_Value: {r: 0, g: 0, b: 0, a: 1} 19 | center: 20 | m_OverrideState: 0 21 | m_Value: {x: 0.5, y: 0.5} 22 | intensity: 23 | m_OverrideState: 1 24 | m_Value: 0.3 25 | smoothness: 26 | m_OverrideState: 0 27 | m_Value: 0.2 28 | rounded: 29 | m_OverrideState: 0 30 | m_Value: 0 31 | --- !u!114 &-747499163746897790 32 | MonoBehaviour: 33 | m_ObjectHideFlags: 3 34 | m_CorrespondingSourceObject: {fileID: 0} 35 | m_PrefabInstance: {fileID: 0} 36 | m_PrefabAsset: {fileID: 0} 37 | m_GameObject: {fileID: 0} 38 | m_Enabled: 1 39 | m_EditorHideFlags: 0 40 | m_Script: {fileID: 11500000, guid: b23efd1a75591a34dbd4af2bd1fc1067, type: 3} 41 | m_Name: Volumetric 42 | m_EditorClassIdentifier: 43 | active: 1 44 | fogQuality: 45 | m_OverrideState: 1 46 | m_Value: 2 47 | GlobalDensity: 48 | m_OverrideState: 1 49 | m_Value: 0.95 50 | Distance: 51 | m_OverrideState: 1 52 | m_Value: 80 53 | ConstantFogDensity: 54 | m_OverrideState: 0 55 | m_Value: 1 56 | HeightFogDensity: 57 | m_OverrideState: 1 58 | m_Value: 1 59 | HeightFogExponent: 60 | m_OverrideState: 1 61 | m_Value: 0.432 62 | HeightFogOffset: 63 | m_OverrideState: 1 64 | m_Value: 2 65 | Anisotropy: 66 | m_OverrideState: 1 67 | m_Value: 0.657 68 | AmbientColor: 69 | m_OverrideState: 1 70 | m_Value: {r: 0.103773594, g: 0.103773594, b: 0.103773594, a: 1} 71 | --- !u!114 &11400000 72 | MonoBehaviour: 73 | m_ObjectHideFlags: 0 74 | m_CorrespondingSourceObject: {fileID: 0} 75 | m_PrefabInstance: {fileID: 0} 76 | m_PrefabAsset: {fileID: 0} 77 | m_GameObject: {fileID: 0} 78 | m_Enabled: 1 79 | m_EditorHideFlags: 0 80 | m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} 81 | m_Name: Global Volume Profile 82 | m_EditorClassIdentifier: 83 | components: 84 | - {fileID: -747499163746897790} 85 | - {fileID: 7621830791201954981} 86 | - {fileID: 6636022074293043041} 87 | - {fileID: -5314134068567666882} 88 | --- !u!114 &6636022074293043041 89 | MonoBehaviour: 90 | m_ObjectHideFlags: 3 91 | m_CorrespondingSourceObject: {fileID: 0} 92 | m_PrefabInstance: {fileID: 0} 93 | m_PrefabAsset: {fileID: 0} 94 | m_GameObject: {fileID: 0} 95 | m_Enabled: 1 96 | m_EditorHideFlags: 0 97 | m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3} 98 | m_Name: Bloom 99 | m_EditorClassIdentifier: 100 | active: 1 101 | threshold: 102 | m_OverrideState: 0 103 | m_Value: 0.9 104 | intensity: 105 | m_OverrideState: 1 106 | m_Value: 8 107 | scatter: 108 | m_OverrideState: 1 109 | m_Value: 0.739 110 | clamp: 111 | m_OverrideState: 0 112 | m_Value: 65472 113 | tint: 114 | m_OverrideState: 0 115 | m_Value: {r: 1, g: 1, b: 1, a: 1} 116 | highQualityFiltering: 117 | m_OverrideState: 1 118 | m_Value: 1 119 | skipIterations: 120 | m_OverrideState: 0 121 | m_Value: 1 122 | dirtTexture: 123 | m_OverrideState: 0 124 | m_Value: {fileID: 0} 125 | dirtIntensity: 126 | m_OverrideState: 0 127 | m_Value: 0 128 | --- !u!114 &7621830791201954981 129 | MonoBehaviour: 130 | m_ObjectHideFlags: 3 131 | m_CorrespondingSourceObject: {fileID: 0} 132 | m_PrefabInstance: {fileID: 0} 133 | m_PrefabAsset: {fileID: 0} 134 | m_GameObject: {fileID: 0} 135 | m_Enabled: 1 136 | m_EditorHideFlags: 0 137 | m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3} 138 | m_Name: Tonemapping 139 | m_EditorClassIdentifier: 140 | active: 1 141 | mode: 142 | m_OverrideState: 1 143 | m_Value: 2 144 | -------------------------------------------------------------------------------- /DemoScene/LocalLight/Global Volume Profile.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 40dbf4b36cc64e049bb098588d3bb8bd 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DemoScene/LocalLight/LightingData.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladesero/Volumetrics_URP/050d405f217567a7143ed9501511bfe30ceb30cc/DemoScene/LocalLight/LightingData.asset -------------------------------------------------------------------------------- /DemoScene/LocalLight/LightingData.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7e894dbe3d5547418e2b1635340269b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 112000000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DemoScene/LocalLight/ReflectionProbe-0.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladesero/Volumetrics_URP/050d405f217567a7143ed9501511bfe30ceb30cc/DemoScene/LocalLight/ReflectionProbe-0.exr -------------------------------------------------------------------------------- /DemoScene/LocalLight/ReflectionProbe-0.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 370dc3cb68db6934e94fe4a61bb98662 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | ignoreMasterTextureLimit: 0 28 | grayScaleToAlpha: 0 29 | generateCubemap: 6 30 | cubemapConvolution: 1 31 | seamlessCubemap: 1 32 | textureFormat: 1 33 | maxTextureSize: 2048 34 | textureSettings: 35 | serializedVersion: 2 36 | filterMode: 2 37 | aniso: 0 38 | mipBias: 0 39 | wrapU: 1 40 | wrapV: 1 41 | wrapW: 1 42 | nPOTScale: 1 43 | lightmap: 0 44 | compressionQuality: 50 45 | spriteMode: 0 46 | spriteExtrude: 1 47 | spriteMeshType: 1 48 | alignment: 0 49 | spritePivot: {x: 0.5, y: 0.5} 50 | spritePixelsToUnits: 100 51 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 52 | spriteGenerateFallbackPhysicsShape: 1 53 | alphaUsage: 1 54 | alphaIsTransparency: 0 55 | spriteTessellationDetail: -1 56 | textureType: 0 57 | textureShape: 2 58 | singleChannelComponent: 0 59 | flipbookRows: 1 60 | flipbookColumns: 1 61 | maxTextureSizeSet: 0 62 | compressionQualitySet: 0 63 | textureFormatSet: 0 64 | ignorePngGamma: 0 65 | applyGammaDecoding: 0 66 | platformSettings: 67 | - serializedVersion: 3 68 | buildTarget: DefaultTexturePlatform 69 | maxTextureSize: 2048 70 | resizeAlgorithm: 0 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 100 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | androidETC2FallbackOverride: 0 78 | forceMaximumCompressionQuality_BC6H_BC7: 0 79 | - serializedVersion: 3 80 | buildTarget: Standalone 81 | maxTextureSize: 8192 82 | resizeAlgorithm: 0 83 | textureFormat: -1 84 | textureCompression: 1 85 | compressionQuality: 50 86 | crunchedCompression: 0 87 | allowsAlphaSplitting: 0 88 | overridden: 0 89 | androidETC2FallbackOverride: 0 90 | forceMaximumCompressionQuality_BC6H_BC7: 0 91 | - serializedVersion: 3 92 | buildTarget: iPhone 93 | maxTextureSize: 8192 94 | resizeAlgorithm: 0 95 | textureFormat: -1 96 | textureCompression: 1 97 | compressionQuality: 50 98 | crunchedCompression: 0 99 | allowsAlphaSplitting: 0 100 | overridden: 0 101 | androidETC2FallbackOverride: 0 102 | forceMaximumCompressionQuality_BC6H_BC7: 0 103 | - serializedVersion: 3 104 | buildTarget: Android 105 | maxTextureSize: 8192 106 | resizeAlgorithm: 0 107 | textureFormat: -1 108 | textureCompression: 1 109 | compressionQuality: 50 110 | crunchedCompression: 0 111 | allowsAlphaSplitting: 0 112 | overridden: 0 113 | androidETC2FallbackOverride: 0 114 | forceMaximumCompressionQuality_BC6H_BC7: 0 115 | - serializedVersion: 3 116 | buildTarget: Windows Store Apps 117 | maxTextureSize: 8192 118 | resizeAlgorithm: 0 119 | textureFormat: -1 120 | textureCompression: 1 121 | compressionQuality: 50 122 | crunchedCompression: 0 123 | allowsAlphaSplitting: 0 124 | overridden: 0 125 | androidETC2FallbackOverride: 0 126 | forceMaximumCompressionQuality_BC6H_BC7: 0 127 | spriteSheet: 128 | serializedVersion: 2 129 | sprites: [] 130 | outline: [] 131 | physicsShape: [] 132 | bones: [] 133 | spriteID: 134 | internalID: 0 135 | vertices: [] 136 | indices: 137 | edges: [] 138 | weights: [] 139 | secondaryTextures: [] 140 | nameFileIdTable: {} 141 | spritePackingTag: 142 | pSDRemoveMatte: 0 143 | pSDShowRemoveMatteOption: 0 144 | userData: 145 | assetBundleName: 146 | assetBundleVariant: 147 | -------------------------------------------------------------------------------- /DemoScene/LocalLight/ReflectionProbe-1.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladesero/Volumetrics_URP/050d405f217567a7143ed9501511bfe30ceb30cc/DemoScene/LocalLight/ReflectionProbe-1.exr -------------------------------------------------------------------------------- /DemoScene/LocalLight/ReflectionProbe-1.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32e0c507b61508c45b6bff47c641210f 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | ignoreMasterTextureLimit: 0 28 | grayScaleToAlpha: 0 29 | generateCubemap: 6 30 | cubemapConvolution: 1 31 | seamlessCubemap: 1 32 | textureFormat: 1 33 | maxTextureSize: 2048 34 | textureSettings: 35 | serializedVersion: 2 36 | filterMode: 2 37 | aniso: 0 38 | mipBias: 0 39 | wrapU: 1 40 | wrapV: 1 41 | wrapW: 1 42 | nPOTScale: 1 43 | lightmap: 0 44 | compressionQuality: 50 45 | spriteMode: 0 46 | spriteExtrude: 1 47 | spriteMeshType: 1 48 | alignment: 0 49 | spritePivot: {x: 0.5, y: 0.5} 50 | spritePixelsToUnits: 100 51 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 52 | spriteGenerateFallbackPhysicsShape: 1 53 | alphaUsage: 1 54 | alphaIsTransparency: 0 55 | spriteTessellationDetail: -1 56 | textureType: 0 57 | textureShape: 2 58 | singleChannelComponent: 0 59 | flipbookRows: 1 60 | flipbookColumns: 1 61 | maxTextureSizeSet: 0 62 | compressionQualitySet: 0 63 | textureFormatSet: 0 64 | ignorePngGamma: 0 65 | applyGammaDecoding: 0 66 | platformSettings: 67 | - serializedVersion: 3 68 | buildTarget: DefaultTexturePlatform 69 | maxTextureSize: 2048 70 | resizeAlgorithm: 0 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 100 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | androidETC2FallbackOverride: 0 78 | forceMaximumCompressionQuality_BC6H_BC7: 0 79 | - serializedVersion: 3 80 | buildTarget: Standalone 81 | maxTextureSize: 8192 82 | resizeAlgorithm: 0 83 | textureFormat: -1 84 | textureCompression: 1 85 | compressionQuality: 50 86 | crunchedCompression: 0 87 | allowsAlphaSplitting: 0 88 | overridden: 0 89 | androidETC2FallbackOverride: 0 90 | forceMaximumCompressionQuality_BC6H_BC7: 0 91 | - serializedVersion: 3 92 | buildTarget: iPhone 93 | maxTextureSize: 8192 94 | resizeAlgorithm: 0 95 | textureFormat: -1 96 | textureCompression: 1 97 | compressionQuality: 50 98 | crunchedCompression: 0 99 | allowsAlphaSplitting: 0 100 | overridden: 0 101 | androidETC2FallbackOverride: 0 102 | forceMaximumCompressionQuality_BC6H_BC7: 0 103 | - serializedVersion: 3 104 | buildTarget: Android 105 | maxTextureSize: 8192 106 | resizeAlgorithm: 0 107 | textureFormat: -1 108 | textureCompression: 1 109 | compressionQuality: 50 110 | crunchedCompression: 0 111 | allowsAlphaSplitting: 0 112 | overridden: 0 113 | androidETC2FallbackOverride: 0 114 | forceMaximumCompressionQuality_BC6H_BC7: 0 115 | - serializedVersion: 3 116 | buildTarget: Windows Store Apps 117 | maxTextureSize: 8192 118 | resizeAlgorithm: 0 119 | textureFormat: -1 120 | textureCompression: 1 121 | compressionQuality: 50 122 | crunchedCompression: 0 123 | allowsAlphaSplitting: 0 124 | overridden: 0 125 | androidETC2FallbackOverride: 0 126 | forceMaximumCompressionQuality_BC6H_BC7: 0 127 | spriteSheet: 128 | serializedVersion: 2 129 | sprites: [] 130 | outline: [] 131 | physicsShape: [] 132 | bones: [] 133 | spriteID: 134 | internalID: 0 135 | vertices: [] 136 | indices: 137 | edges: [] 138 | weights: [] 139 | secondaryTextures: [] 140 | nameFileIdTable: {} 141 | spritePackingTag: 142 | pSDRemoveMatte: 0 143 | pSDShowRemoveMatteOption: 0 144 | userData: 145 | assetBundleName: 146 | assetBundleVariant: 147 | -------------------------------------------------------------------------------- /DemoScene/New Material.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-7338199985037520295 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 11 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | version: 5 16 | --- !u!21 &2100000 17 | Material: 18 | serializedVersion: 6 19 | m_ObjectHideFlags: 0 20 | m_CorrespondingSourceObject: {fileID: 0} 21 | m_PrefabInstance: {fileID: 0} 22 | m_PrefabAsset: {fileID: 0} 23 | m_Name: New Material 24 | m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} 25 | m_ShaderKeywords: 26 | m_LightmapFlags: 4 27 | m_EnableInstancingVariants: 0 28 | m_DoubleSidedGI: 0 29 | m_CustomRenderQueue: -1 30 | stringTagMap: 31 | RenderType: Opaque 32 | disabledShaderPasses: [] 33 | m_SavedProperties: 34 | serializedVersion: 3 35 | m_TexEnvs: 36 | - _BaseMap: 37 | m_Texture: {fileID: 0} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | - _BumpMap: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | - _DetailAlbedoMap: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - _DetailMask: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | - _DetailNormalMap: 53 | m_Texture: {fileID: 0} 54 | m_Scale: {x: 1, y: 1} 55 | m_Offset: {x: 0, y: 0} 56 | - _EmissionMap: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - _MainTex: 61 | m_Texture: {fileID: 0} 62 | m_Scale: {x: 1, y: 1} 63 | m_Offset: {x: 0, y: 0} 64 | - _MetallicGlossMap: 65 | m_Texture: {fileID: 0} 66 | m_Scale: {x: 1, y: 1} 67 | m_Offset: {x: 0, y: 0} 68 | - _OcclusionMap: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | - _ParallaxMap: 73 | m_Texture: {fileID: 0} 74 | m_Scale: {x: 1, y: 1} 75 | m_Offset: {x: 0, y: 0} 76 | - _SpecGlossMap: 77 | m_Texture: {fileID: 0} 78 | m_Scale: {x: 1, y: 1} 79 | m_Offset: {x: 0, y: 0} 80 | - unity_Lightmaps: 81 | m_Texture: {fileID: 0} 82 | m_Scale: {x: 1, y: 1} 83 | m_Offset: {x: 0, y: 0} 84 | - unity_LightmapsInd: 85 | m_Texture: {fileID: 0} 86 | m_Scale: {x: 1, y: 1} 87 | m_Offset: {x: 0, y: 0} 88 | - unity_ShadowMasks: 89 | m_Texture: {fileID: 0} 90 | m_Scale: {x: 1, y: 1} 91 | m_Offset: {x: 0, y: 0} 92 | m_Ints: [] 93 | m_Floats: 94 | - _AlphaClip: 0 95 | - _Blend: 0 96 | - _BumpScale: 1 97 | - _ClearCoatMask: 0 98 | - _ClearCoatSmoothness: 0 99 | - _Cull: 2 100 | - _Cutoff: 0.5 101 | - _DetailAlbedoMapScale: 1 102 | - _DetailNormalMapScale: 1 103 | - _DstBlend: 0 104 | - _EnvironmentReflections: 1 105 | - _GlossMapScale: 0 106 | - _Glossiness: 0 107 | - _GlossyReflections: 0 108 | - _Metallic: 0 109 | - _OcclusionStrength: 1 110 | - _Parallax: 0.005 111 | - _QueueOffset: 0 112 | - _ReceiveShadows: 1 113 | - _Smoothness: 0.179 114 | - _SmoothnessTextureChannel: 0 115 | - _SpecularHighlights: 1 116 | - _SrcBlend: 1 117 | - _Surface: 0 118 | - _WorkflowMode: 1 119 | - _ZWrite: 1 120 | m_Colors: 121 | - _BaseColor: {r: 0.1509434, g: 0.1509434, b: 0.1509434, a: 1} 122 | - _Color: {r: 0.15094337, g: 0.15094337, b: 0.15094337, a: 1} 123 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 124 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 125 | m_BuildTextureStacks: [] 126 | -------------------------------------------------------------------------------- /DemoScene/New Material.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb2aed7298ecbb14eafde0ed5a2d04ef 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DemoScene/Sky.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Sky 11 | m_Shader: {fileID: 106, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _SUNDISK_HIGH_QUALITY 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BaseMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _BumpMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailAlbedoMap: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailMask: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _DetailNormalMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _EmissionMap: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MainTex: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _MetallicGlossMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _OcclusionMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | - _ParallaxMap: 59 | m_Texture: {fileID: 0} 60 | m_Scale: {x: 1, y: 1} 61 | m_Offset: {x: 0, y: 0} 62 | - _SpecGlossMap: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - unity_Lightmaps: 67 | m_Texture: {fileID: 0} 68 | m_Scale: {x: 1, y: 1} 69 | m_Offset: {x: 0, y: 0} 70 | - unity_LightmapsInd: 71 | m_Texture: {fileID: 0} 72 | m_Scale: {x: 1, y: 1} 73 | m_Offset: {x: 0, y: 0} 74 | - unity_ShadowMasks: 75 | m_Texture: {fileID: 0} 76 | m_Scale: {x: 1, y: 1} 77 | m_Offset: {x: 0, y: 0} 78 | m_Ints: [] 79 | m_Floats: 80 | - _AlphaClip: 0 81 | - _AtmosphereThickness: 1 82 | - _Blend: 0 83 | - _BumpScale: 1 84 | - _ClearCoatMask: 0 85 | - _ClearCoatSmoothness: 0 86 | - _Cull: 2 87 | - _Cutoff: 0.5 88 | - _DetailAlbedoMapScale: 1 89 | - _DetailNormalMapScale: 1 90 | - _DstBlend: 0 91 | - _EnvironmentReflections: 1 92 | - _Exposure: 0 93 | - _GlossMapScale: 0 94 | - _Glossiness: 0 95 | - _GlossyReflections: 0 96 | - _Metallic: 0 97 | - _OcclusionStrength: 1 98 | - _Parallax: 0.005 99 | - _QueueOffset: 0 100 | - _ReceiveShadows: 1 101 | - _Smoothness: 0.5 102 | - _SmoothnessTextureChannel: 0 103 | - _SpecularHighlights: 1 104 | - _SrcBlend: 1 105 | - _SunDisk: 2 106 | - _SunSize: 0.04 107 | - _SunSizeConvergence: 5 108 | - _Surface: 0 109 | - _WorkflowMode: 1 110 | - _ZWrite: 1 111 | m_Colors: 112 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 113 | - _Color: {r: 1, g: 1, b: 1, a: 1} 114 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 115 | - _GroundColor: {r: 0.36899996, g: 0.34899998, b: 0.34099993, a: 1} 116 | - _SkyTint: {r: 0.5, g: 0.5, b: 0.5, a: 1} 117 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 118 | m_BuildTextureStacks: [] 119 | --- !u!114 &4187506503491512082 120 | MonoBehaviour: 121 | m_ObjectHideFlags: 11 122 | m_CorrespondingSourceObject: {fileID: 0} 123 | m_PrefabInstance: {fileID: 0} 124 | m_PrefabAsset: {fileID: 0} 125 | m_GameObject: {fileID: 0} 126 | m_Enabled: 1 127 | m_EditorHideFlags: 0 128 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 129 | m_Name: 130 | m_EditorClassIdentifier: 131 | version: 5 132 | -------------------------------------------------------------------------------- /DemoScene/Sky.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5892c30f85c3074e9ae0c21aa08fe3a 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DemoScene/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7e76cfe48e72fd4c9ab5dfe10ef3a6d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /DemoScene/Textures/DancingGirl_curvature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladesero/Volumetrics_URP/050d405f217567a7143ed9501511bfe30ceb30cc/DemoScene/Textures/DancingGirl_curvature.png -------------------------------------------------------------------------------- /DemoScene/Textures/DancingGirl_curvature.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ec74b70c1289ea4c84846f27dd37b6c 3 | timeCreated: 1506232892 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: 2 34 | aniso: -1 35 | mipBias: -1 36 | wrapU: 1 37 | wrapV: 1 38 | wrapW: 1 39 | nPOTScale: 1 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 0 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 1 50 | alphaIsTransparency: 0 51 | spriteTessellationDetail: -1 52 | textureType: 0 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 2048 60 | textureFormat: -1 61 | textureCompression: 1 62 | compressionQuality: 50 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | - buildTarget: Standalone 67 | maxTextureSize: 2048 68 | textureFormat: -1 69 | textureCompression: 1 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | spritePackingTag: 80 | userData: 81 | assetBundleName: 82 | assetBundleVariant: 83 | -------------------------------------------------------------------------------- /DemoScene/Textures/DancingGirl_normals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladesero/Volumetrics_URP/050d405f217567a7143ed9501511bfe30ceb30cc/DemoScene/Textures/DancingGirl_normals.png -------------------------------------------------------------------------------- /DemoScene/Textures/DancingGirl_normals.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 470c40004b504b44d81b18dc675f9941 3 | timeCreated: 1506234435 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: 2 34 | aniso: 4 35 | mipBias: -1 36 | wrapU: 1 37 | wrapV: 1 38 | wrapW: 1 39 | nPOTScale: 1 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 0 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 1 50 | alphaIsTransparency: 0 51 | spriteTessellationDetail: -1 52 | textureType: 1 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 2048 60 | textureFormat: -1 61 | textureCompression: 1 62 | compressionQuality: 50 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | - buildTarget: Standalone 67 | maxTextureSize: 2048 68 | textureFormat: -1 69 | textureCompression: 1 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | spritePackingTag: 80 | userData: 81 | assetBundleName: 82 | assetBundleVariant: 83 | -------------------------------------------------------------------------------- /DemoScene/Textures/DancingGirl_occlusion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladesero/Volumetrics_URP/050d405f217567a7143ed9501511bfe30ceb30cc/DemoScene/Textures/DancingGirl_occlusion.png -------------------------------------------------------------------------------- /DemoScene/Textures/DancingGirl_occlusion.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 66b65b33bc005a2438552ff5e3d8c845 3 | timeCreated: 1506232893 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: 2 34 | aniso: -1 35 | mipBias: -1 36 | wrapU: 1 37 | wrapV: 1 38 | wrapW: 1 39 | nPOTScale: 1 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 0 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 1 50 | alphaIsTransparency: 0 51 | spriteTessellationDetail: -1 52 | textureType: 0 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 2048 60 | textureFormat: -1 61 | textureCompression: 1 62 | compressionQuality: 50 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | - buildTarget: Standalone 67 | maxTextureSize: 2048 68 | textureFormat: -1 69 | textureCompression: 1 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | spritePackingTag: 80 | userData: 81 | assetBundleName: 82 | assetBundleVariant: 83 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 bladesero 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 842118fdaaba8634ab20da5aa9c9cd14 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Prefabs/LightManager.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &6017331181115198087 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 6134180004556011575} 12 | - component: {fileID: 7086267081204666466} 13 | m_Layer: 0 14 | m_Name: LightManager 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &6134180004556011575 21 | Transform: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 6017331181115198087} 27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 28 | m_LocalPosition: {x: 0, y: 0, z: 0} 29 | m_LocalScale: {x: 1, y: 1, z: 1} 30 | m_Children: [] 31 | m_Father: {fileID: 0} 32 | m_RootOrder: 0 33 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 34 | --- !u!114 &7086267081204666466 35 | MonoBehaviour: 36 | m_ObjectHideFlags: 0 37 | m_CorrespondingSourceObject: {fileID: 0} 38 | m_PrefabInstance: {fileID: 0} 39 | m_PrefabAsset: {fileID: 0} 40 | m_GameObject: {fileID: 6017331181115198087} 41 | m_Enabled: 1 42 | m_EditorHideFlags: 0 43 | m_Script: {fileID: 11500000, guid: 2712d5a13ec53ba44a1ad09a6af1ff23, type: 3} 44 | m_Name: 45 | m_EditorClassIdentifier: 46 | -------------------------------------------------------------------------------- /Prefabs/LightManager.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9417d4a0a49de4f4d972b8112296a7a0 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Volumetrics_URP 2 | volumetric 3 | 4 | A render feature to recover Unity 5.x's offical volumetric fog in Adam demo 5 | - [x] URP 12 6 | - [x] URP 10 7 | - [ ] URP 7 8 | 9 | Directional light,point light,spot light type has been supported.And it also include costant fog,height fog. 10 | 11 | The wind direction and noise density will be supported soon. 12 | -------------------------------------------------------------------------------- /Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58b1ef1ca36c5c941bd3dc37867bbdb7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/FogLight.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | [ExecuteInEditMode] 4 | public partial class FogLight : LightOverride 5 | { 6 | public bool m_ForceOnForFog = false; 7 | [Tooltip("Only one shadowed fog AreaLight at a time.")] 8 | [Header("Shadows")] 9 | public bool m_Shadows = false; 10 | 11 | public enum TextureSize 12 | { 13 | x256 = 256, 14 | x512 = 512, 15 | x1024 = 1024, 16 | } 17 | 18 | [Tooltip("Always at most half the res of the AreaLight's shadowmap.")] 19 | public TextureSize m_ShadowmapRes = TextureSize.x256; 20 | [Range(0, 3)] 21 | public int m_BlurIterations = 0; 22 | [Range(0.0f, float.PositiveInfinity)] 23 | public float m_BlurSize = 1.0f; 24 | [Min(0)] 25 | [Tooltip("Affects shadow softness.")] 26 | public float m_ESMExponent = 40.0f; 27 | 28 | public bool m_Bounded = true; 29 | 30 | public override bool GetForceOn() 31 | { 32 | return m_ForceOnForFog; 33 | } 34 | 35 | bool m_AddedToLightManager = false; 36 | 37 | void AddToLightManager() 38 | { 39 | if (!m_AddedToLightManager) 40 | m_AddedToLightManager = LightManagerFogLights.Add(this); 41 | } 42 | 43 | void OnEnable() 44 | { 45 | base.Init(); 46 | AddToLightManager(); 47 | } 48 | 49 | void Update() 50 | { 51 | // LightManager might not have been available during this light's OnEnable(), so keep trying. 52 | AddToLightManager(); 53 | } 54 | 55 | void OnDisable() 56 | { 57 | this.m_Initialized = false; 58 | LightManagerFogLights.Remove(this); 59 | m_AddedToLightManager = false; 60 | //CleanupDirectionalShadowmap(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Runtime/FogLight.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f73d813f820f2544da617d01be754e94 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/FogQualityParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine.Rendering.Universal; 3 | 4 | namespace UnityEngine.Rendering 5 | { 6 | [Serializable] 7 | public class FogQualityParameter : VolumeParameter 8 | { 9 | public FogQualityParameter(Volumetric.FogQuality value, bool overrideState = false) : base(value, overrideState) { } 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /Runtime/FogQualityParameter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c2054397857d77428bb49aec7285c12 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/LightManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | public class LightManager : MonoBehaviour 5 | { 6 | static LightManager s_Instance; 7 | HashSet m_Container = new HashSet(); 8 | 9 | static LightManager Instance 10 | { 11 | get 12 | { 13 | if (s_Instance != null) 14 | return s_Instance; 15 | 16 | s_Instance = (LightManager) FindObjectOfType(typeof(LightManager)); 17 | return s_Instance; 18 | } 19 | } 20 | 21 | public static HashSet Get() 22 | { 23 | LightManager instance = Instance; 24 | return instance == null ? new HashSet() : instance.m_Container; 25 | } 26 | 27 | public static bool Add(T t) 28 | { 29 | LightManager instance = Instance; 30 | if (instance == null) 31 | return false; 32 | 33 | instance.m_Container.Add(t); 34 | return true; 35 | } 36 | 37 | public static void Remove(T t) 38 | { 39 | LightManager instance = Instance; 40 | if (instance == null) 41 | return; 42 | 43 | instance.m_Container.Remove(t); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Runtime/LightManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fa6a18ce378efa479c493a2dcceb3a5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/LightManagerFogLights.cs: -------------------------------------------------------------------------------- 1 | public class LightManagerFogLights : LightManager 2 | { 3 | 4 | } 5 | -------------------------------------------------------------------------------- /Runtime/LightManagerFogLights.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2712d5a13ec53ba44a1ad09a6af1ff23 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/LightOverride.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public abstract class LightOverride : MonoBehaviour 4 | { 5 | 6 | [Header("Overrides")] 7 | public float m_IntensityMult = 1.0f; 8 | [Min(0.0f)] 9 | public float m_RangeMult = 1.0f; 10 | 11 | public enum Type{None, Point, Spot, Tube, Area, Directional} 12 | 13 | Type m_Type = Type.None; 14 | internal bool m_Initialized = false; 15 | Light m_Light; 16 | 17 | public bool isOn 18 | { 19 | get 20 | { 21 | if (!isActiveAndEnabled) 22 | return false; 23 | 24 | Init(); 25 | 26 | switch(m_Type) 27 | { 28 | case Type.Point: return m_Light.enabled || GetForceOn(); 29 | case Type.Directional: return m_Light.enabled || GetForceOn(); 30 | case Type.Spot: return m_Light.enabled || GetForceOn(); 31 | } 32 | 33 | return false; 34 | } 35 | 36 | private set{} 37 | } 38 | 39 | new public Light light {get{Init(); return m_Light;} private set{}} 40 | 41 | public Type type {get{Init(); return m_Type;} private set{}} 42 | 43 | // To get the "enabled" state checkbox 44 | void Update() 45 | { 46 | 47 | } 48 | 49 | public abstract bool GetForceOn(); 50 | 51 | internal void Init() 52 | { 53 | if (m_Initialized) 54 | return; 55 | 56 | if ((m_Light = GetComponent()) != null) 57 | { 58 | switch(m_Light.type) 59 | { 60 | case LightType.Point: m_Type = Type.Point; break; 61 | case LightType.Spot: m_Type = Type.Spot; break; 62 | case LightType.Directional: m_Type = Type.Directional; break; 63 | default: m_Type = Type.None; break; 64 | } 65 | } 66 | 67 | m_Initialized = true; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Runtime/LightOverride.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b90820e53fb7e4644b019c2bc400df1d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16440139c05464a4abc941919e74b23a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Resources/ApplyToOpaque.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/Volumetrics/ApplyToOpaque" { 2 | SubShader { 3 | //Tags { "RenderType" = "transparent" "RenderPipeline" = "UniversalPipeline"} 4 | Tags { "RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline"} 5 | LOD 100 6 | 7 | Pass { 8 | Name "FogCombine" 9 | ZTest Always Cull Off ZWrite Off 10 | Blend Off 11 | 12 | HLSLPROGRAM 13 | #pragma target 3.0 14 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" 15 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" 16 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" 17 | #include "Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/Common.hlsl" 18 | #include"Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl" 19 | #include "VolumetricFog.hlsl" 20 | #include "ExponentHeightFog.hlsl" 21 | #pragma vertex FullscreenVert 22 | #pragma fragment frag 23 | 24 | TEXTURE2D_X(_VolumeSourceTex); 25 | SAMPLER(sampler_VolumeSourceTex); 26 | 27 | float3 _InscatteringColor; 28 | float _MaxOpacity; 29 | float _Density; 30 | float _Height; 31 | float _CutoffDistance; 32 | float _StartDistance; 33 | float _HeightFalloff; 34 | 35 | //struct Attributes 36 | // { 37 | // float4 positionHCS : POSITION; 38 | // float2 uv : TEXCOORD0; 39 | // UNITY_VERTEX_INPUT_INSTANCE_ID 40 | // }; 41 | 42 | // struct Varyings 43 | // { 44 | // float4 positionCS : SV_POSITION; 45 | // float2 uv : TEXCOORD0; 46 | // UNITY_VERTEX_OUTPUT_STEREO 47 | // }; 48 | 49 | // Varyings VertDefault(Attributes input) 50 | // { 51 | // Varyings output; 52 | // UNITY_SETUP_INSTANCE_ID(input); 53 | // UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); 54 | 55 | // // Note: The pass is setup with a mesh already in CS 56 | // // Therefore, we can just output vertex position 57 | // output.positionCS = float4(input.positionHCS.xyz, 1.0); 58 | 59 | // #if UNITY_UV_STARTS_AT_TOP 60 | // output.positionCS.y *= -1; 61 | // #endif 62 | 63 | // output.uv = input.uv; 64 | 65 | // // Add a small epsilon to avoid artifacts when reconstructing the normals 66 | // output.uv += 1.0e-6; 67 | 68 | // return output; 69 | // } 70 | 71 | half4 frag (Varyings input) : SV_Target 72 | { 73 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); 74 | float2 uv = UnityStereoTransformScreenSpaceTex(input.uv); 75 | 76 | float depth = SampleSceneDepth(uv); 77 | 78 | half linear01Depth = Linear01Depth(depth,_ZBufferParams); 79 | half4 fog = Fog(linear01Depth, uv); 80 | 81 | FogData fogData=(FogData)0; 82 | 83 | //Init fogdata 84 | fogData.inscatteringColor=_InscatteringColor; 85 | fogData.maxOpacity=_MaxOpacity; 86 | fogData.density=_Density; 87 | fogData.height=_Height; 88 | fogData.cutoffDistance=_CutoffDistance; 89 | fogData.startDistance=_StartDistance; 90 | fogData.heightFalloff=_HeightFalloff; 91 | 92 | half4 farHeightFog=ApplyExponentialHeightFog(uv,depth,fogData); 93 | 94 | 95 | half4 col = SAMPLE_TEXTURE2D_X(_VolumeSourceTex, sampler_VolumeSourceTex, uv)* fog.a + fog; 96 | col=col* farHeightFog.a+ farHeightFog; 97 | 98 | //Stop Nan,but how to keep color,maybe rgb to hsv 99 | col.rgb=min(col.rgb,float3(50,50,50)); 100 | return col; 101 | } 102 | 103 | ENDHLSL 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Runtime/Resources/ApplyToOpaque.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 231f83be598021e4f8522cbf9f5e7e42 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | preprocessorOverride: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Runtime/Resources/ExponentHeightFog.hlsl: -------------------------------------------------------------------------------- 1 | #ifndef EXPONENT_HEIGHT_FOG_PASS_INCLUDED 2 | #define EXPONENT_HEIGHT_FOG_PASS_INCLUDED 3 | 4 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" 5 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl" 6 | 7 | static const float FLT_EPSILON2 = 0.01f; 8 | 9 | // UE 4.22 HeightFogCommon.ush 10 | // Calculate the line integral of the ray from the camera to the receiver position through the fog density function 11 | // The exponential fog density function is d = GlobalDensity * exp(-HeightFalloff * y) 12 | float CalculateLineIntegralShared(float FogHeightFalloff, float RayDirectionY, float RayOriginTerms) 13 | { 14 | float Falloff = max(-127.0f, FogHeightFalloff * RayDirectionY); // if it's lower than -127.0, then exp2() goes crazy in OpenGL's GLSL. 15 | float LineIntegral = (1.0f - exp2(-Falloff)) / Falloff; 16 | float LineIntegralTaylor = log(2.0) - (0.5 * pow(log(2.0),2)) * Falloff; // Taylor expansion around 0 17 | 18 | return RayOriginTerms * (abs(Falloff) > FLT_EPSILON2 ? LineIntegral : LineIntegralTaylor); 19 | } 20 | 21 | half4 GetExponentialHeightFog( 22 | float3 WorldPositionRelativeToCamera, 23 | half4 ExponentialFogParameters, half4 ExponentialFogParameters2, 24 | half4 ExponentialFogColorParameter 25 | ) // camera to vertex 26 | { 27 | const half MinFogOpacity = ExponentialFogColorParameter.w; 28 | 29 | float3 CameraToReceiver = WorldPositionRelativeToCamera; 30 | float CameraToReceiverLengthSqr = dot(CameraToReceiver, CameraToReceiver); 31 | float CameraToReceiverLengthInv = rsqrt(CameraToReceiverLengthSqr); 32 | float CameraToReceiverLength = CameraToReceiverLengthSqr * CameraToReceiverLengthInv; 33 | half3 CameraToReceiverNormalized = CameraToReceiver * CameraToReceiverLengthInv; 34 | 35 | // FogDensity * exp2(-FogHeightFalloff * (CameraWorldPosition.y - FogHeight)) 36 | half RayOriginTerms = ExponentialFogParameters.x; 37 | float RayLength = CameraToReceiverLength; 38 | float RayDirectionY = CameraToReceiver.y; 39 | 40 | // Factor in StartDistance 41 | half ExcludeDistance = ExponentialFogParameters.w; 42 | 43 | UNITY_BRANCH 44 | if (ExcludeDistance > 0) 45 | { 46 | float ExcludeIntersectionTime = ExcludeDistance * CameraToReceiverLengthInv; 47 | float CameraToExclusionIntersectionY = ExcludeIntersectionTime * CameraToReceiver.y; 48 | float ExclusionIntersectionY = _WorldSpaceCameraPos.y + CameraToExclusionIntersectionY; 49 | float ExclusionIntersectionToReceiverY = CameraToReceiver.y - CameraToExclusionIntersectionY; 50 | 51 | // Calculate fog off of the ray starting from the exclusion distance, instead of starting from the camera 52 | RayLength = (1.0f - ExcludeIntersectionTime) * CameraToReceiverLength; 53 | RayDirectionY = ExclusionIntersectionToReceiverY; 54 | // ExponentialFogParameters.y : height falloff 55 | // ExponentialFogParameters2.y : fog height 56 | // height falloff * height 57 | float Exponent = max(-127.0f, ExponentialFogParameters.y * (ExclusionIntersectionY - ExponentialFogParameters2.y)); 58 | // ExponentialFogParameters2.x : fog density 59 | RayOriginTerms = ExponentialFogParameters2.x * exp2(-Exponent); 60 | } 61 | 62 | // Calculate the "shared" line integral (this term is also used for the directional light inscattering) by adding the two line integrals together (from two different height falloffs and densities) 63 | // ExponentialFogParameters.y : fog height falloff 64 | float ExponentialHeightLineIntegralShared = 65 | CalculateLineIntegralShared(ExponentialFogParameters.y, RayDirectionY, RayOriginTerms); 66 | // fog amount 67 | float ExponentialHeightLineIntegral = ExponentialHeightLineIntegralShared * RayLength; 68 | 69 | half3 InscatteringColor = ExponentialFogColorParameter.xyz; 70 | 71 | // Calculate the amount of light that made it through the fog using the transmission equation 72 | // 73 | half ExpFogFactor = max(saturate(exp2(-ExponentialHeightLineIntegral)), MinFogOpacity); 74 | 75 | // ExponentialFogParameters2.w : FogCutoffDistance 76 | if (ExponentialFogParameters2.w > 0 && CameraToReceiverLength > ExponentialFogParameters2.w) 77 | { 78 | ExpFogFactor = 1; 79 | } 80 | 81 | half3 FogColor = (InscatteringColor) * (1 - ExpFogFactor); 82 | return half4(FogColor, ExpFogFactor); 83 | } 84 | 85 | 86 | struct FogData 87 | { 88 | float3 inscatteringColor; 89 | float maxOpacity; 90 | float density; 91 | float height; 92 | float cutoffDistance; 93 | float startDistance; 94 | float heightFalloff; 95 | }; 96 | 97 | half4 ApplyExponentialHeightFog(float2 uv, float depth,FogData fogdata) 98 | { 99 | if (UNITY_REVERSED_Z) 100 | depth = 1 - depth; 101 | 102 | float4 ndcPos = float4(float3(uv, depth) * 2 - 1, 1); 103 | float4 camPos = mul(unity_CameraInvProjection, ndcPos); 104 | camPos /= camPos.w; 105 | camPos.z *= -1; 106 | float3 worldPos = mul(unity_CameraToWorld, camPos).xyz; 107 | float3 worldCameraRay = worldPos - _WorldSpaceCameraPos; 108 | 109 | half4 ExponentialFogColorParameter; 110 | ExponentialFogColorParameter = float4( 111 | fogdata.inscatteringColor, 112 | 1.0 - fogdata.maxOpacity 113 | ); 114 | 115 | float4 ExponentialFogParameters; 116 | ExponentialFogParameters = float4( 117 | fogdata.density * exp2(-fogdata.heightFalloff * (_WorldSpaceCameraPos.y - fogdata.height)), 118 | fogdata.heightFalloff, 119 | 0, 120 | fogdata.startDistance 121 | ); 122 | 123 | half4 ExponentialFogParameters2; 124 | ExponentialFogParameters2 = float4( 125 | fogdata.density, 126 | fogdata.height, 127 | 0, 128 | fogdata.cutoffDistance 129 | ); 130 | 131 | float4 fogColor = GetExponentialHeightFog( 132 | worldCameraRay, 133 | ExponentialFogParameters, ExponentialFogParameters2, 134 | ExponentialFogColorParameter); 135 | 136 | return fogColor; 137 | } 138 | 139 | #endif -------------------------------------------------------------------------------- /Runtime/Resources/ExponentHeightFog.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c2fb585a3ab087b40a809d6c45ddabaf 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | preprocessorOverride: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Runtime/Resources/InjectLightingAndDensity.compute: -------------------------------------------------------------------------------- 1 | #pragma kernel CSMain ANISOTROPY POINT_LIGHTS SPOT_LIGHTS DIR_LIGHT DIR_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE 2 | 3 | // Directional light support not quite ready yet 4 | // #pragma kernel CSMain TUBE_LIGHTS TUBE_LIGHT_SHADOW_PLANES FOG_ELLIPSOIDS ANISOTROPY AREA_LIGHTS POINT_LIGHTS DIR_LIGHT 5 | 6 | //#define TUBE_LIGHT_ATTENUATION_LEGACY 1 7 | //#include "..\..\TubeLight\Shaders\TubeLightAttenuation.cginc" 8 | 9 | //#ifdef TUBE_LIGHT_SHADOW_PLANES 10 | // #include "..\..\TubeLight\Shaders\TubeLightShadowPlanes.cginc" 11 | //#endif 12 | 13 | //Core 14 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" 15 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" 16 | //Lighting 17 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" 18 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" 19 | 20 | #define MIEG 0.5f 21 | #pragma multi_compile _ _MAIN_LIGHT_SHADOWS 22 | 23 | RWTexture3D _VolumeInject; 24 | float4 _FrustumRays[4]; 25 | float4 _CameraPos; 26 | float4 _FrustumRaysLight[4]; 27 | float4 _CameraPosLight; 28 | float _Density; 29 | float _Intensity; 30 | float _Anisotropy; 31 | Texture2D _Noise; 32 | SamplerState sampler_Noise; 33 | float4 _FogParams; 34 | float _NoiseFogAmount; 35 | float _NoiseFogScale; 36 | float _WindSpeed; 37 | float3 _WindDir; 38 | //float _Time; 39 | Texture2D _LightTextureB0; 40 | SamplerState sampler_LightTextureB0; 41 | float _NearOverFarClip; 42 | float3 _AmbientLight; 43 | float _ZSlice; 44 | 45 | 46 | #ifdef FOG_BOMB 47 | float _FogBombRadius; 48 | float3 _FogBombPos; 49 | #endif 50 | 51 | #ifdef DIR_LIGHT 52 | float3 _DirLightColor; 53 | float3 _DirLightDir; 54 | #ifdef DIR_LIGHT_SHADOWS 55 | float _DirLightShadows; 56 | float _ESMExponentDirLight; 57 | struct ShadowParams 58 | { 59 | float4x4 worldToShadow[4]; 60 | float4 shadowSplitSpheres[4]; 61 | float4 shadowSplitSqRadii; 62 | }; 63 | RWStructuredBuffer _ShadowParams; 64 | Texture2D _DirectionalShadowmap; 65 | SamplerState sampler_DirectionalShadowmap; 66 | //Texture2D _MainLightShadowmap; 67 | float _MieG; 68 | float _SunFogDensity; 69 | #endif 70 | #endif 71 | 72 | #ifdef POINT_LIGHTS 73 | struct PointLight 74 | { 75 | float3 pos; 76 | float range; 77 | float3 color; 78 | float padding; 79 | }; 80 | StructuredBuffer _PointLights; 81 | float _PointLightsCount; 82 | #endif 83 | 84 | #ifdef SPOT_LIGHTS 85 | struct SpotLight 86 | { 87 | float3 pos; 88 | float3 spotDir; 89 | float range; 90 | float3 color; 91 | float2 angle; 92 | }; 93 | StructuredBuffer _SpotLights; 94 | float _SpotLightsCount; 95 | #endif 96 | 97 | #ifdef TUBE_LIGHTS 98 | struct TubeLight 99 | { 100 | float3 start; 101 | float range; 102 | float3 end; 103 | float radius; 104 | float3 color; 105 | float padding; 106 | }; 107 | StructuredBuffer _TubeLights; 108 | float _TubeLightsCount; 109 | 110 | //#ifdef TUBE_LIGHT_SHADOW_PLANES 111 | //// Same count as _TubeLightsCount 112 | //StructuredBuffer _TubeLightShadowPlanes; 113 | //#endif 114 | 115 | #endif // TUBE_LIGHTS 116 | 117 | #ifdef AREA_LIGHTS 118 | struct AreaLight 119 | { 120 | float4x4 mat; 121 | float4 pos; // only needed for anisotropy. w: 0 ortho, 1 proj 122 | float3 color; 123 | float bounded; 124 | }; 125 | StructuredBuffer _AreaLights; 126 | float _AreaLightsCount; 127 | Texture2D _AreaLightShadowmap; 128 | SamplerState sampler_AreaLightShadowmap; 129 | float _ShadowedAreaLightIndex; 130 | float4 _AreaLightShadowmapZParams; 131 | float _ESMExponentAreaLight; 132 | #endif 133 | 134 | #ifdef FOG_ELLIPSOIDS 135 | struct FogEllipsoid 136 | { 137 | float3 pos; 138 | float radius; 139 | float3 axis; 140 | float stretch; 141 | float density; 142 | float noiseAmount; 143 | float noiseSpeed; 144 | float noiseScale; 145 | float feather; 146 | float blend; 147 | float padding1; 148 | float padding2; 149 | }; 150 | StructuredBuffer _FogEllipsoids; 151 | float _FogEllipsoidsCount; 152 | #endif 153 | 154 | float hash( float n ) { return frac(sin(n)*753.5453123); } 155 | float noisep(float3 x) 156 | { 157 | float3 p = floor(x); 158 | float3 f = frac(x); 159 | f = f*f*(3.0-2.0*f); 160 | 161 | float n = p.x + p.y*157.0 + 113.0*p.z; 162 | return lerp(lerp(lerp( hash(n+ 0.0), hash(n+ 1.0),f.x), 163 | lerp( hash(n+157.0), hash(n+158.0),f.x),f.y), 164 | lerp(lerp( hash(n+113.0), hash(n+114.0),f.x), 165 | lerp( hash(n+270.0), hash(n+271.0),f.x),f.y),f.z); 166 | } 167 | 168 | float noise(float3 x) 169 | { 170 | float3 p = floor(x); 171 | float3 f = frac(x); 172 | f = f * f * (3.0 - 2.0 * f); 173 | float2 uv = (p.xy + float2(37.0,17.0) * p.z) + f.xy; 174 | float2 rg = _Noise.SampleLevel(sampler_Noise, (uv + 0.5) / 256.0, 0).yx; 175 | return -1.0 + 2.0 * lerp(rg.x, rg.y, f.z); 176 | } 177 | 178 | float ScrollNoise(float3 pos, float speed, float scale, float3 dir, float amount, float bias = 0.0, float mult = 1.0) 179 | { 180 | float time = _Time.y * speed; 181 | float noiseScale = scale; 182 | float3 noiseScroll = dir * time; 183 | float3 q = pos - noiseScroll; 184 | q *= scale; 185 | float f = 0; 186 | f = 0.5 * noisep(q); 187 | // scroll the next octave in the opposite direction to get some morphing instead of just scrolling 188 | q += noiseScroll * scale; 189 | q = q * 2.01; 190 | f += 0.25 * noisep(q); 191 | 192 | f += bias; 193 | f *= mult; 194 | 195 | f = max(f, 0.0); 196 | return lerp(1.0, f, amount); 197 | } 198 | 199 | #ifdef FOG_ELLIPSOIDS 200 | void FogEllipsoids(float3 pos, inout float density) 201 | { 202 | for (int i = 0; i < _FogEllipsoidsCount; i++) 203 | { 204 | float3 dir = _FogEllipsoids[i].pos - pos; 205 | float3 axis = _FogEllipsoids[i].axis; 206 | float3 dirAlongAxis = dot(dir, axis) * axis; 207 | 208 | float scrollNoise = ScrollNoise(dir, _FogEllipsoids[i].noiseSpeed, _FogEllipsoids[i].noiseScale, axis, _FogEllipsoids[i].noiseAmount); 209 | 210 | dir = dir + dirAlongAxis * _FogEllipsoids[i].stretch; 211 | float distsq = dot(dir, dir); 212 | float radius = _FogEllipsoids[i].radius; 213 | float feather = _FogEllipsoids[i].feather; 214 | // float feather = 0.3; 215 | feather = (1.0 - smoothstep (radius * feather, radius, distsq)); 216 | 217 | float contribution = scrollNoise * feather * _FogEllipsoids[i].density; 218 | density = lerp(density + contribution, density * contribution, _FogEllipsoids[i].blend); 219 | } 220 | } 221 | #endif 222 | 223 | #ifdef FOG_BOMB 224 | float Pulse(float c, float w, float x) 225 | { 226 | return smoothstep(c - w, c, x) - smoothstep(c, c + w, x); 227 | } 228 | #endif 229 | 230 | float Density(float3 pos) 231 | { 232 | float fog = _FogParams.x; 233 | 234 | //Height fog,move to PS for infinity distance 235 | 236 | fog += max(exp(_FogParams.y*(-pos.y + _FogParams.z)) * _FogParams.w, 0.0); 237 | //fog *= max(exp(_FogParams.y*(-pos.y + _FogParams.z)) * _FogParams.w, 0.0); 238 | 239 | float3 warp = pos; 240 | 241 | #ifdef FOG_BOMB 242 | if (_FogBombRadius > 0) 243 | { 244 | float3 posToBomb = _FogBombPos - pos; 245 | float distToBomb = length(posToBomb); 246 | fog *= smoothstep (_FogBombRadius * 0.9, _FogBombRadius * 1.1, distToBomb); 247 | fog *= 1.0 + 0.5 * Pulse(_FogBombRadius * 1.35, 0.7, distToBomb); 248 | warp += (1 - smoothstep(_FogBombRadius, _FogBombRadius * 1.4, distToBomb)) * posToBomb * 0.3; 249 | } 250 | #endif 251 | 252 | fog *= ScrollNoise(warp, _WindSpeed, _NoiseFogScale, _WindDir, _NoiseFogAmount, -0.3, 8.0); 253 | 254 | #ifdef FOG_ELLIPSOIDS 255 | FogEllipsoids(pos, fog); 256 | #endif 257 | 258 | return max(fog * _Density, 0.0); 259 | } 260 | 261 | float Attenuation(float distSqr) 262 | { 263 | float d = sqrt(distSqr); 264 | float kDefaultPointLightRadius = 0.25; 265 | return 1.0 / pow(1.0 + d/kDefaultPointLightRadius, 2); 266 | } 267 | 268 | float AttenuationToZero(float distSqr) 269 | { 270 | // attenuation = 1 / (1 + distance_to_light / light_radius)^2 271 | // = 1 / (1 + 2*(d/r) + (d/r)^2) 272 | // For more details see: https://imdoingitwrong.wordpress.com/2011/01/31/light-attenuation/ 273 | float d = sqrt(distSqr); 274 | float kDefaultPointLightRadius = 0.25; 275 | float atten = 1.0 / pow(1.0 + d/kDefaultPointLightRadius, 2); 276 | float kCutoff = 1.0 / pow(1.0 + 1.0/kDefaultPointLightRadius, 2); // cutoff equal to attenuation at distance 1.0 277 | 278 | // Force attenuation to fall towards zero at distance 1.0 279 | atten = (atten - kCutoff) / (1.f - kCutoff); 280 | if (d >= 1.f) 281 | atten = 0.f; 282 | 283 | return atten; 284 | } 285 | 286 | float3 FrustumRay(float2 uv, float4 frustumRays[4]) 287 | { 288 | float3 ray0 = lerp(frustumRays[0].xyz, frustumRays[1].xyz, uv.x); 289 | float3 ray1 = lerp(frustumRays[3].xyz, frustumRays[2].xyz, uv.x); 290 | return lerp(ray0, ray1, uv.y); 291 | } 292 | 293 | //Lighting Function 294 | #ifdef ANISOTROPY 295 | float anisotropy(float costheta) 296 | { 297 | float g = _Anisotropy; 298 | float gsq = g*g; 299 | float denom = 1 + gsq - 2.0 * g * costheta; 300 | denom = denom * denom * denom; 301 | denom = sqrt(max(0, denom)); 302 | return (1 - gsq) / denom; 303 | } 304 | #endif 305 | 306 | float3 LightDensity(Light light,float3 pos) 307 | { 308 | float attenuation=light.distanceAttenuation*light.shadowAttenuation; 309 | #if ANISOTROPY 310 | float3 cameraToPos = normalize(pos - _CameraPos.xyz); 311 | float costheta = dot(cameraToPos, normalize(light.direction-pos)); 312 | attenuation *= anisotropy(costheta); 313 | #endif 314 | return light.color*attenuation; 315 | } 316 | 317 | float3 LightDensityDirectional(Light light,float3 pos) 318 | { 319 | float attenuation=light.shadowAttenuation; 320 | #if ANISOTROPY 321 | float3 posToCamera = normalize(_CameraPos.xyz-pos); 322 | float costheta = dot(posToCamera, normalize(light.direction)); 323 | attenuation *= anisotropy(costheta); 324 | #endif 325 | return light.color*attenuation; 326 | } 327 | 328 | float3 LightVolume(float3 pos) 329 | { 330 | float3 color=float3(0,0,0); 331 | Light mainLight = GetMainLight(); 332 | 333 | color+=LightDensityDirectional(mainLight,pos); 334 | //#ifdef _ADDITIONAL_LIGHTS 335 | // uint pixelLightCount = GetAdditionalLightsCount(); 336 | // for (uint i = 0; i < pixelLightCount; ++i) 337 | // { 338 | // Light light = GetAdditionalLight(i, pos); 339 | // color +=float3(1,1,1); 340 | // } 341 | //#endif 342 | return color; 343 | } 344 | 345 | #if AREA_LIGHTS || DIR_LIGHT_SHADOWS 346 | #define VSM 1 347 | #if VSM 348 | float ChebyshevUpperBound(float2 moments, float mean) 349 | { 350 | // Compute variance 351 | float variance = moments.y - (moments.x * moments.x); 352 | float _VSMBias = 0.001f; 353 | variance = max(variance, _VSMBias * mean * mean); 354 | 355 | // Compute probabilistic upper bound 356 | float d = mean - moments.x; 357 | float pMax = variance / (variance + (d * d)); 358 | 359 | // One-tailed Chebyshev 360 | return (mean <= moments.x ? 1.0f : pMax); 361 | } 362 | #endif 363 | #endif 364 | 365 | #if DIR_LIGHT 366 | #if DIR_LIGHT_SHADOWS 367 | float4 getCascadeWeights_splitSpheres(float3 pos) 368 | { 369 | float3 fromCenter0 = pos - _ShadowParams[0].shadowSplitSpheres[0].xyz; 370 | float3 fromCenter1 = pos - _ShadowParams[0].shadowSplitSpheres[1].xyz; 371 | float3 fromCenter2 = pos - _ShadowParams[0].shadowSplitSpheres[2].xyz; 372 | float3 fromCenter3 = pos - _ShadowParams[0].shadowSplitSpheres[3].xyz; 373 | float4 distances2 = float4(dot(fromCenter0,fromCenter0), dot(fromCenter1,fromCenter1), dot(fromCenter2,fromCenter2), dot(fromCenter3,fromCenter3)); 374 | float4 weights = float4(distances2 >= _ShadowParams[0].shadowSplitSqRadii); 375 | return weights; 376 | } 377 | 378 | float4 getShadowCoord(float3 pos, float4 cascadeWeights) 379 | { 380 | return mul(_ShadowParams[0].worldToShadow[(int)dot(cascadeWeights, float4(1,1,1,1))], float4(pos, 1)); 381 | } 382 | 383 | float4 getShadowCoordURP(float3 pos, float4 cascadeWeights) 384 | { 385 | return mul(_ShadowParams[0].worldToShadow[(int)dot(cascadeWeights, float4(1,1,1,1))], float4(pos, 1)); 386 | } 387 | #endif 388 | 389 | float3 DirectionalLight(float3 pos) 390 | { 391 | if (!any(_DirLightColor)) 392 | return 0; 393 | 394 | float att = 1; 395 | 396 | #if DIR_LIGHT_SHADOWS 397 | if (_DirLightShadows > 0.0) 398 | { 399 | float4 cascadeWeights = getCascadeWeights_splitSpheres(pos); 400 | //bool inside = dot(cascadeWeights, float4(1,1,1,1)) < 4; 401 | float3 samplePos = getShadowCoord(pos, cascadeWeights).xyz; 402 | //occlusion += inside ? UNITY_SAMPLE_SHADOW(u_CascadedShadowMap, samplePos) : 1.f; 403 | #if 1 404 | att *= _DirectionalShadowmap.SampleLevel(sampler_DirectionalShadowmap, samplePos.xy, 0).r > samplePos.z; 405 | #else 406 | float2 shadowmap = _DirectionalShadowmap.SampleLevel(sampler_DirectionalShadowmap, samplePos, 0).xy; 407 | att *= ChebyshevUpperBound(shadowmap.xy, samplePos.z); 408 | 409 | // float depth = exp(-40.0 * samplePos.z); 410 | // att = saturate(shadowmap.r * depth); 411 | #endif 412 | } 413 | #endif 414 | 415 | #if ANISOTROPY 416 | float3 posToCamera = normalize(_CameraPos.xyz - pos); 417 | float costheta = dot(posToCamera, _DirLightDir); 418 | att *= anisotropy(costheta); 419 | #endif 420 | 421 | return _DirLightColor * att; 422 | } 423 | 424 | float MieScattering(float cosAngle, float4 g) 425 | { 426 | return g.w * (g.x / (pow(abs(g.y - g.z * cosAngle), 1.5))); 427 | } 428 | 429 | float3 DirectionalLightURP(float3 pos) 430 | { 431 | if (!any(_MainLightColor)) 432 | return 0; 433 | 434 | float att = 1; 435 | 436 | #ifdef _MAIN_LIGHT_SHADOWS 437 | { 438 | ShadowSamplingData MainLightShadowSamplingData=GetMainLightShadowSamplingData(); 439 | float4 shadowTexcoord = TransformWorldToShadowCoord(pos); 440 | float shadowatt = SAMPLE_TEXTURE2D_SHADOW(_MainLightShadowmapTexture,sampler_MainLightShadowmapTexture,shadowTexcoord.xyz); 441 | shadowatt *= ChebyshevUpperBound(shadowTexcoord.xy, shadowTexcoord.z); 442 | att *= shadowatt; 443 | } 444 | #endif 445 | 446 | //#if ANISOTROPY 447 | //float3 posToCamera = normalize(_CameraPos.xyz - pos); 448 | //float costheta = dot(posToCamera, _MainLightPosition.xyz); 449 | //att *= anisotropy(costheta); 450 | //#endif 451 | 452 | //Phase Function Mie G 453 | float3 posToCamera = normalize(_CameraPos.xyz - pos); 454 | float cosAngle = dot(_MainLightPosition.xyz, -posToCamera); 455 | // x: 1 - g^2, y: 1 + g^2, z: 2*g, w: 1/4pi 456 | float4 mieG=float4(1 - (_MieG * _MieG), 1 + (_MieG * _MieG), 2 * _MieG, 1.0f / (4.0f * 3.1415926)); 457 | float MieGScatter=MieScattering(cosAngle, mieG);//MieG=0.1 458 | 459 | return _MainLightColor.rgb * att*_MainLightShadowParams.x*MieGScatter*_SunFogDensity; 460 | } 461 | #endif 462 | 463 | #ifdef POINT_LIGHTS 464 | float3 PointLights(float3 pos) 465 | { 466 | float3 color = 0; 467 | for (int i = 0; i < _PointLightsCount; i++) 468 | { 469 | float3 posToLight = _PointLights[i].pos - pos; 470 | float distNorm = dot(posToLight, posToLight) * _PointLights[i].range; 471 | float att = Attenuation(distNorm); 472 | 473 | #if ANISOTROPY 474 | float3 cameraToPos = normalize(pos - _CameraPos.xyz); 475 | float costheta = dot(cameraToPos, normalize(posToLight)); 476 | att *= anisotropy(costheta); 477 | #endif 478 | 479 | color += _PointLights[i].color*att; 480 | } 481 | return color; 482 | } 483 | #endif 484 | 485 | #ifdef SPOT_LIGHTS 486 | float3 SpotLights(float3 pos) 487 | { 488 | float3 color = 0; 489 | for (int i = 0; i < _SpotLightsCount; i++) 490 | { 491 | float3 posToLight = normalize(_SpotLights[i].pos - pos); 492 | float3 posToLight2 = _SpotLights[i].pos - pos; 493 | float distNorm = dot(posToLight2, posToLight2) * _SpotLights[i].range; 494 | float spotAtt = saturate(dot(posToLight, -_SpotLights[i].spotDir) * _SpotLights[i].angle.x+_SpotLights[i].angle.y); 495 | spotAtt*=spotAtt; 496 | float distanceSqr=max(dot(posToLight,posToLight),0.01); 497 | spotAtt=spotAtt/distanceSqr; 498 | float att = Attenuation(distNorm)*spotAtt; 499 | 500 | #if ANISOTROPY 501 | float3 cameraToPos = normalize(pos - _CameraPos.xyz); 502 | float costheta = dot(cameraToPos, normalize(posToLight)); 503 | att *= anisotropy(costheta); 504 | #endif 505 | 506 | color += _SpotLights[i].color * att; 507 | } 508 | return color; 509 | } 510 | #endif 511 | 512 | #ifdef AREA_LIGHTS 513 | float3 AreaLights(float3 pos) 514 | { 515 | float3 color = 0; 516 | uint count = _AreaLightsCount; 517 | uint shadowedAreaLightIndex = _ShadowedAreaLightIndex; 518 | for (uint i = 0; i < count; i++) 519 | { 520 | float4 pClip = mul(_AreaLights[i].mat, float4(pos, 1)); 521 | float3 p = float3(pClip.x / pClip.w, pClip.y / pClip.w, pClip.z); 522 | float z = p.z * 0.5 + 0.5; 523 | 524 | float att = 1; 525 | 526 | if (_AreaLights[i].bounded) 527 | { 528 | att *= saturate(AttenuationToZero(z * z)); 529 | 530 | // Magic tweaks to the shape 531 | float corner = 0.4; 532 | float outset = 0.8; 533 | float smooth = 0.7; 534 | 535 | float d = length(max(abs(p.xy) - 1 + corner*outset, 0.0)) - corner; 536 | att *= saturate(1 - smoothstep(-smooth, 0, d)); 537 | att *= smoothstep(-0.01, 0.01, z); 538 | } 539 | 540 | #if ANISOTROPY 541 | float3 cameraToPos = normalize(pos - _CameraPos.xyz); 542 | float4 lightPos = _AreaLights[i].pos; 543 | float3 posToLight = lerp(lightPos.xyz, lightPos.xyz - pos, lightPos.w); 544 | float costheta = dot(cameraToPos, normalize(posToLight)); 545 | att *= anisotropy(costheta); 546 | #endif 547 | 548 | if (i == shadowedAreaLightIndex && all(abs(p) < 1)) 549 | { 550 | #if VSM 551 | float2 shadowmap = _AreaLightShadowmap.SampleLevel(sampler_AreaLightShadowmap, p.xy * 0.5 + 0.5, 0).xy; 552 | att *= ChebyshevUpperBound(shadowmap.xy, z); 553 | #else 554 | float shadowmap = _AreaLightShadowmap.SampleLevel(sampler_AreaLightShadowmap, p.xy * 0.5 + 0.5, 0); 555 | float depth = exp(-_ESMExponentAreaLight * z); 556 | att *= saturate(shadowmap * depth); 557 | #endif 558 | } 559 | 560 | color += _AreaLights[i].color * att; 561 | } 562 | return color; 563 | } 564 | #endif 565 | 566 | [numthreads(16,2,16)] 567 | void CSMain (uint3 id : SV_DispatchThreadID) 568 | { 569 | float3 color = _AmbientLight;//Abient Color 570 | //float3 color = float3(0,0,0);//Abient Color 571 | float2 uv = float2(id.x/159.0, id.y/89.0); 572 | float z = id.z/(_ZSlice-1.0); 573 | z = _NearOverFarClip + z * (1 - _NearOverFarClip); 574 | float3 pos = FrustumRay(uv, _FrustumRays) * z + _CameraPos.xyz; 575 | 576 | 577 | 578 | 579 | 580 | // Point lights 581 | #ifdef POINT_LIGHTS 582 | color += PointLights(pos); 583 | #endif 584 | 585 | #ifdef SPOT_LIGHTS 586 | color += SpotLights(pos); 587 | #endif 588 | 589 | //// Area lights 590 | //#ifdef AREA_LIGHTS 591 | //color += AreaLights(pos); 592 | //#endif 593 | 594 | //LightLoop 595 | //color +=LightVolume(pos); 596 | 597 | // Density 598 | float density = Density(pos); 599 | 600 | float extinction=density*0.2; 601 | 602 | // Directional light 603 | #ifdef DIR_LIGHT 604 | float3 dirColor = DirectionalLightURP(pos); 605 | color += dirColor; 606 | extinction+=dirColor*0.2; 607 | #endif 608 | 609 | extinction=exp(-extinction); 610 | 611 | // Output 612 | float4 output; 613 | output.rgb = _Intensity * density * color; 614 | output.a = density; 615 | _VolumeInject[id] = output; 616 | } 617 | 618 | -------------------------------------------------------------------------------- /Runtime/Resources/InjectLightingAndDensity.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23cc22315619926428be8ede1709c0fa 3 | ComputeShaderImporter: 4 | externalObjects: {} 5 | currentAPIMask: 4 6 | preprocessorOverride: 0 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Runtime/Resources/Scatter.compute: -------------------------------------------------------------------------------- 1 | // Based on 'Volumetric fog: Unified, compute shader based solution to atmospheric scattering, ACM Siggraph 2014' 2 | // https://bartwronski.com/publications/ 3 | 4 | #pragma kernel CSMain 5 | //#define VOLUME_DEPTH 128.0 6 | float _ZSlice; 7 | 8 | Texture3D _VolumeInject; 9 | RWTexture3D _VolumeScatter; 10 | 11 | float4 ScatterStep(float3 accumulatedLight, float accumulatedTransmittance, float3 sliceLight, float sliceDensity) 12 | { 13 | sliceDensity = max(sliceDensity, 0.000001); 14 | float sliceTransmittance = exp(-sliceDensity / _ZSlice); 15 | 16 | // Seb Hillaire's improved transmission by calculating an integral over slice depth instead of 17 | // constant per slice value. Light still constant per slice, but that's acceptable. See slide 28 of 18 | // Physically-based & Unified Volumetric Rendering in Frostbite 19 | // http://www.frostbite.com/2015/08/physically-based-unified-volumetric-rendering-in-frostbite/ 20 | float3 sliceLightIntegral = sliceLight * (1.0 - sliceTransmittance) / sliceDensity; 21 | 22 | accumulatedLight += sliceLightIntegral * accumulatedTransmittance; 23 | accumulatedTransmittance *= sliceTransmittance; 24 | 25 | return float4(accumulatedLight, accumulatedTransmittance); 26 | } 27 | 28 | [numthreads(32, 2, 1)] 29 | void CSMain (uint3 id : SV_DispatchThreadID) 30 | { 31 | // Store transmission in .a, as opposed to density in _VolumeInject 32 | float4 accum = float4(0, 0, 0, 1); 33 | uint3 pos = uint3(id.xy, 0); 34 | uint steps = _ZSlice; 35 | 36 | for(uint z = 0; z < steps; z++) 37 | { 38 | pos.z = z; 39 | float4 slice = _VolumeInject[pos]; 40 | accum = ScatterStep(accum.rgb, accum.a, slice.rgb, slice.a); 41 | _VolumeScatter[pos] = accum; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Runtime/Resources/Scatter.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e8dda4949afd84429b62c6fc9a1512b 3 | ComputeShaderImporter: 4 | externalObjects: {} 5 | currentAPIMask: 4 6 | preprocessorOverride: 0 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Runtime/Resources/VolumetricFog.cginc: -------------------------------------------------------------------------------- 1 | sampler3D _VolumeScatter; 2 | float4 _VolumeScatter_TexelSize; 3 | float4 _Screen_TexelSize; 4 | float _CameraFarOverMaxFar; 5 | float _NearOverFarClip; 6 | 7 | int ihash(int n) 8 | { 9 | n = (n<<13)^n; 10 | return (n*(n*n*15731+789221)+1376312589) & 2147483647; 11 | } 12 | 13 | float frand(int n) 14 | { 15 | return ihash(n) / 2147483647.0; 16 | } 17 | 18 | float2 cellNoise(int2 p) 19 | { 20 | int i = p.y*256 + p.x; 21 | return float2(frand(i), frand(i + 57)) - 0.5;//*2.0-1.0; 22 | } 23 | 24 | half4 Fog(half linear01Depth, half2 screenuv) 25 | { 26 | half z = linear01Depth * _CameraFarOverMaxFar; 27 | z = (z - _NearOverFarClip) / (1 - _NearOverFarClip); 28 | if (z < 0.0) 29 | return half4(0, 0, 0, 1); 30 | 31 | half3 uvw = half3(screenuv.x, screenuv.y, z); 32 | uvw.xy += cellNoise(uvw.xy * _Screen_TexelSize.zw) * _VolumeScatter_TexelSize.xy * 0.8; 33 | return tex3D(_VolumeScatter, uvw); 34 | } 35 | -------------------------------------------------------------------------------- /Runtime/Resources/VolumetricFog.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 301c0c649b251cb43aeddf0baad3adfb 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | preprocessorOverride: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Runtime/Resources/VolumetricFog.hlsl: -------------------------------------------------------------------------------- 1 | sampler3D _VolumeScatter; 2 | float4 _VolumeScatter_TexelSize; 3 | float4 _Screen_TexelSize; 4 | float _CameraFarOverMaxFar; 5 | float _NearOverFarClip; 6 | 7 | int ihash(int n) 8 | { 9 | n = (n<<13)^n; 10 | return (n*(n*n*15731+789221)+1376312589) & 2147483647; 11 | } 12 | 13 | float frand(int n) 14 | { 15 | return ihash(n) / 2147483647.0; 16 | } 17 | 18 | float2 cellNoise(int2 p) 19 | { 20 | int i = p.y*256 + p.x; 21 | return float2(frand(i), frand(i + 57)) - 0.5;//*2.0-1.0; 22 | } 23 | 24 | half4 Fog(half linear01Depth, half2 screenuv) 25 | { 26 | half z = linear01Depth * _CameraFarOverMaxFar; 27 | z = (z - _NearOverFarClip) / (1 - _NearOverFarClip); 28 | if (z < 0.0) 29 | return half4(0, 0, 0, 1); 30 | 31 | half3 uvw = half3(screenuv.x, screenuv.y, z); 32 | uvw.xy += cellNoise(uvw.xy * _Screen_TexelSize.zw) * _VolumeScatter_TexelSize.xy * 0.8; 33 | return tex3D(_VolumeScatter, uvw); 34 | } 35 | -------------------------------------------------------------------------------- /Runtime/Resources/VolumetricFog.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 12274db12454cb5419ce2386eff22680 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | preprocessorOverride: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Runtime/Resources/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bladesero/Volumetrics_URP/050d405f217567a7143ed9501511bfe30ceb30cc/Runtime/Resources/noise.png -------------------------------------------------------------------------------- /Runtime/Resources/noise.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37b3db7653744a5479667f54e306469d 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 0 39 | wrapV: 0 40 | wrapW: 0 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 0 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | spriteSheet: 79 | serializedVersion: 2 80 | sprites: [] 81 | outline: [] 82 | physicsShape: [] 83 | bones: [] 84 | spriteID: 85 | internalID: 0 86 | vertices: [] 87 | indices: 88 | edges: [] 89 | weights: [] 90 | secondaryTextures: [] 91 | spritePackingTag: 92 | pSDRemoveMatte: 0 93 | pSDShowRemoveMatteOption: 0 94 | userData: 95 | assetBundleName: 96 | assetBundleVariant: 97 | -------------------------------------------------------------------------------- /Runtime/Volumetric.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace UnityEngine.Rendering.Universal 7 | { 8 | [Serializable, VolumeComponentMenu("Post-processing/Volumetric Fog")] 9 | public class Volumetric : VolumeComponent, IPostProcessComponent 10 | { 11 | public enum FogQuality { Low, Medium, High }; 12 | 13 | [Tooltip("Fog Quality")] 14 | public FogQualityParameter fogQuality = new FogQualityParameter(FogQuality.Medium); 15 | [Tooltip("Fog Global Density")] 16 | public ClampedFloatParameter GlobalDensity = new ClampedFloatParameter(0.0f, 0.0f, 5.0f); 17 | [Tooltip("Fog Distance")] 18 | public ClampedFloatParameter Distance = new ClampedFloatParameter(50.0f, 20.0f, 100.0f); 19 | [Tooltip("Constant Fog Density")] 20 | public ClampedFloatParameter ConstantFogDensity = new ClampedFloatParameter(1.0f, 0.0f, 2.0f); 21 | [Tooltip("Height Fog Density")] 22 | public ClampedFloatParameter HeightFogDensity = new ClampedFloatParameter(1.0f, 0.0f, 3.0f); 23 | [Tooltip("Second Height Fog Density for far Object")] 24 | public ClampedFloatParameter SecondHeightFogDensity = new ClampedFloatParameter(0.01f, 0.0f, 0.02f); 25 | [Tooltip("Height Fog Exponent")] 26 | public ClampedFloatParameter HeightFogExponent = new ClampedFloatParameter(0.125f, 0.0f, 1.0f); 27 | [Tooltip("Height Fog Height Offset")] 28 | public ClampedFloatParameter HeightFogOffset = new ClampedFloatParameter(0.0f, -100.0f, 100.0f); 29 | [Tooltip("Anisotropy Scatter")] 30 | public ClampedFloatParameter Anisotropy = new ClampedFloatParameter(0.5f, 0.0f, 0.98f); 31 | [Tooltip("Fog Ambient Color")] 32 | public ColorParameter AmbientColor = new ColorParameter(new Color(0.23f, 0.63f, 1.0f)); 33 | 34 | [Header("MainLightParams")] 35 | public ClampedFloatParameter SunDensity = new ClampedFloatParameter(1.0f, 0.0f, 30.0f); 36 | public ClampedFloatParameter MieG = new ClampedFloatParameter(0.5f, 0.0f, 1.0f); 37 | 38 | Volumetric() 39 | { 40 | displayName = "Volumetric Fog"; 41 | } 42 | 43 | public bool IsActive() 44 | { 45 | return GlobalDensity.value > 0.0f; 46 | } 47 | 48 | public bool IsTileCompatible() 49 | { 50 | return false; 51 | } 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Runtime/Volumetric.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b23efd1a75591a34dbd4af2bd1fc1067 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/VolumetricFeature.cs: -------------------------------------------------------------------------------- 1 | //Source:Unity Volumetric lighting 2 | 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Runtime.InteropServices; 7 | using UnityEngine; 8 | 9 | namespace UnityEngine.Rendering.Universal 10 | { 11 | public class VolumetricFogPass : ScriptableRenderPass 12 | { 13 | const string PassName = "VolumetricFog"; 14 | const string CombineShaderName = "Hidden/Volumetrics/ApplyToOpaque"; 15 | private static readonly int s_VolumeInject = Shader.PropertyToID("_VolumeInject"); 16 | private static readonly int s_VolumeScatter = Shader.PropertyToID("_VolumeScatter"); 17 | 18 | //Public Params 19 | public struct FogSettings 20 | { 21 | public float m_GlobalIntensityMult; 22 | public float m_GlobalDensityMult; 23 | public float m_ConstantFog; 24 | public float m_HeightFogAmount; 25 | public float m_HeightFogExponent; 26 | public float m_HeightFogOffset; 27 | public float m_Anisotropy; 28 | public float NearClip; 29 | public float FarClip; 30 | public Color AmbientColor; 31 | }; 32 | //public FogSettings fogSettings = new FogSettings(); 33 | 34 | private Texture2D m_Noise; 35 | 36 | 37 | static readonly Vector2[] frustumUVs = 38 | new Vector2[] { new Vector2(0, 0), new Vector2(1, 0), new Vector2(1, 1), new Vector2(0, 1) }; 39 | static float[] frustumRays = new float[16]; 40 | float[] m_fogParams; 41 | 42 | private ComputeShader m_InjectLightingAndDensity; 43 | private ComputeShader m_Scatter; 44 | private Material Combine; 45 | private Volumetric volumetric; 46 | 47 | RenderTargetIdentifier VolumeInjectID = new RenderTargetIdentifier(s_VolumeInject); 48 | RenderTargetIdentifier VolumeScatterID = new RenderTargetIdentifier(s_VolumeScatter); 49 | Vector3Int m_InjectNumThreads = new Vector3Int(16, 2, 16); 50 | Vector3Int m_ScatterNumThreads = new Vector3Int(32, 2, 1); 51 | Vector3Int m_VolumeResolution = new Vector3Int(160, 90, 128); 52 | public int ZSlice=128; 53 | 54 | private ScriptableRenderer m_renderer; 55 | RenderTargetIdentifier source; 56 | RenderTargetHandle m_TemporaryColorTexture; 57 | 58 | #region Light Data&Function 59 | struct PointLightParams 60 | { 61 | public Vector3 pos; 62 | public float range; 63 | public Vector3 color; 64 | float padding; 65 | } 66 | 67 | PointLightParams[] m_PointLightParams; 68 | ComputeBuffer m_PointLightParamsCB; 69 | 70 | struct SpotLightParams 71 | { 72 | public Vector3 pos; 73 | public Vector3 spotDir; 74 | public float range; 75 | public Vector3 color; 76 | public Vector2 angle; 77 | } 78 | 79 | SpotLightParams[] m_SpotLightParams; 80 | ComputeBuffer m_SpotLightParamsCB; 81 | 82 | ComputeBuffer m_DummyCB; 83 | 84 | void SetUpPointLightBuffers(int kernel,CommandBuffer cmd) 85 | { 86 | int count = m_PointLightParamsCB == null ? 0 : m_PointLightParamsCB.count; 87 | m_InjectLightingAndDensity.SetFloat("_PointLightsCount", count); 88 | if (count == 0) 89 | { 90 | // Can't not set the buffer 91 | m_InjectLightingAndDensity.SetBuffer(kernel, "_PointLights", m_DummyCB); 92 | return; 93 | } 94 | 95 | if (m_PointLightParams == null || m_PointLightParams.Length != count) 96 | m_PointLightParams = new PointLightParams[count]; 97 | 98 | HashSet fogLights = LightManagerFogLights.Get(); 99 | 100 | int j = 0; 101 | for (var x = fogLights.GetEnumerator(); x.MoveNext();) 102 | { 103 | var fl = x.Current; 104 | if (fl == null || fl.type != FogLight.Type.Point || !fl.isOn) 105 | continue; 106 | 107 | Light light = fl.light; 108 | m_PointLightParams[j].pos = light.transform.position; 109 | float range = light.range * fl.m_RangeMult; 110 | m_PointLightParams[j].range = 1.0f / (range * range); 111 | m_PointLightParams[j].color = new Vector3(light.color.r, light.color.g, light.color.b) * light.intensity * fl.m_IntensityMult; 112 | j++; 113 | } 114 | 115 | // TODO: try a constant buffer with setfloats instead for perf 116 | cmd.SetComputeBufferData(m_PointLightParamsCB, m_PointLightParams); 117 | cmd.SetComputeBufferParam(m_InjectLightingAndDensity, kernel, "_PointLights", m_PointLightParamsCB); 118 | } 119 | 120 | void SetUpSpotLightBuffers(int kernel,CommandBuffer cmd) 121 | { 122 | int count = m_SpotLightParamsCB == null ? 0 : m_SpotLightParamsCB.count; 123 | m_InjectLightingAndDensity.SetFloat("_SpotLightsCount", count); 124 | if (count == 0) 125 | { 126 | // Can't not set the buffer 127 | m_InjectLightingAndDensity.SetBuffer(kernel, "_SpotLights", m_DummyCB); 128 | return; 129 | } 130 | 131 | if (m_SpotLightParams == null || m_SpotLightParams.Length != count) 132 | m_SpotLightParams = new SpotLightParams[count]; 133 | 134 | HashSet fogLights = LightManagerFogLights.Get(); 135 | 136 | int j = 0; 137 | for (var x = fogLights.GetEnumerator(); x.MoveNext();) 138 | { 139 | var fl = x.Current; 140 | if (fl == null || fl.type != FogLight.Type.Spot || !fl.isOn) 141 | continue; 142 | 143 | Light light = fl.light; 144 | m_SpotLightParams[j].pos = light.transform.position; 145 | m_SpotLightParams[j].spotDir = light.transform.forward; 146 | float range = light.range * fl.m_RangeMult; 147 | m_SpotLightParams[j].range = 1.0f / (range * range); 148 | m_SpotLightParams[j].color = new Vector3(light.color.r, light.color.g, light.color.b) * light.intensity * fl.m_IntensityMult; 149 | float innerCos = Mathf.Cos(Mathf.Deg2Rad * 0.5f * light.innerSpotAngle); 150 | float outerCos = Mathf.Cos(Mathf.Deg2Rad * 0.5f * light.spotAngle); 151 | float angleRangeInv = 1f / Mathf.Max(innerCos - outerCos, 0.001f); 152 | m_SpotLightParams[j].angle = new Vector2(angleRangeInv, -outerCos * angleRangeInv); 153 | j++; 154 | } 155 | 156 | // TODO: try a constant buffer with setfloats instead for perf 157 | //m_SpotLightParamsCB.SetData(m_SpotLightParams); 158 | cmd.SetComputeBufferData(m_SpotLightParamsCB, m_SpotLightParams); 159 | cmd.SetComputeBufferParam(m_InjectLightingAndDensity, kernel, "_SpotLights", m_SpotLightParamsCB); 160 | } 161 | 162 | void CreateBuffer(ref ComputeBuffer buffer, int count, int stride) 163 | { 164 | if (buffer != null && buffer.count == count) 165 | return; 166 | 167 | if (buffer != null) 168 | { 169 | buffer.Release(); 170 | buffer = null; 171 | } 172 | 173 | if (count <= 0) 174 | return; 175 | 176 | buffer = new ComputeBuffer(count, stride); 177 | } 178 | void ReleaseComputeBuffer(ref ComputeBuffer buffer) 179 | { 180 | if (buffer != null) 181 | buffer.Release(); 182 | buffer = null; 183 | } 184 | #endregion 185 | 186 | #region Init Function 187 | public VolumetricFogPass() 188 | { 189 | if (Combine == null) 190 | Combine = CoreUtils.CreateEngineMaterial(Shader.Find(CombineShaderName)); 191 | //m_Noise = Resources.Load("noise"); 192 | m_InjectLightingAndDensity = Resources.Load("InjectLightingAndDensity"); 193 | m_Scatter = Resources.Load("Scatter"); 194 | m_TemporaryColorTexture.Init("_TempColor"); 195 | } 196 | 197 | public bool Setup(ScriptableRenderer render) 198 | { 199 | //this.fogSettings = settings; 200 | this.m_renderer = render; 201 | return true; 202 | } 203 | 204 | #endregion 205 | 206 | #region Cleanup Function 207 | 208 | void Cleanup(CommandBuffer cmd) 209 | { 210 | cmd.ReleaseTemporaryRT(s_VolumeInject); 211 | cmd.ReleaseTemporaryRT(s_VolumeScatter); 212 | } 213 | 214 | public void ReleaseComputeBuffer() 215 | { 216 | ReleaseComputeBuffer(ref m_PointLightParamsCB); 217 | ReleaseComputeBuffer(ref m_SpotLightParamsCB); 218 | ReleaseComputeBuffer(ref m_DummyCB); 219 | } 220 | 221 | #endregion 222 | 223 | public override void Execute(ScriptableRenderContext context, ref RenderingData data) 224 | { 225 | var camera = data.cameraData.camera; 226 | var stack = VolumeManager.instance.stack; 227 | volumetric = stack.GetComponent(); 228 | 229 | 230 | if (camera != null && camera.cameraType != CameraType.Preview && volumetric != null && volumetric.IsActive()) 231 | { 232 | if (!CheckSupport()) 233 | { 234 | Debug.LogError(GetUnsupportedErrorMessage()); 235 | return; 236 | } 237 | 238 | var cmd = CommandBufferPool.Get(PassName); 239 | 240 | //Caculate volume texture 241 | Scatter(cmd, camera); 242 | //Draw to Screen 243 | RenderTextureDescriptor opaqueDesc = data.cameraData.cameraTargetDescriptor; 244 | 245 | 246 | //Combine.SetTexture("_MainTex"); 247 | CombinewithSecondHeightFog(cmd, data, camera, opaqueDesc); 248 | 249 | context.ExecuteCommandBuffer(cmd); 250 | CommandBufferPool.Release(cmd); 251 | } 252 | 253 | } 254 | 255 | #region Camera Function 256 | public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData) 257 | { 258 | var stack = VolumeManager.instance.stack; 259 | volumetric = stack.GetComponent(); 260 | ZSlice = VolumetricQuality(volumetric.fogQuality.value); 261 | InitVolume(s_VolumeInject, cmd); 262 | InitVolume(s_VolumeScatter, cmd); 263 | cmd.GetTemporaryRT(m_TemporaryColorTexture.id, renderingData.cameraData.cameraTargetDescriptor); 264 | } 265 | 266 | public override void OnCameraCleanup(CommandBuffer cmd) 267 | { 268 | Cleanup(cmd); 269 | cmd.ReleaseTemporaryRT(m_TemporaryColorTexture.id); 270 | } 271 | 272 | public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) 273 | { 274 | this.source = m_renderer.cameraColorTarget; 275 | } 276 | 277 | #endregion 278 | 279 | #region Check Compute Shader Support 280 | public static bool CheckSupport() 281 | { 282 | return SystemInfo.supportsComputeShaders; 283 | } 284 | 285 | public static string GetUnsupportedErrorMessage() 286 | { 287 | return "Volumetric Fog requires compute shaders and this platform doesn't support them. Disabling. \nDetected device type: " + 288 | SystemInfo.graphicsDeviceType + ", version: " + SystemInfo.graphicsDeviceVersion; 289 | } 290 | #endregion 291 | 292 | #region Do Volume Render 293 | void InitVolume(int volume,CommandBuffer cmd) 294 | { 295 | RenderTextureDescriptor volumeDescriptor = new RenderTextureDescriptor(); 296 | volumeDescriptor.width = m_VolumeResolution.x; 297 | volumeDescriptor.height = m_VolumeResolution.y; 298 | volumeDescriptor.volumeDepth = ZSlice; 299 | volumeDescriptor.dimension = UnityEngine.Rendering.TextureDimension.Tex3D; 300 | volumeDescriptor.enableRandomWrite = true; 301 | volumeDescriptor.colorFormat = RenderTextureFormat.ARGBHalf; 302 | volumeDescriptor.msaaSamples = 1; 303 | 304 | cmd.GetTemporaryRT(volume, volumeDescriptor, FilterMode.Bilinear); 305 | } 306 | 307 | void SetFrustumRays(Camera cam) 308 | { 309 | float far = volumetric.Distance.value; 310 | Vector3 cameraPos = cam.transform.position; 311 | Vector2[] uvs = frustumUVs; 312 | 313 | for (int i = 0; i < 4; i++) 314 | { 315 | Vector3 ray = cam.ViewportToWorldPoint(new Vector3(uvs[i].x, uvs[i].y, far)) - cameraPos; 316 | frustumRays[i * 4 + 0] = ray.x; 317 | frustumRays[i * 4 + 1] = ray.y; 318 | frustumRays[i * 4 + 2] = ray.z; 319 | frustumRays[i * 4 + 3] = 0; 320 | } 321 | 322 | m_InjectLightingAndDensity.SetVector("_CameraPos", cameraPos); 323 | m_InjectLightingAndDensity.SetFloats("_FrustumRays", frustumRays); 324 | } 325 | 326 | void SetUpForScatter(int kernel,Camera cam,CommandBuffer cmd) 327 | { 328 | //fogSettings.m_GlobalDensityMult = Mathf.Max(fogSettings.m_GlobalDensityMult, 0); 329 | //fogSettings.m_ConstantFog = Mathf.Max(fogSettings.m_ConstantFog, 0); 330 | //fogSettings.m_HeightFogAmount = Mathf.Max(fogSettings.m_HeightFogAmount, 0); 331 | 332 | SetFrustumRays(cam); 333 | 334 | //Create Compute Buffer 335 | int pointLightCount = 0, spotLightCount = 0; 336 | HashSet fogLights = LightManagerFogLights.Get(); 337 | for (var x = fogLights.GetEnumerator(); x.MoveNext();) 338 | { 339 | var fl = x.Current; 340 | if (fl == null) 341 | continue; 342 | 343 | bool isOn = fl.isOn; 344 | 345 | switch (fl.type) 346 | { 347 | case FogLight.Type.Point: if (isOn) pointLightCount++; break; 348 | case FogLight.Type.Spot: if (isOn) spotLightCount++; break; 349 | } 350 | } 351 | CreateBuffer(ref m_PointLightParamsCB, pointLightCount, Marshal.SizeOf(typeof(PointLightParams))); 352 | CreateBuffer(ref m_SpotLightParamsCB, spotLightCount, Marshal.SizeOf(typeof(SpotLightParams))); 353 | CreateBuffer(ref m_DummyCB, 1, 4); 354 | //Set light 355 | SetUpPointLightBuffers(kernel,cmd); 356 | SetUpSpotLightBuffers(kernel,cmd); 357 | 358 | // Compensate for more light and density being injected in per world space meter when near and far are closer. 359 | // TODO: Not quite correct yet. 360 | float depthCompensation = (volumetric.Distance.value - 0.3f/*fixed NearClip*/) * 0.01f; 361 | m_InjectLightingAndDensity.SetFloat("_Density", volumetric.GlobalDensity.value * 0.128f * depthCompensation); 362 | m_InjectLightingAndDensity.SetFloat("_Intensity", 1.0f); 363 | m_InjectLightingAndDensity.SetFloat("_Anisotropy", volumetric.Anisotropy.value); 364 | cmd.SetComputeTextureParam(m_InjectLightingAndDensity, kernel, "_VolumeInject", VolumeInjectID); 365 | //m_InjectLightingAndDensity.SetTexture(kernel, "_Noise", m_Noise); 366 | if (m_fogParams == null || m_fogParams.Length != 4) 367 | m_fogParams = new float[4]; 368 | m_fogParams[0] = volumetric.ConstantFogDensity.value; 369 | m_fogParams[1] = volumetric.HeightFogExponent.value; 370 | m_fogParams[2] = volumetric.HeightFogOffset.value; 371 | m_fogParams[3] = volumetric.HeightFogDensity.value; 372 | 373 | //m_InjectLightingAndDensity.SetFloat("_Time", Time.time); 374 | m_InjectLightingAndDensity.SetFloats("_FogParams", m_fogParams); 375 | m_InjectLightingAndDensity.SetFloat("_NearOverFarClip", cam.nearClipPlane / cam.farClipPlane); 376 | m_InjectLightingAndDensity.SetVector("_AmbientLight", volumetric.AmbientColor.value); 377 | m_InjectLightingAndDensity.SetFloat("_SunFogDensity", volumetric.SunDensity.value); 378 | m_InjectLightingAndDensity.SetFloat("_MieG", volumetric.MieG.value); 379 | m_InjectLightingAndDensity.SetFloat("_ZSlice", (float)ZSlice); 380 | } 381 | 382 | void Scatter(CommandBuffer cmd, Camera cam) 383 | { 384 | int kernel = 0; 385 | 386 | SetUpForScatter(0, cam, cmd); 387 | //Inject 388 | cmd.DispatchCompute(m_InjectLightingAndDensity, kernel, m_VolumeResolution.x / m_InjectNumThreads.x, m_VolumeResolution.y / m_InjectNumThreads.y, ZSlice / m_InjectNumThreads.z); 389 | 390 | //Scatter 391 | cmd.SetComputeTextureParam(m_Scatter, 0, "_VolumeInject", VolumeInjectID); 392 | cmd.SetComputeTextureParam(m_Scatter, 0, "_VolumeScatter", VolumeScatterID); 393 | cmd.SetComputeFloatParam(m_Scatter, "_ZSlice", (float)ZSlice); 394 | cmd.DispatchCompute(m_Scatter,0, m_VolumeResolution.x / m_ScatterNumThreads.x, m_VolumeResolution.y / m_ScatterNumThreads.y, 1); 395 | } 396 | 397 | void CombinewithSecondHeightFog(CommandBuffer cmd, RenderingData data,Camera camera, RenderTextureDescriptor descriptor) 398 | { 399 | //Set params 400 | cmd.SetGlobalTexture("_VolumeScatter", VolumeScatterID); 401 | cmd.SetGlobalTexture("_VolumeSourceTex", m_TemporaryColorTexture.Identifier()); 402 | Combine.SetVector("_Screen_TexelSize", new Vector4(1.0f / descriptor.width, 1.0f / descriptor.height, descriptor.width, descriptor.height)); 403 | Combine.SetVector("_VolumeScatter_TexelSize", new Vector4(1.0f / m_VolumeResolution.x, 1.0f / m_VolumeResolution.y, 1.0f / ZSlice, 0)); 404 | Combine.SetFloat("_CameraFarOverMaxFar", camera.farClipPlane / volumetric.Distance.value); 405 | Combine.SetFloat("_NearOverFarClip", 0.3f/*fixed NearClip*/ / volumetric.Distance.value); 406 | 407 | //SecondFog param 408 | Combine.SetColor("_InscatteringColor", volumetric.AmbientColor.value); 409 | Combine.SetFloat("_MaxOpacity", 1.0f); 410 | Combine.SetFloat("_Density", volumetric.SecondHeightFogDensity.value); 411 | Combine.SetFloat("_Height", volumetric.HeightFogOffset.value); 412 | Combine.SetFloat("_StartDistance", volumetric.Distance.value); 413 | Combine.SetFloat("_HeightFalloff", volumetric.HeightFogExponent.value); 414 | //Blit 415 | cmd.Blit(data.cameraData.renderer.cameraColorTarget, m_TemporaryColorTexture.Identifier()); 416 | cmd.Blit(m_TemporaryColorTexture.Identifier(), source, Combine, 0); 417 | } 418 | 419 | int VolumetricQuality(Volumetric.FogQuality fogQuality) 420 | { 421 | switch(fogQuality) 422 | { 423 | case Volumetric.FogQuality.High: return 256; 424 | case Volumetric.FogQuality.Medium: return 128; 425 | case Volumetric.FogQuality.Low: return 64; 426 | default: return 128; 427 | } 428 | } 429 | #endregion 430 | 431 | } 432 | 433 | public class VolumetricFeature : ScriptableRendererFeature 434 | { 435 | VolumetricFogPass pass; 436 | public RenderPassEvent renderPassEvent = RenderPassEvent.AfterRenderingTransparents; 437 | 438 | //[Header("Clip Size")] 439 | //public float nearClip = 0.3f; 440 | //public float farClip = 20f; 441 | 442 | //[Header("Fog Settings")] 443 | //public float GlobalIntensityMult = 1.0f; 444 | //public float GlobalDensityMult = 1.0f; 445 | //public float ConstantFog = 1; 446 | //public float HeightFogAmount = 1; 447 | //public float HeightFogExponent = 0.125f; 448 | //public float HeightFogOffset = 0; 449 | //[Range(0,1)] 450 | //public float Anisotropy = 0.5f; 451 | //public Color AmbientColor = Color.gray; 452 | 453 | //VolumetricFogPass.FogSettings fogSettings = new VolumetricFogPass.FogSettings(); 454 | public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData data) 455 | { 456 | if(pass!=null) 457 | { 458 | //fogSettings.m_GlobalIntensityMult = GlobalIntensityMult; 459 | //fogSettings.m_GlobalDensityMult = GlobalDensityMult; 460 | //fogSettings.m_ConstantFog = ConstantFog; 461 | //fogSettings.m_HeightFogAmount = HeightFogAmount; 462 | //fogSettings.m_HeightFogExponent = HeightFogExponent; 463 | //fogSettings.m_HeightFogOffset = HeightFogOffset; 464 | //fogSettings.m_Anisotropy = Anisotropy; 465 | //fogSettings.NearClip = nearClip; 466 | //fogSettings.FarClip = farClip; 467 | //fogSettings.AmbientColor = AmbientColor; 468 | 469 | pass.Setup(renderer); 470 | pass.ConfigureInput(ScriptableRenderPassInput.Color); 471 | renderer.EnqueuePass(pass); 472 | } 473 | 474 | } 475 | 476 | public override void Create() 477 | { 478 | if(pass==null) 479 | { 480 | pass = new VolumetricFogPass(); 481 | } 482 | pass.renderPassEvent = renderPassEvent; 483 | 484 | } 485 | 486 | 487 | 488 | private void OnDisable() 489 | { 490 | pass.ReleaseComputeBuffer(); 491 | } 492 | 493 | protected override void Dispose(bool disposing) 494 | { 495 | pass.ReleaseComputeBuffer(); 496 | } 497 | } 498 | } 499 | -------------------------------------------------------------------------------- /Runtime/VolumetricFeature.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a76e888dd98f0d14f8786c9748ee6f6f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.bladesero.volumetric", 3 | "displayName": "URP volumetric render feature", 4 | "version": "0.1.5", 5 | "unity": "2021.3", 6 | "description": "A render feature to recover Unity 5.x's offical volumetric fog in Adam demo", 7 | "keywords": [ 8 | "Volumetric","Rendering" 9 | ], 10 | "dependencies": { 11 | "com.unity.render-pipelines.universal": "12.1.2" 12 | } 13 | } --------------------------------------------------------------------------------