diff --git a/Assets/AmplifyShaderEditor/Examples/HD SRP Samples.unitypackage.meta b/Assets/AmplifyShaderEditor/Examples/HD SRP Samples.unitypackage.meta new file mode 100644 index 0000000..872a1e1 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Examples/HD SRP Samples.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d1c0b77896049554fa4b635531caf741 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Examples/LW SRP Samples.unitypackage.meta b/Assets/AmplifyShaderEditor/Examples/LW SRP Samples.unitypackage.meta new file mode 100644 index 0000000..74eb369 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Examples/LW SRP Samples.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6ecbfd0a046659943a69328c98ff0442 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FogVolume.meta b/Assets/AmplifyShaderEditor/Examples/Official.meta similarity index 77% rename from Assets/FogVolume.meta rename to Assets/AmplifyShaderEditor/Examples/Official.meta index b35bb35..15d9465 100644 --- a/Assets/FogVolume.meta +++ b/Assets/AmplifyShaderEditor/Examples/Official.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ae8d1e885fa13b84c99761b09423ebf2 +guid: d32786c99caa66e41baea4ab6d1c1cb8 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/FogVolume/Resources.meta b/Assets/AmplifyShaderEditor/Examples/Official/CustomRTRain.meta similarity index 77% rename from Assets/FogVolume/Resources.meta rename to Assets/AmplifyShaderEditor/Examples/Official/CustomRTRain.meta index 35a7687..2d0c900 100644 --- a/Assets/FogVolume/Resources.meta +++ b/Assets/AmplifyShaderEditor/Examples/Official/CustomRTRain.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7eb63699416f37e4ea9ffd26cc221269 +guid: 917f314cd7500ab41a37e0c60edaf755 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/AmplifyShaderEditor/Examples/Official/CustomRTRain/Custom RT Samples.unitypackage.meta b/Assets/AmplifyShaderEditor/Examples/Official/CustomRTRain/Custom RT Samples.unitypackage.meta new file mode 100644 index 0000000..5b4b6c6 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Examples/Official/CustomRTRain/Custom RT Samples.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 88dfe89a073bdf748bf05396f5285cdd +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FogVolume/Scenes.meta b/Assets/AmplifyShaderEditor/Examples/Official/SimpleTerrain.meta similarity index 77% rename from Assets/FogVolume/Scenes.meta rename to Assets/AmplifyShaderEditor/Examples/Official/SimpleTerrain.meta index 47705d6..d50bf8c 100644 --- a/Assets/FogVolume/Scenes.meta +++ b/Assets/AmplifyShaderEditor/Examples/Official/SimpleTerrain.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 56c6be63002988c479f9434dcae1119b +guid: e14f9199031928442a76fcb851644355 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/AmplifyShaderEditor/Examples/Official/SimpleTerrain/ApplyGrassWindToTerrain.unitypackage.meta b/Assets/AmplifyShaderEditor/Examples/Official/SimpleTerrain/ApplyGrassWindToTerrain.unitypackage.meta new file mode 100644 index 0000000..f13afd9 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Examples/Official/SimpleTerrain/ApplyGrassWindToTerrain.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 11f44bcb01ea56742bb7177b439b1a4f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FogVolume/Scenes/RT Viewer.meta b/Assets/AmplifyShaderEditor/Examples/Official/Substance.meta similarity index 77% rename from Assets/FogVolume/Scenes/RT Viewer.meta rename to Assets/AmplifyShaderEditor/Examples/Official/Substance.meta index 00d52ed..68bce78 100644 --- a/Assets/FogVolume/Scenes/RT Viewer.meta +++ b/Assets/AmplifyShaderEditor/Examples/Official/Substance.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7050d2934f0457d4a9a06cf1a1a43858 +guid: 3a1c9292d8fac714e9091922355abcd7 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/AmplifyShaderEditor/Examples/Official/Substance/LegacySubstanceExample.unitypackage.meta b/Assets/AmplifyShaderEditor/Examples/Official/Substance/LegacySubstanceExample.unitypackage.meta new file mode 100644 index 0000000..5417a54 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Examples/Official/Substance/LegacySubstanceExample.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 490e8164148c52c468b633dcc1c12d57 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Examples/Official/Substance2018.meta b/Assets/AmplifyShaderEditor/Examples/Official/Substance2018.meta new file mode 100644 index 0000000..2a2c78c --- /dev/null +++ b/Assets/AmplifyShaderEditor/Examples/Official/Substance2018.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 50c3f69bf74856340867f04dd9288b24 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Examples/Official/Substance2018/Substance2018.unitypackage.meta b/Assets/AmplifyShaderEditor/Examples/Official/Substance2018/Substance2018.unitypackage.meta new file mode 100644 index 0000000..bed3c3e --- /dev/null +++ b/Assets/AmplifyShaderEditor/Examples/Official/Substance2018/Substance2018.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: af7de8b91a27c254fa1bd24c01ae6e8e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates.meta b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates.meta new file mode 100644 index 0000000..9cf984b --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 211faf49d0bea6c4081e4e1135d19686 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/CustomRTTemplates.unitypackage.meta b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/CustomRTTemplates.unitypackage.meta new file mode 100644 index 0000000..1e0464d --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/CustomRTTemplates.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 191365b4aece81443875ae2bb7243b55 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP.meta b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP.meta new file mode 100644 index 0000000..7e6002c --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cc9e432e1a0a4764f80870c080173cb7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/HDSRPTemplates (Legacy).unitypackage.meta b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/HDSRPTemplates (Legacy).unitypackage.meta new file mode 100644 index 0000000..2d96284 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/HDSRPTemplates (Legacy).unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4dc1afbcc68875c4780502f5e6b80158 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/HDSRPTemplates.unitypackage.meta b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/HDSRPTemplates.unitypackage.meta new file mode 100644 index 0000000..e51ee6d --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/HDSRPTemplates.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9a5e61a8b3421b944863d0946e32da0a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/LWSRPTemplates (Legacy).unitypackage.meta b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/LWSRPTemplates (Legacy).unitypackage.meta new file mode 100644 index 0000000..8a216b9 --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/LWSRPTemplates (Legacy).unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b53d2f3b156ff104f90d4d7693d769c8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/LWSRPTemplates.unitypackage.meta b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/LWSRPTemplates.unitypackage.meta new file mode 100644 index 0000000..0f3221b --- /dev/null +++ b/Assets/AmplifyShaderEditor/Plugins/EditorResources/Templates/SRP/LWSRPTemplates.unitypackage.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4c816894a3147d343891060451241bfe +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FogVolume/Resources/3DNoise.asset b/Assets/FogVolume/Resources/3DNoise.asset deleted file mode 100644 index 03164ef..0000000 --- a/Assets/FogVolume/Resources/3DNoise.asset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2dab8520d2b1e8fb214ed1a56e2b21107a59648e0e8eedfdd3bbd47db89cf6b9 -size 16777760 diff --git a/Assets/FogVolume/Resources/3DNoise.asset.meta b/Assets/FogVolume/Resources/3DNoise.asset.meta deleted file mode 100644 index e40f1a3..0000000 --- a/Assets/FogVolume/Resources/3DNoise.asset.meta +++ /dev/null @@ -1,6 +0,0 @@ -fileFormatVersion: 2 -guid: ce515a5a715cb574eb40037cfb1ab766 -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Resources/FogVolume.shader b/Assets/FogVolume/Resources/FogVolume.shader deleted file mode 100644 index bdf40e8..0000000 --- a/Assets/FogVolume/Resources/FogVolume.shader +++ /dev/null @@ -1,142 +0,0 @@ -Shader "Hidden/FogVolume" -{ - Properties - { - [hideininspector]_SrcBlend("__src", Float) = 1.0 - [hideininspector]_NoiseVolume("_NoiseVolume", 3D)= "white" {} - [hideininspector]_NoiseVolume2("_NoiseVolume2", 3D) = "white" {} - [hideininspector]_Gradient("_Gradient", 2D) = "white" {} - [hideininspector]CoverageTex("CoverageTex", 2D) = "grey" {} - //[hideininspector]_ShadowTexture("_ShadowTexture", 2D) = "white" {} - } - CGINCLUDE - //#define COVERAGE - //#define EARTH_CLOUD_STYLE - //#define VOLUMETRIC_SHADOWS _VolumetricShadowsEnabled - //#define CONVOLVE_VOLUMETRIC_SHADOWS - //custom depth input - //#define ExternalDepth - #define AMBIENT_AFFECTS_FOG_COLOR _AmbientAffectsFogColor - //#define DEBUG_PRIMITIVES - #define VOLUMETRIC_SHADOWS _VolumetricShadowsEnabled - #define FOG_TINTS_INSCATTER VolumeFogInscatterColorAffectedWithFogColor - #include "UnityCG.cginc" - #include "CommonInputs.cginc" - #include "Integrations.cginc" - #define PROBES _ProxyVolume - - half NoiseAtten = 1; - int _SrcBlend; - int _ztest; - - #include "FogVolumeCommon.cginc" - #define DEBUG_ITERATIONS 1 - #define DEBUG_INSCATTERING 2 - #define DEBUG_VOLUMETRIC_SHADOWS 3 - #define DEBUG_VOLUME_FOG_INSCATTER_CLAMP 4 - #define DEBUG_VOLUME_FOG_PHASE 5 - #include "FogVolumeFragment.cginc" - - - ENDCG - - //normal pass - SubShader - { - - Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "None" } - LOD 600 - //Blend SrcAlpha OneMinusSrcAlpha - //Blend One OneMinusSrcAlpha - Blend[_SrcBlend] OneMinusSrcAlpha - - Fog{ Mode Off } - Cull Front - Lighting Off - ZWrite Off - ZTest [_ztest] - - Pass - { - - - CGPROGRAM - //#pragma multi_compile _ ExternalDepth - #pragma multi_compile _ _FOG_LOWRES_RENDERER - #pragma shader_feature _INSCATTERING - #pragma shader_feature VOLUME_FOG - #pragma shader_feature _VOLUME_FOG_INSCATTERING - #pragma shader_feature _FOG_GRADIENT - #pragma shader_feature _FOG_VOLUME_NOISE - // #pragma shader_feature _COLLISION - //#pragma multi_compile _ DEBUG - //#pragma shader_feature SAMPLING_METHOD_ViewAligned - #pragma shader_feature HEIGHT_GRAD - //#pragma shader_feature _TONEMAP - #pragma shader_feature JITTER - #pragma shader_feature ColorAdjust - #pragma shader_feature ABSORPTION - #pragma multi_compile _ Twirl_X Twirl_Y Twirl_Z - #pragma shader_feature _SHADE - #pragma shader_feature DF - #pragma shader_feature DIRECTIONAL_LIGHTING - #pragma multi_compile _ ATTEN_METHOD_1 ATTEN_METHOD_2 ATTEN_METHOD_3 - #pragma shader_feature SPHERICAL_FADE - //#pragma shader_feature _LAMBERT_SHADING - #pragma multi_compile _ VOLUME_SHADOWS - #pragma shader_feature LIGHT_ATTACHED - #pragma shader_feature HALO - //Unity define for stereo is not working. Had to do it manually - #pragma multi_compile _ FOG_VOLUME_STEREO_ON - #pragma exclude_renderers d3d9 - //#pragma only_renderers d3d11 - #pragma vertex vert - #pragma fragment frag - - #pragma target 3.0 - - ENDCG - } - - } - -//opacity pass . Only for shadow rt - SubShader - { - Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "None" } - LOD 100 - Blend SrcAlpha OneMinusSrcAlpha - - Fog{ Mode Off } - Cull Front - Lighting Off - ZWrite Off - ZTest Always - - Pass - { - Fog{ Mode Off } - - CGPROGRAM - #define SHADOW_PASS - #pragma shader_feature _FOG_GRADIENT - #pragma shader_feature _FOG_VOLUME_NOISE - // #pragma shader_feature _COLLISION - #pragma shader_feature SAMPLING_METHOD_ViewAligned - #pragma shader_feature HEIGHT_GRAD - #pragma multi_compile Twirl_X Twirl_Y Twirl_Z - #pragma shader_feature DF - //#pragma multi_compile SHADOW_PASS - #pragma shader_feature SPHERICAL_FADE - #pragma exclude_renderers d3d9 - //#pragma only_renderers d3d11 - #pragma glsl - #pragma vertex vert - #pragma fragment frag - - #pragma target 3.0 - ENDCG - } - - } -} diff --git a/Assets/FogVolume/Resources/FogVolume.shader.meta b/Assets/FogVolume/Resources/FogVolume.shader.meta deleted file mode 100644 index a9ff0c6..0000000 --- a/Assets/FogVolume/Resources/FogVolume.shader.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6040e6c91df9d9d47b7e5426d41a7471 -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Resources/FogVolumeDirectionalLight.shader b/Assets/FogVolume/Resources/FogVolumeDirectionalLight.shader deleted file mode 100644 index 28dd3e3..0000000 --- a/Assets/FogVolume/Resources/FogVolumeDirectionalLight.shader +++ /dev/null @@ -1,164 +0,0 @@ -// Upgrade NOTE: removed variant '__' where variant LOD_FADE_PERCENTAGE is used. - -Shader "Hidden/FogVolumeDirectionalLight" -{ - Properties - { - _Cutoff("Alpha cutoff", Range(0,1)) = 0.5 - _MainTex("Base (RGB)", 2D) = "white" {} - _Color("Color", Color) = (1,1,1,1) - //_FogVolumeShadowMapEdgeSoftness("Edge size", Range(1, 100))=100 - } - - SubShader - { - Tags{ "RenderType" = "Opaque" } - - Pass - { - CGPROGRAM - #define EDGE_FIX - #pragma vertex vert - #pragma fragment frag - #include "UnityCG.cginc" - - uniform sampler2D _MainTex; - float4 _ShadowCameraPosition; - uniform float _Cutoff = 1, _FogVolumeShadowMapEdgeSoftness; - - struct v2f - { - float4 pos : SV_POSITION; - float depth : DEPTH; - float2 uv : TEXCOORD0; - float4 screenUV : TEXCOORD1; - }; - - v2f vert(appdata_base v) - { - v2f o; - o.pos = UnityObjectToClipPos(v.vertex); - o.depth = length(mul(unity_ObjectToWorld, v.vertex).xyz - _ShadowCameraPosition.xyz); - o.uv = v.texcoord.xy; - o.screenUV = ComputeScreenPos(o.pos); - return o; - } - - float4 frag(v2f i) : COLOR - { - float2 uv = i.screenUV.xy / i.screenUV.w; - float d = i.depth; - #ifdef EDGE_FIX - half edges = saturate(dot(1-uv.r, 1-uv.g) * dot(uv.r, uv.g)*600); - d = lerp(10000, d, edges); - #endif - half fade = saturate(dot(1 - uv.r, 1 - uv.g) * dot(uv.r, uv.g)*_FogVolumeShadowMapEdgeSoftness); - fade *= fade*fade; - return float4(d, fade, 0.0f, 1); - } - ENDCG - } - } - - SubShader - { - Tags{ "RenderType" = "TransparentCutout" } - - Pass - { - CGPROGRAM - #define EDGE_FIX - #pragma vertex vert - #pragma fragment frag - #include "UnityCG.cginc" - - uniform sampler2D _MainTex; - float4 _ShadowCameraPosition; - uniform float _Cutoff = 1, _FogVolumeShadowMapEdgeSoftness; - float4 _Color; - - struct v2f - { - float4 pos : SV_POSITION; - float depth : DEPTH; - float2 uv : TEXCOORD0; - float4 screenUV : TEXCOORD1; - }; - - v2f vert(appdata_base v) - { - v2f o; - o.pos = UnityObjectToClipPos(v.vertex); - o.depth = length(mul(unity_ObjectToWorld, v.vertex).xyz - _ShadowCameraPosition.xyz); - o.uv = v.texcoord.xy; - o.screenUV = ComputeScreenPos(o.pos); - return o; - } - - float4 frag(v2f i) : COLOR - { - half4 c = tex2D(_MainTex, i.uv)*_Color; - float2 uv = i.screenUV.xy / i.screenUV.w; - clip(c.a - _Cutoff); - float d = i.depth; - #ifdef EDGE_FIX - - half edges = saturate(dot(1 - uv.r, 1 - uv.g) * dot(uv.r, uv.g) * 600); - - d = lerp(10000, d, edges); - #endif - - half fade = saturate(dot(1 - uv.r, 1 - uv.g) * dot(uv.r, uv.g)*_FogVolumeShadowMapEdgeSoftness); - fade *= fade*fade; - return float4(d, fade, 0.0f, 1); - } - ENDCG - } - } - - SubShader - { - Tags - { - "Queue" = "Geometry" - "IgnoreProjector" = "True" - "RenderType" = "SpeedTree" - "DisableBatching" = "LODFading" - } - - Cull[_Cull] - Fog{ Mode Off } - - CGPROGRAM - uniform sampler2D _MainTex; - float4 /*_ShadowCameraPosition,*/ _Color; - uniform float _Cutoff = 1, _FogVolumeShadowMapEdgeSoftness; - #pragma surface surf Lambert vertex:SpeedTreeVert nolightmap - #pragma target 3.0 - #pragma multi_compile LOD_FADE_PERCENTAGE LOD_FADE_CROSSFADE - #pragma shader_feature GEOM_TYPE_BRANCH GEOM_TYPE_BRANCH_DETAIL GEOM_TYPE_FROND GEOM_TYPE_LEAF GEOM_TYPE_MESH - #define ENABLE_WIND - #define SPEEDTREE_ALPHATEST - #define EDGE_FIX - #include "SpeedTreeCommonDepth.cginc" - - void surf(Input i, inout SurfaceOutput OUT) - { - float2 uv = i.screenUV.xy / i.screenUV.w; - float d = i.ShadowDepth; - #ifdef EDGE_FIX - half edges = saturate(dot(1 - uv.r, 1 - uv.g) * dot(uv.r, uv.g) * 600); - d = lerp(10000, d, edges); - #endif - half fade = saturate(dot(1 - uv.r, 1 - uv.g) * dot(uv.r, uv.g)*_FogVolumeShadowMapEdgeSoftness); - fade *= fade*fade; - - OUT.Emission = float3(d, fade, 0.0f); - - SpeedTreeFragOut o; - SpeedTreeFrag(i, o); - SPEEDTREE_COPY_FRAG(OUT, o) - } - ENDCG - } -} \ No newline at end of file diff --git a/Assets/FogVolume/Resources/FogVolumeDirectionalLight.shader.meta b/Assets/FogVolume/Resources/FogVolumeDirectionalLight.shader.meta deleted file mode 100644 index 60e16b3..0000000 --- a/Assets/FogVolume/Resources/FogVolumeDirectionalLight.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 4fc2932190d974a4887533f0e52baf6c -timeCreated: 1496863314 -licenseType: Store -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Resources/InspectorIcon.png b/Assets/FogVolume/Resources/InspectorIcon.png deleted file mode 100644 index f74f275..0000000 --- a/Assets/FogVolume/Resources/InspectorIcon.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:370f399cfed63c5021e519eebc8004f4a0eb7defeeccc42b980f935eb5023e0a -size 22653 diff --git a/Assets/FogVolume/Resources/InspectorIcon.png.meta b/Assets/FogVolume/Resources/InspectorIcon.png.meta deleted file mode 100644 index b421b1a..0000000 --- a/Assets/FogVolume/Resources/InspectorIcon.png.meta +++ /dev/null @@ -1,84 +0,0 @@ -fileFormatVersion: 2 -guid: 925eb9f7b0e73dd438a616124964bba8 -timeCreated: 1488739538 -licenseType: Store -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 0 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Android - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Resources/InspectorIconScreenFX.png b/Assets/FogVolume/Resources/InspectorIconScreenFX.png deleted file mode 100644 index 0f6a7e4..0000000 --- a/Assets/FogVolume/Resources/InspectorIconScreenFX.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e9a70fcd7af92becfcd3b8f83178460c104d8af6f7909e61fda245023e481cba -size 50381 diff --git a/Assets/FogVolume/Resources/InspectorIconScreenFX.png.meta b/Assets/FogVolume/Resources/InspectorIconScreenFX.png.meta deleted file mode 100644 index 3fcb72c..0000000 --- a/Assets/FogVolume/Resources/InspectorIconScreenFX.png.meta +++ /dev/null @@ -1,84 +0,0 @@ -fileFormatVersion: 2 -guid: 5aac178e436d68546ae151ed5ba76b94 -timeCreated: 1493126559 -licenseType: Store -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Android - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Resources/PerformanceLUT.psd b/Assets/FogVolume/Resources/PerformanceLUT.psd deleted file mode 100644 index ad866ab..0000000 --- a/Assets/FogVolume/Resources/PerformanceLUT.psd +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d1a1320d75a666ce746677cd81a3d3eada05308d62099b0e1462caa3ef012a7 -size 25508 diff --git a/Assets/FogVolume/Resources/PerformanceLUT.psd.meta b/Assets/FogVolume/Resources/PerformanceLUT.psd.meta deleted file mode 100644 index 96a1432..0000000 --- a/Assets/FogVolume/Resources/PerformanceLUT.psd.meta +++ /dev/null @@ -1,76 +0,0 @@ -fileFormatVersion: 2 -guid: f651c771afb96204b85e925622f5e2b9 -timeCreated: 1483987450 -licenseType: Store -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: 0 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Resources/Primitive.shader b/Assets/FogVolume/Resources/Primitive.shader deleted file mode 100644 index 5d63c1a..0000000 --- a/Assets/FogVolume/Resources/Primitive.shader +++ /dev/null @@ -1,59 +0,0 @@ -// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' - -// Shader created with Shader Forge v1.33 -// Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/ -// Note: Manually altering this data may prevent you from opening it in Shader Forge -/*SF_DATA;ver:1.33;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,lico:1,lgpr:1,limd:0,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:0,bsrc:3,bdst:7,dpts:2,wrdp:False,dith:0,atcv:False,rfrpo:True,rfrpn:Refraction,coma:15,ufog:False,aust:True,igpj:True,qofs:0,qpre:3,rntp:2,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,stcl:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:False,fnsp:False,fnfb:False;n:type:ShaderForge.SFN_Final,id:3138,x:33057,y:32649,varname:node_3138,prsc:2|emission-7241-RGB,alpha-7241-A;n:type:ShaderForge.SFN_Color,id:7241,x:32471,y:32812,ptovrint:False,ptlb:Color,ptin:_Color,varname:_Color,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.07843138,c2:0.3921569,c3:0.7843137,c4:1;proporder:7241;pass:END;sub:END;*/ - -Shader "Fog Volume/Primitive" { - Properties { - _Color ("Color", Color) = (0.07843138,0.3921569,0.7843137,1) - [HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 - } - SubShader { - Tags { - "IgnoreProjector"="True" - "Queue"="Transparent" - "RenderType"="Transparent" - } - Pass { - Name "FORWARD" - Tags { - "LightMode"="ForwardBase" - } - Blend SrcAlpha OneMinusSrcAlpha - ZWrite Off - Cull off - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - //#define UNITY_PASS_FORWARDBASE - #include "UnityCG.cginc" - #pragma multi_compile_fwdbase - #pragma only_renderers d3d9 d3d11 glcore gles gles3 metal - #pragma target 3.0 - uniform float4 _Color; - struct VertexInput { - float4 vertex : POSITION; - }; - struct VertexOutput { - float4 pos : SV_POSITION; - }; - VertexOutput vert (VertexInput v) { - VertexOutput o = (VertexOutput)0; - o.pos = UnityObjectToClipPos(v.vertex ); - return o; - } - float4 frag(VertexOutput i) : COLOR { -////// Lighting: -////// Emissive: - float3 emissive = _Color.rgb; - float3 finalColor = emissive; - return fixed4(finalColor,_Color.a); - } - ENDCG - } - } - FallBack "Diffuse" - // CustomEditor "ShaderForgeMaterialInspector" -} diff --git a/Assets/FogVolume/Resources/Primitive.shader.meta b/Assets/FogVolume/Resources/Primitive.shader.meta deleted file mode 100644 index f0f698c..0000000 --- a/Assets/FogVolume/Resources/Primitive.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 972bc62358fe0b74390929ddcc7f76cc -timeCreated: 1487241739 -licenseType: Store -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Resources/PrimitiveMaterial.mat b/Assets/FogVolume/Resources/PrimitiveMaterial.mat deleted file mode 100644 index b7f0865..0000000 --- a/Assets/FogVolume/Resources/PrimitiveMaterial.mat +++ /dev/null @@ -1,136 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: PrimitiveMaterial - m_Shader: {fileID: 4800000, guid: 972bc62358fe0b74390929ddcc7f76cc, type: 3} - m_ShaderKeywords: _EMISSION - m_LightmapFlags: 1 - m_CustomRenderQueue: -1 - stringTagMap: {} - m_SavedProperties: - serializedVersion: 2 - m_TexEnvs: - - first: - name: _BumpMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _DetailAlbedoMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _DetailMask - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _DetailNormalMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _EmissionMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _MainTex - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _MetallicGlossMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _OcclusionMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - first: - name: _ParallaxMap - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - first: - name: _BumpScale - second: 1 - - first: - name: _Cutoff - second: 0.5 - - first: - name: _DetailNormalMapScale - second: 1 - - first: - name: _DstBlend - second: 0 - - first: - name: _GlossMapScale - second: 1 - - first: - name: _Glossiness - second: 0.5 - - first: - name: _GlossyReflections - second: 1 - - first: - name: _Metallic - second: 0 - - first: - name: _Mode - second: 0 - - first: - name: _OcclusionStrength - second: 1 - - first: - name: _Parallax - second: 0.02 - - first: - name: _Shininess - second: 0.1 - - first: - name: _SmoothnessTextureChannel - second: 0 - - first: - name: _SpecularHighlights - second: 1 - - first: - name: _SrcBlend - second: 1 - - first: - name: _UVSec - second: 0 - - first: - name: _ZWrite - second: 1 - m_Colors: - - first: - name: _Color - second: {r: 1, g: 0, b: 0, a: 0.134} - - first: - name: _Emission - second: {r: 0, g: 0, b: 0, a: 0} - - first: - name: _EmissionColor - second: {r: 0, g: 0, b: 0, a: 1} - - first: - name: _SpecColor - second: {r: 1, g: 1, b: 1, a: 0} diff --git a/Assets/FogVolume/Resources/PrimitiveMaterial.mat.meta b/Assets/FogVolume/Resources/PrimitiveMaterial.mat.meta deleted file mode 100644 index f290881..0000000 --- a/Assets/FogVolume/Resources/PrimitiveMaterial.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0429485e63d913a438bd171228fce857 -timeCreated: 1486134877 -licenseType: Store -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scenes/RT Viewer/RT_ShadowDepth.mat b/Assets/FogVolume/Scenes/RT Viewer/RT_ShadowDepth.mat deleted file mode 100644 index 1dd4d6f..0000000 --- a/Assets/FogVolume/Scenes/RT Viewer/RT_ShadowDepth.mat +++ /dev/null @@ -1,28 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: RT_ShadowDepth - m_Shader: {fileID: 4800000, guid: 0e538740b46ab4446a93508d7ed08389, type: 3} - m_ShaderKeywords: - m_LightmapFlags: 5 - m_CustomRenderQueue: -1 - stringTagMap: {} - m_SavedProperties: - serializedVersion: 2 - m_TexEnvs: - - first: - name: _MainTex - second: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - first: - name: _Divide - second: 7303 - m_Colors: [] diff --git a/Assets/FogVolume/Scenes/RT Viewer/RT_ShadowDepth.mat.meta b/Assets/FogVolume/Scenes/RT Viewer/RT_ShadowDepth.mat.meta deleted file mode 100644 index 951b656..0000000 --- a/Assets/FogVolume/Scenes/RT Viewer/RT_ShadowDepth.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 92dc32887d2555f469466609a34e858c -timeCreated: 1499305061 -licenseType: Store -NativeFormatImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scenes/RT Viewer/RT_ShadowDepth.shader b/Assets/FogVolume/Scenes/RT Viewer/RT_ShadowDepth.shader deleted file mode 100644 index e28153e..0000000 --- a/Assets/FogVolume/Scenes/RT Viewer/RT_ShadowDepth.shader +++ /dev/null @@ -1,58 +0,0 @@ -Shader "Fog Volume/RT viewers/_ShadowTexture" -{ - Properties{ - _MainTex("Base", 2D) = "" {} - _Divide("Divide", Range(1, 30000))=1000 - } - SubShader - { - Tags { "RenderType"="Opaque" } - LOD 100 - - Pass - { - CGPROGRAM - - #pragma vertex vert - #pragma fragment frag - - #include "UnityCG.cginc" - - struct appdata - { - float4 vertex : POSITION; - float2 uv : TEXCOORD0; - }; - - struct v2f - { - float2 uv : TEXCOORD0; - - float4 vertex : SV_POSITION; - }; - - sampler2D _ShadowTexture; - float4 _ShadowTexture_ST; - fixed _Divide; - - v2f vert (appdata v) - { - v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); - o.uv = TRANSFORM_TEX(v.uv, _ShadowTexture); - - return o; - } - - fixed4 frag (v2f i) : SV_Target - { - // sample the texture - //fixed4 col = tex2D(_ShadowTexture, i.uv).r/ _Divide; - fixed4 col = tex2D(_ShadowTexture, i.uv); - col.r = col.r / _Divide; - return col.r*col.g; - } - ENDCG - } - } -} diff --git a/Assets/FogVolume/Scenes/RT Viewer/RT_ShadowDepth.shader.meta b/Assets/FogVolume/Scenes/RT Viewer/RT_ShadowDepth.shader.meta deleted file mode 100644 index 84178eb..0000000 --- a/Assets/FogVolume/Scenes/RT Viewer/RT_ShadowDepth.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 0e538740b46ab4446a93508d7ed08389 -timeCreated: 1488040482 -licenseType: Store -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts.meta b/Assets/FogVolume/Scripts.meta deleted file mode 100644 index d744d79..0000000 --- a/Assets/FogVolume/Scripts.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 192c30bff2bac964f84e2a8f0d25f37b -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/EFogVolumeLightType.cs b/Assets/FogVolume/Scripts/EFogVolumeLightType.cs deleted file mode 100644 index d0f9092..0000000 --- a/Assets/FogVolume/Scripts/EFogVolumeLightType.cs +++ /dev/null @@ -1,8 +0,0 @@ -public enum EFogVolumeLightType -{ - None = 0, - FogVolumePointLight, - FogVolumeSpotLight, - PointLight, - SpotLight -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/EFogVolumeLightType.cs.meta b/Assets/FogVolume/Scripts/EFogVolumeLightType.cs.meta deleted file mode 100644 index fbee330..0000000 --- a/Assets/FogVolume/Scripts/EFogVolumeLightType.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e821da77bc9507e4f902de699d582090 -timeCreated: 1501009162 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/EFogVolumePrimitiveType.cs b/Assets/FogVolume/Scripts/EFogVolumePrimitiveType.cs deleted file mode 100644 index 92f6123..0000000 --- a/Assets/FogVolume/Scripts/EFogVolumePrimitiveType.cs +++ /dev/null @@ -1,8 +0,0 @@ -public enum EFogVolumePrimitiveType -{ - Box = 0, - - Sphere = 1, - - None = 2 -} diff --git a/Assets/FogVolume/Scripts/EFogVolumePrimitiveType.cs.meta b/Assets/FogVolume/Scripts/EFogVolumePrimitiveType.cs.meta deleted file mode 100644 index daecc77..0000000 --- a/Assets/FogVolume/Scripts/EFogVolumePrimitiveType.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: b565090fc25f4f07b7ef4625c6ac06a1 -timeCreated: 1512376752 \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/Editor.meta b/Assets/FogVolume/Scripts/Editor.meta deleted file mode 100644 index c3560ce..0000000 --- a/Assets/FogVolume/Scripts/Editor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4c906e898cb099849b16d9ac741d047a -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumeDataEditor.cs b/Assets/FogVolume/Scripts/Editor/FogVolumeDataEditor.cs deleted file mode 100644 index d532f09..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumeDataEditor.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditorInternal; -using UnityEditor; - -[CustomEditor(typeof(FogVolumeData))] -public class FogVolumeDataEditor : Editor -{ - - FogVolumeData _target; - void OnEnable() - { - _target = (FogVolumeData)target; - } - private static bool SHOW_DEBUG_DATA - { - get { return EditorPrefs.GetBool("SHOW_DEBUG_DATATab", false); } - set { EditorPrefs.SetBool("SHOW_DEBUG_DATATab", value); } - } - public override void OnInspectorGUI() - { - - serializedObject.Update(); - EditorGUI.BeginChangeCheck(); - GUILayout.Space(10); - _target.GameCamera = (Camera)EditorGUILayout.ObjectField("Game Camera", _target.GameCamera, typeof(Camera), true); - _target.ForceNoRenderer = EditorGUILayout.Toggle("Disable Camera script", _target.ForceNoRenderer); - - GUILayout.Space(10); - - if (GUILayout.Button("DEBUG DATA", EditorStyles.toolbarButton)) - SHOW_DEBUG_DATA = !SHOW_DEBUG_DATA; - if (SHOW_DEBUG_DATA) - { - var FoundCameras = serializedObject.FindProperty("FoundCameras"); - GUILayout.BeginVertical("box"); - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(FoundCameras, new GUIContent("Available Cameras:"), true); - EditorGUI.indentLevel--; - GUILayout.EndVertical(); - - var SceneFogVolumes = serializedObject.FindProperty("SceneFogVolumes"); - GUILayout.BeginVertical("box"); - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(SceneFogVolumes, new GUIContent("Available Fog Volumes:"), true); - EditorGUI.indentLevel--; - GUILayout.EndVertical(); - - } - EditorGUI.EndChangeCheck(); - - - if (GUI.changed) - { - Undo.RecordObject(target, "Fog volume Data modified"); - EditorUtility.SetDirty(target); - } - - serializedObject.ApplyModifiedProperties(); - } -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumeDirectionalLightEditor.cs b/Assets/FogVolume/Scripts/Editor/FogVolumeDirectionalLightEditor.cs deleted file mode 100644 index 8fc2fea..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumeDirectionalLightEditor.cs +++ /dev/null @@ -1,162 +0,0 @@ -using UnityEngine; -using UnityEditor; - -[CustomEditor(typeof(FogVolumeDirectionalLight))] -public class FogVolumeDirectionalLightEditor : Editor -{ - - FogVolumeDirectionalLight _target; - void OnEnable() - { - _target = (FogVolumeDirectionalLight)target; - } - - GUIContent VariableField(string VariableName, string Tooltip) - { - return new GUIContent(VariableName, Tooltip); - } - private static bool SHOW_DEBUG_Options - { - get { return EditorPrefs.GetBool("SHOW_FV_DIR_LIGHT_DEBUG_OptionsTab", false); } - set { EditorPrefs.SetBool("SHOW_FV_DIR_LIGHT_DEBUG_OptionsTab", value); } - } - - public override void OnInspectorGUI() - { - - serializedObject.Update(); - EditorGUI.BeginChangeCheck(); - Undo.RecordObject(_target, "Fog volume directional light modified"); - GUILayout.Space(10); - GUILayout.BeginVertical("box"); - if (_target._ProminentFogVolume == null) - GUI.color = Color.red; - // _target._TargetFogVolume = (FogVolume)EditorGUILayout.ObjectField("Target Fog Volume", _target._TargetFogVolume, typeof(FogVolume), true); - - var FogVolumes = serializedObject.FindProperty("_TargetFogVolumes"); - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(FogVolumes, new GUIContent("Target Fog Volume"), true); - EditorGUI.indentLevel--; - GUI.color = Color.white; - GUI.color = new Color(.9f, 1, .9f); - if (GUILayout.Button("Add all Fog Volumes" /*GUILayout.Width(100)*/)) - { - _target.AddAllFogVolumesToThisLight(); - _target.Refresh(); - _target.Render(); - } - if (GUILayout.Button("Remove all Fog Volumes" /*GUILayout.Width(100)*/)) - { - _target.RemoveAllFogVolumesFromThisLight(); - _target.Refresh(); - _target.Render(); - } - GUI.color = Color.white; - _target._CameraVerticalPosition = EditorGUILayout.FloatField(VariableField - ("Shadow camera distance", "This is the distance from the shadow camera to the focus point. Increase it if the scene area you want to shade is not completely visible in the shadowmap"), _target._CameraVerticalPosition); - _target.Size = (FogVolumeDirectionalLight.Resolution)EditorGUILayout.EnumPopup("Resolution", _target.Size); - _target._Antialiasing = (FogVolumeDirectionalLight.Antialiasing)EditorGUILayout.EnumPopup("Antialiasing", _target._Antialiasing); - _target._UpdateMode = (FogVolumeDirectionalLight.UpdateMode)EditorGUILayout.EnumPopup(VariableField("Update mode", "OnStart: bake shadowmap on start\nInterleaved: skip frames"), _target._UpdateMode); - if (_target._UpdateMode == FogVolumeDirectionalLight.UpdateMode.Interleaved) - _target.SkipFrames = EditorGUILayout.IntSlider(VariableField("Skip frames", "Instead updating per-frame, we can skip frames before updating the shadow"), _target.SkipFrames, 0, 10); - else - { - GUI.color = new Color(.9f, 1, .9f); - if (GUILayout.Button("Refresh" /*GUILayout.Width(100)*/)) - { - _target.Refresh(); - _target.Render(); - _target.Render(); - } - GUI.color = Color.white; - } - - Rect LayerFieldRect = GUILayoutUtility.GetRect(GUIContent.none, GUIStyle.none, GUILayout.Height(20)); - - if (_target.ShadowCamera != null && _target.ShadowCamera.cullingMask == 0) - GUI.color = Color.red; - _target.LayersToRender = FogVolumeUtilities.EditorExtension.DrawLayerMaskField(LayerFieldRect, _target.LayersToRender, new GUIContent("Layers to render")); - GUI.color = Color.white; - _target._ScaleMode = (FogVolumeDirectionalLight.ScaleMode)EditorGUILayout.EnumPopup(VariableField("Scale mode", - "With VolumeX, the camera will take the volume scale.x to adjust its size\nSet it to manual to adjust this size yourself. Useful when you have a large volume and only want to have good shadows at the focus point"), _target._ScaleMode); - if (_target._ScaleMode == FogVolumeDirectionalLight.ScaleMode.Manual && _target._ProminentFogVolume != null) - _target.Scale = EditorGUILayout.Slider(VariableField("Zoom", "Scale the view range of the camera.\n It will use the volume size from position 0"), _target.Scale, 10, _target._ProminentFogVolume.fogVolumeScale.x); - _target._FocusMode = (FogVolumeDirectionalLight.FocusMode)EditorGUILayout.EnumPopup(VariableField("Focus mode", "The camera will focus on the given position. If the volume is not too large the best option would be Volume center"), _target._FocusMode); - if (_target._FocusMode == FogVolumeDirectionalLight.FocusMode.GameObject) - _target._GameObjectFocus = (Transform)EditorGUILayout.ObjectField(VariableField("Focus point", "Gameobject used to focus the shadow camera"), _target._GameObjectFocus, typeof(Transform), true); - _target._FogVolumeShadowMapEdgeSoftness = EditorGUILayout.Slider(VariableField("Edge softness", "Fading range for the edges of the shadowmap"), - _target._FogVolumeShadowMapEdgeSoftness, .001f, 1); - GUILayout.EndVertical();//end box - - #region Debug - GUILayout.BeginVertical("box"); - if (GUILayout.Button("Debug options", EditorStyles.toolbarButton)) - SHOW_DEBUG_Options = !SHOW_DEBUG_Options; - - if (SHOW_DEBUG_Options) - { - _target.CameraVisible = EditorGUILayout.Toggle(VariableField("Show shadow map camera", "Not updating correctly until we click on the hierarchy window :/"), _target.CameraVisible); - - - if (_target.GOShadowCamera && _target.GOShadowCamera.hideFlags == HideFlags.HideInHierarchy && _target.CameraVisible) - { - - _target.GOShadowCamera.hideFlags = HideFlags.None; - EditorApplication.RepaintHierarchyWindow(); - EditorApplication.DirtyHierarchyWindowSorting(); - } - if (_target.GOShadowCamera && _target.GOShadowCamera.hideFlags == HideFlags.None && !_target.CameraVisible) - { - _target.GOShadowCamera.hideFlags = HideFlags.HideInHierarchy; - EditorApplication.RepaintHierarchyWindow(); - EditorApplication.DirtyHierarchyWindowSorting(); - } - _target.ShowMiniature = EditorGUILayout.Toggle("View depth map", _target.ShowMiniature); - - EditorGUI.indentLevel++; - if (_target.ShowMiniature) - _target.MiniaturePosition = EditorGUILayout.Vector2Field("Position", _target.MiniaturePosition); - EditorGUI.indentLevel--; - } - EditorGUI.EndChangeCheck(); - GUI.color = Color.green; - if (_target._ProminentFogVolume == null) - EditorGUILayout.HelpBox("Add a Fog Volume now", MessageType.Info); - if (_target._ProminentFogVolume != null && _target.ShadowCamera != null && _target.ShadowCamera.cullingMask == 0) - EditorGUILayout.HelpBox("Set the layers used to cast shadows", MessageType.Info); - GUI.color = Color.white; - - GUI.color = Color.red; - if (_target._TargetFogVolumes != null) - { - foreach (FogVolume fv in _target._TargetFogVolumes) - { - if (fv != null) - if (fv._FogType == FogVolume.FogType.Uniform) - { - EditorGUILayout.HelpBox(fv.name + - " Is not a valid Volume. It has to be textured (must use gradient or noise)", - MessageType.Info); - } - } - } - - GUI.color = Color.white; - - GUI.color = Color.red; - if (_target._FocusMode == FogVolumeDirectionalLight.FocusMode.GameObject && _target._GameObjectFocus == null) - EditorGUILayout.HelpBox("Set the focus point object", MessageType.Info); - GUI.color = Color.white; - - EditorGUILayout.HelpBox("Initial version, experimental", MessageType.Info); - GUILayout.EndVertical();//end box - #endregion - - if (GUI.changed) - { - EditorUtility.SetDirty(target); - } - - serializedObject.ApplyModifiedProperties(); - } -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumeDirectionalLightEditor.cs.meta b/Assets/FogVolume/Scripts/Editor/FogVolumeDirectionalLightEditor.cs.meta deleted file mode 100644 index 7a4b955..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumeDirectionalLightEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 42de5d3f2cc8e2445a7b71d151382ce0 -timeCreated: 1499486407 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumeEditor.cs b/Assets/FogVolume/Scripts/Editor/FogVolumeEditor.cs deleted file mode 100644 index 21ea280..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumeEditor.cs +++ /dev/null @@ -1,816 +0,0 @@ -using UnityEditor; -using UnityEngine; -using System.Collections; -using UnityEditorInternal; -using System.IO; - -[CustomEditor(typeof(FogVolume))] - -public class FogVolumeEditor : Editor -{ - #region Variables - private static bool ShowInspectorTooltips - { - get { return EditorPrefs.GetBool("ShowInspectorTooltips", true); } - set { EditorPrefs.SetBool("ShowInspectorTooltips", value); } - } - - FogVolume _target; - private const string _showCustomizationOptions = "showCustomizationOptions"; - - private GUIStyle Theme1, ThemeFooter; - #endregion - //Texture2D[] _InspectorBackground; - - void OnEnable() - { - _target = (FogVolume)target; - string m_ScriptFilePath; - string BackgroundImagesPath; - MonoScript ms = MonoScript.FromScriptableObject(this); - m_ScriptFilePath = AssetDatabase.GetAssetPath(ms); - - FileInfo fi = new FileInfo(m_ScriptFilePath); - BackgroundImagesPath = fi.Directory.ToString(); - BackgroundImagesPath= BackgroundImagesPath.Replace("\\", "/"); - BackgroundImagesPath += "/Themes/png"; - - _target.BackgroundImagesPath = BackgroundImagesPath; - - int ImageIndex = 0; - - foreach (string filePath in System.IO.Directory.GetFiles(BackgroundImagesPath)) - { - if (!filePath.Contains(".meta")) - // print(filePath); - ImageIndex++; - } - _target._InspectorBackground = null; - _target._InspectorBackground = new Texture2D[ImageIndex]; - // print(ImageIndex); - int i = 0; - - foreach (string filePath in System.IO.Directory.GetFiles(BackgroundImagesPath)) - { - if (!filePath.Contains(".meta")) - { - - byte[] fileData; - // print(filePath); - fileData = File.ReadAllBytes(filePath); - //init - Texture2D tex = new Texture2D(1, 32, TextureFormat.RHalf, false, true); - tex.filterMode = FilterMode.Trilinear; - tex.LoadImage(fileData); - _target._InspectorBackground[i] = tex; - i++; - } - - - } - - - Theme1 = new GUIStyle(); - ThemeFooter = new GUIStyle(); - // ThemeFooter.normal.background = MakeTex(new Color(.31f, 0.2f, .3f)); - if (EditorGUIUtility.isProSkin) - ThemeFooter.normal.background = (Texture2D)Resources.Load("RendererInspectorBodyBlack"); - else - ThemeFooter.normal.background = (Texture2D)Resources.Load("RendererInspectorBodyBright"); - } - - GUIContent VariableField(string VariableName, string Tooltip) - { - return new GUIContent(VariableName, ShowInspectorTooltips ? Tooltip : ""); - } - - - public override bool RequiresConstantRepaint() { return true; } - - - - public override void OnInspectorGUI() - { - GUILayout.Space(10); - serializedObject.Update(); - GUI.color = Color.white; - GUILayout.BeginVertical(Theme1); - //some info about fog type - - - EditorGUI.BeginChangeCheck(); - Undo.RecordObject(target, "Fog volume parameter"); - #region Basic - - // _target.bias = EditorGUILayout.Slider("bias", _target.bias, 0, 1); - //_target.RenderableInSceneView Rod, lo moví pabajo, a other/rendering options - if (_target._FogType == FogVolume.FogType.Textured) - { - _target.FogMainColor = EditorGUILayout.ColorField(new GUIContent("Light energy", ShowInspectorTooltips ? "Multiplies all lighting contributions" : ""), _target.FogMainColor); - _target.bVolumeFog = EditorGUILayout.Toggle(VariableField("Volume Fog", "Fills the empty space left by noise with volumetric fog. This fog allows the use of pointlights and shadows"), _target.bVolumeFog); - } - else - _target.FogMainColor = EditorGUILayout.ColorField("Color", _target.FogMainColor); - - if (!_target.EnableNoise && !_target.EnableGradient || _target.bVolumeFog) - _target.Visibility = EditorGUILayout.FloatField(VariableField("Visibility", "Fog Visibility") , _target.Visibility); - _target.fogVolumeScale = EditorGUILayout.Vector3Field("Size", _target.fogVolumeScale); - if (_target._FogType == FogVolume.FogType.Textured) - { - - if (_target.bVolumeFog) - { - GUILayout.BeginVertical("box"); - _target._FogColor = EditorGUILayout.ColorField("Volume Fog Color", _target._FogColor); - _target._AmbientAffectsFogColor = EditorGUILayout.Toggle(VariableField("Apply ambient color", "Use ambient color and proxy volume to multiply this color"), _target._AmbientAffectsFogColor); - GUILayout.EndVertical();//end box - } - } - if(_target._FogType == FogVolume.FogType.Textured)//3.1.9 Hide if Uniform. Its going to be hardcoded as "Traditional" - _target._BlendMode = (FogVolumeRenderer.BlendMode)EditorGUILayout.EnumPopup(VariableField("Blend Mode", "Choose between standard of premultiplied alpha blend"), _target._BlendMode); - #endregion - - #region lighting - //GUILayout.BeginHorizontal("toolbarbutton"); - //EditorGUILayout.LabelField("Lighting"); - //showLighting = EditorGUILayout.Toggle("Show", showLighting); - //GUILayout.EndHorizontal(); - //if (_target.EnableNoise /*|| _target.EnableGradient*/) - if (GUILayout.Button("Lighting", EditorStyles.toolbarButton)) - _target.showLighting = !_target.showLighting; - - if (_target.showLighting) - { - if (_target._FogType == FogVolume.FogType.Textured) - { - GUILayout.BeginVertical("box"); - - _target._AmbientColor = EditorGUILayout.ColorField(VariableField("Ambient", "Ambient is added as first light contribution. Alpha is used for volumetric shadows ambient amount"), _target._AmbientColor); - _target.Absorption = EditorGUILayout.Slider(VariableField("Absorption", "How much ambient light is absorbed by noise. Depends on noise density"), _target.Absorption, 0, 1); - if (_target.useHeightGradient) - { - _target.HeightAbsorption = EditorGUILayout.Slider(VariableField("Height Absorption", "Multiplies lighting contributoins with height gradient 1"), _target.HeightAbsorption, 0, 1); - - } - GUILayout.EndVertical(); - if (_target.EnableNoise) - { - string HeightAbsorptionTooltip = "Define a height gradient to attenuate lighting. To disable, set both sliders to -1"; - EditorGUILayout.LabelField(VariableField("Height absorption gradient", HeightAbsorptionTooltip), EditorStyles.boldLabel); - GUILayout.BeginVertical("box"); - _target.HeightAbsorptionMin = EditorGUILayout.Slider(VariableField("min", HeightAbsorptionTooltip), _target.HeightAbsorptionMin, -1, 1); - _target.HeightAbsorptionMax = EditorGUILayout.Slider(VariableField("max", HeightAbsorptionTooltip), _target.HeightAbsorptionMax, -1, 1); - GUILayout.EndVertical(); - } - // if( GUILayout.Button(_target.bAbsorption.ToString())) - // _target.bAbsorption = !_target.bAbsorption; - // else - // _target.bAbsorption = false; - - // - // Debug.Log(_target.bAbsorption); - if (_target.Absorption == 0) - _target.bAbsorption = false; - else - _target.bAbsorption = true; - - } - _target.Sun = (Light)EditorGUILayout.ObjectField("Sun Light", _target.Sun, typeof(Light), true); - - if (_target.Sun != null) - { - if (_target._FogType == FogVolume.FogType.Textured) - _target._LightExposure = EditorGUILayout.Slider(VariableField("Light Exposure", "Overrides light intensity"), _target._LightExposure, 1, 5); - if (_target.EnableNoise) - { - GUILayout.BeginVertical("box"); - _target.Lambert = EditorGUILayout.Toggle(VariableField("Lambertian", "Computes lambert lighting. Disabled by default\n uncomment //#pragma shader_feature _LAMBERT_SHADING in FogVolume.shader to enable"), _target.Lambert); - if (_target.Lambert) - { - _target.DirectLightingAmount = EditorGUILayout.Slider("Amount", _target.DirectLightingAmount, .01f, 10f); - _target.LambertianBias = EditorGUILayout.Slider("Lambertian Bias", _target.LambertianBias, .5f, 1); - _target.NormalDistance = EditorGUILayout.Slider("Normal detail", _target.NormalDistance, .01f, .0001f); - _target.DirectLightingDistance = EditorGUILayout.FloatField("Distance", _target.DirectLightingDistance); - } - GUILayout.EndVertical(); - } - #region VolumeFogInscattering - if (_target._FogType == FogVolume.FogType.Textured) - if (_target.bVolumeFog) - { - GUILayout.BeginVertical("box"); - _target.VolumeFogInscattering = EditorGUILayout.Toggle(VariableField("Volume Fog Inscattering", "Computes phase function in fog"), _target.VolumeFogInscattering); - if (_target.VolumeFogInscattering && _target.bVolumeFog) - { - _target.VolumeFogInscatteringColor = EditorGUILayout.ColorField("Color", _target.VolumeFogInscatteringColor); - _target.VolumeFogInscatterColorAffectedWithFogColor = EditorGUILayout.Toggle(VariableField("Tint with fog color", "Off: reacts additively\nOn: incident light is tinted with the given fog color"), _target.VolumeFogInscatterColorAffectedWithFogColor); - _target.VolumeFogInscatteringAnisotropy = EditorGUILayout.Slider(VariableField("Anisotropy", "Balance of forward and back scattering"), _target.VolumeFogInscatteringAnisotropy, -1, 1); - _target.VolumeFogInscatteringIntensity = EditorGUILayout.Slider("Intensity", _target.VolumeFogInscatteringIntensity, 0, 1); - _target.VolumeFogInscatteringStartDistance = EditorGUILayout.FloatField("Start Distance", _target.VolumeFogInscatteringStartDistance); - _target.VolumeFogInscatteringTransitionWideness = EditorGUILayout.FloatField("Transition Wideness", _target.VolumeFogInscatteringTransitionWideness); - } - GUILayout.EndVertical(); - } - - #endregion - - #region Inscattering - // if (_target.NoiseIntensity > 0) - // { - GUILayout.BeginVertical("box"); - _target.EnableInscattering = EditorGUILayout.Toggle(VariableField("Inscattering", "Computes phase function in noise. It is affected by absorption"), _target.EnableInscattering); - if (_target.EnableInscattering) - { - - _target.InscatteringColor = EditorGUILayout.ColorField("Color", _target.InscatteringColor); - _target.InscatteringShape = EditorGUILayout.Slider(VariableField("Anisotropy", "Balance of forward and back scattering"), _target.InscatteringShape, -1, 1); - _target.InscatteringIntensity = EditorGUILayout.Slider("Intensity", _target.InscatteringIntensity, 0, 1); - _target.InscatteringStartDistance = EditorGUILayout.FloatField("Start Distance", _target.InscatteringStartDistance); - _target.InscatteringTransitionWideness = EditorGUILayout.FloatField("Transition Wideness", _target.InscatteringTransitionWideness); - - - } - GUILayout.EndVertical(); - - // } - // else - // _target.EnableInscattering = false; - #endregion - - if (_target.EnableNoise && _target._NoiseVolume != null) - { - GUILayout.BeginVertical("box"); - - _target._DirectionalLighting = EditorGUILayout.Toggle(VariableField("Directional Lighting", "Light is absorbed along light direction. Looks like sub-surface scattering"), _target._DirectionalLighting); - - if (_target._DirectionalLighting) - { - - _target.LightExtinctionColor = EditorGUILayout.ColorField(VariableField("Extinction Color", "The color of the light after full absorption"), _target.LightExtinctionColor); - // _target.DirectionalLightingClamp= EditorGUILayout.Slider(VariableField("Clamp", "Limit the maximum extiction"), _target.DirectionalLightingClamp, 1,5); - _target._DirectionalLightingDistance = EditorGUILayout.Slider(VariableField("Distance", "Distance between samples"), _target._DirectionalLightingDistance, 0, 2.0f); - _target.DirectLightingShadowDensity = EditorGUILayout.Slider(VariableField("Density", "Amount of light being absorbed"), _target.DirectLightingShadowDensity, 0, 15); - _target.DirectLightingShadowSteps = EditorGUILayout.IntSlider(VariableField("Iterations", "How many times to compute. Each iteration computes noise one more time causing dramatical performance hits"), _target.DirectLightingShadowSteps, 1, 5); - - } - GUILayout.EndVertical(); - } - } - - - - if (_target.EnableNoise && _target.Sun) - { - - - GUILayout.BeginVertical("box"); - _target._ShadeNoise = EditorGUILayout.Toggle(VariableField("Self shadow", "Computes directional shadows. \n It has high performance impact"), _target._ShadeNoise); - if (_target._ShadeNoise) - { - - // _target.Shade = EditorGUILayout.Slider("Shadow intensity", _target.Shade, 0, 1); - _target.ShadowShift = EditorGUILayout.Slider(VariableField("Shadow distance", "Distance between samples"), _target.ShadowShift, .0f, 2); - _target._SelfShadowSteps = EditorGUILayout.IntSlider("Iterations", _target._SelfShadowSteps, 1, 20); - _target._SelfShadowColor = EditorGUILayout.ColorField(VariableField("Shadow color", "Ambient color x Shadow color"), _target._SelfShadowColor); - } - GUILayout.EndVertical(); - } - - // - if (_target._FogType == FogVolume.FogType.Textured) - { - - if (_target.FogRenderer.shadowCastingMode == UnityEngine.Rendering.ShadowCastingMode.On || - _target.FogRenderer.receiveShadows == true) - { - GUILayout.BeginVertical("box"); - EditorGUILayout.LabelField("Opacity shadow map", EditorStyles.boldLabel); - // _target.CastShadows = EditorGUILayout.Toggle("Cast Shadows", _target.CastShadows);//lets control it trough the renderer - if (_target.Sun && _target.CastShadows)//casi mejor que un droplist - { - //tempShadowCaster = _target.CastShadows; - _target.ShadowCameraPosition = EditorGUILayout.IntField(VariableField("Vertical Offset", "Distance of the shadow camera. Use the prefab RT Viewer to see the result"), _target.ShadowCameraPosition); - _target.SunAttached = EditorGUILayout.Toggle(VariableField("Attach light", "The assigned light will inherit the volume rotation. This is useful to cast fake shadows with noise. Check the scene Sunset to see this in action"), _target.SunAttached); - _target.ShadowColor = EditorGUILayout.ColorField("Shadow Color", _target.ShadowColor); - _target._ShadowCamera.textureSize = (ShadowCamera.TextureSize)EditorGUILayout.EnumPopup(VariableField("Resolution", "Resolution of the shadow map"), _target._ShadowCamera.textureSize); - _target.ShadowCameraSkippedFrames = EditorGUILayout.IntSlider(VariableField("Skip frames", "Skip frames to reduce costs"), _target.ShadowCameraSkippedFrames, 0, 10); - GUILayout.BeginVertical("box"); - EditorGUILayout.LabelField("Convolution", EditorStyles.boldLabel); - - _target._ShadowCamera.iterations = EditorGUILayout.IntSlider("Iterations", _target._ShadowCamera.iterations, 0, 5); - if (_target._ShadowCamera.iterations > 0) - _target._ShadowCamera.Downsampling = EditorGUILayout.IntSlider("Downsampling", _target._ShadowCamera.Downsampling, 0, 5); - if (_target._ShadowCamera.iterations > 1) - _target._ShadowCamera.blurSpread = EditorGUILayout.Slider("Radius", _target._ShadowCamera.blurSpread, 0, 1); - GUILayout.EndVertical(); - } - else - { - if (_target.FogRenderer.receiveShadows) - _target.ShadowCaster = (FogVolume)EditorGUILayout.ObjectField(VariableField("Shadowmap coming from:", "Assign here the fog volume that is used to cast shadows"), _target.ShadowCaster, typeof(FogVolume), true); - - - if (_target.ShadowCaster != null) - _target.CastShadows = false; - - // tempShadowCaster = _target.CastShadows; - } - if (_target.CastShadows == false && _target.FogRenderer.receiveShadows) - { - _target.UseConvolvedLightshafts = EditorGUILayout.Toggle(VariableField("Use convolved lightshaft", "You can select here if you want to use the blurred shadow"), _target.UseConvolvedLightshafts); - _target.ShadowCutoff = EditorGUILayout.Slider(VariableField("Shadow Cutoff", "Apply contrast to the sampled shadow"), _target.ShadowCutoff, 0.001f, 1); - } - GUILayout.EndVertical(); - } - //_target.RT_Opacity = (RenderTexture)EditorGUILayout.ObjectField("LightMapRT", _target.RT_Opacity, typeof(RenderTexture), false); - //_target._LightMapTex = (Texture2D)EditorGUILayout.ObjectField("LightMapTex", _target._LightMapTex, typeof(Texture2D), false); - - } - else - _target.CastShadows = false; - - if (_target.Sun && _target.EnableNoise) - { - GUILayout.BeginVertical("box"); - - _target.LightHalo = EditorGUILayout.Toggle("Halo", _target.LightHalo); - if (_target.LightHalo && _target.EnableNoise) - { - _target._LightHaloTexture = (Texture2D)EditorGUILayout.ObjectField("Halo texture", _target._LightHaloTexture, typeof(Texture2D), true); - _target._HaloWidth = EditorGUILayout.Slider("Width", _target._HaloWidth, 0, 1); - - _target._HaloRadius = EditorGUILayout.Slider("Radius", _target._HaloRadius, -5, 1); - _target._HaloAbsorption = EditorGUILayout.Slider(VariableField("Absorption", "How much is absorption affecting"), _target._HaloAbsorption, 0, 1); - // _target._HaloOpticalDispersion = EditorGUILayout.Slider("OpticalDispersion", _target._HaloOpticalDispersion, 0, 8); - _target._HaloIntensity = EditorGUILayout.Slider("Intensity", _target._HaloIntensity, 0, 1); - } - GUILayout.EndVertical(); - }//TODO. Halo should be always available - } - - #endregion - - #region PointLights - string PointLightTittle = ""; - if (SystemInfo.graphicsShaderLevel > 30) - PointLightTittle = "Lights"; - else - PointLightTittle = "Lights not available on this platform ";// + SystemInfo.graphicsShaderLevel; - - if (_target._FogType == FogVolume.FogType.Textured) - if (GUILayout.Button(PointLightTittle, EditorStyles.toolbarButton)) - _target.showPointLights = !_target.showPointLights; - - if (_target.showPointLights && - SystemInfo.graphicsShaderLevel > 30) - { - _target.PointLightsActive = EditorGUILayout.Toggle("Enable", _target.PointLightsActive); - } - - if (_target.showPointLights && _target.PointLightsActive) - if (_target._FogType == FogVolume.FogType.Textured) - { - - _target.PointLightsRealTimeUpdate = EditorGUILayout.Toggle(VariableField("Real-time search", "Fog Volume will search for lights in the scene hierarchy. \nEnable this for a brief moment if lights were added to the scene."), _target.PointLightsRealTimeUpdate); - - _target.PointLightBoxCheck = EditorGUILayout.Toggle(VariableField("Inside box only", "Computes only lights that are inside of the volume boundaries. Turn off to compute lights that are outside of the volume"), _target.PointLightBoxCheck); - //GUILayout.BeginHorizon=tal("toolbarbutton"); - //EditorGUILayout.LabelField("Point lights"); - - //GUILayout.EndHorizontal(); - _target._LightScatterMethod = (FogVolume.LightScatterMethod)EditorGUILayout.EnumPopup("Attenuation Method", _target._LightScatterMethod); - _target.PointLightsIntensity = EditorGUILayout.Slider("Intensity", _target.PointLightsIntensity, 0, 50); - _target.PointLightingDistance = Mathf.Max(1, _target.PointLightingDistance); - _target.PointLightingDistance = EditorGUILayout.FloatField(VariableField("Range clamp", "Use this parameter to limit the spherical distance of the pointlight so that it is not computed when attenuation is zero. Use it to improve performance"), _target.PointLightingDistance); - _target.PointLightingDistance2Camera = Mathf.Max(1, _target.PointLightingDistance2Camera); - - _target.PointLightingDistance2Camera = EditorGUILayout.FloatField(VariableField("Draw distance", "Point-light is attenuated at the given distance and turned off as soon as that distance is exceeded"), _target.PointLightingDistance2Camera); - //_target.PointLightScreenMargin = EditorGUILayout.Slider("Discard margin", _target.PointLightScreenMargin, 0, 5);deprecated - _target.PointLightScreenMargin = 0; - - - _target.PointLightCullSizeMultiplier = EditorGUILayout.FloatField(VariableField("Light visibility", "The higher this value, the further the lights need to be offscreen in order to be discarded by the renderer."), _target.PointLightCullSizeMultiplier); - - /* - if (!_target.PointLightsRealTimeUpdate) - { - var FogLights = serializedObject.FindProperty("FogLights"); - GUILayout.BeginVertical("box"); - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(FogLights, new GUIContent - ("Editable array"), true); - EditorGUI.indentLevel--; - GUILayout.EndVertical(); - } - - var PointLightsList = serializedObject.FindProperty("PointLightsList"); - GUILayout.BeginVertical("box"); - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(PointLightsList, new GUIContent("Currently computed:"), true); - EditorGUI.indentLevel--; - GUILayout.EndVertical(); - */ - int totalLightCount = _target.GetTotalLightCount(); - int visibleLightCount = _target.GetVisibleLightCount(); - EditorGUILayout.HelpBox("Contains " + totalLightCount + " lights", MessageType.None); - EditorGUILayout.HelpBox("Rendering " + visibleLightCount + " lights", MessageType.None); - - } - - #endregion - - #region ColorManagement - //GUILayout.BeginHorizontal("toolbarbutton"); - - //_target.ColorAdjust = EditorGUILayout.Toggle("Color Settings", _target.ColorAdjust); - - //showColorTab = EditorGUILayout.Toggle(" Show \t ", showColorTab); - //GUILayout.EndHorizontal(); - if (GUILayout.Button(new GUIContent("Color management", ShowInspectorTooltips? "Color postprocessing such as contrast, brightness and tonemapper":"") , EditorStyles.toolbarButton)) - _target.showColorTab = !_target.showColorTab; - - if (/*_target.ColorAdjust && */_target.showColorTab) - { - _target.ColorAdjust = EditorGUILayout.Toggle("Active", _target.ColorAdjust); - - _target.Offset = EditorGUILayout.Slider("Offset", _target.Offset, -.5f, .5f); - _target.Gamma = EditorGUILayout.Slider("Gamma", _target.Gamma, .01f, 3); - - if (_target.ColorAdjust) - _target.Tonemap = EditorGUILayout.Toggle("Tonemap", _target.Tonemap); - if (_target.Tonemap && _target.ColorAdjust) - _target.Exposure = EditorGUILayout.Slider("Exposure", _target.Exposure, 2.5f, 5); - } - #endregion - - #region Renderer - - if (_target._FogType == FogVolume.FogType.Textured) - { - // GUILayout.BeginHorizontal("toolbarbutton"); - // EditorGUILayout.LabelField("Volume properties"); - //showVolumeProperties = EditorGUILayout.Toggle("Show", showVolumeProperties); - // GUILayout.EndHorizontal(); - - if (GUILayout.Button("Renderer", EditorStyles.toolbarButton)) - _target.showVolumeProperties = !_target.showVolumeProperties; - - if (_target.showVolumeProperties) - { - - - - _target.NoiseIntensity = EditorGUILayout.Slider(VariableField("Intensity", "Opacity of noise and gradients"), _target.NoiseIntensity, 0, 1); - - GUILayout.BeginVertical("box"); - _target.SceneCollision = EditorGUILayout.Toggle(VariableField("Scene Collision", "Textured fog will collide with environment when set to ON. _CameraDepthTexture is requierd for Scene view collisions. Enable Depth in camera script to generate the depth map required for Game view collisions. Disable if the volume is rendered in the background to avoid unneded computation"), _target.SceneCollision); - if (_target.SceneCollision) - _target._SceneIntersectionSoftness = EditorGUILayout.Slider(VariableField("Softness", "Pixels that get in contact with scene elements are faded to black. Use this slider to control the softeness of this transition"), _target._SceneIntersectionSoftness, 50, .01f); - GUILayout.EndVertical(); - - _target._jitter = EditorGUILayout.Slider(VariableField("Jitter", "Apply noise to the sample position. Use this in combination with DeNoise (camera script) to conceal the gaps between samples"), _target._jitter, 0, .1f); - - _target._SamplingMethod = (FogVolume.SamplingMethod)EditorGUILayout.EnumPopup(VariableField("Sampling Method", "Choose between distance to camera or view aligned planes. Hidden by default: uncomment #pragma shader_feature SAMPLING_METHOD_ViewAligned in FogVolume.shader"), _target._SamplingMethod); - _target.Iterations = EditorGUILayout.IntSlider(VariableField("Max Iterations", "Set the max iterations to perform."), _target.Iterations, 10, 1000); - _target.IterationStep = EditorGUILayout.FloatField(VariableField("Iteration step size", "Distance between iterations"), _target.IterationStep); - _target.FadeDistance = EditorGUILayout.FloatField(VariableField("Draw distance", "Noise is faded to black at the given distance. Loop will stop then"), _target.FadeDistance); - _target._OptimizationFactor = EditorGUILayout.Slider(VariableField("Optimization Factor", "Used to increase the distance between iterations so that we can have more quality at close distances. Far distances will be less opaque"), _target._OptimizationFactor, 0, 5e-09f); - - if (_target.EnableNoise) - { - GUILayout.BeginVertical("box"); - - _target.useHeightGradient = EditorGUILayout.Toggle(VariableField("Height Gradient", "Noise opacity is multiplied with a vertical gradient"), _target.useHeightGradient); - if (_target.useHeightGradient) - { - GUILayout.BeginVertical("box"); - _target.GradMin = EditorGUILayout.Slider("Grad 1 Min", _target.GradMin, -1, 1); - _target.GradMax = EditorGUILayout.Slider("Grad 1 Max", _target.GradMax, -1, 1); - GUILayout.EndVertical(); - GUILayout.BeginVertical("box"); - _target.GradMin2 = EditorGUILayout.Slider("Grad 2 Min", _target.GradMin2, -1, 1); - _target.GradMax2 = EditorGUILayout.Slider("Grad 2 Max", _target.GradMax2, -1, 1); - GUILayout.EndVertical(); - } - EditorGUILayout.EndVertical(); - } - if (_target.EnableNoise) - { - GUILayout.BeginVertical("box"); - - _target.bSphericalFade = EditorGUILayout.Toggle(VariableField("Radius Fade", "Multiplies noise opacity with a spherical range. Disabled by default. Uncomment #pragma shader_feature SPHERICAL_FADE in FogVolume.shader to enable"), _target.bSphericalFade); - if (_target.bSphericalFade) - { - - - _target.SphericalFadeDistance = EditorGUILayout.FloatField("Distance", _target.SphericalFadeDistance); - } - EditorGUILayout.EndVertical(); - } - _target._DebugMode = (FogVolume.DebugMode)EditorGUILayout.EnumPopup(VariableField("View mode: ", "Disabled by default. Uncomment #pragma multi_compile _ DEBUG in FogVolume.shader"), _target._DebugMode); - - //Primitives - GUILayout.BeginHorizontal("toolbarbutton"); - _target.EnableDistanceFields = EditorGUILayout.Toggle("Enable Primitives", _target.EnableDistanceFields); - - if (_target.EnableDistanceFields && _target.GetTotalPrimitiveCount() > 0) - EditorGUILayout.LabelField(_target.GetVisiblePrimitiveCount() + " primitives visible | " + _target.GetTotalPrimitiveCount() + " primitives in volume"); - else - EditorGUILayout.LabelField("0 primitives visible | 0 primitives in volume"); - GUILayout.EndHorizontal(); - - if (_target.EnableDistanceFields) - { - GUILayout.BeginVertical("box"); - _target.ShowPrimitives = EditorGUILayout.Toggle(VariableField("Show primitives", "Enables the primitive renderer component"), _target.ShowPrimitives); - _target.PrimitivesRealTimeUpdate = EditorGUILayout.Toggle(VariableField("Real-time search", "Searches primitives that are inside of the volume. Turn on only to refresh the list"), _target.PrimitivesRealTimeUpdate); - EditorGUILayout.EndVertical(); - _target.Constrain = EditorGUILayout.Slider(VariableField("Size", "Overrides the primitive original size"), _target.Constrain, 0, -150); - _target._PrimitiveEdgeSoftener = EditorGUILayout.Slider(VariableField("Softness", "Softens the primitive shape"), _target._PrimitiveEdgeSoftener, 1, 100); - _target._PrimitiveCutout = EditorGUILayout.Slider(VariableField("Cutout", "Cuts the distance field with the primitive boundaries"), _target._PrimitiveCutout, 0, .99999f); - - /* - var PrimitivesList = serializedObject.FindProperty("PrimitivesList"); - GUILayout.BeginVertical("box"); - EditorGUI.indentLevel++; - EditorGUILayout.PropertyField(PrimitivesList, true); - EditorGUI.indentLevel--; - EditorGUILayout.EndVertical(); - */ - } - - } - } - #endregion - - #region Noise - if (GUILayout.Button("Noise", EditorStyles.toolbarButton)) - _target.showNoiseProperties = !_target.showNoiseProperties; - // GUILayout.BeginHorizontal("toolbarbutton"); - //EditorGUILayout.LabelField(""); - - // showNoiseProperties = EditorGUILayout.Toggle(" Show", showNoiseProperties); - //GUILayout.EndHorizontal(); - - if (/*_target.EnableNoise && */_target.showNoiseProperties) - { - - _target.EnableNoise = EditorGUILayout.Toggle("Active", _target.EnableNoise); - if (_target.EnableNoise) - { - GUILayout.BeginVertical("Box"); - EditorGUILayout.LabelField("Common", EditorStyles.boldLabel); - //var TexturesRect = GUILayoutUtility.GetRect(new GUIContent(""), GUIStyle.none); - //EditorGUI.indentLevel++; - //_target.TexturesGroup = EditorGUI.Foldout(TexturesRect, _target.TexturesGroup, "Noise textures"); - //if (_target.TexturesGroup) - //{ - // _target._NoiseVolume = (Texture3D)EditorGUILayout.ObjectField("Base", _target._NoiseVolume, typeof(Texture3D), false); - // // _target._NoiseVolume2 = (Texture3D)EditorGUILayout.ObjectField("Detail", _target._NoiseVolume2, typeof(Texture3D), false); - // _target.CoverageTex = (Texture2D)EditorGUILayout.ObjectField(VariableField("Coverage (Experimental)", - // "Input texture to add or multiply coverage. This texture is sampled in the vertical axis. Uncomment #define COVERAGE in FogVolume.shader and test scene: Ocean"), _target.CoverageTex, typeof(Texture2D), false); - //} - //EditorGUI.indentLevel--; - // _target.CastShadows = tempShadowCaster; - _target._3DNoiseScale = EditorGUILayout.FloatField(VariableField("Scale", "Global size of all the noise layers"), _target._3DNoiseScale); - //_target.Procedural = EditorGUILayout.Toggle("Procedural", _target.Procedural); - - - - - // - #region Coordinates&Deformers - GUILayout.BeginVertical("box"); - EditorGUILayout.LabelField("Coordinates", EditorStyles.boldLabel); - - _target.Speed = EditorGUILayout.Vector3Field("Scroll", _target.Speed); - _target.Stretch = EditorGUILayout.Vector3Field("Stretch", _target.Stretch); - GUILayout.EndVertical(); - - GUILayout.BeginVertical("box"); - EditorGUILayout.LabelField("Deformers", EditorStyles.boldLabel); - - - _target.Vortex = EditorGUILayout.Slider(VariableField("Swirl", "Twist the space. Very useful to break tiling"), _target.Vortex, 0, 3); - if (_target.Vortex > 0) - { - _target.RotationSpeed = EditorGUILayout.Slider("Rotation Speed", _target.RotationSpeed, 0, 10); - _target.rotation = EditorGUILayout.Slider("Rotation", _target.rotation, 0, 360); - _target._VortexAxis = (FogVolume.VortexAxis)EditorGUILayout.EnumPopup("Axis", _target._VortexAxis); - } - GUILayout.EndVertical(); - - // - GUILayout.EndVertical(); - // GUILayout.EndVertical(); - #endregion - GUILayout.BeginVertical("Box"); - - EditorGUILayout.LabelField("Base layer", EditorStyles.boldLabel); - _target.Coverage = EditorGUILayout.Slider(VariableField("Coverage", "Multiplies the base layer intensity. Lighting is affected as density increases"), _target.Coverage, 0, 5); - _target.NoiseContrast = EditorGUILayout.Slider(VariableField("Contrast", "Apply contrast to noise. High values creates more empty space, which is good for performance"), _target.NoiseContrast, 0, 20); - _target.NoiseDensity = EditorGUILayout.Slider(VariableField( - "Density", "Opacity of the final noise. This won't change the shape of the noise as Intensity does. It only affects the density / opacity of the noise"), - _target.NoiseDensity, 0, 20); - - _target.Octaves = EditorGUILayout.IntSlider(VariableField("Octaves", "How many layers of noise to use"), _target.Octaves, 1, 5); - - _target.BaseTiling = EditorGUILayout.FloatField(VariableField("Base Tiling", "Independent scale for this layer"), _target.BaseTiling); - _target._BaseRelativeSpeed = EditorGUILayout.Slider(VariableField("Speed", "Independent speed multiplier for this layer"), _target._BaseRelativeSpeed, 0, 4); - GUILayout.EndVertical(); - - GUILayout.BeginVertical("Box"); - EditorGUILayout.LabelField("Detail layer", EditorStyles.boldLabel); - _target.DetailTiling = EditorGUILayout.FloatField("Tiling", _target.DetailTiling); - _target._DetailRelativeSpeed = EditorGUILayout.Slider("Speed", _target._DetailRelativeSpeed, 0, 20); - _target.DetailDistance = EditorGUILayout.FloatField(VariableField("Draw Distance", "This layer is a lot more costly than the base. Limit the draw distance to incerase performance"), _target.DetailDistance); - if (_target.DetailDistance > 0) - { - _target._NoiseDetailRange = EditorGUILayout.Slider(VariableField("Trim", - "The detail layer is used to cut the base layer at the edges. If contrast is not too high, this will be more effective"), _target._NoiseDetailRange, 0, 1); - _target._DetailMaskingThreshold = EditorGUILayout.Slider(VariableField - ("Trim Threshold", "Detail layer is applied only at the edges of the base layer. Use this slider to control the size of this edge"), - _target._DetailMaskingThreshold, 1, 350); - //_target.DetailSamplingBaseOpacityLimit = EditorGUILayout.Slider(VariableField("Cutoff", "This is the threshold to stop the detail sampling. We don't compute detail when the base layer opacity is higher than this value"), _target.DetailSamplingBaseOpacityLimit, 0, 1); - - - if (_target.Octaves > 1) - _target._Curl = EditorGUILayout.Slider(VariableField("Curl", "Used to distort the edges. Check the 'Time of Day' demo to see this in action"), _target._Curl, 0, 1); - } - GUILayout.EndVertical(); - - - - - - //_target.noise2D= (Texture2D)EditorGUILayout.ObjectField("noise2D", _target.noise2D, typeof(Texture2D), false); - - - - - - } - } - - #endregion - - #region Gradient - if (GUILayout.Button("Gradient", EditorStyles.toolbarButton)) - _target.showGradient = !_target.showGradient; - - if (_target.showGradient) - { - _target.EnableGradient = EditorGUILayout.Toggle("Active", _target.EnableGradient); - - if (_target.EnableGradient) - _target.Gradient = (Texture2D)EditorGUILayout.ObjectField("", _target.Gradient, typeof(Texture2D), true); - } - #endregion - - - - #region Footer - GUILayout.EndVertical();//termina estilo anterior - - EditorGUI.indentLevel++; - if (GUILayout.Button("Other", EditorStyles.toolbarButton)) - _target.OtherTAB = !_target.OtherTAB; - - GUILayout.BeginVertical(ThemeFooter); - - if (_target.OtherTAB) - { - GUILayout.Space(10); - var OtherRect = GUILayoutUtility.GetRect(new GUIContent(""), GUIStyle.none); - _target.showOtherOptions = EditorGUI.Foldout(OtherRect, _target.showOtherOptions, "Rendering options"); - if (_target.showOtherOptions) - { - //EditorGUI.indentLevel++; - - // if(!_target.CreateSurrogate) - _target.DrawOrder = EditorGUILayout.IntField(new GUIContent("DrawOrder", "Ignored when surrogates are not created manually"), _target.DrawOrder); - _target._PushAlpha = EditorGUILayout.Slider(new GUIContent("Push Alpha", "Compensate opacity when samples are not enough"), _target._PushAlpha, 1, 2f); - _target._ztest = (UnityEngine.Rendering.CompareFunction)EditorGUILayout.EnumPopup("ZTest ", _target._ztest); - if (_target.GameCameraGO != null /*&& _target._FogType == FogVolume.FogType.Textured*/) - if (_target.GameCameraGO.GetComponent() && - _target.GameCameraGO.GetComponent()._Downsample > 0 && - _target._FogType == FogVolume.FogType.Textured) - _target.CreateSurrogate = EditorGUILayout.Toggle(VariableField("Create Surrogate mesh", - "A copy of the volume mesh is created to project the result of the low-res render. This is good for preview, but usually, we have to create surrogate meshes by hand to sort them manually"), _target.CreateSurrogate); - _target._VisibleByReflectionProbeStatic = EditorGUILayout.Toggle("Visible for static probe", _target._VisibleByReflectionProbeStatic); - _target.RenderableInSceneView = EditorGUILayout.Toggle(VariableField("Render In Scene View", "Volume is not visible in Scene view. Please not that it won't be visible for reflection probes either"), _target.RenderableInSceneView); - _target.ExcludeFromLowRes = EditorGUILayout.Toggle(VariableField("Exclude from low res", - "Exclude this fog volume from the main game camera low res process\n" + - "Enable and change the layer\n useful when rendering underwater fog with another camera\nA custom depth buffer can be injected uncommenting this line: #pragma multi_compile _ ExternalDepth"), _target.ExcludeFromLowRes); - if (_target.ExcludeFromLowRes) - _target.InjectCustomDepthBuffer = EditorGUILayout.Toggle(VariableField("External depth buffer", - "Feed this Volume with a custom depth buffer with name: _CustomCameraDepthTexture\n useful when rendering underwater fog with another camera that has horizontal clip plane\nUncomment this line: #pragma multi_compile _ ExternalDepth"), _target.InjectCustomDepthBuffer); - } - - GUILayout.Space(10); - var DebugOptionsRect = GUILayoutUtility.GetRect(new GUIContent(""), GUIStyle.none); - _target.showDebugOptions = EditorGUI.Foldout(DebugOptionsRect, _target.showDebugOptions, "Debug options"); - if (_target.showDebugOptions) - { - _target.ShowDebugGizmos = - EditorGUILayout.Toggle("Draw Debug Gizmos", _target.ShowDebugGizmos); - } - - GUILayout.Space(10); - var CustomizationOptionsRect = GUILayoutUtility.GetRect(new GUIContent(""), GUIStyle.none); - _target.showCustomizationOptions = EditorGUI.Foldout(CustomizationOptionsRect, _target.showCustomizationOptions, "Customize look"); - if (_target.showCustomizationOptions) - { - // EditorGUI.indentLevel++; - // _target._InspectorBackground = (Texture2D)EditorGUILayout.ObjectField("Background", _target._InspectorBackground, typeof(Texture2D), false); - if (EditorGUIUtility.isProSkin) - { - if (_target._InspectorBackground.Length > 0) - _target._InspectorBackgroundIndex = - EditorGUILayout.IntSlider("Inspector background", - _target._InspectorBackgroundIndex, - 0, - _target._InspectorBackground.Length - - 1); - } - _target.HideWireframe = EditorGUILayout.Toggle("Scene view wireframe", _target.HideWireframe); - ShowInspectorTooltips = EditorGUILayout.Toggle(new GUIContent("Enable inspector tooltips", "Work in progress"), ShowInspectorTooltips); - // EditorGUI.indentLevel--; - } - - GUILayout.Space(10); - - bool prevSaveMaterials = _target.SaveMaterials; - _target.SaveMaterials = - EditorGUILayout.Toggle(new GUIContent("Save Materials", "Ensures that material shaders are built correctly when creating a platform specific build."), - _target.SaveMaterials); - if (prevSaveMaterials != _target.SaveMaterials && _target.SaveMaterials) - { - _target.RequestSavingMaterials = true; - } - else - { - _target.RequestSavingMaterials = false; - } - - } - - - - - - if (_target._InspectorBackground.Length > 0) - if (_target._InspectorBackground[_target._InspectorBackgroundIndex] != null && EditorGUIUtility.isProSkin) - Theme1.normal.background = _target._InspectorBackground[_target._InspectorBackgroundIndex]; - GUILayout.EndVertical();//end footer style - EditorGUI.indentLevel--; - //GUI.backgroundColor = new Color(.9f, .5f, .9f); - - - - - - #endregion - - #region Info - if (GUILayout.Button("Info", EditorStyles.toolbarButton)) - _target.generalInfo = !_target.generalInfo; - - if (_target.generalInfo) - { - GUILayout.BeginVertical("box"); - EditorGUILayout.LabelField("Description",EditorStyles.boldLabel); - _target.Description = EditorGUILayout.TextArea(_target.Description, GUILayout.MaxWidth(300)); - EditorGUILayout.LabelField("Version 3.4"); - EditorGUILayout.LabelField("Release date: May 2018"); - EditorGUILayout.LabelField("Fog type: " + _target._FogType.ToString()); - - #region Camera - - if (_target.GameCameraGO) - { - EditorGUILayout.LabelField("Assigned camera: " + _target.GameCameraGO.name); - if (GUILayout.Button("Select " + _target.GameCameraGO.name, EditorStyles.toolbarButton)) - Selection.activeGameObject = _target.GameCameraGO; - } - else - GUILayout.Button("No valid camera found", EditorStyles.toolbarButton); - GUILayout.EndVertical(); - GUILayout.Space(10); - #endregion - - - - } - #endregion - if (EditorGUI.EndChangeCheck()) - { - EditorUtility.SetDirty(target); - } - - - - serializedObject.ApplyModifiedProperties(); - } - -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumeEditor.cs.meta b/Assets/FogVolume/Scripts/Editor/FogVolumeEditor.cs.meta deleted file mode 100644 index e1f0830..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumeEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d5459245959cecf4985c5fcc323f4000 -timeCreated: 1476952094 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumeLightEditor.cs b/Assets/FogVolume/Scripts/Editor/FogVolumeLightEditor.cs deleted file mode 100644 index de350e0..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumeLightEditor.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.Collections; -using System.Collections.Generic; - -using UnityEngine; - -using UnityEditor; - - -[CustomEditor(typeof(FogVolumeLight))] -public class FogVolumeLightEditor : Editor -{ - public override void OnInspectorGUI() - { - GUILayout.Space(10.0f); - serializedObject.Update(); - - GUILayout.BeginVertical("box"); - - var usesNormalLight = serializedObject.FindProperty("IsAddedToNormalLight"); - if (usesNormalLight.boolValue) - { - EditorGUILayout.HelpBox("This light will use the settings of the light on this GameObject.\n\nRemove this component if the light should not be recognized by Fog Volume 3", MessageType.Info); - - } - else - { - var enabled = serializedObject.FindProperty("Enabled"); - if (GUILayout.Button(enabled.boolValue ? "Disable the light" : "Enable the light")) - { - enabled.boolValue = !enabled.boolValue; - } - - if (enabled.boolValue == true) - { - GUILayout.Space(10.0f); - - var isPointLight = serializedObject.FindProperty("IsPointLight"); - int selectedLightType = isPointLight.boolValue ? 0 : 1; - - selectedLightType = - EditorGUILayout.Popup("Light Type: ", - selectedLightType, - m_lightTypes, - EditorStyles.toolbarButton); - - if (selectedLightType == 0) { isPointLight.boolValue = true; } - else { isPointLight.boolValue = false; } - - GUILayout.Space(10.0f); - - var color = serializedObject.FindProperty("Color"); - EditorGUILayout.PropertyField(color, new GUIContent("Color:")); - - GUILayout.Space(10.0f); - - var intensity = serializedObject.FindProperty("Intensity"); - EditorGUILayout.Slider(intensity, - MinIntensity, - MaxIntenstity, - new GUIContent("Intensity:")); - - GUILayout.Space(10.0f); - - var range = serializedObject.FindProperty("Range"); - EditorGUILayout.Slider(range, MinRange, MaxRange, new GUIContent("Range:")); - - - - if (selectedLightType == 1) - { - GUILayout.Space(10.0f); - var angle = serializedObject.FindProperty("Angle"); - EditorGUILayout.Slider(angle, - MinSpotAngle, - MaxSpotAngle, - new GUIContent("SpotAngle:")); - } - } - } - GUILayout.EndVertical(); - - serializedObject.ApplyModifiedProperties(); - } - - private const float MinIntensity = 0.0f; - private const float MaxIntenstity = 50.0f; - private const float MinRange = 0.0f; - private const float MaxRange = 500.0f; - private const float MinSpotAngle = 0.0f; - private const float MaxSpotAngle = 180.0f; - - private readonly string[] m_lightTypes = new[] - { - "Point Light", - "Spot Light" - }; -} diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumeLightEditor.cs.meta b/Assets/FogVolume/Scripts/Editor/FogVolumeLightEditor.cs.meta deleted file mode 100644 index df9dc4c..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumeLightEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b93ef22c40098a942923df70f18d3f24 -timeCreated: 1501093543 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumePrimitiveEditor.cs b/Assets/FogVolume/Scripts/Editor/FogVolumePrimitiveEditor.cs deleted file mode 100644 index 92797eb..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumePrimitiveEditor.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; - -[CustomEditor(typeof(FogVolumePrimitive))] -public class FogVolumePrimitiveEditor : Editor -{ - public override void OnInspectorGUI() - { - GUILayout.Space(10.0f); - serializedObject.Update(); - - GUILayout.BeginVertical("box"); - - - var enabled = serializedObject.FindProperty("IsSubtractive"); - int selectedActionType = enabled.boolValue ? 0 : 1; - - selectedActionType = - EditorGUILayout.Popup("Action Type: ", - selectedActionType, - m_actionTypes, - EditorStyles.toolbarButton); - - if (selectedActionType == 0) { enabled.boolValue = true; } - else { enabled.boolValue = false; } - - - var persistent = serializedObject.FindProperty("IsPersistent"); - int selectedPersistenceType = persistent.boolValue ? 0 : 1; - - selectedPersistenceType = - EditorGUILayout.Popup("Persistence Type:", - selectedPersistenceType, - m_persistenceType, - EditorStyles.toolbarButton); - if (selectedPersistenceType == 0) { persistent.boolValue = true; } - else { persistent.boolValue = false; } - - GUILayout.Space(2.0f); - - - - - - GUILayout.EndVertical(); - - serializedObject.ApplyModifiedProperties(); - } - - private readonly string[] m_actionTypes = new[] - { - "Subtractive", - "Additive" - }; - - private readonly string[] m_persistenceType = new[] - { - "Persistent", - "Cullable" - }; -} diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumePrimitiveEditor.cs.meta b/Assets/FogVolume/Scripts/Editor/FogVolumePrimitiveEditor.cs.meta deleted file mode 100644 index fe8e28f..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumePrimitiveEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 00e0f071df3efac4a8069752c25cf053 -timeCreated: 1512414546 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumeRendererEditor.cs b/Assets/FogVolume/Scripts/Editor/FogVolumeRendererEditor.cs deleted file mode 100644 index e952c33..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumeRendererEditor.cs +++ /dev/null @@ -1,176 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; -using UnityEditorInternal; - -[CustomEditor(typeof(FogVolumeRenderer))] - -public class FogVolumeRendererEditor : Editor -{ - SerializedProperty ShowCamera; - FogVolumeRenderer _target; - private Texture2D InspectorImage; - private GUIStyle HeaderStyle, BodyStyle; - private static bool DebugTab - { - get { return EditorPrefs.GetBool("fvDebugTab"); } - set { EditorPrefs.SetBool("fvDebugTab", value); } - } - private static bool ShowInspectorTooltips - { - get { return EditorPrefs.GetBool("ShowInspectorTooltips"); } - set { EditorPrefs.SetBool("ShowInspectorTooltips", value); } - } - GUIContent VariableField(string VariableName, string Tooltip) - { - return new GUIContent(VariableName, ShowInspectorTooltips ? Tooltip : ""); - } - - string[] layerMaskName; - //int layerMaskNameIndex = 0; - - - void OnEnable() - { - _target = (FogVolumeRenderer)target; - ShowCamera = serializedObject.FindProperty("ShowCamera"); - InspectorImage = Resources.Load("InspectorImage", typeof(Texture2D)) as Texture2D; - HeaderStyle = new GUIStyle(); - HeaderStyle.normal.background = InspectorImage; - BodyStyle = new GUIStyle(); - // BodyStyle.normal.background = (Texture2D)Resources.Load("RendererInspectorBody"); - if (EditorGUIUtility.isProSkin) - BodyStyle.normal.background = (Texture2D)Resources.Load("RendererInspectorBodyBlack"); - else - BodyStyle.normal.background = (Texture2D)Resources.Load("RendererInspectorBodyBright"); - - List layerMaskList = new List(); - for (int i = 0; i < 32; i++) - { - string layerName = LayerMask.LayerToName(i); - //if (layerName != "") - //{ - // if (layerName == _target.DepthLayersName) - // layerMaskNameIndex = layerMaskList.Count; - layerMaskList.Add(layerName); - //} - } - layerMaskName = layerMaskList.ToArray(); - } - - public override void OnInspectorGUI() - { - - serializedObject.Update(); - GUILayout.Space(10); - // GUILayout.Box(InspectorImage, GUILayout.ExpandWidth(true)); - GUILayout.BeginVertical(HeaderStyle); - - // EditorGUILayout.HelpBox(BodyStyle.name, MessageType.None); - GUILayout.Space(EditorGUIUtility.currentViewWidth / 4 - 10); - //end header - GUILayout.EndVertical(); - //begin body - GUILayout.Space(1); - GUILayout.BeginVertical(BodyStyle); - - EditorGUI.BeginChangeCheck(); - Undo.RecordObject(_target, "Fog volume Renderer parameter"); - - GUILayout.Space(20); - // GUILayout.BeginVertical("box"); - _target._Downsample = EditorGUILayout.IntSlider("Downscale", _target._Downsample, 1, 16); - - //if (_target._Downsample>1) - // _target.RenderableInSceneView = EditorGUILayout.Toggle(VariableField("Render In Scene View", "Makes it visible for reflection probes and Scene viewport"), _target.RenderableInSceneView); - - //GUILayout.EndVertical();//end box - if (_target._Downsample > 1) - _target._BlendMode = (FogVolumeRenderer.BlendMode)EditorGUILayout.EnumPopup("Blend Mode", _target._BlendMode); - EditorGUILayout.HelpBox("Resolution: " + _target.FogVolumeResolution, MessageType.None); - if (_target._Downsample > 1) - { - - GUILayout.BeginVertical("box"); - _target.GenerateDepth = EditorGUILayout.Toggle(VariableField("Depth", "Compute Depth when rendered in low-res and textured volumes collide with scene elements"), _target.GenerateDepth); - if (_target.GenerateDepth) - { - //GUILayout.BeginHorizontal(); - //EditorGUILayout.LabelField("Exclude layer"); - //int newLayerMaskNameIndex = EditorGUILayout.Popup(layerMaskNameIndex, layerMaskName); - //if (newLayerMaskNameIndex != layerMaskNameIndex) - //{ - // layerMaskNameIndex = newLayerMaskNameIndex; - // _target.DepthLayersName = layerMaskName[layerMaskNameIndex]; - - //} - //GUILayout.EndHorizontal(); - // GUILayout.BeginHorizontal(); - // EditorGUILayout.LabelField("Depth layers"); - _target.DepthLayer2 = EditorGUILayout.MaskField(VariableField("Depth layers", "Select the layers used to collide with FV\n(Experimental feature)"), _target.DepthLayer2, layerMaskName); - //_target.DepthLayer2 = EditorGUILayout.LayerField("Depth layers", _target.DepthLayer2); - //GUILayout.EndHorizontal(); - GUILayout.BeginVertical("box"); - _target.useBilateralUpsampling = EditorGUILayout.Toggle(VariableField("Edge-aware upscale", "Minimize the aliasing at the edges of colliding elements"), _target.useBilateralUpsampling); - - - if (_target.useBilateralUpsampling) - { - _target.upsampleDepthThreshold = EditorGUILayout.Slider("Depth Threshold", _target.upsampleDepthThreshold, 0, .01f); - _target.showBilateralEdge = EditorGUILayout.Toggle("Show edge mask", _target.showBilateralEdge); - _target.upsampleMode = (FogVolumeRenderer.UpsampleMode)EditorGUILayout.EnumPopup("Method", _target.upsampleMode); - - } - GUILayout.EndVertical();//end box - } - GUILayout.EndVertical();//end box - - #region DeNoise - if (_target._Downsample > 1) - { - GUILayout.BeginVertical("box"); - _target.TAA = EditorGUILayout.Toggle(VariableField("DeNoise", "Performs Playdead's TAA to minimize noise when using jitter. Note: effect works only in 5.5"), _target.TAA); - if (_target.TAA && _target.HDR) - EditorGUILayout.HelpBox("Color output is in LDR", MessageType.None); - GUILayout.EndVertical();//end box - - } - #endregion - - // #region Stereo - //if ( _target._Downsample > 0) - //{ - // GUILayout.BeginVertical("box"); - // _target.useRectangularStereoRT = EditorGUILayout.Toggle("Rectangular stereo", _target.useRectangularStereoRT); - // GUILayout.EndVertical();//end box - //} - // #endregion - - if (GUILayout.Button("Debug", EditorStyles.toolbarButton)) - DebugTab = !DebugTab; - - if (DebugTab) - { - GUILayout.BeginVertical("box"); - { - EditorGUILayout.PropertyField(ShowCamera, new GUIContent("Show camera", "Unhide the camera used to render FV in low resolution")); - } - GUILayout.EndVertical(); - } - } - - EditorGUI.EndChangeCheck(); - EditorGUILayout.HelpBox("Fog Volume 3.4 July 2018", MessageType.None); - GUILayout.EndVertical(); - if (GUI.changed) - { - EditorUtility.SetDirty(_target); - } - - - - serializedObject.ApplyModifiedProperties(); - } - - -} diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumeRendererEditor.cs.meta b/Assets/FogVolume/Scripts/Editor/FogVolumeRendererEditor.cs.meta deleted file mode 100644 index de2fbdd..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumeRendererEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: cc84cfc3ca565c246a1dfa0e6ce47919 -timeCreated: 1488719253 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumeScreenEditor.cs b/Assets/FogVolume/Scripts/Editor/FogVolumeScreenEditor.cs deleted file mode 100644 index 5801e47..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumeScreenEditor.cs +++ /dev/null @@ -1,49 +0,0 @@ -using UnityEditor; -using UnityEngine; -using System.Collections; -using System.Collections.Generic; - -[CustomEditor(typeof(FogVolumeScreen))] -[ExecuteInEditMode] -public class FogVolumeScreenEditor : Editor -{ - string[] layerMaskName; - int layerMaskNameIndex = 0; - - void OnEnable() - { - FogVolumeScreen _target = (FogVolumeScreen)target; - List layerMaskList = new List(); - for (int i = 0; i < 32; i++) - { - string layerName = LayerMask.LayerToName(i); - if (layerName != "") - { - if (layerName == _target.FogVolumeLayerName) - layerMaskNameIndex = layerMaskList.Count; - layerMaskList.Add(layerName); - } - } - layerMaskName = layerMaskList.ToArray(); - } - - public override void OnInspectorGUI() - { - FogVolumeScreen _target = (FogVolumeScreen)target; - - - GUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Density layer"); - int newLayerMaskNameIndex = EditorGUILayout.Popup(layerMaskNameIndex, layerMaskName); - if (newLayerMaskNameIndex != layerMaskNameIndex) - { - layerMaskNameIndex = newLayerMaskNameIndex; - _target.FogVolumeLayerName = layerMaskName[layerMaskNameIndex]; - } - GUILayout.EndHorizontal(); - // Draw the default inspector - DrawDefaultInspector(); - EditorGUILayout.HelpBox("Work in progress!", MessageType.None); - EditorUtility.SetDirty(target); - } -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumeScreenEditor.cs.meta b/Assets/FogVolume/Scripts/Editor/FogVolumeScreenEditor.cs.meta deleted file mode 100644 index c6bd44c..0000000 --- a/Assets/FogVolume/Scripts/Editor/FogVolumeScreenEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a114e1e498c1c184eb874bf8356208d5 -timeCreated: 1493151842 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/FogVolume.cs b/Assets/FogVolume/Scripts/FogVolume.cs deleted file mode 100644 index 069315a..0000000 --- a/Assets/FogVolume/Scripts/FogVolume.cs +++ /dev/null @@ -1,2340 +0,0 @@ -//CHANGE LOG - -/* - ----[ v 3.2.1 ]---- - * Fog Volume data will ignore cameras without HideFlags.None - * Less garbage allocation - * Replaced PointLight component with a general purpose FogVolumeLight component - * Added a LightManager component that is now responsible for handling lights - It is automatically added to each FogVolume - * Added spot lights - * Added Fog Volume lights (point and spot) that work without a real point or spotlight - * Added Fog Volume to the menu bar, including new options for light creation - * New 'Light visibility' option in the inspector allows to modify the culling behaviour of point lights - * Depth buffer won't be affected now with the camera clip planes. - * A textured Fog Volume can be now excluded from the low-res process. Useful to render FV with a different camera, i.e water refraction - * Directional Light allows now multiple volumes. User will have to reasign the target volume. - * "Render in scene view" is now a per-volume option - * Added an option to receive a depth map externally "_CustomCameraDepthTexture" - * FV shadow map faded at the edges, so pixels are not stretched - * Added Directional light option to the 'Fog Volume' menu - - Only available when a directional light and at least one FogVolume is present - - ----[ v 3.2.1p1 ]---- - * Fixed an error that didn't update FrustumPlanes correctly - * Camera script shows a message when user adds FogVolume.cs to the camera. The camera is then cleaned OnEnable() - * Reasigned ShadowProjectorMesh when it is null - - ----[ v 3.2.1p2 ]---- - * Fixed a bug related with visibility - * Mesh filter is hidden from inspector - * Lights can now be turned on/off without the need for toggling "Real-time search". - * Camera script can be removed when "Disable camera script"== ON in FogVolumeData - * Directional light debug miniature can be moved now - * Added a culling mask field for depth pass - * LightManager is correctly hidden from inspector - * Fixed unneeded shadow work performed in Depth pass - - ----[ v 3.2.1p3 ] ---- - * Better depth-buffer behaviour on non-windows platforms - * Glitch fixing: shading rounding precission -venus scene-, more solid editing of quality-settings, better scene-game viewports relationship. - * Lights now works on OpenGL (there was a too-many-uniforms error) - * Better behaviour of surrogates in Mac - * Better CPU perf - * Updated VR showroom (now mostly event driven, using SteamVR's libs, improved VR start location -counter transformed start into meat space-, etc) - - - - - ----[ v 3.2.1p4 ] ---- - * Added FogVolumePrimitiveManager which supports up to 20 primitives that can be visible at the same time. - * The total amount of supported primitives is the same as for lights and is set to 1000. Only the 20 closest to the camera will be taken into account. - * Fixed a bug where removing a light would always return false. - * Overhauled the FogVolume menu to make it more accessible. - * Reduced garbage allocation for version before Unity 2017.3 (GeometryUtility.CalculateFrustumPlanes()). - * FogVolumeLightManager methods that are meant to be accessed by the user are: - - AddSimulatedSpotLight() - - AddSimulatedPointLight() - - AddPointLight() - - AddSpotLight() - - RemoveLight() - - SetPointOfInterest() - * FogVolumePrimitiveManager methods that are meant to be accessed by the user are: - - AddPrimitiveBox() - - AddPrimitiveSphere() - - RemovePrimitie() - - SetPointOfInterest() - - - - ----[ v 3.3 ] ---- - * Fixed a bug that made primitives to not work in the build - * Each FogVolume will now store it's material. - - The path where the materials are stored is specified by the constant MaterialPath. - -----[ v 3.3.1 ] ---- - * Unity returned FALSE with SystemInfo.supports3DTextures in webgl. But it is supported, so removed that damn thing to enable 3D textures in webgl. - - ----[ v 3.4 ] ---- - * Improved VR support. Parent object is not required now - * Bilateral upsampling done for stereo rendering - * DeNoise executed when not in play -*/ - -using UnityEngine; -using System.Reflection; -using System.Collections.Generic; -using System.Runtime.Serialization.Formatters; -using UnityEngine.SceneManagement; -#if UNITY_EDITOR -using UnityEditor.SceneManagement; -#endif -using UnityEngine.Profiling; -using FogVolumeUtilities; - -#if UNITY_EDITOR -using UnityEditor; -using System.IO; -#endif - -[ExecuteInEditMode] -//[RequireComponent(typeof(FogVolumeLightManager))] -public class FogVolume : MonoBehaviour -{ - #region InspectorData -#if UNITY_EDITOR - public bool showLighting, - OtherTAB, - showGradient, - showPointLights, - showNoiseProperties, - showVolumeProperties, - showColorTab, - tempShadowCaster, - showCustomizationOptions, - showDebugOptions, - showOtherOptions, - generalInfo, - TexturesGroup; - - public string BackgroundImagesPath; -#endif - #endregion - - public enum FogType - { - Uniform = 0, - Textured = 1 - } - - public FogType _FogType; - public bool RenderableInSceneView = true; - GameObject FogVolumeGameObject; - public FogVolume ShadowCaster; - public Texture2D _PerformanceLUT; - //public float bias = .5f; - public Vector3 fogVolumeScale = new Vector3(20, 20, 20); - [SerializeField] - public Color FogMainColor = Color.white; - public Color _FogColor = Color.white; - public bool _AmbientAffectsFogColor = false; - [Range(1, 5)] - public float Exposure = 2.5f; - [Range(-.5f, .5f)] - public float Offset = 0; - [Range(.01f, 3)] - public float Gamma = 1; - public bool Tonemap = false; - public float Visibility = 25; - [HideInInspector] - public bool ColorAdjust = false; - [Header("Lighting")] - public int _SelfShadowSteps = 3; - public int ShadowCameraSkippedFrames = 0; - public Color _SelfShadowColor = Color.black; - public float VolumeFogInscatteringAnisotropy = .5f; - public float VolumeFogInscatteringIntensity = .1f; - public float VolumeFogInscatteringStartDistance = 10f; - public float VolumeFogInscatteringTransitionWideness = 1; - public Color VolumeFogInscatteringColor = Color.white; - public bool VolumeFogInscattering = false; - public float HeightAbsorption, HeightAbsorptionMin = -1, HeightAbsorptionMax = -1; - public bool SunAttached; - [SerializeField] - public Light Sun = null; - [SerializeField] - public bool _ShadeNoise = false; - public bool _DirectionalLighting = false; - public float _DirectionalLightingDistance = .01f; - // public float DirectionalLightingClamp = 2; - public float DirectLightingShadowDensity = 1; - public Color LightExtinctionColor = new Color(81 / 255f, 45 / 255f, 26 / 255f, 0); - public int DirectLightingShadowSteps = 1; - public bool bAbsorption = true; - public float Absorption = .5f; - public float _LightExposure = 1; - public bool Lambert = false; - public float LambertianBias = 1; - public float NormalDistance = .01f; - public float DirectLightingAmount = 1; - public float DirectLightingDistance = 10; - [Range(1, 3)] - public float ShadowBrightness = 1; - public Color _AmbientColor = Color.gray; - bool _ProxyVolume = false; - // [SerializeField] - // [Range(1, 10)] - // public float Shade = 1; - [SerializeField] - [Range(.0f, .15f)] - public float ShadowShift = 0.0094f; - [Range(0, 5)] - public float PointLightsIntensity = 1; - // public PointLight[] PointLights; - // public List PointLightsList; - public float PointLightingDistance = 1000, PointLightingDistance2Camera = 50; - - public float PointLightCullSizeMultiplier = 1.0f; - public bool PointLightsActive = false; - - public bool EnableInscattering = false; - public Color InscatteringColor = Color.white; - public Texture2D _LightHaloTexture, CoverageTex; - public bool LightHalo; - public float _HaloWidth = .75f; - public float _HaloOpticalDispersion = 1; - public float _HaloRadius = 1; - public float _HaloIntensity = 1; - public float _HaloAbsorption = .5f; - [Range(-1, 1)] - public float - InscatteringShape = 0; - public float InscatteringIntensity = .2f, InscatteringStartDistance = 00, InscatteringTransitionWideness = 1; - - [Header("Noise")] - public bool EnableNoise = false; - - public int Octaves = 1; - public float _DetailMaskingThreshold = 18; - // public float DetailSamplingBaseOpacityLimit = .3f; - public bool bSphericalFade = false; - public float SphericalFadeDistance = 10; - public float DetailDistance = 500; - public float DetailTiling = 1; - public float _DetailRelativeSpeed = 10; - public float _BaseRelativeSpeed = 1; - public float _NoiseDetailRange = .5f, _Curl = .5f; - public float BaseTiling = 8; - public float Coverage = 1.5f; - public float NoiseDensity = 1; - // [SerializeField] - // public bool Procedural = false; - //[SerializeField] - //bool DoubleLayer = false; - //[SerializeField] - public float _3DNoiseScale = 80; - // [SerializeField] - [Range(10f, 300)] - public int Iterations = 85; - - public FogVolumeRenderer.BlendMode _BlendMode = FogVolumeRenderer.BlendMode.TraditionalTransparency; - //[SerializeField] - // [Range(10, 2000)] - public float IterationStep = 500, _OptimizationFactor = 0; - public enum SamplingMethod - { - Eye2Box = 0, - ViewAligned = 1 - } - public SamplingMethod _SamplingMethod = (SamplingMethod)0; - public enum DebugMode - { - Lit, - Iterations, - Inscattering, - VolumetricShadows, - VolumeFogInscatterClamp, - VolumeFogPhase - } - public bool _VisibleByReflectionProbeStatic = true; - FogVolumeRenderer _FogVolumeRenderer = null; - public GameObject GameCameraGO = null; - public DebugMode _DebugMode = DebugMode.Lit; - public bool useHeightGradient = false; - public float GradMin = 1, GradMax = -1, GradMin2 = -1, GradMax2 = -1; - public Texture3D _NoiseVolume2; - public Texture3D _NoiseVolume = null; - [Range(0f, 10)] - - public float NoiseIntensity = 0.3f; - - public void setNoiseIntensity(float value) - { - NoiseIntensity = value; - } - //[Range(1, 200)] - - [Range(0f, 5f)] - public float - NoiseContrast = 12; - public float FadeDistance = 5000; - [Range(0, 20)] - public float Vortex = 0; - public enum VortexAxis - { - X = 0, - Y = 1, - Z = 2 - } - - - public VortexAxis _VortexAxis = (VortexAxis)2; - - public bool bVolumeFog = false; - public bool VolumeFogInscatterColorAffectedWithFogColor = true; - public enum LightScatterMethod - { - BeersLaw = 0, - InverseSquare = 1, - - Linear = 2 - } - public LightScatterMethod _LightScatterMethod = (LightScatterMethod)1; - [Range(0, 360)] - public float rotation = 0; - [Range(0, 10)] - public float RotationSpeed = 0; - public Vector4 Speed = new Vector4(0, 0, 0, 0); - public Vector4 Stretch = new Vector4(0, 0, 0, 0); - [SerializeField] - [Header("Collision")] - public bool SceneCollision = true; - public bool ShowPrimitives = false; - public bool EnableDistanceFields = false; - //public List PrimitivesList; - public float _PrimitiveEdgeSoftener = 1; - public float _PrimitiveCutout = 0; - public float Constrain = 0; - [SerializeField] - //[Range(1, 200)] - //float _SceneIntersectionThreshold = 1000; - //[SerializeField] - [Range(1, 200)] - public float _SceneIntersectionSoftness = 1; - [SerializeField] - [Range(0, .1f)] - public float _jitter = 0.0045f; - public MeshRenderer FogRenderer = null; - public Texture2D[] _InspectorBackground; - public int _InspectorBackgroundIndex = 0; - - public string Description = ""; - [Header("Gradient")] - public bool EnableGradient = false; - public Texture2D Gradient; - - // #if UNITY_EDITOR - [SerializeField] - public bool HideWireframe = true; - // #endif - [SerializeField] - public bool SaveMaterials = false; - [SerializeField] - public bool RequestSavingMaterials = false; - [SerializeField] - public int - DrawOrder = 0; - - [SerializeField] - public bool ShowDebugGizmos = false; - MeshFilter filter; - Mesh mesh; - public RenderTexture RT_Opacity, RT_OpacityBlur; - - public float ShadowCutoff = 1f; - Vector3 currentFogVolume = Vector3.one; - public bool CastShadows = false; - public GameObject ShadowCameraGO; - public int shadowCameraPosition = 20; - public int ShadowCameraPosition - { - set - { - if (value != shadowCameraPosition) - { - shadowCameraPosition = value; - _ShadowCamera.CameraTransform(); - } - } - get - { - return shadowCameraPosition; - } - } - public ShadowCamera _ShadowCamera; - - public float _PushAlpha = 1; - public float GetVisibility() - { - return Visibility; - } - - // public Material _FogMaterial { get { return FogMaterial; } } - [SerializeField] - Material fogMaterial = null; - public Material FogMaterial - { - get - { - if (fogMaterial == null) - { - CreateMaterial(); - } - return fogMaterial; - } - } - public Shader FogVolumeShader; - - #if UNITY_EDITOR - private string m_prevFVName = null; - #endif - - - void RemoveMaterial() - { - #if UNITY_EDITOR - Scene activeScene = EditorSceneManager.GetActiveScene(); - string activeScenePath = - activeScene.path.Substring(0, - activeScene.path.Length - activeScene.name.Length - - 7); - string materialName = m_prevFVName + "_Material"; - string[] materials = AssetDatabase.FindAssets(materialName); - if (materials.Length != 0) - { - AssetDatabase.DeleteAsset(activeScenePath + "/" + activeScene.name + "/" + - materialName + ".mat"); - } - #endif - } - - void CreateMaterial() - { - if (SaveMaterials) - { - #if UNITY_EDITOR - Scene activeScene = EditorSceneManager.GetActiveScene(); - - if (activeScene.path.Length == 0) - { - Debug.LogWarning("The scene must be saved in order to enable 'SaveMaterials'!"); - FogVolumeShader = Shader.Find("Hidden/FogVolume"); - fogMaterial = new Material(FogVolumeShader); - SaveMaterials = false; - return; - } - - string activeScenePath = - activeScene.path.Substring(0, - activeScene.path.Length - activeScene.name.Length - - 7); - string materialName = FogVolumeGameObject.name + "_Material.mat"; - string[] materials = AssetDatabase.FindAssets(materialName); - if (materials.Length == 0) - { - FogVolumeShader = Shader.Find("Hidden/FogVolume"); - fogMaterial = new Material(FogVolumeShader); - - bool subfolderExists = false; - string[] subfolders = AssetDatabase.GetSubFolders(activeScenePath); - for (int i = 0; i < subfolders.Length; i++) - { - if (subfolders[i].Substring(subfolders[i].Length - activeScene.name.Length, activeScene.name.Length) == activeScene.name) - { - subfolderExists = true; - break; - } - } - - if (!subfolderExists) - { - AssetDatabase.CreateFolder(activeScenePath, activeScene.name); - } - - AssetDatabase.CreateAsset(fogMaterial, - activeScenePath + "/" + activeScene.name + "/" + - materialName); - } - else - { - fogMaterial = - AssetDatabase.LoadAssetAtPath(activeScenePath + "/" + activeScene.name + - "/" + materialName, - typeof(Material)) as Material; - } - #else - FogVolumeShader = Shader.Find("Hidden/FogVolume"); - fogMaterial = new Material(FogVolumeShader); - #endif - } - else - { - DestroyImmediate(fogMaterial); - FogVolumeShader = Shader.Find("Hidden/FogVolume"); - - // FogVolumeShader.maximumLOD = 600; - fogMaterial = new Material(FogVolumeShader); - try - { - fogMaterial.name = FogVolumeGameObject.name + " Material"; - } - catch - { - print(name); - } - fogMaterial.hideFlags = HideFlags.HideAndDontSave; - - } - } - - //void SetCameraDepth() - //{ - // if (ForwardRenderingCamera) - // ForwardRenderingCamera.depthTextureMode |= DepthTextureMode.Depth; - //} -#if UNITY_EDITOR - void CreateLayer(string LayerName) - { - // https://forum.unity3d.com/threads/adding-layer-by-script.41970/reply?quote=2274824 - SerializedObject tagManager = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/TagManager.asset")[0]); - SerializedProperty layers = tagManager.FindProperty("layers"); - bool ExistLayer = false; - //print(ExistLayer); - for (int i = 8; i < layers.arraySize; i++) - { - SerializedProperty layerSP = layers.GetArrayElementAtIndex(i); - - //print(layerSP.stringValue); - if (layerSP.stringValue == LayerName) - { - ExistLayer = true; - break; - } - - } - for (int j = 8; j < layers.arraySize; j++) - { - SerializedProperty layerSP = layers.GetArrayElementAtIndex(j); - if (layerSP.stringValue == "" && !ExistLayer) - { - layerSP.stringValue = LayerName; - tagManager.ApplyModifiedProperties(); - - break; - } - } - - // print(layers.arraySize); - } - - - -#endif - [SerializeField] - GameObject ShadowProjector; - MeshRenderer ShadowProjectorRenderer; - MeshFilter ShadowProjectorMeshFilter; - Material ShadowProjectorMaterial; - //Shader ShadowProjectorShader; - public Mesh ShadowProjectorMesh; - public Color ShadowColor = new Color(.5f, .5f, .5f, .25f); - //Vector3 ShadowProjectorScaleBackup = new Vector3(20, 20, 20); - //Vector3 ShadowProjectorPositionBackup; - public UnityEngine.Rendering.CompareFunction _ztest = UnityEngine.Rendering.CompareFunction.Disabled; - - void ShadowProjectorLock() - { - if (ShadowProjector) - { - ShadowProjector.transform.position = new Vector3( - FogVolumeGameObject.transform.position.x, - ShadowProjector.transform.position.y, - FogVolumeGameObject.transform.position.z); - - Vector3 ShadowProjectorScale = new Vector3(fogVolumeScale.x, ShadowProjector.transform.localScale.y, fogVolumeScale.z); - ShadowProjector.transform.localScale = ShadowProjectorScale; - - ShadowProjector.transform.localRotation = new Quaternion(); - } - } - void ShadowMapSetup() - { - if (ShadowCameraGO) - { - //print(ShadowCameraGO.name); - //DestroyImmediate(ShadowCameraGO); - // ShadowCameraGO.hideFlags = HideFlags.None; -// ShadowCameraGO.hideFlags = HideFlags.HideInHierarchy; - ShadowCameraGO.GetComponent().cullingMask = 1 << LayerMask.NameToLayer("FogVolumeShadowCaster"); - ShadowCameraGO.GetComponent().renderingPath = RenderingPath.Forward; - _ShadowCamera.CameraTransform(); - } - //The volume must be square, sir - if (CastShadows) - { - fogVolumeScale.z = fogVolumeScale.x; - } - - - - //Create shadow projector - if (CastShadows) - { - ShadowProjector = GameObject.Find(FogVolumeGameObject.name + " Shadow Projector"); - if (ShadowProjector == null) - { - ShadowProjector = new GameObject(); - - ShadowProjector.AddComponent(); - ShadowProjector.AddComponent(); - ShadowProjector.transform.parent = FogVolumeGameObject.transform; - ShadowProjector.transform.position = FogVolumeGameObject.transform.position; - ShadowProjector.transform.rotation = FogVolumeGameObject.transform.rotation; - ShadowProjector.transform.localScale = fogVolumeScale; - ShadowProjector.GetComponent().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; - ShadowProjector.GetComponent().receiveShadows = false; - ShadowProjector.GetComponent().reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Off; - ShadowProjector.GetComponent().lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; - } - - //ShadowProjector.hideFlags = HideFlags.DontSave; - - - ShadowProjectorMeshFilter = ShadowProjector.GetComponent(); - //doesnt work ShadowProjectorMesh = Resources.Load("ShadowVolume") as Mesh; - ShadowProjectorMeshFilter.mesh = ShadowProjectorMesh; - //3.1.3 for some reason, the mesh is lost in the VR showroom - if (ShadowProjectorMesh == null) - { - GameObject tempShadowBoxGO = GameObject.CreatePrimitive(PrimitiveType.Cube); - ShadowProjectorMesh = tempShadowBoxGO.GetComponent().mesh; - DestroyImmediate(tempShadowBoxGO, true); - } - - if (ShadowProjector.GetComponent().sharedMesh == null) - ShadowProjector.GetComponent().mesh = ShadowProjectorMesh; - - if (ShadowProjectorMesh == null) print("Missing mesh"); - - ShadowProjectorRenderer = ShadowProjector.GetComponent(); - ShadowProjectorRenderer.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; - ShadowProjectorRenderer.reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Off; - ShadowProjectorRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; - ShadowProjectorRenderer.receiveShadows = false; - ShadowProjectorMaterial = ShadowProjectorRenderer.sharedMaterial; - ShadowProjector.name = FogVolumeGameObject.name + " Shadow Projector"; - if (ShadowProjectorMaterial == null) - { - ShadowProjectorMaterial = new Material(Shader.Find("Fog Volume/Shadow Projector")); - //ShadowProjectorMaterial = new Material(Shader.Find("Diffuse")); - - ShadowProjectorMaterial.name = "Shadow Projector Material"; - // ShadowProjectorMaterial.hideFlags = HideFlags.HideAndDontSave; - - } - ShadowProjectorRenderer.sharedMaterial = ShadowProjectorMaterial; - } - } - - void SetShadowProyectorLayer() - { - //lets hide it when we don't render it in scene view. We will send it to the UI layer to make it easy - if (ShadowProjector) - { - if (RenderableInSceneView == false) - { - if (ShadowProjector.layer == LayerMask.NameToLayer("Default")) - { - ShadowProjector.layer = LayerMask.NameToLayer("UI"); - // print("switch projector to UI"); - } - } - else - { - if (ShadowProjector.layer == LayerMask.NameToLayer("UI")) - { - ShadowProjector.layer = LayerMask.NameToLayer("Default"); - // print("switch projector to Default"); - } - } - } - } - - void FindDirectionalLight() - { - //pick a light - Light[] SceneLights = FindObjectsOfType(); - //first, try to get it from light settings - if (!Sun) - Sun = RenderSettings.sun; - - //not yet? - if (!Sun) - foreach (Light TempLight in SceneLights) - { - - if (TempLight.type == LightType.Directional) - { - Sun = TempLight; - break; - } - } - - if (Sun == null) - { - Debug.LogError("Fog Volume: No valid light found\nDirectional light is required. Light component can be disabled."); - return; - } - else - { - - //remove fog layers from light 3.1.8. Light must not affect the volume we want to use as density for the screen effect - Sun.cullingMask &= ~(1 << LayerMask.NameToLayer("FogVolumeUniform")); - Sun.cullingMask &= ~(1 << LayerMask.NameToLayer("FogVolume")); - Sun.cullingMask &= ~(1 << LayerMask.NameToLayer("FogVolumeSurrogate")); - // Sun.cullingMask &= ~(1 << LayerMask.NameToLayer("FogVolumeShadowCaster")); - } - } - private Plane[] FrustumPlanes; - Camera GameCamera; - Material SurrogateMaterial; - BoxCollider _BoxCollider; - public FogVolumeData _FogVolumeData; - GameObject _FogVolumeDataGO; - public void FindFogVolumeData() - { - if (_FogVolumeDataGO == null) - { - FogVolumeData[] aFVD = FindObjectsOfType(); - - if (aFVD.Length == 0) - { - _FogVolumeDataGO = new GameObject(); - _FogVolumeData = _FogVolumeDataGO.AddComponent(); - _FogVolumeDataGO.name = "Fog Volume Data"; - } - else - { - _FogVolumeDataGO = aFVD[0].gameObject; - _FogVolumeData = aFVD[0]; - } - } - else { _FogVolumeData = _FogVolumeDataGO.GetComponent(); } - - } - /* With ExcludeFromLowRes enabled a textured FV is excluded from the low-res process. - * So it can be rendered by another camera, for example, a water reflection or refraction camera - * Then, we have to feed it with a custom DepthTexture that ignores the clip planes. _CameraDepthTexture is not valid because - * the clip planes of a camera like MirrorReflection.cs break FV. The provided shader Depth.shader will generate - * a valid depth texture - */ - public bool ExcludeFromLowRes = false; - void MoveToLayer() - { - if (!CastShadows) - { - if (!ExcludeFromLowRes) - { - if (_FogType == FogType.Textured) - { - if (FogVolumeGameObject.layer != LayerMask.NameToLayer("FogVolume")) - { - FogVolumeGameObject.layer = LayerMask.NameToLayer("FogVolume"); - // print("Moved to FogVolume layer"); - } - - - } - else - { - if (FogVolumeGameObject.layer != LayerMask.NameToLayer("FogVolumeUniform")) - { - FogVolumeGameObject.layer = LayerMask.NameToLayer("FogVolumeUniform"); - // FogMaterial.DisableKeyword("ExternalDepth"); - } - } - } - - } - } - public void AssignCamera() - { - - FindFogVolumeData(); - if (_FogVolumeDataGO == null) return;//wait til update check - - if (_FogVolumeData.GetFogVolumeCamera != null) - GameCameraGO = _FogVolumeData.GetFogVolumeCamera.gameObject; - - if (GameCameraGO == null) - { - - //Debug.Log("No camera available in "+gameObject.name); - this.enabled = false; - return; - } - else - this.enabled = true; - - GameCamera = GameCameraGO.GetComponent(); - - _FogVolumeRenderer = GameCameraGO.GetComponent(); - if (_FogVolumeRenderer == null) - { - if (!_FogVolumeData.ForceNoRenderer) - { - _FogVolumeRenderer = GameCameraGO.AddComponent(); - _FogVolumeRenderer.enabled = true; - } - } - else - if (_FogVolumeData.ForceNoRenderer == false)//3.1.8 Lets preserve that option - _FogVolumeRenderer.enabled = true; - } - void SetIcon() - { -#if UNITY_EDITOR - Texture Icon = Resources.Load("FogVolumeIcon") as Texture; - //Icon.hideFlags = HideFlags.HideAndDontSave; - var editorGUI = typeof(EditorGUIUtility); - var bindingFlags = BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.NonPublic; - var args = new object[] { gameObject, Icon }; - editorGUI.InvokeMember("SetIconForObject", bindingFlags, null, null, args); -#endif - } - - - int MessageDelay; - void OnEnable() - { - m_lightManager = null; - m_primitiveManager = null; - #if UNITY_EDITOR - m_prevFVName = gameObject.name; - fogMaterial = null; - #endif - SetIcon(); - //Low resolution renderer setup - AssignCamera(); - - SurrogateMaterial = Resources.Load("Fog Volume Surrogate", typeof(Material)) as Material; - FindDirectionalLight(); - _BoxCollider = GetComponent(); - - if (_BoxCollider == null) - _BoxCollider = gameObject.AddComponent(); - - _BoxCollider.hideFlags = HideFlags.HideAndDontSave; - - _BoxCollider.isTrigger = true; - - FogVolumeGameObject = this.gameObject; -#if UNITY_EDITOR - CreateLayer("FogVolumeShadowCaster"); - CreateLayer("FogVolume"); - CreateLayer("FogVolumeSurrogate"); - CreateLayer("FogVolumeUniform"); -#endif - FogRenderer = FogVolumeGameObject.GetComponent(); - if (FogRenderer == null) - FogRenderer = FogVolumeGameObject.AddComponent(); - - FogRenderer.sharedMaterial = FogMaterial; - ToggleKeyword(); - - // FogRenderer.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; - - //Shadow cam setup (GO, camera, components) - if (FogRenderer.shadowCastingMode == UnityEngine.Rendering.ShadowCastingMode.On) - { - string ShadowCameraName = FogVolumeGameObject.name + " Shadow Camera"; - ShadowCameraGO = GameObject.Find(ShadowCameraName); - if (ShadowCameraGO == null) - { - ShadowCameraGO = new GameObject(ShadowCameraName); - ShadowCameraGO.transform.parent = FogVolumeGameObject.transform; - ShadowCameraGO.AddComponent(); - Camera ShadowCamera = ShadowCameraGO.GetComponent(); - ShadowCamera.orthographic = true; - ShadowCamera.depth = -6; - ShadowCamera.clearFlags = CameraClearFlags.Color; - ShadowCamera.backgroundColor = new Color(0, 0, 0, 0); - ShadowCamera.allowHDR = false; - ShadowCamera.allowMSAA = false; - _ShadowCamera = ShadowCameraGO.AddComponent(); - - - - } - //ShadowCameraGO.hideFlags = HideFlags.None; - ShadowCameraGO.hideFlags = HideFlags.HideInHierarchy; - _ShadowCamera = ShadowCameraGO.GetComponent(); - ShadowMapSetup(); - //----------------------------- - } - - if (filter == null) - { - filter = gameObject.GetComponent(); - CreateBoxMesh(transform.localScale); - transform.localScale = Vector3.one; - } - filter.hideFlags = HideFlags.HideInInspector; - UpdateBoxMesh(); - - _PerformanceLUT = Resources.Load("PerformanceLUT") as Texture2D; - - //first check - GetShadowMap(); - _FogVolumeData.FindFogVolumes();//3.2 -#region LoadBackgroundImages - #if UNITY_EDITOR - // string BackgroundImagesPath = Application.dataPath + "/FogVolume/Scripts/Themes/png"; - #endif -#endregion - - if (FrustumPlanes == null) { FrustumPlanes = new Plane[6]; } - _InitializeLightManagerIfNeccessary(); - _InitializePrimitiveManagerIfNeccessary(); - } - public float PointLightCPUMaxDistance = 1; - GameObject PointLightsCameraGO = null; - Camera PointLightsCamera = null; - float GetPointLightDistance2Camera(Vector3 lightPosition) - { - PointLightsCameraGO = Camera.current.gameObject;//so it works in scene view too - - float Distance = (lightPosition - PointLightsCameraGO.transform.position).magnitude; - // print(Distance); - return Distance; - } - - public float PointLightScreenMargin = 1f; - - //bool PointLightRangeVisible(PointLight p) - //{ - // Collider pCol = p.GetComponent(); - // bool visible = true; - // if (Application.isPlaying) - // { - // if (GeometryUtility.TestPlanesAABB(FrustumPlanes, pCol.bounds)) - // visible = true; - // else - // visible = false; - - // } - // else - // visible = PointIsVisible(p.transform.position); - - // // print(visible); - // return visible; - //} - - bool PointIsVisible(Vector3 point) - { - PointLightsCamera = PointLightsCameraGO.GetComponent();//for scene view! - //possible TODO: attenuate light when it is outside view - float marginNeg = 0 - PointLightScreenMargin; - float marginPos = 1 + PointLightScreenMargin; - bool visible = true; - Vector3 screenPoint = PointLightsCamera.WorldToViewportPoint(point); - - if (screenPoint.z > marginNeg && screenPoint.x > marginNeg && screenPoint.x < marginPos - && screenPoint.y > marginNeg && screenPoint.y < marginPos) - { - // print("visible"); - visible = true; - } - else - { - //print("no visible"); - visible = false; - } - - return visible; - } - - //bool isPointLightInVisibleRange(PointLight light) - //{ - // Vector3 position = light.gameObject.transform.position; - // float Distance = GetPointLightDistance2Camera(position); - - - // if (Distance > PointLightingDistance2Camera) - // return false; - // else - // { - // return PointLightRangeVisible(light); - // } - //} - public bool PointLightsRealTimeUpdate = true; - public bool PointLightBoxCheck = true; - - - - - public bool PointIsInsideVolume(Vector3 PointPosition) - { - - //todo: rotation! - bool result = false; - float FogVolumeXmax = gameObject.transform.position.x + fogVolumeScale.x / 2; - float FogVolumeXmin = gameObject.transform.position.x - fogVolumeScale.x / 2; - - float FogVolumeYmax = gameObject.transform.position.y + fogVolumeScale.y / 2; - float FogVolumeYmin = gameObject.transform.position.y - fogVolumeScale.y / 2; - - float FogVolumeZmax = gameObject.transform.position.z + fogVolumeScale.z / 2; - float FogVolumeZmin = gameObject.transform.position.z - fogVolumeScale.z / 2; - - if (FogVolumeXmax > PointPosition.x && FogVolumeXmin < PointPosition.x) - { - // print("x dentro"); - if (FogVolumeYmax > PointPosition.y && FogVolumeYmin < PointPosition.y) - { - // print("y dentro"); - if (FogVolumeZmax > PointPosition.z && FogVolumeZmin < PointPosition.z) - { - // print("dentro"); - result = true; - } - } - - } - // else - // print("fuera"); - // print("nombre luz: " + FogLights.name); - // print("x maximo: " + FogVolumeXmax + " x minimo: " + FogVolumeXmin); - return result; - } - /* - Vector4[] PrimitivePositions = new Vector4[20]; - Transform[] PrimitivePositionsTransform = new Transform[20]; - public Vector4[] GetPrimitivesPositions() - { - int index = 0; - - foreach (FogVolumePrimitive guy in PrimitivesList) - { - index = Mathf.Min(16, index); - PrimitivePositionsTransform[index] = guy.GetTransform; - - PrimitivePositions[index] = this.gameObject.transform. - InverseTransformPoint(PrimitivePositionsTransform[index].position); - index++; - } - return PrimitivePositions; - } - Matrix4x4[] PrimitivesMatrixTransform = new Matrix4x4[20]; - Transform[] PrimitivesTransform = new Transform[20]; - public Matrix4x4[] GetPrimitivesTransform() - { - int index = 0; - - foreach (FogVolumePrimitive guy in PrimitivesList) - { - PrimitivesTransform[index] = guy.GetTransform; - - - PrimitivesMatrixTransform[index].SetTRS( - PrimitivesTransform[index].position, - Quaternion.Inverse(PrimitivesTransform[index].rotation) * (gameObject.transform.rotation), - - Vector3.one - ) - - ; - - // MatrixTransform[index] = MatrixTransform[index].inverse; - index++; - - } - return PrimitivesMatrixTransform; - } - - Vector4[] Scales = new Vector4[20]; - public Vector4[] GetPrimitivesScale() - { - int index = 0; - - foreach (FogVolumePrimitive guy in PrimitivesList) - { - Scales[index] = guy.GetPrimitiveScale; - index++; - } - return Scales; - } - */ - // Vector4[] PointlightPositions = new Vector4[256]; - // Transform[] PointlightPositionsTransform = new Transform[256]; - //public Vector4[] GetPointLightPositions() - //{ - // int index = 0; - - - // if (PointLightsList.Count > 0) - // foreach (PointLight guy in PointLightsList) - // { - // index = Mathf.Min(255, index); - // // Positions[index] = guy.GetPointLightPosition; - // if (guy != null) - // { - // PointlightPositionsTransform[index] = guy.GetTransform; - - // PointlightPositions[index] = this.gameObject.transform. - // InverseTransformPoint(PointlightPositionsTransform[index].position); - // } - // index++; - - // } - // return PointlightPositions; - //} - - Vector3 LocalDirectionalSunLight(Light Sun) - { - return transform.InverseTransformVector(-Sun.transform.forward); - } - // Color[] PointlightColors = new Color[256]; - //public Color[] GetPointLightColors() - //{ - // int index = 0; - - // if (PointLightsList.Count > 0) - // foreach (PointLight guy in PointLightsList) - // { - // index = Mathf.Min(255, index); - // if (guy != null) - // PointlightColors[index] = guy.GetPointLightColor; - - // index++; - // } - // return PointlightColors; - //} - - // float[] PointLightIntensity = new float[256]; - //public float[] GetPointLightIntensity() - //{ - // int index = 0; - - // if (PointLightsList.Count > 0) - // foreach (PointLight guy in PointLightsList) - // { - // index = Mathf.Min(255, index); - // if (guy != null) - // { - // PointLightIntensity[index] = guy.GetPointLightIntensity * PointLightsIntensity - // //distance fade - // * (1 - Mathf.Clamp01(GetPointLightDistance2Camera(guy.gameObject.transform.position) / PointLightingDistance2Camera)); - // } - // index++; - // } - // return PointLightIntensity; - //} - // float[] PointlightRange = new float[256]; - //public float[] GetPointLightRanges() - //{ - // int index = 0; - - // if (PointLightsList.Count > 0) - // foreach (PointLight guy in PointLightsList) - // { - // index = Mathf.Min(256, index); - // if (guy != null) - // PointlightRange[index] = guy.GetPointLightRange; - - // index++; - // } - // return PointlightRange; - //} - /* - void PrimitivesVisible() - { - int index = 0; - - foreach (FogVolumePrimitive guy in PrimitivesList) - { - if (guy == null) - { - PrimitivesList.Remove(guy); - break; - } - - if (guy) - { - if (ShowPrimitives) - guy.GetComponent().enabled = true; - else - guy.GetComponent().enabled = false; - } - index++; - } - } - */ - public bool PrimitivesRealTimeUpdate = true; - /* - public FogVolumePrimitive[] Primitives; - void ClearPrimitiveList() - { - if (PrimitivesList != null && PrimitivesRealTimeUpdate) - PrimitivesList.Clear(); - if (PrimitivesList == null) - PrimitivesList = new List(); - } - void CreatePrimitiveList() - { - - if (PrimitivesRealTimeUpdate) - Primitives = FindObjectsOfType(typeof(FogVolumePrimitive)) as FogVolumePrimitive[]; - ClearPrimitiveList(); - - for (int i = 0; i < Primitives.Length; i++) - { - if (Primitives[i] != null && - Primitives[i].GetComponent().enabled && - PointIsInsideVolume(Primitives[i].transform.position)) - { - if (PrimitivesRealTimeUpdate) - PrimitivesList.Add(Primitives[i]); - - } - } - - - - PrimitivesVisible(); - } - */ - void OnDisable() - { - m_lightManager = null; - m_primitiveManager = null; - - } - - static public void Wireframe(GameObject obj, bool Enable) - { -#if UNITY_EDITOR - //not valid in 5.5 - // EditorUtility.SetSelectedWireframeHidden(obj.GetComponent(), Enable); - if (Enable) - EditorUtility.SetSelectedRenderState(obj.GetComponent(), EditorSelectedRenderState.Wireframe); - else - EditorUtility.SetSelectedRenderState(obj.GetComponent(), EditorSelectedRenderState.Highlight); -#endif - } - void OnBecameVisible() - { } - public bool IsVisible; - - void GetShadowMap() - { - if (!FogRenderer) - FogRenderer = FogVolumeGameObject.GetComponent(); - //if (FogRenderer.isVisible){//Visible by ANY camera '-_- - - if (IsVisible) - { - if (FogRenderer != null && FogRenderer.shadowCastingMode == UnityEngine.Rendering.ShadowCastingMode.Off) - { - CastShadows = false; - } - if (FogRenderer.shadowCastingMode == UnityEngine.Rendering.ShadowCastingMode.On) - { - if (_FogType == FogType.Textured) - CastShadows = true; - else - FogRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;//revert if fog is uniform - } - - //allow self shadows? not for now, since the result will be incorrect - //if (FogRenderer.receiveShadows) - // CastShadows = false; - if (CastShadows && _ShadowCamera == null) - { - ShadowMapSetup(); - RT_OpacityBlur = _ShadowCamera.GetOpacityBlurRT(); - } - if (_ShadowCamera) - { - //_ShadowCamera.enabled = CastShadows; - ShadowCameraGO.SetActive(CastShadows); - } - if (CastShadows) - { - RT_Opacity = _ShadowCamera.GetOpacityRT(); -// Debug.Log(RT_Opacity); - } - else if (ShadowCaster && FogRenderer.receiveShadows) - { - RT_Opacity = ShadowCaster.RT_Opacity; - RT_OpacityBlur = ShadowCaster.RT_OpacityBlur; - //same dimensions than caster - fogVolumeScale.x = ShadowCaster.fogVolumeScale.x; - fogVolumeScale.z = fogVolumeScale.x; - } - if (CastShadows) - { - FogVolumeGameObject.layer = LayerMask.NameToLayer("FogVolumeShadowCaster"); - } - // else - // FogVolumeGameObject.layer = LayerMask.NameToLayer("FogVolume"); - //if (!CastShadows && !RT_Opacity) - // FogMaterial.SetTexture("LightshaftTex", null); - - if (CastShadows && ShadowCaster) - FogMaterial.DisableKeyword("VOLUME_SHADOWS"); - if (ShadowCaster && ShadowCaster.CastShadows || FogRenderer.receiveShadows) - FogMaterial.EnableKeyword("VOLUME_SHADOWS"); - - if (ShadowCaster && !ShadowCaster.CastShadows || !FogRenderer.receiveShadows) - FogMaterial.DisableKeyword("VOLUME_SHADOWS"); - } - } - - public bool CreateSurrogate = true; - - // private float m_cameraNearClipPlane = 0.0f; - // private float m_cameraFarClipPlane = 0.0f; - public bool InjectCustomDepthBuffer = false; - - - void Update() - { - #if UNITY_EDITOR - - if (MessageDelay < 101) - MessageDelay++; - if(MessageDelay>100) - if (GameCamera.depthTextureMode == DepthTextureMode.None) - Debug.LogWarning("............ATTENTION, this camera is not generating the required Depth for Fog Volume. " + - "Add -EnableDepthInForwardCamera.cs- to this camera"); - - if (RequestSavingMaterials) - { - CreateMaterial(); - RequestSavingMaterials = false; - } - - if (FogVolumeGameObject.name != m_prevFVName) - { - if (SaveMaterials) - { - RemoveMaterial(); - m_prevFVName = FogVolumeGameObject.name; - CreateMaterial(); - } - } - #endif - - //External depth: - if (InjectCustomDepthBuffer && FogMaterial.IsKeywordEnabled("ExternalDepth") == false && ExcludeFromLowRes) - { - FogMaterial.EnableKeyword("ExternalDepth"); - // Debug.Log("Enabled keyword ExternalDepth"); - } - - if (FogMaterial.IsKeywordEnabled("ExternalDepth") == true && ExcludeFromLowRes && !InjectCustomDepthBuffer) - { - FogMaterial.DisableKeyword("ExternalDepth"); - // Debug.Log("Disabled keyword ExternalDepth"); - } - //Debug.Log("Rendering " + gameObject.name + "\n Layer: " + LayerMask.LayerToName(gameObject.layer) + "\n External depth keyword: " + FogMaterial.IsKeywordEnabled("ExternalDepth")); - - //#if UNITY_EDITOR - if (GameCamera == null) - AssignCamera(); - //#endif - - if (PointLightCullSizeMultiplier < 1.0f) { PointLightCullSizeMultiplier = 1.0f; } - if (m_lightManager != null) - { - m_lightManager.DrawDebugData = ShowDebugGizmos; - m_lightManager.SetPointLightCullSizeMultiplier(PointLightCullSizeMultiplier); - } - - if (m_primitiveManager != null) { m_primitiveManager.SetVisibility(ShowPrimitives); } - - if (GameCamera != null) - { - //if ((GameCamera.nearClipPlane != m_cameraNearClipPlane) || - // (GameCamera.farClipPlane != m_cameraFarClipPlane)) - //{ - // m_cameraNearClipPlane = GameCamera.nearClipPlane; - // m_cameraFarClipPlane = GameCamera.farClipPlane; - FrustumPlanes = GeometryUtility.CalculateFrustumPlanes(GameCamera); - - // } - - - if (Application.isPlaying) - { - if (GeometryUtility.TestPlanesAABB(FrustumPlanes, _BoxCollider.bounds)) - { - IsVisible = true; - // Debug.Log(gameObject.name + " Visible by "+ GameCamera.name); - } - else - { - IsVisible = false; - // Debug.Log(gameObject.name + " Not visible by " + GameCamera.name); - } - } - - else - - IsVisible = true; - } - // print(IsVisible); - if (EnableNoise || EnableGradient) - _FogType = FogType.Textured; - else - _FogType = FogType.Uniform; - -#if UNITY_EDITOR - UpdateBoxMesh(); - ShadowProjectorLock(); - Visibility = Mathf.Max(1, Visibility); - IterationStep = Mathf.Max(1, IterationStep); - //InscatteringIntensity = Mathf.Max(0, InscatteringIntensity); - //NoiseIntensity = Mathf.Max(0, NoiseIntensity); - InscatteringTransitionWideness = Mathf.Max(1, InscatteringTransitionWideness); - InscatteringStartDistance = Mathf.Max(0, InscatteringStartDistance); - if (_NoiseVolume == null) - EnableNoise = false; - - fogVolumeScale.x = Mathf.Max(fogVolumeScale.x, .001f); - fogVolumeScale.y = Mathf.Max(fogVolumeScale.y, .001f); - fogVolumeScale.z = Mathf.Max(fogVolumeScale.z, .001f); - - if (ShadowProjector == null && CastShadows) - { - // print("ShadowMapSetup()"); - ShadowMapSetup(); - } - SetShadowProyectorLayer(); - if (!Sun) FindDirectionalLight(); - - MoveToLayer(); - - StaticEditorFlags flags; - flags = GameObjectUtility.GetStaticEditorFlags(gameObject); - if (_VisibleByReflectionProbeStatic && GameObjectUtility.GetStaticEditorFlags(gameObject) != StaticEditorFlags.ReflectionProbeStatic) - { - //print("Fog Volume visible for Static reflection probes"); - GameObjectUtility.SetStaticEditorFlags(gameObject, StaticEditorFlags.ReflectionProbeStatic); - } - - if (!_VisibleByReflectionProbeStatic && flags == StaticEditorFlags.ReflectionProbeStatic) - { - // print("Fog Volume not visible for Static reflection probes"); - flags = flags & ~StaticEditorFlags.ReflectionProbeStatic; - GameObjectUtility.SetStaticEditorFlags(gameObject, flags); - } -#endif - - RenderSurrogate(); - if (ShadowProjector != null && CastShadows) - { - - // ShadowProjectorMaterial.SetTexture("_MainTex", RT_OpacityBlur); - - ShadowProjectorMaterial.SetColor("_ShadowColor", ShadowColor); - } - // FogMaterial.SetTexture("LightshaftTex", RT_Opacity); - //if (Camera.current != null) - //{ - // Vector3 ForwardCameraVector = Camera.current.transform.forward; - // FogMaterial.SetVector("_SliceNormal", ForwardCameraVector); - // print(ForwardCameraVector); - //} - // - if (FogMaterial.GetTexture("_NoiseVolume") == null && _NoiseVolume != null || FogMaterial.GetTexture("_NoiseVolume") != _NoiseVolume) - { - FogMaterial.SetTexture("_NoiseVolume", _NoiseVolume); - // Debug.Log("Updating tex"); - } - if (FogMaterial.GetTexture("_NoiseVolume2") == null && _NoiseVolume2 != null || FogMaterial.GetTexture("_NoiseVolume2") != _NoiseVolume2) - { - FogMaterial.SetTexture("_NoiseVolume2", _NoiseVolume2); - - } - - if (FogMaterial.GetTexture("CoverageTex") == null && CoverageTex != null || FogMaterial.GetTexture("CoverageTex") != CoverageTex) - { - FogMaterial.SetTexture("CoverageTex", CoverageTex); - - } - - //GetComponent().Update(); - } - - public void RenderSurrogate() - { - - if (IsVisible) - { - if (GameCameraGO == null) AssignCamera(); - var renderer = GameCameraGO.GetComponent(); - if (renderer == null) - { - if (!_FogVolumeData.ForceNoRenderer) - { - renderer = GameCameraGO.AddComponent(); - renderer.enabled = true; - } - } - if (!_FogVolumeData.ForceNoRenderer && renderer._Downsample > 0 && CreateSurrogate && mesh != null && - _FogType == FogVolume.FogType.Textured) - { - - Graphics.DrawMesh(mesh, transform.position, transform.rotation, SurrogateMaterial, - LayerMask.NameToLayer("FogVolumeSurrogate"), - //GameCamera,//it blinks - null, - 0, null, false, false, false); - - // if(EnableNoise) - // FogMaterial.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One); - } - - } - } - - void UpdateParams() - { - if (IsVisible) - { - if (_PerformanceLUT && _DebugMode == DebugMode.Iterations) - FogMaterial.SetTexture("_PerformanceLUT", _PerformanceLUT); - - if (_DebugMode != DebugMode.Lit) - FogMaterial.SetInt("_DebugMode", (int)_DebugMode); - - if (FogType.Textured == _FogType) - { - FogMaterial.SetInt("_SrcBlend", (int)_BlendMode); - // print((int)_BlendMode); - } - else - //set it as standard alpha blend for uniform fog - FogMaterial.SetInt("_SrcBlend", (int)FogVolumeRenderer.BlendMode.TraditionalTransparency); - FogMaterial.SetInt("_ztest", (int)_ztest); - - Profiler.BeginSample("FogVolume Pointlights update"); - if (m_lightManager != null) - { - if (m_lightManager.CurrentLightCount > 0 && - PointLightsActive && - SystemInfo.graphicsShaderLevel > 30) - { - FogMaterial.SetVectorArray("_LightPositions", - m_lightManager.GetLightPositionArray()); - FogMaterial.SetVectorArray("_LightRotations", m_lightManager.GetLightRotationArray()); - FogMaterial.SetColorArray("_LightColors", m_lightManager.GetLightColorArray()); - FogMaterial.SetVectorArray("_LightData", m_lightManager.GetLightData()); - - FogMaterial.SetFloat("PointLightingDistance", 1.0f / PointLightingDistance);//spherical range clamp - FogMaterial.SetFloat("PointLightingDistance2Camera", - 1.0f / PointLightingDistance2Camera);//draw distance - - - } - } - Profiler.EndSample(); - Profiler.BeginSample("FogVolume Primitives update"); - if (m_primitiveManager != null) - if (m_primitiveManager.CurrentPrimitiveCount > 0 && EnableDistanceFields) - { - FogMaterial.SetFloat("Constrain", Constrain); - FogMaterial.SetVectorArray("_PrimitivePosition", m_primitiveManager.GetPrimitivePositionArray()); - FogMaterial.SetVectorArray("_PrimitiveScale", m_primitiveManager.GetPrimitiveScaleArray()); - FogMaterial.SetInt("_PrimitiveCount", m_primitiveManager.VisiblePrimitiveCount); - FogMaterial.SetMatrixArray("_PrimitivesTransform", m_primitiveManager.GetPrimitiveTransformArray()); - FogMaterial.SetFloat("_PrimitiveEdgeSoftener", 1 / _PrimitiveEdgeSoftener); - FogMaterial.SetFloat("_PrimitiveCutout", _PrimitiveCutout); - FogMaterial.SetVectorArray("_PrimitiveData", m_primitiveManager.GetPrimitiveDataArray()); - } - Profiler.EndSample(); - Profiler.BeginSample("FogVolume PARAMETERS"); - // FogMaterial.SetVector("_CameraForward", Camera.current.transform.forward); - - if (Sun && Sun.enabled) - { - FogMaterial.SetFloat("_LightExposure", _LightExposure); - if (LightHalo && _LightHaloTexture) - { - FogMaterial.SetTexture("_LightHaloTexture", _LightHaloTexture); - FogMaterial.SetFloat("_HaloOpticalDispersion", _HaloOpticalDispersion); - FogMaterial.SetFloat("_HaloWidth", _HaloWidth.Remap(0, 1, 10, 1)); - FogMaterial.SetFloat("_HaloIntensity", _HaloIntensity * 2000); - FogMaterial.SetFloat("_HaloRadius", _HaloRadius.Remap(0, 1, 2, .1f)); - FogMaterial.SetFloat("_HaloAbsorption", _HaloAbsorption.Remap(0, 1, 0, 16)); - } - - FogMaterial.SetVector("L", -Sun.transform.forward); - Shader.SetGlobalVector("L", -Sun.transform.forward); - FogMaterial.SetVector("_LightLocalDirection", LocalDirectionalSunLight(Sun)); - - if (EnableInscattering) - { - FogMaterial.SetFloat("_InscatteringIntensity", InscatteringIntensity * 50); - FogMaterial.SetFloat("InscatteringShape", InscatteringShape); - FogMaterial.SetFloat("InscatteringTransitionWideness", InscatteringTransitionWideness); - FogMaterial.SetColor("_InscatteringColor", InscatteringColor); - } - - if (VolumeFogInscattering) - { - FogMaterial.SetFloat("VolumeFogInscatteringIntensity", VolumeFogInscatteringIntensity * 50); - FogMaterial.SetFloat("VolumeFogInscatteringAnisotropy", VolumeFogInscatteringAnisotropy); - FogMaterial.SetColor("VolumeFogInscatteringColor", VolumeFogInscatteringColor); - VolumeFogInscatteringStartDistance = Mathf.Max(0, VolumeFogInscatteringStartDistance); - FogMaterial.SetFloat("VolumeFogInscatteringStartDistance", VolumeFogInscatteringStartDistance); - VolumeFogInscatteringTransitionWideness = Mathf.Max(.01f, VolumeFogInscatteringTransitionWideness); - FogMaterial.SetFloat("VolumeFogInscatteringTransitionWideness", VolumeFogInscatteringTransitionWideness); - } - - FogMaterial.SetColor("_LightColor", Sun.color * Sun.intensity); - - if (EnableNoise && _NoiseVolume != null) - { - FogMaterial.SetFloat("_NoiseDetailRange", _NoiseDetailRange * 1f); - FogMaterial.SetFloat("_Curl", _Curl); - if (_DirectionalLighting) - { - FogMaterial.SetFloat("_DirectionalLightingDistance", _DirectionalLightingDistance); - //FogMaterial.SetFloat("DirectionalLightingClamp", DirectionalLightingClamp); - FogMaterial.SetInt("DirectLightingShadowSteps", DirectLightingShadowSteps); - FogMaterial.SetFloat("DirectLightingShadowDensity", DirectLightingShadowDensity); - } - } - } - FogMaterial.SetFloat("_Cutoff", ShadowCutoff); - FogMaterial.SetFloat("Absorption", Absorption); - LightExtinctionColor.r = Mathf.Max(.1f, LightExtinctionColor.r); - LightExtinctionColor.g = Mathf.Max(.1f, LightExtinctionColor.g); - LightExtinctionColor.b = Mathf.Max(.1f, LightExtinctionColor.b); - FogMaterial.SetColor("LightExtinctionColor", LightExtinctionColor); - //if (Procedural) - // FogMaterial.EnableKeyword("USE_PROCEDURAL"); - //else - // FogMaterial.DisableKeyword("USE_PROCEDURAL"); - - //if (EnableNoise && _NoiseVolume) - //{ - if (Vortex > 0) - { - FogMaterial.SetFloat("_Vortex", Vortex); - FogMaterial.SetFloat("_Rotation", Mathf.Deg2Rad * rotation); - FogMaterial.SetFloat("_RotationSpeed", -RotationSpeed); - } - DetailDistance = Mathf.Max(1, DetailDistance); - FogMaterial.SetFloat("DetailDistance", DetailDistance); - FogMaterial.SetFloat("Octaves", Octaves); - FogMaterial.SetFloat("_DetailMaskingThreshold", _DetailMaskingThreshold); - //FogMaterial.SetFloat("_DetailSamplingBaseOpacityLimit", DetailSamplingBaseOpacityLimit); - // FogMaterial.SetTexture("_NoiseVolume", _NoiseVolume); - //FogMaterial.SetTexture("noise2D", noise2D); - FogMaterial.SetVector("_VolumePosition", gameObject.transform.position); - FogMaterial.SetFloat("gain", NoiseIntensity); - FogMaterial.SetFloat("threshold", NoiseContrast * 0.5f - 5); - FogMaterial.SetFloat("_3DNoiseScale", _3DNoiseScale * .001f); - FadeDistance = Mathf.Max(1, FadeDistance); - FogMaterial.SetFloat("FadeDistance", FadeDistance); - FogMaterial.SetFloat("STEP_COUNT", Iterations); - FogMaterial.SetFloat("DetailTiling", DetailTiling); - FogMaterial.SetFloat("BaseTiling", BaseTiling * .1f); - FogMaterial.SetFloat("Coverage", Coverage); - FogMaterial.SetFloat("NoiseDensity", NoiseDensity); - FogMaterial.SetVector("Speed", Speed * .1f); - FogMaterial.SetVector("Stretch", new Vector4(1, 1, 1, 1) + Stretch * .01f); - if (useHeightGradient) - { - //FogMaterial.SetFloat("GradMin", GradMin); - // FogMaterial.SetFloat("GradMax", GradMax); - FogMaterial.SetVector("_VerticalGradientParams", new Vector4(GradMin, GradMax, GradMin2, GradMax2)); - } - FogMaterial.SetColor("_AmbientColor", _AmbientColor); - - if (FogRenderer.lightProbeUsage == UnityEngine.Rendering.LightProbeUsage.UseProxyVolume) - _ProxyVolume = true; - else _ProxyVolume = false; - - FogMaterial.SetFloat("_ProxyVolume", _ProxyVolume == false ? 0 : 1); - //FogMaterial.SetFloat("Shade", Shade); - FogMaterial.SetFloat("ShadowBrightness", ShadowBrightness); - FogMaterial.SetFloat("_DetailRelativeSpeed", _DetailRelativeSpeed); - FogMaterial.SetFloat("_BaseRelativeSpeed", _BaseRelativeSpeed); - if (bSphericalFade) - { - SphericalFadeDistance = Mathf.Max(1, SphericalFadeDistance); - FogMaterial.SetFloat("SphericalFadeDistance", SphericalFadeDistance); - } - FogMaterial.SetVector("VolumeSize", new Vector4(fogVolumeScale.x, fogVolumeScale.y, fogVolumeScale.z, 0)); - // } - - FogMaterial.SetFloat("Exposure", Mathf.Max(0, Exposure)); - FogMaterial.SetFloat("Offset", Offset); - FogMaterial.SetFloat("Gamma", Gamma); - if (Gradient != null) - FogMaterial.SetTexture("_Gradient", Gradient); - - FogMaterial.SetFloat("InscatteringStartDistance", InscatteringStartDistance); - Vector3 VolumeSize = currentFogVolume; - FogMaterial.SetVector("_BoxMin", VolumeSize * -.5f); - FogMaterial.SetVector("_BoxMax", VolumeSize * .5f); - FogMaterial.SetColor("_Color", FogMainColor); - FogMaterial.SetColor("_FogColor", _FogColor); - FogMaterial.SetInt("_AmbientAffectsFogColor", _AmbientAffectsFogColor ? 1 : 0); - //FogMaterial.SetFloat("_SceneIntersectionThreshold", _SceneIntersectionThreshold); - - FogMaterial.SetFloat("_SceneIntersectionSoftness", _SceneIntersectionSoftness); - // FogMaterial.SetFloat("_RayStep", IterationStep * .001f); - FogMaterial.SetFloat("_RayStep", IterationStep * .001f); - FogMaterial.SetFloat("_OptimizationFactor", _OptimizationFactor); - FogMaterial.SetFloat("_Visibility", bVolumeFog && EnableNoise && - _NoiseVolume || EnableGradient ? Visibility * 100 : Visibility); - FogRenderer.sortingOrder = DrawOrder; - FogMaterial.SetInt("VolumeFogInscatterColorAffectedWithFogColor", VolumeFogInscatterColorAffectedWithFogColor ? 1 : 0); - FogMaterial.SetFloat("_FOV", GameCamera.fieldOfView); - FogMaterial.SetFloat("HeightAbsorption", HeightAbsorption); - FogMaterial.SetVector("_AmbientHeightAbsorption", new Vector4(HeightAbsorptionMin, HeightAbsorptionMax, HeightAbsorption, 0)); - FogMaterial.SetFloat("NormalDistance", NormalDistance); - FogMaterial.SetFloat("DirectLightingAmount", DirectLightingAmount); - DirectLightingDistance = Mathf.Max(1, DirectLightingDistance); - FogMaterial.SetFloat("DirectLightingDistance", DirectLightingDistance); - FogMaterial.SetFloat("LambertianBias", LambertianBias); - //if (SceneCollision) - FogMaterial.SetFloat("_jitter", _jitter); - FogMaterial.SetInt("SamplingMethod", (int)_SamplingMethod); - - //if (_FogVolumeRenderer) - FogMaterial.SetFloat("_PushAlpha", _PushAlpha); - - if (_ShadeNoise && EnableNoise) - { - FogMaterial.SetColor("_SelfShadowColor", _SelfShadowColor); - FogMaterial.SetInt("_SelfShadowSteps", _SelfShadowSteps); - FogMaterial.SetFloat("ShadowShift", ShadowShift); - } - - Profiler.EndSample(); - } - } - void LateUpdate() - { - - } - - public bool UseConvolvedLightshafts = false; - - void OnWillRenderObject() - { - GetShadowMap(); - -#if UNITY_EDITOR - ToggleKeyword(); - //since I can not set a Camera in DrawMesh (It blinks all the time), I have to make the surrogate not visible in Scene view - - if(Camera.current.name == "SceneCamera") - SurrogateMaterial.EnableKeyword("_EDITOR_WINDOW"); - else - SurrogateMaterial.DisableKeyword("_EDITOR_WINDOW"); - - Wireframe(FogVolumeGameObject, HideWireframe); - - if (ShadowProjector != null) - ShadowProjector.SetActive(CastShadows); - - //3.1.8 added && !ShadowCaster - if (ShadowCameraGO != null && !ShadowCaster) - ShadowCameraGO.SetActive(CastShadows); - - // FogMaterial.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha); -#endif - // if (SystemInfo.graphicsShaderLevel < 40) PointLightsActive = false; - if (PointLightsActive && SystemInfo.graphicsShaderLevel > 30) - { - _InitializeLightManagerIfNeccessary(); - if (m_lightManager != null) - { - if (PointLightsRealTimeUpdate) - { - m_lightManager.Deinitialize(); - if (PointLightBoxCheck) { m_lightManager.FindLightsInFogVolume(); } - else { m_lightManager.FindLightsInScene(); } - } - - if (m_lightManager.AlreadyUsesTransformForPoI == false) - { - m_lightManager.SetPointOfInterest(_FogVolumeData.GameCamera.transform); - } - - m_lightManager.ManualUpdate(ref FrustumPlanes); - } - FogMaterial.SetInt("_LightsCount", GetVisibleLightCount()); - } - else { _DeinitializeLightManagerIfNeccessary(); } - // else - // FogMaterial.SetInt("_LightsCount", 0); - - if (EnableDistanceFields) - { - _InitializePrimitiveManagerIfNeccessary(); - if (m_primitiveManager != null) - { - if (PrimitivesRealTimeUpdate) - { - m_primitiveManager.Deinitialize(); - m_primitiveManager.FindPrimitivesInFogVolume(); - - } - if (m_primitiveManager.AlreadyUsesTransformForPoI == false) - { - m_primitiveManager.SetPointOfInterest(_FogVolumeData.GameCamera.transform); - } - - m_primitiveManager.ManualUpdate(ref FrustumPlanes); - } - FogMaterial.SetInt("_PrimitivesCount", GetVisiblePrimitiveCount()); - } - else { _DeinitializePrimitiveManagerIfNeccessary(); } - //CreatePrimitiveList(); - - //3.1.7 maybe not! - //else - //if (PrimitivesList != null) - // if (PrimitivesList.Count > 0) - // PrimitivesList.Clear(); - - if (RT_Opacity != null) - { - - Shader.SetGlobalTexture("RT_Opacity", RT_Opacity); - - if (UseConvolvedLightshafts) - { - FogMaterial.SetTexture("LightshaftTex", RT_OpacityBlur); - - } - else - { - FogMaterial.SetTexture("LightshaftTex", RT_Opacity); - - } - } - - UpdateParams(); - if (!RenderableInSceneView && (Camera.current.name == "SceneCamera")) - { - // FogMaterial.EnableKeyword("RENDER_SCENE_VIEW"); - FogMaterial.SetVector("_BoxMin", new Vector3(0, 0, 0)); - FogMaterial.SetVector("_BoxMax", new Vector3(0, 0, 0)); - } - else - { - // FogMaterial.DisableKeyword("RENDER_SCENE_VIEW"); - FogMaterial.SetVector("_BoxMin", currentFogVolume * -.5f); - FogMaterial.SetVector("_BoxMax", currentFogVolume * .5f); - } - - //FogMaterial.DisableKeyword("RENDER_SCENE_VIEW"); - } - - void ToggleKeyword() - { - if (IsVisible) - { - Profiler.BeginSample("FogVolume KEYWORDS"); - - if (_jitter > 0) - FogMaterial.EnableKeyword("JITTER"); - else - FogMaterial.DisableKeyword("JITTER"); - - if (_DebugMode != DebugMode.Lit) - FogMaterial.EnableKeyword("DEBUG"); - else - FogMaterial.DisableKeyword("DEBUG"); - - switch (_SamplingMethod) - { - case SamplingMethod.Eye2Box: - FogMaterial.DisableKeyword("SAMPLING_METHOD_ViewAligned"); - FogMaterial.EnableKeyword("SAMPLING_METHOD_Eye2Box"); - break; - - case SamplingMethod.ViewAligned: - FogMaterial.EnableKeyword("SAMPLING_METHOD_ViewAligned"); - FogMaterial.DisableKeyword("SAMPLING_METHOD_Eye2Box"); - break; - } - - - if (LightHalo && _LightHaloTexture) - FogMaterial.EnableKeyword("HALO"); - else - FogMaterial.DisableKeyword("HALO"); - - if (ShadowCaster != null) - { - if (ShadowCaster.SunAttached == true) - { - FogMaterial.EnableKeyword("LIGHT_ATTACHED"); - } - if (ShadowCaster.SunAttached == false) - { - FogMaterial.DisableKeyword("LIGHT_ATTACHED"); - - } - } - - if (Vortex > 0) - { - FogMaterial.EnableKeyword("Twirl"); - //print((int)_VortexAxis); - switch (_VortexAxis) - { - case VortexAxis.X: - FogMaterial.EnableKeyword("Twirl_X"); - FogMaterial.DisableKeyword("Twirl_Y"); - FogMaterial.DisableKeyword("Twirl_Z"); - break; - - case VortexAxis.Y: - FogMaterial.DisableKeyword("Twirl_X"); - FogMaterial.EnableKeyword("Twirl_Y"); - FogMaterial.DisableKeyword("Twirl_Z"); - break; - - case VortexAxis.Z: - FogMaterial.DisableKeyword("Twirl_X"); - FogMaterial.DisableKeyword("Twirl_Y"); - FogMaterial.EnableKeyword("Twirl_Z"); - break; - } - } - else - { - FogMaterial.DisableKeyword("Twirl_X"); - FogMaterial.DisableKeyword("Twirl_Y"); - FogMaterial.DisableKeyword("Twirl_Z"); - } - if (Lambert && Sun && EnableNoise) - FogMaterial.EnableKeyword("_LAMBERT_SHADING"); - else - FogMaterial.DisableKeyword("_LAMBERT_SHADING"); - - - - - - //POINTLIGHTS - if (/*PointLightsList != null && PointLightsList.Count > 0 &&*/ - PointLightsActive && SystemInfo.graphicsShaderLevel > 30) - { - // FogMaterial.EnableKeyword("POINTLIGHTS");//not in use anymore, not needed - - switch (_LightScatterMethod) - { - case LightScatterMethod.BeersLaw: - FogMaterial.EnableKeyword("ATTEN_METHOD_1"); - FogMaterial.DisableKeyword("ATTEN_METHOD_2"); - FogMaterial.DisableKeyword("ATTEN_METHOD_3"); - // FogMaterial.DisableKeyword("ATTEN_METHOD_4"); - break; - - case LightScatterMethod.InverseSquare: - FogMaterial.DisableKeyword("ATTEN_METHOD_1"); - FogMaterial.EnableKeyword("ATTEN_METHOD_2"); - FogMaterial.DisableKeyword("ATTEN_METHOD_3"); - // FogMaterial.DisableKeyword("ATTEN_METHOD_4"); - break; - - //case LightScatterMethod.Gaussian: - // FogMaterial.DisableKeyword("ATTEN_METHOD_1"); - // FogMaterial.DisableKeyword("ATTEN_METHOD_2"); - // FogMaterial.EnableKeyword("ATTEN_METHOD_3"); - // FogMaterial.DisableKeyword("ATTEN_METHOD_4"); - // break; - - - case LightScatterMethod.Linear: - FogMaterial.DisableKeyword("ATTEN_METHOD_1"); - FogMaterial.DisableKeyword("ATTEN_METHOD_2"); - FogMaterial.EnableKeyword("ATTEN_METHOD_3"); - // FogMaterial.EnableKeyword("ATTEN_METHOD_4"); - break; - } - } - else - { - FogMaterial.DisableKeyword("ATTEN_METHOD_1"); - FogMaterial.DisableKeyword("ATTEN_METHOD_2"); - FogMaterial.DisableKeyword("ATTEN_METHOD_3"); - } - - ////////////////// - if (EnableNoise && _NoiseVolume && useHeightGradient) - FogMaterial.EnableKeyword("HEIGHT_GRAD"); - else - FogMaterial.DisableKeyword("HEIGHT_GRAD"); - - if (ColorAdjust) - FogMaterial.EnableKeyword("ColorAdjust"); - else - FogMaterial.DisableKeyword("ColorAdjust"); - - if (bVolumeFog) - FogMaterial.EnableKeyword("VOLUME_FOG"); - else - FogMaterial.DisableKeyword("VOLUME_FOG"); - - if (FogMaterial) - { - if (EnableGradient && Gradient != null) - FogMaterial.EnableKeyword("_FOG_GRADIENT"); - else - FogMaterial.DisableKeyword("_FOG_GRADIENT"); - - // if (EnableNoise && !SystemInfo.supports3DTextures) - // Debug.Log("Noise not supported. SM level found: " + SystemInfo.graphicsShaderLevel / 10); - - if (EnableNoise/* && SystemInfo.supports3DTextures*/) - FogMaterial.EnableKeyword("_FOG_VOLUME_NOISE"); - else - { - FogMaterial.DisableKeyword("_FOG_VOLUME_NOISE"); - } - - if (EnableInscattering && Sun && Sun.enabled && Sun.isActiveAndEnabled) - FogMaterial.EnableKeyword("_INSCATTERING"); - else - FogMaterial.DisableKeyword("_INSCATTERING"); - - if (VolumeFogInscattering && Sun && Sun.enabled && bVolumeFog) - FogMaterial.EnableKeyword("_VOLUME_FOG_INSCATTERING"); - else - FogMaterial.DisableKeyword("_VOLUME_FOG_INSCATTERING"); - - //if (SceneCollision) - FogMaterial.SetFloat("Collisions", SceneCollision ? 1 : 0); - // FogMaterial.EnableKeyword("_COLLISION"); - // else - // FogMaterial.DisableKeyword("_COLLISION"); - - if (ShadowShift > 0 && EnableNoise && Sun && _ShadeNoise) - FogMaterial.EnableKeyword("_SHADE"); - else - FogMaterial.DisableKeyword("_SHADE"); - - //if (EnableNoise && DoubleLayer && SystemInfo.supports3DTextures) - // FogMaterial.EnableKeyword("_DOUBLE_LAYER"); - //else - // FogMaterial.DisableKeyword("_DOUBLE_LAYER"); - - if (Tonemap) - FogMaterial.EnableKeyword("_TONEMAP"); - else - FogMaterial.DisableKeyword("_TONEMAP"); - - if (bSphericalFade) - FogMaterial.EnableKeyword("SPHERICAL_FADE"); - else - FogMaterial.DisableKeyword("SPHERICAL_FADE"); - - if (/*m_primitiveManager != null && m_primitiveManager.VisiblePrimitiveCount > 0 &&*/ EnableDistanceFields) - FogMaterial.EnableKeyword("DF"); - else - FogMaterial.DisableKeyword("DF"); - - if (bAbsorption) - FogMaterial.EnableKeyword("ABSORPTION"); - else - FogMaterial.DisableKeyword("ABSORPTION"); - - if (_DirectionalLighting && EnableNoise && _NoiseVolume != null && _DirectionalLightingDistance > 0 && DirectLightingShadowDensity > 0) - FogMaterial.EnableKeyword("DIRECTIONAL_LIGHTING"); - else - FogMaterial.DisableKeyword("DIRECTIONAL_LIGHTING"); - } - Profiler.EndSample(); - } - } - - - public void UpdateBoxMesh() - { - if (currentFogVolume != fogVolumeScale || filter == null) - { - CreateBoxMesh(fogVolumeScale); - //update shadow camera too - ShadowMapSetup(); - //update collider bounds - _BoxCollider.size = fogVolumeScale; - m_hasUpdatedBoxMesh = true; - } - transform.localScale = Vector3.one;//otherwise, it won't work correctly - } - - public bool HasUpdatedBoxMesh - { - get - { - bool ret = m_hasUpdatedBoxMesh; - m_hasUpdatedBoxMesh = false; - return ret; - } - } - - private bool m_hasUpdatedBoxMesh = false; - - void CreateBoxMesh(Vector3 scale) - { - currentFogVolume = scale; - - // You can change that line to provide another MeshFilter - if (filter == null) - filter = gameObject.AddComponent(); - - if (mesh == null) - { - mesh = new Mesh(); - mesh.name = gameObject.name; - filter.sharedMesh = mesh; - } - mesh.Clear(); - - - - float width = scale.y; - float height = scale.z; - float length = scale.x; - - #region Vertices - Vector3 p0 = new Vector3(-length * .5f, -width * .5f, height * .5f); - Vector3 p1 = new Vector3(length * .5f, -width * .5f, height * .5f); - Vector3 p2 = new Vector3(length * .5f, -width * .5f, -height * .5f); - Vector3 p3 = new Vector3(-length * .5f, -width * .5f, -height * .5f); - - Vector3 p4 = new Vector3(-length * .5f, width * .5f, height * .5f); - Vector3 p5 = new Vector3(length * .5f, width * .5f, height * .5f); - Vector3 p6 = new Vector3(length * .5f, width * .5f, -height * .5f); - Vector3 p7 = new Vector3(-length * .5f, width * .5f, -height * .5f); - - Vector3[] vertices = new Vector3[] - { - // Bottom - p0, p1, p2, p3, - - // Left - p7, p4, p0, p3, - - // Front - p4, p5, p1, p0, - - // Back - p6, p7, p3, p2, - - // Right - p5, p6, p2, p1, - - // Top - p7, p6, p5, p4 - }; - #endregion - - #region Normales - Vector3 up = Vector3.up; - Vector3 down = Vector3.down; - Vector3 front = Vector3.forward; - Vector3 back = Vector3.back; - Vector3 left = Vector3.left; - Vector3 right = Vector3.right; - - Vector3[] normales = new Vector3[] - { - // Bottom - down, down, down, down, - - // Left - left, left, left, left, - - // Front - front, front, front, front, - - // Back - back, back, back, back, - - // Right - right, right, right, right, - - // Top - up, up, up, up - }; - #endregion - - #region UVs - Vector2 _00 = new Vector2(0f, 0f); - Vector2 _10 = new Vector2(1f, 0f); - Vector2 _01 = new Vector2(0f, 1f); - Vector2 _11 = new Vector2(1f, 1f); - - Vector2[] uvs = new Vector2[] - { - // Bottom - _11, _01, _00, _10, - - // Left - _11, _01, _00, _10, - - // Front - _11, _01, _00, _10, - - // Back - _11, _01, _00, _10, - - // Right - _11, _01, _00, _10, - - // Top - _11, _01, _00, _10, - }; - #endregion - - #region Triangles - int[] triangles = new int[] - { - // Bottom - 3, 1, 0, - 3, 2, 1, - - // Left - 3 + 4 * 1, 1 + 4 * 1, 0 + 4 * 1, - 3 + 4 * 1, 2 + 4 * 1, 1 + 4 * 1, - - // Front - 3 + 4 * 2, 1 + 4 * 2, 0 + 4 * 2, - 3 + 4 * 2, 2 + 4 * 2, 1 + 4 * 2, - - // Back - 3 + 4 * 3, 1 + 4 * 3, 0 + 4 * 3, - 3 + 4 * 3, 2 + 4 * 3, 1 + 4 * 3, - - // Right - 3 + 4 * 4, 1 + 4 * 4, 0 + 4 * 4, - 3 + 4 * 4, 2 + 4 * 4, 1 + 4 * 4, - - // Top - 3 + 4 * 5, 1 + 4 * 5, 0 + 4 * 5, - 3 + 4 * 5, 2 + 4 * 5, 1 + 4 * 5, - - }; - #endregion - - mesh.vertices = vertices; - mesh.triangles = triangles; - mesh.normals = normales; - mesh.uv = uvs; - mesh.RecalculateBounds(); - ; - } - //won't work if the icon is not in Assets/Gizmos - //void OnDrawGizmosSelected() - //{ - - // Gizmos.DrawIcon(transform.position, "FogVolume/Gizmos/FogVolumeIcon.png", true); - //} - - - private FogVolumeLightManager m_lightManager = null; - - - private void _InitializeLightManagerIfNeccessary() - { - if (m_lightManager == null) - { - m_lightManager = GetComponent(); - if (m_lightManager == null) - { - m_lightManager = gameObject.AddComponent(); - } - m_lightManager.Initialize(); - if (PointLightBoxCheck) - { - m_lightManager.FindLightsInFogVolume(); - } - else - { - m_lightManager.FindLightsInScene(); - } - } - } - - - private void _DeinitializeLightManagerIfNeccessary() - { - if (m_lightManager != null) - { - m_lightManager.Deinitialize(); - } - } - - public int GetVisibleLightCount() - { - if (m_lightManager != null) { return m_lightManager.VisibleLightCount; } - return 0; - } - public int GetTotalLightCount() - { - if (m_lightManager != null) { return m_lightManager.CurrentLightCount; } - return 0; - } - - - private FogVolumePrimitiveManager m_primitiveManager; - - private void _InitializePrimitiveManagerIfNeccessary() - { - if (m_primitiveManager == null) - { - m_primitiveManager = GetComponent(); - if (m_primitiveManager == null) - { - m_primitiveManager = gameObject.AddComponent(); - } - m_primitiveManager.Initialize(); - m_primitiveManager.FindPrimitivesInFogVolume(); - } - } - - private void _DeinitializePrimitiveManagerIfNeccessary() - { - if (m_primitiveManager != null) { m_primitiveManager.Deinitialize(); } - } - - public int GetVisiblePrimitiveCount() - { - if (m_primitiveManager != null) { return m_primitiveManager.VisiblePrimitiveCount; } - - return 0; - } - - public int GetTotalPrimitiveCount() - { - if (m_primitiveManager != null) { return m_primitiveManager.CurrentPrimitiveCount; } - - return 0; - } -} - diff --git a/Assets/FogVolume/Scripts/FogVolume.cs.meta b/Assets/FogVolume/Scripts/FogVolume.cs.meta deleted file mode 100644 index 491ff5c..0000000 --- a/Assets/FogVolume/Scripts/FogVolume.cs.meta +++ /dev/null @@ -1,29 +0,0 @@ -fileFormatVersion: 2 -guid: 5e7a52d786954b246ab3797052502655 -timeCreated: 1503131861 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: - - ShadowCaster: {instanceID: 0} - - _PerformanceLUT: {fileID: 2800000, guid: f651c771afb96204b85e925622f5e2b9, type: 3} - - Sun: {instanceID: 0} - - _LightHaloTexture: {fileID: 2800000, guid: fa2064f3c8dffc04f93f4f74eae0d72f, type: 3} - - CoverageTex: {instanceID: 0} - - GameCameraGO: {instanceID: 0} - - _NoiseVolume2: {fileID: 11700000, guid: ce515a5a715cb574eb40037cfb1ab766, type: 2} - - _NoiseVolume: {fileID: 11700000, guid: ce515a5a715cb574eb40037cfb1ab766, type: 2} - - FogRenderer: {instanceID: 0} - - Gradient: {fileID: 2800000, guid: 132bd45e1d3746f4ba36d53d9e19b1c9, type: 3} - - RT_Opacity: {instanceID: 0} - - RT_OpacityBlur: {instanceID: 0} - - ShadowCameraGO: {instanceID: 0} - - _ShadowCamera: {instanceID: 0} - - FogVolumeShader: {fileID: 4800000, guid: 6040e6c91df9d9d47b7e5426d41a7471, type: 3} - - ShadowProjector: {instanceID: 0} - - ShadowProjectorMesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} - executionOrder: 0 - icon: {fileID: 2800000, guid: 925eb9f7b0e73dd438a616124964bba8, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/FogVolumeCreator.cs b/Assets/FogVolume/Scripts/FogVolumeCreator.cs deleted file mode 100644 index 7e1ead7..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeCreator.cs +++ /dev/null @@ -1,183 +0,0 @@ -#if UNITY_EDITOR -using UnityEngine; - -using UnityEditor; - -using System.Reflection; - - -public class FogVolumeCreator : Editor -{ - [MenuItem("GameObject/Create Other/Fog Volume")] - [MenuItem("Fog Volume/Create Fog Volume")] - public static void CreateFogVolume() - { - var FogVolume = new GameObject(); - - //Icon stuff - var Icon = Resources.Load("FogVolumeIcon") as Texture; - - //Icon.hideFlags = HideFlags.HideAndDontSave; - var editorGUI = typeof(EditorGUIUtility); - var bindingFlags = BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.NonPublic; - var args = new object[] - { - FogVolume, - Icon - }; - editorGUI.InvokeMember("SetIconForObject", bindingFlags, null, null, args); - - FogVolume.name = "Fog Volume"; - FogVolume.AddComponent(); - FogVolume.AddComponent(); - FogVolume.GetComponent().shadowCastingMode = - UnityEngine.Rendering.ShadowCastingMode.Off; - FogVolume.GetComponent().receiveShadows = false; - FogVolume.GetComponent().reflectionProbeUsage = - UnityEngine.Rendering.ReflectionProbeUsage.Off; - FogVolume.GetComponent().lightProbeUsage = - UnityEngine.Rendering.LightProbeUsage.Off; - Selection.activeObject = FogVolume; - if (SceneView.currentDrawingSceneView) - { - SceneView.currentDrawingSceneView.MoveToView(FogVolume.transform); - } - } - - - //============================================================================================= - // L I G H T S - //============================================================================================= - - [MenuItem("GameObject/Create Other/Fog Volume Light/Fog Volume Point Light")] - [MenuItem("Fog Volume/Create Light/Fog Volume Point Light")] - public static void CreateFogVolumePointLight() - { - var fogVolumeLight = new GameObject("FogVolumePointLight"); - var light = fogVolumeLight.AddComponent(); - light.IsPointLight = true; - light.IsAddedToNormalLight = false; - } - - [MenuItem("GameObject/Create Other/Fog Volume Light/Fog Volume Spot Light")] - [MenuItem("Fog Volume/Create Light/Fog Volume Spot Light")] - public static void CreateFogVolumeSpotLight() - { - var fogVolumeLight = new GameObject("FogVolumeSpotLight"); - var light = fogVolumeLight.AddComponent(); - light.IsPointLight = false; - light.IsAddedToNormalLight = false; - } - - [MenuItem("Fog Volume/Create Light/Fog Volume Directional Light")] - public static void AutoCreateFogVolumeDirectionalLight() - { - var lights = FindObjectsOfType(); - for (var i = 0; i < lights.Length; i++) - { - var light = lights[i]; - if (light.type == LightType.Directional) - { - if (light.GetComponent() == null) - { - var dirLight = light.gameObject.AddComponent(); - var fogVolumes = FindObjectsOfType(); - dirLight._TargetFogVolumes = new FogVolume[fogVolumes.Length]; - for (var k = 0; k < fogVolumes.Length; k++) - { - dirLight._TargetFogVolumes[k] = fogVolumes[k]; - } - } - } - } - } - - [MenuItem("Fog Volume/Create Light/Fog Volume Directional Light", true)] - public static bool EnableCreateFogVolumeDirectionalLight() - { - return FindObjectOfType() == null && - FindObjectOfType() != null; - } - [MenuItem("GameObject/Create Other/Fog Volume Light/Normal Point Light")] - [MenuItem("Fog Volume/Create Light/Normal Point Light")] - public static void CreateNormalPointLight() - { - var normalPointLight = new GameObject("Point light"); - var light = normalPointLight.AddComponent(); - light.type = LightType.Point; - var fvLight = normalPointLight.AddComponent(); - fvLight.IsPointLight = true; - fvLight.IsAddedToNormalLight = true; - } - - [MenuItem("GameObject/Create Other/Fog Volume Light/Normal Spot Light")] - [MenuItem("Fog Volume/Create Light/Normal Spot Light")] - public static void CreateNormalSpotLight() - { - var normalPointLight = new GameObject("Spot light"); - var light = normalPointLight.AddComponent(); - light.type = LightType.Spot; - var fvLight = normalPointLight.AddComponent(); - fvLight.IsPointLight = false; - fvLight.IsAddedToNormalLight = true; - } - - - //============================================================================================= - // P R I M I T I V E S - //============================================================================================= - - [MenuItem("Fog Volume/Create Primitive/Fog Volume Primitive Box")] - [MenuItem("GameObject/Create Other/Fog Volume Primitive/Box")] - static public void CreateFogVolumePrimitiveBox() - { - GameObject FogVolumePrimitive = GameObject.CreatePrimitive(PrimitiveType.Cube); - //Icon stuff - //Texture Icon = Resources.Load("FogVolumePrimitiveIcon") as Texture; - //Icon.hideFlags = HideFlags.HideAndDontSave; - // var editorGUI = typeof(EditorGUIUtility); - // var bindingFlags = BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.NonPublic; - //var args = new object[] { FogVolumePrimitive, Icon }; - //editorGUI.InvokeMember("SetIconForObject", bindingFlags, null, null, args); - - FogVolumePrimitive.name = "Fog Volume Primitive Box"; - - FogVolumePrimitive.GetComponent().isTrigger = true; - - FogVolumePrimitive.GetComponent().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; - FogVolumePrimitive.GetComponent().receiveShadows = false; - FogVolumePrimitive.GetComponent().reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Off; - FogVolumePrimitive.GetComponent().lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; - Selection.activeObject = FogVolumePrimitive; - if (UnityEditor.SceneView.currentDrawingSceneView) UnityEditor.SceneView.currentDrawingSceneView.MoveToView(FogVolumePrimitive.transform); - FogVolumePrimitive.AddComponent(); - } - - - [MenuItem("Fog Volume/Create Primitive/Fog Volume Primitive Sphere")] - [MenuItem("GameObject/Create Other/Fog Volume Primitive/Sphere")] - static public void CreateFogVolumePrimitiveSphere() - { - GameObject FogVolumePrimitive = GameObject.CreatePrimitive(PrimitiveType.Sphere); - //Icon stuff - //Texture Icon = Resources.Load("FogVolumePrimitiveIcon") as Texture; - //Icon.hideFlags = HideFlags.HideAndDontSave; - // var editorGUI = typeof(EditorGUIUtility); - // var bindingFlags = BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.NonPublic; - //var args = new object[] { FogVolumePrimitive, Icon }; - //editorGUI.InvokeMember("SetIconForObject", bindingFlags, null, null, args); - - FogVolumePrimitive.name = "Fog Volume Primitive Sphere"; - - FogVolumePrimitive.GetComponent().isTrigger = true; - - FogVolumePrimitive.GetComponent().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; - FogVolumePrimitive.GetComponent().receiveShadows = false; - FogVolumePrimitive.GetComponent().reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Off; - FogVolumePrimitive.GetComponent().lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; - Selection.activeObject = FogVolumePrimitive; - if (UnityEditor.SceneView.currentDrawingSceneView) UnityEditor.SceneView.currentDrawingSceneView.MoveToView(FogVolumePrimitive.transform); - FogVolumePrimitive.AddComponent(); - } -} -#endif diff --git a/Assets/FogVolume/Scripts/FogVolumeData.cs b/Assets/FogVolume/Scripts/FogVolumeData.cs deleted file mode 100644 index 943e4b7..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeData.cs +++ /dev/null @@ -1,205 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -[ExecuteInEditMode] - -public class FogVolumeData : MonoBehaviour -{ - [SerializeField] - bool _ForceNoRenderer; - public bool ForceNoRenderer - { - get { return _ForceNoRenderer; } - set - { - if (_ForceNoRenderer != value) - { - _ForceNoRenderer = value; - ToggleFogVolumeRenderers(); - } - } - } - [SerializeField] - Camera _GameCamera; - - public Camera GameCamera - { - get { return _GameCamera; } - set - { - if (_GameCamera != value) - { - _GameCamera = value; - RefreshCamera(); - } - } - } - - public void setDownsample(int val) - { - if (_GameCamera.GetComponent()) - _GameCamera.GetComponent()._Downsample = val; - } - - void RefreshCamera() - { - //refresh all fog folumes assigned camera - //print("Refresh"); - - FindFogVolumes(); - foreach (FogVolume _FogVolumes in SceneFogVolumes) - { - _FogVolumes.AssignCamera(); - } - ToggleFogVolumeRenderers(); - } - - [SerializeField] - List FoundCameras; - - void OnEnable() - { - Initialize(); - - } - - void Initialize() - { - if (FoundCameras == null) - FoundCameras = new List(); - FindCamera(); - RefreshCamera(); - if (FoundCameras.Count == 0) - Debug.Log("Definetly, no camera available for Fog Volume"); - } - - [SerializeField] - FogVolume[] SceneFogVolumes; - - public void FindFogVolumes() - { - SceneFogVolumes = (FogVolume[])FindObjectsOfType(typeof(FogVolume)); - } - - void Update() - { - - if (GameCamera == null) - { - Debug.Log("No Camera available for Fog Volume. Trying to find another one"); - Initialize(); - } - - #if UNITY_EDITOR - for (int i = 0; i < SceneFogVolumes.Length; i++) - { - FogVolume SlotFogVolume = SceneFogVolumes[i]; - if(SlotFogVolume==null) - { - //reset and rebuild - SceneFogVolumes = null; - FindFogVolumes(); - } - } - - - if (SceneFogVolumes.Length == 0) - DestroyImmediate(gameObject); -#endif - - - } - void ToggleFogVolumeRenderers() - { - if (FoundCameras != null) - for (int i = 0; i < FoundCameras.Count; i++) - { - if (FoundCameras[i] != _GameCamera) - { - if (FoundCameras[i].GetComponent()) - FoundCameras[i].GetComponent().enabled = false; - } - else if (FoundCameras[i].GetComponent() && - !_ForceNoRenderer) - { - FoundCameras[i].GetComponent().enabled = true; - } - else - { - var FVRenderer = FoundCameras[i].GetComponent(); - if (FVRenderer == null) - { - if (ForceNoRenderer) { continue; } - FVRenderer = FoundCameras[i].gameObject.AddComponent(); - } - - if(ForceNoRenderer) - { - FVRenderer.enabled = false; - } - } - } - } - public void FindCamera() - { - //We will try to assign the typical MainCamera first. This search will be performed only when the field is null - //This is just an initial attempt on assigning any camera available when the field 'Camera' is null. - //We will be able to select any other camera later - if (FoundCameras != null && FoundCameras.Count > 0) FoundCameras.Clear(); - //Find all cameras in scene and store - Camera[] CamerasFound = (Camera[])FindObjectsOfType(typeof(Camera)); - for (int i = 0; i < CamerasFound.Length; i++) - if ( - !CamerasFound[i].name.Contains("FogVolumeCamera") - && - !CamerasFound[i].name.Contains("Shadow Camera") - && - CamerasFound[i].gameObject.hideFlags == HideFlags.None)//not you! - FoundCameras.Add(CamerasFound[i]); - - if (GameCamera == null) - GameCamera = Camera.main; - - //No MainCamera? Try to find any! - if (GameCamera == null) - { - foreach (Camera FoundCamera in FoundCameras) - { - // Many effects may use hidden cameras, so let's filter a little bit until we get something valid - if (FoundCamera.isActiveAndEnabled) - if (FoundCamera.gameObject.activeInHierarchy) - if (FoundCamera.gameObject.hideFlags == HideFlags.None) - { - GameCamera = FoundCamera; - break; - } - } - } - - if (GameCamera != null) - { - // Debug.Log("Fog Volume has been assigned with camera: " + GameCamera); - //if (FindObjectOfType()) - // FindObjectOfType().SceneCamera = GameCamera; - - //NOTE: This makes sure we have a depth texture which will be either free (deferred, etc) or internally generated through a replacement shader - //Now, objects must be able to do shadow casting. If you’re using surface shaders, add the "addshadow" directive - //only “opaque” objects (that which have their materials and shaders setup to use render queue <= 2500) are rendered into the depth texture. - //GameCamera.depthTextureMode = DepthTextureMode.Depth; - } - - } - public Camera GetFogVolumeCamera - { - get - { - return GameCamera; - } - } - - void OnDisable() - { - FoundCameras.Clear(); - SceneFogVolumes = null; - } -} diff --git a/Assets/FogVolume/Scripts/FogVolumeData.cs.meta b/Assets/FogVolume/Scripts/FogVolumeData.cs.meta deleted file mode 100644 index ce6864e..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeData.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9b5fee381bc7db44db761f5cc13c71d5 -timeCreated: 1491065420 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/FogVolumeDirectionalLight.cs b/Assets/FogVolume/Scripts/FogVolumeDirectionalLight.cs deleted file mode 100644 index a26783b..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeDirectionalLight.cs +++ /dev/null @@ -1,521 +0,0 @@ -using UnityEngine; -using UnityEngine.UI; -/*not working on android*/ -[ExecuteInEditMode] -public class FogVolumeDirectionalLight : MonoBehaviour -{ - public FogVolume[] _TargetFogVolumes; - public Vector2 MiniaturePosition = new Vector2(110, 320); - public FogVolume _ProminentFogVolume = null; - - // [HideInInspector] - public Material FogVolumeMaterial; - - public float _CameraVerticalPosition = 500; - - RenderTexture depthRT; - - public enum Resolution - { - _256 = 256, - - _512 = 512, - - _1024 = 1024, - - _2048 = 2048, - - _4096 = 4096 - }; - public enum Antialiasing - { - _1 = 1, - - _2 = 2, - - _4 = 4, - - _8 = 8 - }; - - public Antialiasing _Antialiasing = Antialiasing._1; - - public Resolution Size = Resolution._512; - - // [Range(10, 300)] - // float CameraSize = 100; - //public bool ToggleKeyword = true; - // [HideInInspector] - public Camera ShadowCamera; - - public enum ScaleMode - { - VolumeMaxAxis, - - Manual - }; - - public float _FogVolumeShadowMapEdgeSoftness = 0.001f; - - public ScaleMode _ScaleMode = ScaleMode.VolumeMaxAxis; - - public LayerMask LayersToRender; - - [HideInInspector] - public Shader outputDepth; - - [HideInInspector] - public GameObject GOShadowCamera; - - public bool CameraVisible; - - public enum UpdateMode - { - OnStart, - - Interleaved - }; - - Image _CanvasImage; - - public UpdateMode _UpdateMode = UpdateMode.Interleaved; - - public float Scale = 50; - - [Range(0, 100)] - public int SkipFrames = 2; - - // CanvasRenderer DebugCanvas; - public bool ShowMiniature = false; - - GameObject _GO_Canvas, _GO_Image; - - Canvas _Canvas; - - public Material DebugViewMaterial; - - GameObject Quad; - - Vector3 FocusPosition; - - FogVolumeData _FogVolumeData; - - Camera _GameCamera; - - public enum FocusMode - { - VolumeCenter, - - GameCameraPosition, - - GameObject - }; - - public Transform _GameObjectFocus; - - public FocusMode _FocusMode = FocusMode.VolumeCenter; - - Material quadMaterial = null; - - public Material QuadMaterial - { - get - { - if (quadMaterial == null) { CreateMaterial(); } - return quadMaterial; - } - } - - public Shader quadShader; - - void OnEnable() - { - _GO_Canvas = GameObject.Find("FogVolume Debug Canvas"); - if (!_GO_Canvas) _GO_Canvas = new GameObject("FogVolume Debug Canvas"); - _GO_Image = GameObject.Find("FogVolume Image"); - if (!_GO_Image) - { - _GO_Image = new GameObject("FogVolume Image"); - _CanvasImage = _GO_Image.AddComponent(); - _CanvasImage.material = DebugViewMaterial; - - _CanvasImage.rectTransform.position = new Vector3(MiniaturePosition.x, MiniaturePosition.y, 0); - _CanvasImage.rectTransform.pivot = new Vector2(.5f, .5f); - _CanvasImage.rectTransform.anchorMax = new Vector2(0, 0); - _CanvasImage.rectTransform.anchorMin = new Vector2(0, 0); - _CanvasImage.rectTransform.localScale = new Vector3(2, 2, 2); - } - - if (!_CanvasImage) _CanvasImage = _GO_Image.GetComponent(); - _CanvasImage.material = DebugViewMaterial; - _GO_Image.transform.SetParent(_GO_Canvas.transform); - _GO_Canvas.AddComponent(); - _GO_Canvas.GetComponent().scaleFactor = 1; - _GO_Canvas.GetComponent().referencePixelsPerUnit = 100; - _Canvas = _GO_Canvas.GetComponent(); // ("Debug view canvas"); - _GO_Canvas.hideFlags = HideFlags.HideInHierarchy; - - // DebugCanvas = _GO_Canvas.AddComponent(); - _GO_Canvas.layer = LayerMask.NameToLayer("UI"); - _GO_Image.layer = LayerMask.NameToLayer("UI"); - - _Canvas.renderMode = RenderMode.ScreenSpaceOverlay; - - Initialize(); - - if (_UpdateMode == UpdateMode.OnStart) { Render(); } - } - - void CreateMaterial() - { - DestroyImmediate(quadMaterial); - quadShader = Shader.Find("Hidden/DepthMapQuad"); - - // - quadMaterial = new Material(quadShader); - quadMaterial.name = "Depth camera quad material"; - quadMaterial.hideFlags = HideFlags.HideAndDontSave; - } - RenderTextureFormat rt_DepthFormat; - void Initialize() - { - CreateMaterial(); - - if (SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.RGFloat)) - rt_DepthFormat = RenderTextureFormat.RGFloat; - else - rt_DepthFormat = RenderTextureFormat.DefaultHDR; - - GameObject FogVolumeDataGO = GameObject.Find("Fog Volume Data"); - if (FogVolumeDataGO) _FogVolumeData = FogVolumeDataGO.GetComponent(); - else return; - - _GameCamera = _FogVolumeData.GameCamera; - - GOShadowCamera = GameObject.Find("FogVolumeShadowCamera"); - if (!GOShadowCamera) - { - GOShadowCamera = new GameObject(); - GOShadowCamera.name = "FogVolumeShadowCamera"; - } - - if (!GOShadowCamera) print("Shadow camera is lost"); - else ShadowCamera = GOShadowCamera.GetComponent(); - - if (!depthRT) - { - depthRT = new RenderTexture((int) Size, (int) Size, 16, rt_DepthFormat); - depthRT.antiAliasing = (int) _Antialiasing; - depthRT.filterMode = FilterMode.Bilinear; - depthRT.name = "FogVolumeShadowMap"; - depthRT.wrapMode = TextureWrapMode.Clamp; - } - - if (!ShadowCamera) ShadowCamera = GOShadowCamera.AddComponent(); - else ShadowCamera = GOShadowCamera.GetComponent(); - - ShadowCamera.clearFlags = CameraClearFlags.Color; - ShadowCamera.backgroundColor = Color.black; - ShadowCamera.orthographic = true; - ShadowCamera.farClipPlane = 10000.0f; - ShadowCamera.enabled = false; - ShadowCamera.stereoTargetEye = StereoTargetEyeMask.None; - ShadowCamera.targetTexture = depthRT; - ShadowCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("FogVolume")); - ShadowCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("FogVolumeUniform")); - ShadowCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("FogVolumeSurrogate")); - ShadowCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("FogVolumeShadowCaster")); - - //make it child - ShadowCamera.transform.parent = gameObject.transform; - - Quad = GameObject.Find("Depth map background"); - if (!Quad) Quad = GameObject.CreatePrimitive(PrimitiveType.Quad); - Quad.name = "Depth map background"; - Quad.GetComponent().sharedMaterial = QuadMaterial; - Quad.transform.parent = ShadowCamera.transform; - - //remnove the collider - DestroyImmediate(Quad.GetComponent()); - Quad.hideFlags = HideFlags.HideInHierarchy; - } - void EnableVolumetricShadow(bool b) - { - if (_TargetFogVolumes == null) { return; } - if (_TargetFogVolumes.Length > 0) - { - float largestAxis = 0.0f; - int largestIndex = 0; - for (int FVindex = 0; FVindex < _TargetFogVolumes.Length; FVindex++) - { - var fogVolume = _TargetFogVolumes[FVindex]; - - if ((fogVolume != null) && (fogVolume._FogType == FogVolume.FogType.Textured)) - { - if (fogVolume.enabled) - { - FogVolumeMaterial = fogVolume.FogMaterial; - FogVolumeMaterial.SetInt("_VolumetricShadowsEnabled", b ? 1 : 0); - } - - float largest = _MaxOf(fogVolume.fogVolumeScale.x, - fogVolume.fogVolumeScale.y, - fogVolume.fogVolumeScale.z); - if (largest > largestAxis) - { - largestAxis = largest; - largestIndex = FVindex; - } - } - } - - _ProminentFogVolume = _TargetFogVolumes[largestIndex]; - } - } - - void Update() - { - if (_CanvasImage.material != null) _CanvasImage.material = DebugViewMaterial; - - if (!ShadowCamera) Initialize(); - - if (_TargetFogVolumes != null && _AtLeastOneFogVolumeInArray()) - { - EnableVolumetricShadow(depthRT); - - LayersToRender &= ~(1 << LayerMask.NameToLayer("FogVolume")); - LayersToRender &= ~(1 << LayerMask.NameToLayer("FogVolumeUniform")); - LayersToRender &= ~(1 << LayerMask.NameToLayer("FogVolumeSurrogate")); - LayersToRender &= ~(1 << LayerMask.NameToLayer("FogVolumeShadowCaster")); - ShadowCamera.cullingMask = LayersToRender; - - - Refresh(); - - // - //now, adjust camera size to make it see the whole volume - if (_ScaleMode == ScaleMode.VolumeMaxAxis) - { - if (_ProminentFogVolume != null) - { - ShadowCamera.orthographicSize = - _MaxOf(_ProminentFogVolume.fogVolumeScale.x, - _ProminentFogVolume.fogVolumeScale.y, - _ProminentFogVolume.fogVolumeScale.z) * .5f; - } - } - else ShadowCamera.orthographicSize = Scale; - - // ShadowCamera.orthographicSize = CameraSize; - if (ShadowCamera.cullingMask != 0 && - _ProminentFogVolume != null && - _UpdateMode == UpdateMode.Interleaved) - { - if (FogVolumeUtilities.ExtensionMethods.TimeSnap(SkipFrames)) - { - Render(); - } - } - } - else - { - if (depthRT) - { - DestroyImmediate(depthRT); - DestroyImmediate(GOShadowCamera); - } - } - - if (!ShowMiniature && - _GO_Canvas.activeInHierarchy) _GO_Canvas.SetActive(ShowMiniature); - - if (ShowMiniature && !_GO_Canvas.activeInHierarchy) _GO_Canvas.SetActive(ShowMiniature); - - #if UNITY_EDITOR - if(ShowMiniature) - _CanvasImage.rectTransform.position = new Vector3(MiniaturePosition.x, MiniaturePosition.y, 0); - #endif - } - - public void Refresh() - { - if (_TargetFogVolumes == null) - { - _ProminentFogVolume = null; - return; - } - - for (int i = 0; i < _TargetFogVolumes.Length; i++) - { - var fogVolume = _TargetFogVolumes[i]; - if ((fogVolume != null) && - (fogVolume._FogType == FogVolume.FogType.Textured)) - { - if (fogVolume.HasUpdatedBoxMesh) - { - float largestOfProminent = (_ProminentFogVolume != null) - ? _MaxOf(_ProminentFogVolume.fogVolumeScale.x, - _ProminentFogVolume.fogVolumeScale.y, - _ProminentFogVolume.fogVolumeScale.z) - : 0.0f; - float largest = _MaxOf(fogVolume.fogVolumeScale.x, - fogVolume.fogVolumeScale.y, - fogVolume.fogVolumeScale.z); - if (largest > largestOfProminent) { _ProminentFogVolume = fogVolume; } - } - } - } - } - - public void Render() - { - if (!depthRT) - { - Initialize(); - } - - if (depthRT.height != (int) Size) - { - DestroyImmediate(depthRT); - Initialize(); - - // Debug.Log("A tomar por culo la textura"); - } - - if ((int) _Antialiasing != depthRT.antiAliasing) - { - DestroyImmediate(depthRT); - Initialize(); - } - - if (!ShadowCamera) - { - Initialize(); - } - - switch (_FocusMode) - { - case FocusMode.GameCameraPosition: - FocusPosition = _GameCamera.transform.position; - break; - - case FocusMode.VolumeCenter: - if (_ProminentFogVolume != null) - { - FocusPosition = _ProminentFogVolume.transform.position; - } - else - { - FocusPosition = Vector3.zero; - } - break; - - case FocusMode.GameObject: - if (_GameObjectFocus) FocusPosition = _GameObjectFocus.transform.position; - break; - } - - //move the camera to the target center - Vector3 VerticalTranslate = new Vector3(0, - 0, /* _TargetFogVolume.fogVolumeScale.y / 2*/ - FocusPosition.y - _CameraVerticalPosition); - - ShadowCamera.transform.position = FocusPosition; - ShadowCamera.transform.Translate(VerticalTranslate, Space.Self); - - Vector3 QuadScale = new Vector3(ShadowCamera.orthographicSize * 2, - ShadowCamera.orthographicSize * 2, - ShadowCamera.orthographicSize * 2); - Quad.transform.localScale = QuadScale; - - //move it to the farclip - Quad.transform.position = ShadowCamera.transform.position; - Vector3 QuadTranslate = new Vector3(0, 0, ShadowCamera.farClipPlane - 50); - Quad.transform.Translate(QuadTranslate, Space.Self); - ShadowCamera.transform.rotation = Quaternion.LookRotation(transform.forward); - ; - Shader.SetGlobalVector("_ShadowCameraPosition", ShadowCamera.transform.position); - Shader.SetGlobalMatrix("_ShadowCameraProjection", ShadowCamera.worldToCameraMatrix); - Shader.SetGlobalFloat("_ShadowCameraSize", ShadowCamera.orthographicSize); - Shader.SetGlobalVector("_ShadowLightDir", ShadowCamera.transform.forward); - - //depthRT.DiscardContents(); - quadShader.maximumLOD = 1; - Shader.SetGlobalFloat("_FogVolumeShadowMapEdgeSoftness", - 20.0f / _FogVolumeShadowMapEdgeSoftness); - ShadowCamera.RenderWithShader(outputDepth, "RenderType"); - quadShader.maximumLOD = 100; - Shader.SetGlobalTexture("_ShadowTexture", depthRT); - } - void OnDisable() - { - DestroyImmediate(depthRT); - if (_GO_Canvas) _GO_Canvas.SetActive(false); - - // DestroyImmediate(_Canvas); - // DestroyImmediate(GOShadowCamera); - - // if (FogVolumeMaterial) - // FogVolumeUtilities.Rendering.EnsureKeyword(FogVolumeMaterial, "VOLUMETRIC_SHADOWS", false); - // FogVolumeMaterial.SetInt("_VolumetricShadowsEnabled", 0); - EnableVolumetricShadow(false); - } - - private void OnDestroy() - { - DestroyImmediate(GOShadowCamera); - - // print("A la mierda!"); - DestroyImmediate(_GO_Canvas); - DestroyImmediate(Quad); - } - - private bool _AtLeastOneFogVolumeInArray() - { - if (_TargetFogVolumes != null) - { - for (int i = 0; i < _TargetFogVolumes.Length; i++) - { - if (_TargetFogVolumes[i] != null) { return true; } - } - } - - return false; - } - - public void AddAllFogVolumesToThisLight() - { - _ProminentFogVolume = null; - var fogVolumes = FindObjectsOfType(); - - int validFogVolumeCount = 0; - for (int i = 0; i < fogVolumes.Length; i++) - { - if ((fogVolumes[i] != null) && - (fogVolumes[i]._FogType == FogVolume.FogType.Textured)) { validFogVolumeCount++; } - } - - _TargetFogVolumes = new FogVolume[validFogVolumeCount]; - int k = 0; - for (var i = 0; i < fogVolumes.Length; i++) - { - var fogVolume = fogVolumes[i]; - if ((fogVolume != null) && (fogVolume._FogType == FogVolume.FogType.Textured)) - { - _TargetFogVolumes[k++] = fogVolumes[i]; - } - } - } - - public void RemoveAllFogVolumesFromThisLight() - { - _ProminentFogVolume = null; - _TargetFogVolumes = null; - } - - - private float _MaxOf(float _a, float _b) { return _a >= _b ? _a : _b; } - - - private float _MaxOf(float _a, float _b, float _c) { return _MaxOf(_MaxOf(_a, _b), _c); } -} diff --git a/Assets/FogVolume/Scripts/FogVolumeDirectionalLight.cs.meta b/Assets/FogVolume/Scripts/FogVolumeDirectionalLight.cs.meta deleted file mode 100644 index 9fad306..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeDirectionalLight.cs.meta +++ /dev/null @@ -1,18 +0,0 @@ -fileFormatVersion: 2 -guid: 90a0ecd4363b0a547a4c174b9a95dd5d -timeCreated: 1499495303 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: - - _TargetFogVolume: {instanceID: 0} - - FogVolumeMaterial: {instanceID: 0} - - ShadowCamera: {instanceID: 0} - - outputDepth: {fileID: 4800000, guid: 4fc2932190d974a4887533f0e52baf6c, type: 3} - - GOShadowCamera: {instanceID: 0} - - DebugViewMaterial: {fileID: 2100000, guid: 92dc32887d2555f469466609a34e858c, type: 2} - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/FogVolumeGaiaIntegration.cs b/Assets/FogVolume/Scripts/FogVolumeGaiaIntegration.cs deleted file mode 100644 index 6757eaa..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeGaiaIntegration.cs +++ /dev/null @@ -1,381 +0,0 @@ -#if GAIA_PRESENT && UNITY_EDITOR - -using UnityEngine; -using System; -using UnityEditor; -using UnityEngine.Rendering; - -namespace Gaia.GX.FogVolume3 -{ - /// - /// Fog Volume 3 creator for Gaia. - /// - public class FogVolumeGaiaIntegration : MonoBehaviour - { - #region Generic informational methods - - /// - /// Returns the publisher name if provided. - /// This will override the publisher name in the namespace ie Gaia.GX.PublisherName - /// - /// Publisher name - public static string GetPublisherName() - { - return "David Miranda"; - } - - /// - /// Returns the package name if provided - /// This will override the package name in the class name ie public class PackageName. - /// - /// Package name - public static string GetPackageName() - { - return "Fog Volume 3"; - } - - #endregion - - #region Methods exposed by Gaia as buttons must be prefixed with GX_ - - public static void GX_About() - { - EditorUtility.DisplayDialog("About Fog Volume 3", "This integration adds Fog Volume 3 to your scene. After adding your Fog Volume components adjust their Y positions to better suit your scene. Also pay attention to the Fog Volume settings on your main camera. For example changing falloff will reduce the blur applied to distant clouds.", "OK"); - } - - public static void GX_Setup_AddGroundFog() - { - //Pick colour of main light - GameObject goLight = GameObject.Find("Directional Light"); - Light mainLight = null; - if (goLight != null) - { - mainLight = goLight.GetComponent(); - } - else - { - mainLight = GameObject.FindObjectOfType(); - } - Color mainLightColor = Color.white; - if (mainLight != null) - { - mainLightColor = mainLight.color; - } - - //First make sure its not already in scene - GameObject fvGroundFog = GameObject.Find("Fog Volume [Ground Fog]"); - if (fvGroundFog == null) - { - fvGroundFog = new GameObject(); - fvGroundFog.name = "Fog Volume [Ground Fog]"; - fvGroundFog.AddComponent(); - fvGroundFog.AddComponent(); - fvGroundFog.GetComponent().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; - fvGroundFog.GetComponent().receiveShadows = false; - fvGroundFog.GetComponent().reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Off; - fvGroundFog.GetComponent().lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; - } - - //Adjust its position and size - FogVolume fvVolume = fvGroundFog.GetComponent(); - if (fvVolume != null) - { - GaiaSceneInfo info = GaiaSceneInfo.GetSceneInfo(); - - Debug.Log(info.m_seaLevel); - - fvVolume.transform.position = new Vector3(info.m_sceneBounds.center.x, info.m_seaLevel + 0.01f + (info.m_sceneBounds.extents.y / 4f), info.m_sceneBounds.center.z );// info.m_sceneBounds.center; - fvVolume.fogVolumeScale = new Vector3(info.m_sceneBounds.size.x * 3, info.m_sceneBounds.extents.y / 2f, info.m_sceneBounds.size.z * 3); - - //And adjust camera far clip as well - float maxClip = Math.Max(info.m_sceneBounds.size.x, info.m_sceneBounds.size.z) * 3f; - Camera mainCamera = Camera.main; - if (mainCamera != null) - { - if (mainCamera.farClipPlane < maxClip) - { - mainCamera.farClipPlane = maxClip + 200f; - } - } - - fvVolume.FogMainColor = new Color(53f/255f, 76f/255f, 114f/255f); - //fvVolume.Visibility = maxClip; - fvVolume.Visibility = 800f; - fvVolume.EnableInscattering = true; - fvVolume.InscatteringColor = Color.Lerp(mainLightColor, Color.black, 0.8f); - fvVolume.VolumeFogInscatteringAnisotropy = 0.59f; - fvVolume.InscatteringIntensity = 0.07f; - fvVolume.InscatteringStartDistance = 5f; - fvVolume.InscatteringTransitionWideness = 300f; - - //Other - fvVolume.DrawOrder = 3; - fvVolume._PushAlpha = 1.0025f; - fvVolume._ztest = CompareFunction.Always; - } - } - - public static void GX_Setup_AddClouds() - { - //Pick colour of main light - Color mainLightColor = Color.white; - GameObject goLight = GameObject.Find("Directional Light"); - Light mainLight; - if (goLight != null) - { - mainLight = goLight.GetComponent(); - } - else - { - mainLight = GameObject.FindObjectOfType(); - } - if (mainLight != null) - { - mainLightColor = mainLight.color; - } - - //Get the main camera - Camera mainCamera = Camera.main; - - //First make sure its not already in scene - if it isnt then add it - FogVolume fvVolume; - GameObject goClouds = GameObject.Find("Fog Volume [Clouds]"); - if (goClouds == null) - { - goClouds = new GameObject(); - goClouds.name = "Fog Volume [Clouds]"; - goClouds.AddComponent(); - fvVolume = goClouds.AddComponent(); - goClouds.GetComponent().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; - goClouds.GetComponent().receiveShadows = false; - goClouds.GetComponent().reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Off; - goClouds.GetComponent().lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; - - //Create the horizon - GameObject goHorizon = GameObject.CreatePrimitive(PrimitiveType.Plane); - goHorizon.name = "Horizon"; - goHorizon.transform.parent = goClouds.transform; - goHorizon.transform.localPosition = new Vector3(0f, -79f, 0f); - goHorizon.GetComponent().enabled = false; - goHorizon.GetComponent().enabled = false; - - - //Create the priority script - FogVolumePriority fvPriority = goClouds.AddComponent(); - fvPriority.GameCamera = mainCamera; - fvPriority.FogOrderCameraAbove = 4; - fvPriority.FogOrderCameraBelow = -1; - fvPriority.thisFog = fvVolume; - fvPriority.Horizon = goHorizon; - } - - //Adjust its position and size - fvVolume = goClouds.GetComponent(); - if (fvVolume != null) - { - GaiaSceneInfo info = GaiaSceneInfo.GetSceneInfo(); - - //Location and scale - fvVolume.transform.position = new Vector3(info.m_sceneBounds.center.x, info.m_seaLevel + 200f, info.m_sceneBounds.center.z);// info.m_sceneBounds.center; - fvVolume.fogVolumeScale = new Vector3(info.m_sceneBounds.size.x * 3, 100f, info.m_sceneBounds.size.z * 3); - - //Camera far clip - float maxClip = Math.Max(info.m_sceneBounds.size.x, info.m_sceneBounds.size.z) * 3f; - if (mainCamera != null) - { - if (mainCamera.farClipPlane < maxClip) - { - mainCamera.farClipPlane = maxClip + 200f; - } - } - - //Fog type and blend mode - fvVolume._FogType = FogVolume.FogType.Textured; - fvVolume._BlendMode = FogVolumeRenderer.BlendMode.PremultipliedTransparency; - - //Lighting - fvVolume._AmbientColor = Color.Lerp(mainLightColor, Color.black, 0.1f); - fvVolume.useHeightGradient = true; - fvVolume.Absorption = 0.8f; - fvVolume.HeightAbsorption = 0.185f; - fvVolume.bAbsorption = true; - - fvVolume.EnableInscattering = true; - fvVolume.InscatteringColor = mainLightColor; - fvVolume.InscatteringShape = 0.05f; - fvVolume.InscatteringIntensity = 0.882f; - fvVolume.InscatteringStartDistance = 0f; - fvVolume.InscatteringTransitionWideness = 1f; - - fvVolume._DirectionalLighting = true; - fvVolume.LightExtinctionColor = Color.Lerp(mainLightColor, Color.black, 0.8f); - fvVolume._DirectionalLightingDistance = 0.0008f; - fvVolume.DirectLightingShadowDensity = 6f; - fvVolume.DirectLightingShadowSteps = 1; - - //Renderer - fvVolume.NoiseIntensity = 1f; - fvVolume.SceneCollision = false; //Faster i suppose ? - fvVolume.Iterations = 500; - fvVolume.IterationStep = 100; - fvVolume._OptimizationFactor = 0.0000005f; - - fvVolume.GradMin = 0.19f; - fvVolume.GradMax = 0.06f; - fvVolume.GradMin2 = -0.25f; - fvVolume.GradMax2 = 0.21f; - - //Noise - fvVolume.EnableNoise = true; - fvVolume._3DNoiseScale = 0.15f; - fvVolume.Speed = new Vector4(0.49f, 0f, 0f, 0f); - fvVolume.Vortex = 0.47f; - fvVolume.RotationSpeed = 0f; - fvVolume.rotation = 324f; - fvVolume._VortexAxis = FogVolume.VortexAxis.Y; - fvVolume.Coverage = 2.44f; - fvVolume.NoiseContrast = 12.9f; - fvVolume.NoiseDensity = 0.2f; - fvVolume.Octaves = 3; - fvVolume.BaseTiling = 150f; - fvVolume._BaseRelativeSpeed = 0.85f; - fvVolume.DetailTiling = 285.3f; - fvVolume._DetailRelativeSpeed = 16.6f; - fvVolume.DetailDistance = 5000f; - fvVolume._NoiseDetailRange = 0.337f; - fvVolume._DetailMaskingThreshold = 8f; - fvVolume._Curl = 0.364f; - - //Other - fvVolume.DrawOrder = 4; - fvVolume._ztest = CompareFunction.LessEqual; - fvVolume.CreateSurrogate = true; - } - } - - public static void GX_Setup_AddPostEffects() - { - //Update renderer settings to dampen things down a bit for newcomers - FogVolumeRenderer fvRenderer = GameObject.FindObjectOfType(); - if (fvRenderer != null) - { - fvRenderer._Downsample = 3; - fvRenderer._BlendMode = FogVolumeRenderer.BlendMode.PremultipliedTransparency; - fvRenderer.GenerateDepth = false; - } - - //Add screen if missing - FogVolumeScreen fvScreen = GameObject.FindObjectOfType(); - if (fvScreen == null && Camera.main != null) - { - fvScreen = Camera.main.gameObject.AddComponent(); - fvScreen.Downsample = 3; - fvScreen.iterations = 3; - fvScreen.blurSpread = 0.2f; - } - } - - public static void GX_Quality_Low() - { - //What about ground fog and cloud settings ? - GameObject goGroundFog = GameObject.Find("Fog Volume [Ground Fog]"); - if (goGroundFog != null) - { - FogVolume fvGroundFog = goGroundFog.GetComponent(); - if (fvGroundFog != null) - { - //Make adjustments - } - } - GameObject goClouds = GameObject.Find("Fog Volume [Clouds]"); - if (goClouds != null) - { - FogVolume fvClouds = goClouds.GetComponent(); - if (fvClouds != null) - { - //Make adjustments - } - } - - //Update renderer settings - FogVolumeRenderer fvRenderer = GameObject.FindObjectOfType(); - if (fvRenderer != null) - { - fvRenderer._Downsample = 8; - fvRenderer._BlendMode = FogVolumeRenderer.BlendMode.PremultipliedTransparency; - } - - //Update screen settings - FogVolumeScreen fvScreen = GameObject.FindObjectOfType(); - if (fvScreen != null) - { - - } - } - - public static void GX_Quality_Medium() - { - //What about ground fog and cloud settings ? - - - //Update renderer settings - FogVolumeRenderer fvRenderer = GameObject.FindObjectOfType(); - if (fvRenderer != null) - { - fvRenderer._Downsample = 4; - } - - //Update screen settings - FogVolumeScreen fvScreen = GameObject.FindObjectOfType(); - if (fvScreen != null) - { - - } - } - - public static void GX_Quality_High() - { - //What about ground fog and cloud settings ? - - //Update renderer settings - FogVolumeRenderer fvRenderer = GameObject.FindObjectOfType(); - if (fvRenderer != null) - { - fvRenderer._Downsample = 2; - } - - //Update screen settings - FogVolumeScreen fvScreen = GameObject.FindObjectOfType(); - if (fvScreen != null) - { - - } - } - - public static void GX_Quality_Epic() - { - //What about ground fog and cloud settings ? - - - - //Update renderer settings - FogVolumeRenderer fvRenderer = GameObject.FindObjectOfType(); - if (fvRenderer != null) - { - fvRenderer._Downsample = 0; - - } - - //Update screen settings - FogVolumeScreen fvScreen = GameObject.FindObjectOfType(); - if (fvScreen != null) - { - - } - } - - #endregion - } -} - -#endif \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/FogVolumeGaiaIntegration.cs.meta b/Assets/FogVolume/Scripts/FogVolumeGaiaIntegration.cs.meta deleted file mode 100644 index a67f30c..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeGaiaIntegration.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3a51fd1c984059a439eca4d3320cbeca -timeCreated: 1502613915 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/FogVolumeLight.cs b/Assets/FogVolume/Scripts/FogVolumeLight.cs deleted file mode 100644 index f4716a8..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeLight.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - - -[ExecuteInEditMode] -public class FogVolumeLight : MonoBehaviour -{ - private void OnEnable() - { - SphereCollider collider = GetComponent(); -#if UNITY_EDITOR - if (collider != null) { DestroyImmediate(collider); } -#else - if (collider != null) { Destroy(collider); } -#endif - } - - public bool IsAddedToNormalLight; - public bool IsPointLight; - public bool Enabled = true; - public Color Color = Color.white; - public float Intensity = 1.0f; - public float Range = 10.0f; - public float Angle = 30.0f; -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/FogVolumeLight.cs.meta b/Assets/FogVolume/Scripts/FogVolumeLight.cs.meta deleted file mode 100644 index a148746..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeLight.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 11fa16dd62c21c54189e4e55b0bd978c -timeCreated: 1489615659 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 925eb9f7b0e73dd438a616124964bba8, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/FogVolumeLightManager.cs b/Assets/FogVolume/Scripts/FogVolumeLightManager.cs deleted file mode 100644 index 450615f..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeLightManager.cs +++ /dev/null @@ -1,845 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -using UnityEngine; -using UnityEngine.Assertions; - - -//================================================================================================= -/** - * @brief This class manages all lights for a particular FogVolume. - * - *************************************************************************************************/ -public class FogVolumeLightManager : MonoBehaviour -{ - public int CurrentLightCount { get; private set; } - - public int VisibleLightCount { get; private set; } - - public bool DrawDebugData { get; set; } - - public bool AlreadyUsesTransformForPoI { get { return m_pointOfInterestTf != null; } } - - // Very slow and garbage allocating. Only call this once! - public void FindLightsInScene() - { - CurrentLightCount = 0; - VisibleLightCount = 0; - m_lights.Clear(); - m_lightsInFrustum.Clear(); - for (int i = 0; i < MaxLightCount; i++) - { - m_lights.Add(new LightData()); - m_lightsInFrustum.Add(new LightData()); - } - - FogVolumeLight[] lights = FindObjectsOfType(); - for (int i = 0; i < lights.Length; i++) - { - Light unityLight = lights[i].GetComponent(); - if (unityLight != null) - { - switch (unityLight.type) - { - case LightType.Point: - { - AddPointLight(unityLight); - lights[i].IsAddedToNormalLight = true; - break; - } - case LightType.Spot: - { - AddSpotLight(unityLight); - lights[i].IsAddedToNormalLight = true; - break; - } - } - } - else - { - if (lights[i].IsPointLight) - { - AddSimulatedPointLight(lights[i]); - lights[i].IsAddedToNormalLight = false; - } - else - { - AddSimulatedSpotLight(lights[i]); - lights[i].IsAddedToNormalLight = false; - } - } - } - } - - // Very slow and garbage allocating. Only call this once! - public void FindLightsInFogVolume() - { - CurrentLightCount = 0; - VisibleLightCount = 0; - m_lights.Clear(); - m_lightsInFrustum.Clear(); - for (int i = 0; i < MaxLightCount; i++) - { - m_lights.Add(new LightData()); - m_lightsInFrustum.Add(new LightData()); - } - - if (m_boxCollider == null) { m_boxCollider = gameObject.GetComponent(); } - Bounds boundingBox = m_boxCollider.bounds; - - FogVolumeLight[] lights = FindObjectsOfType(); - for (int i = 0; i < lights.Length; i++) - { - if (boundingBox.Intersects(new Bounds(lights[i].gameObject.transform.position, - Vector3.one * LightInVolumeBoundsSize))) - { - Light unityLight = lights[i].GetComponent(); - if (unityLight != null) - { - switch (unityLight.type) - { - case LightType.Point: - { - AddPointLight(unityLight); - lights[i].IsAddedToNormalLight = true; - break; - } - case LightType.Spot: - { - AddSpotLight(unityLight); - lights[i].IsAddedToNormalLight = true; - break; - } - } - } - else - { - if (lights[i].IsPointLight) - { - AddSimulatedPointLight(lights[i]); - lights[i].IsAddedToNormalLight = false; - } - else - { - AddSimulatedSpotLight(lights[i]); - lights[i].IsAddedToNormalLight = false; - } - } - } - } - } - - //============================================================================================= - /** - * @brief Add a simulated point light to the manager. - * - * Note that a simulated point light is any GameObject with a SimulatedPointLight component on - * it. - * - * @param _light The SimulatedPointLight component of an existing GameObject. - * - * @return True if the light was added to the managers list of lights. - * @return False if the manager already contains the maximum amount of lights that was - * specified in the constructor. - * - *********************************************************************************************/ - public bool AddSimulatedPointLight(FogVolumeLight _light) - { - Assert.IsTrue(CurrentLightCount < MaxLightCount, - "The maximum number of lights is already reached!"); - - int index = _FindFirstFreeLight(); - if (index != InvalidIndex) - { - LightData data = m_lights[index]; - CurrentLightCount++; - data.LightType = EFogVolumeLightType.FogVolumePointLight; - data.Transform = _light.transform; - data.Light = null; - data.FogVolumeLight = _light; - data.Bounds = new Bounds(data.Transform.position, - Vector3.one * data.FogVolumeLight.Range * 2.5f); - return true; - } - - return false; - } - - //============================================================================================= - /** - * @brief Add a simulated spot light to the manager. - * - * Note that a simulated spot light is any GameObject with a SimulatedSpotLight component on - * it. - * - * @param _light The SimulatedSpotLight component of an existing GameObject. - * - * @return True if the light was added to the managers list of lights. - * @return False if the manager already contains the maximum amount of lights that was - * specified in the constructor. - * - *********************************************************************************************/ - public bool AddSimulatedSpotLight(FogVolumeLight _light) - { - Assert.IsTrue(CurrentLightCount < MaxLightCount, - "The maximum number of lights is already reached!"); - - int index = _FindFirstFreeLight(); - if (index != InvalidIndex) - { - LightData data = m_lights[index]; - CurrentLightCount++; - data.LightType = EFogVolumeLightType.FogVolumeSpotLight; - data.Transform = _light.transform; - data.Light = null; - data.FogVolumeLight = _light; - Vector3 center = data.Transform.position + - data.Transform.forward * data.FogVolumeLight.Range * 0.5f; - data.Bounds = new Bounds(center, - Vector3.one * data.FogVolumeLight.Range * - (0.75f + data.FogVolumeLight.Angle * 0.03f)); - return true; - } - - return false; - } - - //============================================================================================= - /** - * @brief Add an existing point light to the manager. - * - * @param _light The light component of an existing point light. - * - * @return True if the light was added to the managers list of lights. - * @return False if the manager already contains the maximum amount of lights that was - * specified in the constructor. - * - *********************************************************************************************/ - public bool AddPointLight(Light _light) - { - Assert.IsTrue(CurrentLightCount < MaxLightCount, - "The maximum number of lights is already reached!"); - - int index = _FindFirstFreeLight(); - if (index != InvalidIndex) - { - LightData data = m_lights[index]; - CurrentLightCount++; - data.LightType = EFogVolumeLightType.PointLight; - data.Transform = _light.transform; - data.Light = _light; - data.FogVolumeLight = null; - data.Bounds = new Bounds(data.Transform.position, - Vector3.one * data.Light.range * 2.5f); - return true; - } - - return false; - } - - //============================================================================================= - /** - * @brief Add an existing spot light to the manager. - * - * @param _light The light component of an existing spot light. - * - * @return True if the light was added to the managers list of lights. - * @return False if the manager already contains the maximum amount of lights that was - * specified in the constructor. - * - *********************************************************************************************/ - public bool AddSpotLight(Light _light) - { - Assert.IsTrue(CurrentLightCount < MaxLightCount, - "The maximum number of lights is already reached!"); - - int index = _FindFirstFreeLight(); - if (index != InvalidIndex) - { - LightData data = m_lights[index]; - CurrentLightCount++; - data.LightType = EFogVolumeLightType.SpotLight; - data.Transform = _light.transform; - data.Light = _light; - data.FogVolumeLight = null; - Vector3 center = data.Transform.position + - data.Transform.forward * data.Light.range * 0.5f; - data.Bounds = new Bounds(center, - Vector3.one * data.Light.range * - (0.75f + data.Light.spotAngle * 0.03f)); - return true; - } - - return false; - } - - //============================================================================================= - /** - * @brief Removes the light with the specified transform. - * - * Note that nothing will happen if the light is not currently present in the manager. - * - * @param _lightToRemove The light that will be removed from this manager. - * - * @return True if the light was found inside the manager and removed successfully. - * @return False if the light was not found an thus not removed. - * - *********************************************************************************************/ - public bool RemoveLight(Transform _lightToRemove) - { - int count = m_lights.Count; - for (int i = 0; i < count; i++) - { - if (ReferenceEquals(m_lights[i].Transform, _lightToRemove)) - { - m_lights[i].LightType = EFogVolumeLightType.None; - CurrentLightCount--; - return true; - } - } - - return false; - } - - //============================================================================================= - /** - * @brief Updates the lights that will be rendered. - * - * Note that this method should be called once per frame, before any data is sent to the - * shaders. - * - *********************************************************************************************/ - public void ManualUpdate(ref Plane[] _frustumPlanes) - { - FrustumPlanes = _frustumPlanes; - m_camera = m_fogVolumeData != null ? m_fogVolumeData.GameCamera : null; - if (m_camera == null) { return; } - - if (m_boxCollider == null) { m_boxCollider = m_fogVolume.GetComponent(); } - if (m_pointOfInterestTf != null) { m_pointOfInterest = m_pointOfInterestTf.position; } - _UpdateBounds(); - _FindLightsInFrustum(); - if (m_lightsInFrustum.Count > MaxVisibleLights) { _SortLightsInFrustum(); } - _PrepareShaderArrays(); - } - - //============================================================================================= - /** - * @brief Draws the gizmos if the user wants to see debug data. - * - *********************************************************************************************/ - public void OnDrawGizmos() - { - hideFlags = HideFlags.HideInInspector; - if (m_camera == null) { return; } - if (!DrawDebugData) { return; } - - Color tempColor = Gizmos.color; - - Gizmos.color = Color.green; - for (int i = 0; i < VisibleLightCount; i++) - { - Gizmos.DrawWireCube(m_lightsInFrustum[i].Bounds.center, - m_lightsInFrustum[i].Bounds.size); - } - - Gizmos.color = Color.magenta; - Matrix4x4 currentMatrix = Gizmos.matrix; - Gizmos.matrix = Matrix4x4.TRS(m_camera.transform.position, - m_camera.transform.rotation, - Vector3.one); - - //Gizmos.matrix = transform.localToWorldMatrix; - Gizmos.DrawFrustum(m_camera.transform.position, - m_camera.fieldOfView, - m_camera.nearClipPlane, - m_fogVolume.PointLightingDistance2Camera, - m_camera.aspect); - - Gizmos.color = tempColor; - Gizmos.matrix = currentMatrix; - } - - //============================================================================================= - /** - * @brief Sets the multiplier that is applied to the bounding box size of point lights. - * - * @param _cullSizeMultiplier The multiplier that is applied to the AABB of point lights. - * - *********************************************************************************************/ - public void SetPointLightCullSizeMultiplier(float _cullSizeMultiplier) - { - m_pointLightCullSizeMultiplier = _cullSizeMultiplier; - } - - //============================================================================================= - /** - * @brief Sets the point of interest to a fixed position. - * - * @param _pointOfInterest The point that will be used for prioritizing which lights need to - * be rendered. - * - *********************************************************************************************/ - public void SetPointOfInterest(Vector3 _pointOfInterest) - { - m_pointOfInterestTf = null; - m_pointOfInterest = _pointOfInterest; - } - - //============================================================================================= - /** - * @brief Sets the point of interest to the specified transform. - * - * The point of interest will be updated from the position of the transform. It is therefore - * not necessary to call this method more than once. - * - *********************************************************************************************/ - public void SetPointOfInterest(Transform _pointOfInterest) - { - Assert.IsTrue(_pointOfInterest != null, "_pointOfInterest must not be null!"); - m_pointOfInterestTf = _pointOfInterest; - } - - //============================================================================================= - /** - * @brief Returns the array that contains all light positions. - * - * Remember to call Update() before using this method, otherwise old data will be sent to the - * shaders. - * - *********************************************************************************************/ - public Vector4[] GetLightPositionArray() { return m_lightPos; } - - //============================================================================================= - /** - * @brief Returns the array that contains all light rotations. - * - * Remember to call Update() before using this method, otherwise old data will be sent to the - * shaders. - * - *********************************************************************************************/ - public Vector4[] GetLightRotationArray() { return m_lightRot; } - - //============================================================================================= - /** - * @brief Returns the array that contains all light colors. - * - * Remember to call Update() before using this method, otherwise old data will be sent to the - * shaders. - *********************************************************************************************/ - public Color[] GetLightColorArray() { return m_lightColor; } - - //============================================================================================= - /** - * @brief Returns the array that contains all light data (intensity, range, spotlight angle, - * none). - * - * Remember to call Update() before using this method, otherwise old data will be sent to the - * shaders. - * - *********************************************************************************************/ - public Vector4[] GetLightData() { return m_lightData; } - - //============================================================================================= - /** - * @brief Initializes the LightManager with default values. - * - *********************************************************************************************/ - public void Initialize() - { - m_fogVolume = gameObject.GetComponent(); - m_fogVolumeData = FindObjectOfType(); - m_camera = null; - m_boxCollider = null; - CurrentLightCount = 0; - DrawDebugData = false; - - if (m_lights == null) - { - m_lights = new List(MaxLightCount); - m_lightsInFrustum = new List(MaxLightCount); - - for (int i = 0; i < MaxLightCount; i++) - { - m_lights.Add(new LightData()); - m_lightsInFrustum.Add(new LightData()); - } - } - } - - //============================================================================================= - /** - * @brief Clears the LightManager and prepares it toi be reinitialized. - * - *********************************************************************************************/ - public void Deinitialize() - { - VisibleLightCount = 0; - DrawDebugData = false; - } - - - public void SetFrustumPlanes(ref Plane[] _frustumPlanes) { FrustumPlanes = _frustumPlanes; } - -#if UNITY_EDITOR - private void Update() { hideFlags = HideFlags.HideInInspector; } -#endif - - //============================================================================================= - /** - * @brief Updates the axis aligned bounding boxes of all registered lights. - * - *********************************************************************************************/ - private void _UpdateBounds() - { - int count = m_lights.Count; - for (int i = 0; i < count; i++) - { - LightData data = m_lights[i]; - - if (data.LightType == EFogVolumeLightType.None) { continue; } - - - switch (data.LightType) - { - case EFogVolumeLightType.None: - { - break; - } - case EFogVolumeLightType.PointLight: - { - data.Bounds = new Bounds(data.Transform.position, - Vector3.one * data.Light.range * - m_pointLightCullSizeMultiplier); - break; - } - case EFogVolumeLightType.SpotLight: - { - Vector3 center = data.Transform.position + - data.Transform.forward * data.Light.range * 0.5f; - data.Bounds = new Bounds(center, - Vector3.one * data.Light.range * - m_pointLightCullSizeMultiplier * 1.25f); - break; - } - case EFogVolumeLightType.FogVolumePointLight: - { - data.Bounds = new Bounds(data.Transform.position, - Vector3.one * data.FogVolumeLight.Range * - m_pointLightCullSizeMultiplier); - break; - } - case EFogVolumeLightType.FogVolumeSpotLight: - { - Vector3 center = data.Transform.position + - data.Transform.forward * data.FogVolumeLight.Range * 0.5f; - data.Bounds = new Bounds(center, - Vector3.one * data.FogVolumeLight.Range * - m_pointLightCullSizeMultiplier * 1.25f); - break; - } - } - } - } - - //============================================================================================= - /** - * @brief Finds the first free light in the list of all lights. - * - * Note that this method is necessary to ensure that adding/removing lights does not allocate - * any garbage. - * - *********************************************************************************************/ - private int _FindFirstFreeLight() - { - if (CurrentLightCount < MaxLightCount) - { - int count = m_lights.Count; - for (int i = 0; i < count; i++) - { - if (m_lights[i].LightType == EFogVolumeLightType.None) { return i; } - } - } - - return InvalidIndex; - } - - //============================================================================================= - /** - * @brief Finds all lights that are currently in the view frustum of the camera and calculates - * all necessary data for them. - * - *********************************************************************************************/ - private void _FindLightsInFrustum() - { - m_inFrustumCount = 0; - Vector3 CameraPos = m_camera.gameObject.transform.position; - int count = m_lights.Count; - for (int i = 0; i < count; i++) - { - if (m_lights[i].Transform == null) { m_lights[i].LightType = EFogVolumeLightType.None; } - - if (m_lights[i].LightType == EFogVolumeLightType.None) { continue; } - - float distanceToCamera = (m_lights[i].Transform.position - CameraPos).magnitude; - if (distanceToCamera > m_fogVolume.PointLightingDistance2Camera) { continue; } - - switch (m_lights[i].LightType) - { - case EFogVolumeLightType.None: - { - continue; - } - case EFogVolumeLightType.PointLight: - case EFogVolumeLightType.SpotLight: - { - if (m_lights[i].Light.enabled == false) { continue; } - - break; - } - case EFogVolumeLightType.FogVolumePointLight: - { - if (m_lights[i].FogVolumeLight.Enabled == false) { continue; } - - break; - } - case EFogVolumeLightType.FogVolumeSpotLight: - { - if (m_lights[i].FogVolumeLight.Enabled == false) { continue; } - - break; - } - } - - if (GeometryUtility.TestPlanesAABB(FrustumPlanes, m_lights[i].Bounds)) - { - LightData light = m_lights[i]; - Vector3 lightPos = light.Transform.position; - light.SqDistance = (lightPos - m_pointOfInterest).sqrMagnitude; - light.Distance2Camera = (lightPos - CameraPos).magnitude; - m_lightsInFrustum[m_inFrustumCount++] = light; - - if (light.FogVolumeLight != null) - { - if (light.LightType == EFogVolumeLightType.FogVolumePointLight && - !light.FogVolumeLight.IsPointLight) - { - light.LightType = EFogVolumeLightType.FogVolumeSpotLight; - } - else if (light.LightType == EFogVolumeLightType.FogVolumeSpotLight && - light.FogVolumeLight.IsPointLight) - { - light.LightType = EFogVolumeLightType.FogVolumePointLight; - } - } - } - } - } - - //============================================================================================= - /** - * @brief Sorts the lights that are currently within the view frustum of the camera by - * distance to the camera. - * - * This method will only be called when there are more than MaxVisibleLights in the view - * frustum of the camera. - * - *********************************************************************************************/ - private void _SortLightsInFrustum() - { - bool finishedSorting = false; - do - { - finishedSorting = true; - for (int i = 0; i < m_inFrustumCount - 1; i++) - { - if (m_lightsInFrustum[i].SqDistance > m_lightsInFrustum[i + 1].SqDistance) - { - LightData tempData = m_lightsInFrustum[i]; - m_lightsInFrustum[i] = m_lightsInFrustum[i + 1]; - m_lightsInFrustum[i + 1] = tempData; - finishedSorting = false; - } - } - } - while (!finishedSorting); - } - - //============================================================================================= - /** - * @brief Prepares the data of the currently visible light and writes it to the arrays that - * can then be sent to the shaders. - * - *********************************************************************************************/ - private void _PrepareShaderArrays() - { - VisibleLightCount = 0; - for (int i = 0; i < MaxVisibleLights; i++) - { - if (i >= m_inFrustumCount) { break; } - - LightData data = m_lightsInFrustum[i]; - - switch (data.LightType) - { - case EFogVolumeLightType.FogVolumePointLight: - { - FogVolumeLight light = data.FogVolumeLight; - m_lightPos[i] = - gameObject.transform.InverseTransformPoint(data.Transform.position); - m_lightRot[i] = - gameObject.transform.InverseTransformVector(data.Transform.forward); - m_lightColor[i] = light.Color; - m_lightData[i] = - new Vector4(light.Intensity * m_fogVolume.PointLightsIntensity * - (1.0f - Mathf.Clamp01(data.Distance2Camera / m_fogVolume - .PointLightingDistance2Camera) - ), - light.Range / PointLightRangeDivider, - InvalidSpotLightAngle, - NoData); - VisibleLightCount++; - break; - } - case EFogVolumeLightType.FogVolumeSpotLight: - { - FogVolumeLight light = data.FogVolumeLight; - m_lightPos[i] = - gameObject.transform.InverseTransformPoint(data.Transform.position); - m_lightRot[i] = - gameObject.transform.InverseTransformVector(data.Transform.forward); - m_lightColor[i] = light.Color; - m_lightData[i] = - new Vector4(light.Intensity * m_fogVolume.PointLightsIntensity * - (1.0f - Mathf.Clamp01(data.Distance2Camera / m_fogVolume - .PointLightingDistance2Camera) - ), - light.Range / SpotLightRangeDivider, - light.Angle, - NoData); - VisibleLightCount++; - break; - } - case EFogVolumeLightType.PointLight: - { - Light light = data.Light; - m_lightPos[i] = - gameObject.transform.InverseTransformPoint(data.Transform.position); - m_lightRot[i] = - gameObject.transform.InverseTransformVector(data.Transform.forward); - m_lightColor[i] = light.color; - m_lightData[i] = - new Vector4(light.intensity * m_fogVolume.PointLightsIntensity * - (1.0f - Mathf.Clamp01(data.Distance2Camera / m_fogVolume - .PointLightingDistance2Camera) - ), - light.range / PointLightRangeDivider, - InvalidSpotLightAngle, - NoData); - VisibleLightCount++; - break; - } - case EFogVolumeLightType.SpotLight: - { - Light light = data.Light; - m_lightPos[i] = - gameObject.transform.InverseTransformPoint(data.Transform.position); - m_lightRot[i] = - gameObject.transform.InverseTransformVector(data.Transform.forward); - m_lightColor[i] = light.color; - m_lightData[i] = - new Vector4(light.intensity * m_fogVolume.PointLightsIntensity * - (1.0f - Mathf.Clamp01(data.Distance2Camera / m_fogVolume - .PointLightingDistance2Camera) - ), - light.range / SpotLightRangeDivider, - light.spotAngle, - NoData); - VisibleLightCount++; - - break; - } - case EFogVolumeLightType.None: - { - break; - } - } - } - } - - private float m_pointLightCullSizeMultiplier = 1.0f; - - private FogVolume m_fogVolume = null; - - private FogVolumeData m_fogVolumeData = null; - - private Camera m_camera = null; - - private BoxCollider m_boxCollider = null; - - private Transform m_pointOfInterestTf = null; - - private Vector3 m_pointOfInterest = Vector3.zero; - - private readonly Vector4[] m_lightPos = new Vector4[MaxVisibleLights]; - - private readonly Vector4[] m_lightRot = new Vector4[MaxVisibleLights]; - - private readonly Color[] m_lightColor = new Color[MaxVisibleLights]; - - private readonly Vector4[] m_lightData = new Vector4[MaxVisibleLights]; - - private List m_lights = null; - - private List m_lightsInFrustum = null; - - private int m_inFrustumCount = 0; - - private Plane[] FrustumPlanes = null; - - private const int InvalidIndex = -1; - - private const int MaxVisibleLights = 64; - - private const float InvalidSpotLightAngle = -1.0f; - - private const float NoData = 0.0f; - - private const float PointLightRangeDivider = 5.0f; - - private const float SpotLightRangeDivider = 5.0f; - - private const int MaxLightCount = 1000; - - /// The assumed size of a light. Used by realtime search when searching for lights inside a FV. - private const float LightInVolumeBoundsSize = 5.0f; - - protected class LightData - { - public LightData() - { - LightType = EFogVolumeLightType.None; - Light = null; - FogVolumeLight = null; - Transform = null; - SqDistance = 0.0f; - Distance2Camera = 0.0f; - Bounds = new Bounds(); - } - - public EFogVolumeLightType LightType { get; set; } - - public Light Light { get; set; } - - public FogVolumeLight FogVolumeLight { get; set; } - - public Transform Transform { get; set; } - - public float SqDistance { get; set; } - - public float Distance2Camera { get; set; } - - public Bounds Bounds { get; set; } - } -} diff --git a/Assets/FogVolume/Scripts/FogVolumeLightManager.cs.meta b/Assets/FogVolume/Scripts/FogVolumeLightManager.cs.meta deleted file mode 100644 index e7b8ccc..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeLightManager.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 28ead9d9608fc8d43827ac46c26c6dae -timeCreated: 1501009496 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/FogVolumePrimitive.cs b/Assets/FogVolume/Scripts/FogVolumePrimitive.cs deleted file mode 100644 index 834eecf..0000000 --- a/Assets/FogVolume/Scripts/FogVolumePrimitive.cs +++ /dev/null @@ -1,110 +0,0 @@ - -using UnityEngine; - - -[ExecuteInEditMode] -public class FogVolumePrimitive : MonoBehaviour -{ - public FogVolumePrimitive() - { - SphereColl = null; - BoxColl = null; - } - - public Transform GetTransform { get { return gameObject.transform; } } - - public Vector3 GetPrimitiveScale - { - get - { - return new Vector3(Mathf.Max(MinScale, transform.lossyScale.x), - Mathf.Max(MinScale, transform.lossyScale.y), - Mathf.Max(MinScale, transform.lossyScale.z)); - } - } - - public Bounds Bounds - { - get - { - if (BoxColl != null) { return BoxColl.bounds; } - else if (SphereColl != null) { return SphereColl.bounds; } - else - { - return new Bounds(gameObject.transform.position, gameObject.transform.lossyScale); - } - } - } - - public void AddColliderIfNeccessary(EFogVolumePrimitiveType _type) - { - Type = _type; - switch (Type) - { - case EFogVolumePrimitiveType.None: - { - break; - } - case EFogVolumePrimitiveType.Box: - { - if (BoxColl == null) { BoxColl = gameObject.AddComponent(); } - break; - } - case EFogVolumePrimitiveType.Sphere: - { - if (SphereColl == null) { SphereColl = gameObject.AddComponent(); } - break; - } - } - } - - private void OnEnable() - { - Primitive = gameObject; - _Renderer = Primitive.GetComponent(); - if (!PrimitiveMaterial) - { - PrimitiveMaterial = (Material) Resources.Load("PrimitiveMaterial"); - } - _Renderer.reflectionProbeUsage = UnityEngine.Rendering.ReflectionProbeUsage.Off; - _Renderer.lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off; - _Renderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; - _Renderer.receiveShadows = false; - - GetComponent().material = PrimitiveMaterial; - - BoxColl = GetComponent(); - SphereColl = GetComponent(); - - if (BoxColl == null && - SphereColl == null) - { - BoxColl = gameObject.AddComponent(); - Type = EFogVolumePrimitiveType.Box; - } - else - { - if (BoxColl != null) { Type = EFogVolumePrimitiveType.Box; } - else if (SphereColl != null) { Type = EFogVolumePrimitiveType.Sphere; } - else { Type = EFogVolumePrimitiveType.None; } - } - } - - public BoxCollider BoxColl; - - public SphereCollider SphereColl; - - public bool IsPersistent = true; - - public EFogVolumePrimitiveType Type; - - public bool IsSubtractive; - - public Material PrimitiveMaterial; - - private GameObject Primitive; - - private Renderer _Renderer; - - private readonly float MinScale = .0001f; -} diff --git a/Assets/FogVolume/Scripts/FogVolumePrimitive.cs.meta b/Assets/FogVolume/Scripts/FogVolumePrimitive.cs.meta deleted file mode 100644 index 4a64303..0000000 --- a/Assets/FogVolume/Scripts/FogVolumePrimitive.cs.meta +++ /dev/null @@ -1,13 +0,0 @@ -fileFormatVersion: 2 -guid: ea6605193e9715e449050736b7efaea1 -timeCreated: 1492381964 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: - - PrimitiveMaterial: {fileID: 2100000, guid: 0429485e63d913a438bd171228fce857, type: 2} - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/FogVolumePrimitiveManager.cs b/Assets/FogVolume/Scripts/FogVolumePrimitiveManager.cs deleted file mode 100644 index 729831b..0000000 --- a/Assets/FogVolume/Scripts/FogVolumePrimitiveManager.cs +++ /dev/null @@ -1,415 +0,0 @@ -using System.Collections; -using System.Collections.Generic; - -using UnityEngine; -using UnityEngine.Assertions; - - -public class FogVolumePrimitiveManager : MonoBehaviour -{ - public int CurrentPrimitiveCount { get; private set; } - - public int VisiblePrimitiveCount { get; private set; } - - public bool AlreadyUsesTransformForPoI { get { return m_pointOfInterestTf != null; } } - - public void FindPrimitivesInFogVolume() - { - CurrentPrimitiveCount = 0; - VisiblePrimitiveCount = 0; - m_primitives.Clear(); - m_primitivesInFrustum.Clear(); - for (int i = 0; i < MaxPrimitivesCount; i++) - { - m_primitives.Add(new PrimitiveData()); - m_primitivesInFrustum.Add(new PrimitiveData()); - } - - if (m_boxCollider == null) { m_boxCollider = gameObject.GetComponent(); } - Bounds boundingBox = m_boxCollider.bounds; - - FogVolumePrimitive[] primitives = FindObjectsOfType(); - for (int i = 0; i < primitives.Length; i++) - { - var data = primitives[i]; - - if (boundingBox.Intersects(data.Bounds)) - { - if (data.BoxColl != null) { data.Type = EFogVolumePrimitiveType.Box; } - else if (data.SphereColl != null) { data.Type = EFogVolumePrimitiveType.Sphere; } - else - { - data.BoxColl = data.GetTransform.gameObject.AddComponent(); - data.Type = EFogVolumePrimitiveType.Box; - } - - if (data.Type == EFogVolumePrimitiveType.Box) - { - AddPrimitiveBox(data); - } - else if (data.Type == EFogVolumePrimitiveType.Sphere) - { - AddPrimitiveSphere(data); - } - } - } - } - - public bool AddPrimitiveBox(FogVolumePrimitive _box) - { - Assert.IsTrue(CurrentPrimitiveCount < MaxPrimitivesCount, - "The maximum amount of primitives is already reached!"); - - int index = _FindFirstFreePrimitive(); - if (index != InvalidIndex) - { - PrimitiveData data = m_primitives[index]; - CurrentPrimitiveCount++; - data.PrimitiveType = EFogVolumePrimitiveType.Box; - data.Transform = _box.transform; - data.Renderer = _box.GetComponent(); - data.Primitive = _box; - data.Bounds = new Bounds(data.Transform.position, _box.GetPrimitiveScale); - return true; - } - - return false; - } - - public bool AddPrimitiveSphere(FogVolumePrimitive _sphere) - { - Assert.IsTrue(CurrentPrimitiveCount < MaxPrimitivesCount, - "The maximum amount of primitives is already reached!"); - - int index = _FindFirstFreePrimitive(); - if (index != InvalidIndex) - { - PrimitiveData data = m_primitives[index]; - CurrentPrimitiveCount++; - data.PrimitiveType = EFogVolumePrimitiveType.Sphere; - data.Transform = _sphere.transform; - data.Renderer = _sphere.GetComponent(); - data.Primitive = _sphere; - data.Bounds = new Bounds(data.Transform.position, _sphere.GetPrimitiveScale); - return true; - } - - return false; - } - - public bool RemovePrimitive(Transform _primitiveToRemove) - { - int count = m_primitives.Count; - for (int i = 0; i < count; i++) - { - PrimitiveData data = m_primitives[i]; - if (ReferenceEquals(m_primitives[i].Transform, _primitiveToRemove)) - { - data.Reset(); - CurrentPrimitiveCount--; - return true; - } - } - - return false; - } - - - //============================================================================================= - /** - * @brief Sets the point of interest to a fixed position. - * - * @param _pointOfInterest The point that will be used for prioritizing which primitives need - * to be rendered. - * - *********************************************************************************************/ - public void SetPointOfInterest(Vector3 _pointOfInterest) - { - m_pointOfInterestTf = null; - m_pointOfInterest = _pointOfInterest; - } - - //============================================================================================= - /** - * @brief Sets the point of interest to the specified transform. - * - * The point of interest will be updated from the position of the transform. It is therefore - * not necessary to call this method more than once. - * - *********************************************************************************************/ - public void SetPointOfInterest(Transform _pointOfInterest) - { - Assert.IsTrue(_pointOfInterest != null, "_pointOfInterest must not be null!"); - m_pointOfInterestTf = _pointOfInterest; - } - - - public void OnDrawGizmos() { hideFlags = HideFlags.HideInInspector; } - - - public void ManualUpdate(ref Plane[] _frustumPlanes) - { - m_camera = m_fogVolumeData != null ? m_fogVolumeData.GameCamera : null; - if (m_camera == null) { return; } - FrustumPlanes = _frustumPlanes; - if (m_boxCollider == null) { m_boxCollider = m_fogVolume.GetComponent(); } - _UpdateBounds(); - _FindPrimitivesInFrustum(); - if (m_primitivesInFrustum.Count > MaxVisiblePrimitives) { _SortPrimitivesInFrustum(); } - _PrepareShaderArrays(); - } - - public void SetVisibility(bool _enabled) - { - int count = m_primitives.Count; - for (int i = 0; i < count; i++) - { - if (m_primitives[i].Renderer != null) { m_primitives[i].Renderer.enabled = _enabled; } - } - } - - public void Initialize() - { - m_fogVolume = gameObject.GetComponent(); - m_fogVolumeData = FindObjectOfType(); - m_camera = null; - m_boxCollider = null; - CurrentPrimitiveCount = 0; - - if (m_primitives == null) - { - m_primitives = new List(MaxPrimitivesCount); - m_primitivesInFrustum = new List(); - - for (int i = 0; i < MaxPrimitivesCount; i++) - { - m_primitives.Add(new PrimitiveData()); - m_primitivesInFrustum.Add(new PrimitiveData()); - } - } - } - - - public void Deinitialize() { VisiblePrimitiveCount = 0; } - - - public Vector4[] GetPrimitivePositionArray() { return m_primitivePos; } - - - public Vector4[] GetPrimitiveScaleArray() { return m_primitiveScale; } - - - public Matrix4x4[] GetPrimitiveTransformArray() { return m_primitiveTf; } - - - public Vector4[] GetPrimitiveDataArray() { return m_primitiveData; } - - - private void _UpdateBounds() - { - int count = m_primitives.Count; - for (int i = 0; i < count; i++) - { - PrimitiveData data = m_primitives[i]; - - if (data.PrimitiveType == EFogVolumePrimitiveType.None) { continue; } - - if (data.Primitive == null) - { - RemovePrimitive(data.Transform); - continue; - } - - if (data.PrimitiveType == EFogVolumePrimitiveType.Box) - { - // Check if collider was removed by the user and add it again. - if (data.Primitive.BoxColl == null) - { - Debug.LogWarning("FogVolumePrimitive requires a collider.\nThe collider will be automatically created."); - data.Primitive.AddColliderIfNeccessary(EFogVolumePrimitiveType.Box); - } - data.Bounds = data.Primitive.BoxColl.bounds; - - } - else if (data.PrimitiveType == EFogVolumePrimitiveType.Sphere) - { - // Check if collider was removed by the user and add it again. - if (data.Primitive.SphereColl == null) - { - Debug.LogWarning("FogVolumePrimitive requires a collider.\nThe collider will be automatically created."); - data.Primitive.AddColliderIfNeccessary(EFogVolumePrimitiveType.Sphere); - } - data.Bounds = data.Primitive.SphereColl.bounds; - - } - } - } - - private int _FindFirstFreePrimitive() - { - if (CurrentPrimitiveCount < MaxPrimitivesCount) - { - int count = m_primitives.Count; - for (int i = 0; i < count; i++) - { - if (m_primitives[i].PrimitiveType == EFogVolumePrimitiveType.None) { return i; } - } - } - - return InvalidIndex; - } - - private void _FindPrimitivesInFrustum() - { - m_inFrustumCount = 0; - Vector3 cameraPos = m_camera.gameObject.transform.position; - int count = m_primitives.Count; - for (int i = 0; i < count; i++) - { - PrimitiveData primitive = m_primitives[i]; - - if (primitive.Transform == null) - { - primitive.PrimitiveType = EFogVolumePrimitiveType.None; - } - if (primitive.PrimitiveType == EFogVolumePrimitiveType.None) { continue; } - - if (primitive.Primitive.IsPersistent) - { - Vector3 pos = primitive.Transform.position; - primitive.SqDistance = (pos - m_pointOfInterest).sqrMagnitude; - primitive.Distance2Camera = (pos - cameraPos).magnitude; - m_primitivesInFrustum[m_inFrustumCount++] = primitive; - } - else if (GeometryUtility.TestPlanesAABB(FrustumPlanes, m_primitives[i].Bounds)) - { - Vector3 pos = primitive.Transform.position; - primitive.SqDistance = (pos - m_pointOfInterest).sqrMagnitude; - primitive.Distance2Camera = (pos - cameraPos).magnitude; - m_primitivesInFrustum[m_inFrustumCount++] = primitive; - } - } - } - - private void _SortPrimitivesInFrustum() - { - bool finishedSorting = false; - do - { - finishedSorting = true; - for (int i = 0; i < m_inFrustumCount - 1; i++) - { - if (m_primitivesInFrustum[i].SqDistance > m_primitivesInFrustum[i + 1].SqDistance) - { - PrimitiveData tempData = m_primitivesInFrustum[i]; - m_primitivesInFrustum[i] = m_primitivesInFrustum[i + 1]; - m_primitivesInFrustum[i + 1] = tempData; - finishedSorting = false; - } - } - } - while (!finishedSorting); - } - - private void _PrepareShaderArrays() - { - VisiblePrimitiveCount = 0; - - Quaternion fogVolumeRotation = m_fogVolume.gameObject.transform.rotation; - - for (int i = 0; i < MaxVisiblePrimitives; i++) - { - if (i >= m_inFrustumCount) { break; } - - PrimitiveData data = m_primitivesInFrustum[i]; - Vector3 position = data.Transform.position; - m_primitivePos[i] = gameObject.transform.InverseTransformPoint(position); - m_primitiveTf[i].SetTRS(position, - Quaternion.Inverse(data.Transform.rotation) * fogVolumeRotation, - Vector3.one); - m_primitiveScale[i] = data.Primitive.GetPrimitiveScale; - m_primitiveData[i] = - new Vector4(data.PrimitiveType == EFogVolumePrimitiveType.Box ? 0.5f : 1.5f, - data.Primitive.IsSubtractive ? 1.5f : 0.5f, - 0.0f, - 0.0f); - VisiblePrimitiveCount++; - } - } - -#if UNITY_EDITOR - private void Update() { hideFlags = HideFlags.HideInInspector; } -#endif - - private FogVolume m_fogVolume = null; - - private FogVolumeData m_fogVolumeData = null; - - private Camera m_camera = null; - - private BoxCollider m_boxCollider = null; - - private Transform m_pointOfInterestTf = null; - - private Vector3 m_pointOfInterest = Vector3.zero; - - private List m_primitives = null; - - private List m_primitivesInFrustum = null; - - private int m_inFrustumCount = 0; - - private Plane[] FrustumPlanes = null; - - private readonly Vector4[] m_primitivePos = new Vector4[MaxVisiblePrimitives]; - - private readonly Vector4[] m_primitiveScale = new Vector4[MaxVisiblePrimitives]; - - private readonly Matrix4x4[] m_primitiveTf = new Matrix4x4[MaxVisiblePrimitives]; - - private readonly Vector4[] m_primitiveData = new Vector4[MaxVisiblePrimitives]; - - private const int InvalidIndex = -1; - - private const int MaxVisiblePrimitives = 20; - - private const int MaxPrimitivesCount = 1000; - - protected class PrimitiveData - { - public PrimitiveData() - { - PrimitiveType = EFogVolumePrimitiveType.None; - Primitive = null; - Transform = null; - Renderer = null; - SqDistance = 0.0f; - Distance2Camera = 0.0f; - Bounds = new Bounds(); - } - - public EFogVolumePrimitiveType PrimitiveType { get; set; } - - public FogVolumePrimitive Primitive { get; set; } - - public Transform Transform { get; set; } - - public Renderer Renderer { get; set; } - - public float SqDistance { get; set; } - - public float Distance2Camera { get; set; } - - public Bounds Bounds { get; set; } - - public void Reset() - { - PrimitiveType = EFogVolumePrimitiveType.None; - Primitive = null; - Transform = null; - Renderer = null; - SqDistance = 0.0f; - Distance2Camera = 0.0f; - } - } -} diff --git a/Assets/FogVolume/Scripts/FogVolumePrimitiveManager.cs.meta b/Assets/FogVolume/Scripts/FogVolumePrimitiveManager.cs.meta deleted file mode 100644 index 0b1c5e5..0000000 --- a/Assets/FogVolume/Scripts/FogVolumePrimitiveManager.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a8340c6d549ef1c4099a619f31eef29e -timeCreated: 1512373111 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/FogVolumeRenderer.cs b/Assets/FogVolume/Scripts/FogVolumeRenderer.cs deleted file mode 100644 index 19c8afe..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeRenderer.cs +++ /dev/null @@ -1,901 +0,0 @@ -using UnityEngine; -using UnityEngine.Profiling; -using FogVolumeUtilities; -using UnityEngine.XR; -#if UNITY_EDITOR -using UnityEditor; -#endif - -[ExecuteInEditMode] -public class FogVolumeRenderer : MonoBehaviour -{ - bool ShowCamerasBack = true; - public bool ShowCamera; - //public bool DestroyOnDisable; - private int m_screenWidth = 0; - private int m_screenHeight = 0; - public string FogVolumeResolution; - // public bool RenderableInSceneView = true; - public enum BlendMode - { - PremultipliedTransparency = (int)UnityEngine.Rendering.BlendMode.One, - TraditionalTransparency = (int)UnityEngine.Rendering.BlendMode.SrcAlpha, - }; - RenderTextureFormat rt_DepthFormat; - public BlendMode _BlendMode = BlendMode.PremultipliedTransparency; - public bool GenerateDepth = true; - RenderTexture RT_FogVolume, RT_FogVolumeR; - [SerializeField] - [Range(0, 8)] - public int _Downsample = 1; - public void setDownsample(int val) { _Downsample = val; } - //public bool useRectangularStereoRT = false; - - public bool _showBilateralEdge = false; - - - public bool showBilateralEdge - { - set - { - if (value != _showBilateralEdge) - ShowBilateralEdge(value); - } - get - { - return _showBilateralEdge; - } - } - public void ShowBilateralEdge(bool b) - { - - _showBilateralEdge = b; - if (bilateralMaterial) - { - - if (showBilateralEdge) - bilateralMaterial.EnableKeyword("VISUALIZE_EDGE"); - else - bilateralMaterial.DisableKeyword("VISUALIZE_EDGE"); - } - } - - [SerializeField] - //public FogVolumeCamera.UpsampleMode USMode = FogVolumeCamera.UpsampleMode.DOWNSAMPLE_CHESSBOARD; - [System.Serializable] - public enum UpsampleMode - { - DOWNSAMPLE_MIN, - DOWNSAMPLE_MAX, - DOWNSAMPLE_CHESSBOARD - }; - public enum UpsampleMaterialPass - { - DEPTH_DOWNSAMPLE = 0, - BILATERAL_UPSAMPLE = 1 - }; - Material bilateralMaterial; - - public bool _useBilateralUpsampling = true; - public bool useBilateralUpsampling - { - get { return _useBilateralUpsampling; } - set - { - if (_useBilateralUpsampling != value) - SetUseBilateralUpsampling(value); - } - } - void SetUseBilateralUpsampling(bool b) - { - - _useBilateralUpsampling = b /*&& BilateralUpsamplingEnabled()*/;//works on dx9 - if (_useBilateralUpsampling) - { - - if (bilateralMaterial == null) - { - bilateralMaterial = new Material(Shader.Find("Hidden/Upsample")); - if (bilateralMaterial == null) - Debug.Log("#ERROR# Hidden/Upsample"); - - // refresh keywords - UpdateBilateralDownsampleModeSwitch(); - ShowBilateralEdge(_showBilateralEdge); - } - } - else - { - // release resources - bilateralMaterial = null; - } - } - // [SerializeField] - public UpsampleMode _upsampleMode = UpsampleMode.DOWNSAMPLE_MAX; - public UpsampleMode upsampleMode - { - - set - { - if (value != _upsampleMode) - SetUpsampleMode(value); - } - get - { - return _upsampleMode; - } - } - void UpdateBilateralDownsampleModeSwitch() - { - if (bilateralMaterial != null) - { - switch (_upsampleMode) - { - case UpsampleMode.DOWNSAMPLE_MIN: - bilateralMaterial.EnableKeyword("DOWNSAMPLE_DEPTH_MODE_MIN"); - bilateralMaterial.DisableKeyword("DOWNSAMPLE_DEPTH_MODE_MAX"); - bilateralMaterial.DisableKeyword("DOWNSAMPLE_DEPTH_MODE_CHESSBOARD"); - break; - case UpsampleMode.DOWNSAMPLE_MAX: - bilateralMaterial.DisableKeyword("DOWNSAMPLE_DEPTH_MODE_MIN"); - bilateralMaterial.EnableKeyword("DOWNSAMPLE_DEPTH_MODE_MAX"); - bilateralMaterial.DisableKeyword("DOWNSAMPLE_DEPTH_MODE_CHESSBOARD"); - break; - case UpsampleMode.DOWNSAMPLE_CHESSBOARD: - bilateralMaterial.DisableKeyword("DOWNSAMPLE_DEPTH_MODE_MIN"); - bilateralMaterial.DisableKeyword("DOWNSAMPLE_DEPTH_MODE_MAX"); - bilateralMaterial.EnableKeyword("DOWNSAMPLE_DEPTH_MODE_CHESSBOARD"); - break; - default: - break; - } - } - } - void SetUpsampleMode(UpsampleMode value) - { - - _upsampleMode = value; - UpdateBilateralDownsampleModeSwitch(); - - } - - Camera ThisCamera = null; - RenderTexture RT_Depth, RT_DepthR; - Shader depthShader = null; - [HideInInspector] - Camera _FogVolumeCamera; - // [SerializeField] - GameObject _FogVolumeCameraGO; - [SerializeField] - [Range(0, .01f)] - public float upsampleDepthThreshold = 0.00187f; - public bool HDR; - public bool TAA = false; - public FogVolumeTAA _TAA = null; - private FogVolumePlaydeadTAA.VelocityBuffer _TAAvelocity = null; - private FogVolumePlaydeadTAA.FrustumJitter _TAAjitter = null; - //[HideInInspector] - //public LayerMask DepthLayer = -1; - [SerializeField] - // [HideInInspector] - //string _DepthLayersName = "Water"; - public int DepthLayer2 = 0; - //public string DepthLayersName - //{ - // get { return _DepthLayersName; } - // set - // { - // if (_DepthLayersName != value) - // SetDepthLayer(value); - // } - //} - - //void SetDepthLayer(string NewDepthLayersName) - //{ - // _DepthLayersName = NewDepthLayersName; - // DepthLayer = ThisCamera.cullingMask; - // DepthLayer &= ~(1 << LayerMask.NameToLayer(_DepthLayersName)); - // //DepthLayer = LayerMask.NameToLayer(_DepthLayersName); - //} - - //void OnValidate() - //{ - // SetDepthLayer(_DepthLayersName); - //} - public RenderTextureReadWrite GetRTReadWrite() - { - //return RenderTextureReadWrite.Default; - return (ThisCamera.allowHDR) ? RenderTextureReadWrite.Default : RenderTextureReadWrite.Linear; - - } - - public RenderTextureFormat GetRTFormat() - { - return (ThisCamera.allowHDR == true) ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default; - } - protected void GetRT(ref RenderTexture rt, int2 size, string name) - { - // Release existing one - ReleaseRT(rt); - rt = RenderTexture.GetTemporary(size.x, size.y, 0, GetRTFormat(), GetRTReadWrite()); - rt.filterMode = FilterMode.Bilinear; - rt.name = name; - rt.wrapMode = TextureWrapMode.Clamp; - - } - public void ReleaseRT(RenderTexture rt) - { - if (rt != null) - { - RenderTexture.ReleaseTemporary(rt); - rt = null; - } - } - - protected void Get_RT_Depth(ref RenderTexture rt, int2 size, string name) - { - // Release existing one - ReleaseRT(rt); - rt = RenderTexture.GetTemporary(size.x, size.y, 16, rt_DepthFormat); - rt.filterMode = FilterMode.Bilinear; - rt.name = name; - rt.wrapMode = TextureWrapMode.Clamp; - - } - void RenderDepth() - { - if (GenerateDepth && _FogVolumeCamera) - { - if (_TAAjitter) - { - //_TAA.enabled = false; - _TAAjitter.patternScale = 0; - } - - Profiler.BeginSample("FogVolume Depth"); - //Gimme scene depth - - // ThisCamera.cullingMask = _FogVolumeCamera.cullingMask;//Render the same than scene camera - //3.2.1p2 - - _FogVolumeCamera.cullingMask = DepthLayer2; - #region Stereo - if (ThisCamera.stereoEnabled) - { - - Shader.EnableKeyword("FOG_VOLUME_STEREO_ON"); - //Left eye - - if (ThisCamera.stereoTargetEye == StereoTargetEyeMask.Both || ThisCamera.stereoTargetEye == StereoTargetEyeMask.Left) - { - _FogVolumeCamera.worldToCameraMatrix = ThisCamera.GetStereoViewMatrix(Camera.StereoscopicEye.Left); - _FogVolumeCamera.projectionMatrix = ThisCamera.GetStereoProjectionMatrix(Camera.StereoscopicEye.Left); - - Get_RT_Depth(ref RT_Depth, new int2(m_screenWidth, m_screenHeight), "RT_DepthLeft"); - - _FogVolumeCamera.targetTexture = RT_Depth; - _FogVolumeCamera.RenderWithShader(depthShader, "RenderType"); - - - } - //Right eye - - if (ThisCamera.stereoTargetEye == StereoTargetEyeMask.Both || ThisCamera.stereoTargetEye == StereoTargetEyeMask.Right) - { - _FogVolumeCamera.worldToCameraMatrix = ThisCamera.GetStereoViewMatrix(Camera.StereoscopicEye.Right); - _FogVolumeCamera.projectionMatrix = ThisCamera.GetStereoProjectionMatrix(Camera.StereoscopicEye.Right); - - Get_RT_Depth(ref RT_DepthR, new int2(m_screenWidth, m_screenHeight), "RT_DepthRight"); - _FogVolumeCamera.targetTexture = RT_DepthR; - _FogVolumeCamera.RenderWithShader(depthShader, "RenderType"); - - - Shader.SetGlobalTexture("RT_DepthR", RT_DepthR); - } - } - #endregion - //MONO - else - { - Shader.DisableKeyword("FOG_VOLUME_STEREO_ON"); - Get_RT_Depth(ref RT_Depth, new int2(m_screenWidth, m_screenHeight), "RT_Depth"); - //pepe - _FogVolumeCamera.projectionMatrix = ThisCamera.projectionMatrix; - - - _FogVolumeCamera.targetTexture = RT_Depth; - - _FogVolumeCamera.RenderWithShader(depthShader, "RenderType"); - - - - - - } - - - Shader.SetGlobalTexture("RT_Depth", RT_Depth); - Profiler.EndSample(); - } - - } - public RenderTexture[] lowProfileDepthRT; - void ReleaseLowProfileDepthRT() - { - if (lowProfileDepthRT != null) - { - for (int i = 0; i < lowProfileDepthRT.Length; i++) - RenderTexture.ReleaseTemporary(lowProfileDepthRT[i]); - - lowProfileDepthRT = null; - } - } - public RenderTexture[] lowProfileDepthRRT; - void ReleaseLowProfileDepthRRT() - { - if (lowProfileDepthRRT != null) - { - for (int i = 0; i < lowProfileDepthRRT.Length; i++) - RenderTexture.ReleaseTemporary(lowProfileDepthRRT[i]); - - lowProfileDepthRRT = null; - } - } - void RenderColor() - { - if (_TAA && _TAAjitter) - { - _TAA.enabled = TAA; - _TAAvelocity.enabled = false; - _TAAjitter.enabled = TAA; - _TAAjitter.patternScale = 0.2f; - } - //Textured Fog - _FogVolumeCamera.cullingMask = 1 << LayerMask.NameToLayer("FogVolume");//show Fog volume - _FogVolumeCamera.cullingMask |= 1 << LayerMask.NameToLayer("FogVolumeShadowCaster");//show FogVolumeShadowCaster - int2 resolution = new int2(m_screenWidth / _Downsample, m_screenHeight / _Downsample); - FogVolumeResolution = resolution.x + " X " + resolution.y; - - if (ThisCamera.stereoEnabled) - { - - Profiler.BeginSample("FogVolume Render Stereo"); - Shader.EnableKeyword("FOG_VOLUME_STEREO_ON"); - //Left eye - - if (ThisCamera.stereoTargetEye == StereoTargetEyeMask.Both || ThisCamera.stereoTargetEye == StereoTargetEyeMask.Left) - { - _FogVolumeCamera.projectionMatrix = ThisCamera.GetStereoProjectionMatrix(Camera.StereoscopicEye.Left); - _FogVolumeCamera.worldToCameraMatrix = ThisCamera.GetStereoViewMatrix(Camera.StereoscopicEye.Left); - - GetRT(ref RT_FogVolume, resolution, "RT_FogVolumeLeft"); - _FogVolumeCamera.targetTexture = RT_FogVolume; - _FogVolumeCamera.Render(); - } - - //Right eye - - if (ThisCamera.stereoTargetEye == StereoTargetEyeMask.Both || ThisCamera.stereoTargetEye == StereoTargetEyeMask.Right) - { - - _FogVolumeCamera.projectionMatrix = ThisCamera.GetStereoProjectionMatrix(Camera.StereoscopicEye.Right); - _FogVolumeCamera.worldToCameraMatrix = ThisCamera.GetStereoViewMatrix(Camera.StereoscopicEye.Right); - - GetRT(ref RT_FogVolumeR, resolution, "RT_FogVolumeRight"); - _FogVolumeCamera.targetTexture = RT_FogVolumeR; - _FogVolumeCamera.Render(); - - } - Profiler.EndSample(); - } - else - { - Profiler.BeginSample("FogVolume Render"); - Shader.DisableKeyword("FOG_VOLUME_STEREO_ON"); - _FogVolumeCamera.projectionMatrix = ThisCamera.projectionMatrix; - GetRT(ref RT_FogVolume, resolution, "RT_FogVolume"); - _FogVolumeCamera.targetTexture = RT_FogVolume; - _FogVolumeCamera.Render(); - Profiler.EndSample(); - } - - - if (TAA) - _TAA.TAA(ref RT_FogVolume); - - - if (ThisCamera.stereoEnabled) - { - if (TAA) - _TAA.TAA(ref RT_FogVolumeR); - - } - - - if (useBilateralUpsampling && GenerateDepth) - { - - //MONO - #region BILATERAL_DEPTH_DOWNSAMPLE - Profiler.BeginSample("FogVolume Upsample"); - // Compute downsampled depth-buffer for bilateral upsampling - if (bilateralMaterial) - { - bilateralMaterial.SetInt("RightSide", 0); - ReleaseLowProfileDepthRT(); - lowProfileDepthRT = new RenderTexture[_Downsample]; - - for (int downsampleStep = 0; downsampleStep < _Downsample; downsampleStep++) - { - int targetWidth = m_screenWidth / (downsampleStep + 1); - int targetHeight = m_screenHeight / (downsampleStep + 1); - - int stepWidth = m_screenWidth / Mathf.Max(downsampleStep, 1); - int stepHeight = m_screenHeight / Mathf.Max(downsampleStep, 1); - Vector4 texelSize = new Vector4(1.0f / stepWidth, 1.0f / stepHeight, 0.0f, 0.0f); - bilateralMaterial.SetFloat("_UpsampleDepthThreshold", upsampleDepthThreshold); - bilateralMaterial.SetVector("_TexelSize", texelSize); - - bilateralMaterial.SetTexture("_HiResDepthBuffer", RT_Depth); - - lowProfileDepthRT[downsampleStep] = - RenderTexture.GetTemporary(targetWidth, targetHeight, 0, rt_DepthFormat, GetRTReadWrite()); - lowProfileDepthRT[downsampleStep].name = "lowProfileDepthRT_" + downsampleStep; - Graphics.Blit(null, lowProfileDepthRT[downsampleStep], bilateralMaterial, (int)UpsampleMaterialPass.DEPTH_DOWNSAMPLE); - } - - Shader.SetGlobalTexture("RT_Depth", lowProfileDepthRT[lowProfileDepthRT.Length - 1]); - - - } - - - #endregion - - #region BILATERAL_UPSAMPLE - - // Upsample convolution RT - if (bilateralMaterial) - { - for (int downsampleStep = _Downsample - 1; downsampleStep >= 0; downsampleStep--) - { - int targetWidth = m_screenWidth / Mathf.Max(downsampleStep, 1); - int targetHeight = m_screenHeight / Mathf.Max(downsampleStep, 1); - - // compute Low-res texel size - int stepWidth = m_screenWidth / (downsampleStep + 1); - int stepHeight = m_screenHeight / (downsampleStep + 1); - Vector4 texelSize = new Vector4(1.0f / stepWidth, 1.0f / stepHeight, 0.0f, 0.0f); - bilateralMaterial.SetVector("_TexelSize", texelSize); - bilateralMaterial.SetVector("_InvdUV", new Vector4(RT_FogVolume.width, RT_FogVolume.height, 0, 0)); - // High-res depth texture - - bilateralMaterial.SetTexture("_HiResDepthBuffer", RT_Depth); - bilateralMaterial.SetTexture("_LowResDepthBuffer", lowProfileDepthRT[downsampleStep]); - - bilateralMaterial.SetTexture("_LowResColor", RT_FogVolume); - RenderTexture newRT = RenderTexture.GetTemporary(targetWidth, targetHeight, 0, GetRTFormat(), GetRTReadWrite()); - newRT.filterMode = FilterMode.Bilinear; - Graphics.Blit(null, newRT, bilateralMaterial, (int)UpsampleMaterialPass.BILATERAL_UPSAMPLE); - - // Swap and release - RenderTexture swapRT = RT_FogVolume; - RT_FogVolume = newRT; - RenderTexture.ReleaseTemporary(swapRT); - - } - - - } - ReleaseLowProfileDepthRT(); - #endregion - - //Stereo right side - if (ThisCamera.stereoEnabled) - { - - #region BILATERAL_DEPTH_DOWNSAMPLE - Profiler.BeginSample("FogVolume Upsample Right"); - // Compute downsampled depth-buffer for bilateral upsampling - if (bilateralMaterial) - { - bilateralMaterial.EnableKeyword("FOG_VOLUME_STEREO_ON"); - bilateralMaterial.SetInt("RightSide", 1); - ReleaseLowProfileDepthRRT(); - lowProfileDepthRRT = new RenderTexture[_Downsample]; - - for (int downsampleStep = 0; downsampleStep < _Downsample; downsampleStep++) - { - int targetWidth = m_screenWidth / (downsampleStep + 1); - int targetHeight = m_screenHeight / (downsampleStep + 1); - - int stepWidth = m_screenWidth / Mathf.Max(downsampleStep, 1); - int stepHeight = m_screenHeight / Mathf.Max(downsampleStep, 1); - Vector4 texelSize = new Vector4(1.0f / stepWidth, 1.0f / stepHeight, 0.0f, 0.0f); - bilateralMaterial.SetFloat("_UpsampleDepthThreshold", upsampleDepthThreshold); - bilateralMaterial.SetVector("_TexelSize", texelSize); - - bilateralMaterial.SetTexture("_HiResDepthBufferR", RT_DepthR); - - lowProfileDepthRRT[downsampleStep] = - RenderTexture.GetTemporary(targetWidth, targetHeight, 0, rt_DepthFormat, GetRTReadWrite()); - lowProfileDepthRRT[downsampleStep].name = "lowProfileDepthRRT_" + downsampleStep; - Graphics.Blit(null, lowProfileDepthRRT[downsampleStep], bilateralMaterial, (int)UpsampleMaterialPass.DEPTH_DOWNSAMPLE); - } - - Shader.SetGlobalTexture("RT_DepthR", lowProfileDepthRRT[lowProfileDepthRRT.Length - 1]); - - - } - - - #endregion - - #region BILATERAL_UPSAMPLE - - // Upsample convolution RT - if (bilateralMaterial) - { - for (int downsampleStep = _Downsample - 1; downsampleStep >= 0; downsampleStep--) - { - int targetWidth = m_screenWidth / Mathf.Max(downsampleStep, 1); - int targetHeight = m_screenHeight / Mathf.Max(downsampleStep, 1); - - // compute Low-res texel size - int stepWidth = m_screenWidth / (downsampleStep + 1); - int stepHeight = m_screenHeight / (downsampleStep + 1); - Vector4 texelSize = new Vector4(1.0f / stepWidth, 1.0f / stepHeight, 0.0f, 0.0f); - bilateralMaterial.SetVector("_TexelSize", texelSize); - bilateralMaterial.SetVector("_InvdUV", new Vector4(RT_FogVolumeR.width, RT_FogVolumeR.height, 0, 0)); - // High-res depth texture - - bilateralMaterial.SetTexture("_HiResDepthBufferR", RT_DepthR); - bilateralMaterial.SetTexture("_LowResDepthBufferR", lowProfileDepthRRT[downsampleStep]); - - bilateralMaterial.SetTexture("_LowResColorR", RT_FogVolumeR); - RenderTexture newRT = RenderTexture.GetTemporary(targetWidth, targetHeight, 0, GetRTFormat(), GetRTReadWrite()); - newRT.filterMode = FilterMode.Bilinear; - Graphics.Blit(null, newRT, bilateralMaterial, (int)UpsampleMaterialPass.BILATERAL_UPSAMPLE); - - // Swap and release - RenderTexture swapRT = RT_FogVolumeR; - RT_FogVolumeR = newRT; - RenderTexture.ReleaseTemporary(swapRT); - - } - - - } - ReleaseLowProfileDepthRRT(); - #endregion - - } - else - bilateralMaterial.DisableKeyword("FOG_VOLUME_STEREO_ON"); - Profiler.EndSample(); - } - - - - - if (ThisCamera.stereoEnabled) - Shader.SetGlobalTexture("RT_FogVolumeR", RT_FogVolumeR); - Shader.SetGlobalTexture("RT_FogVolume", RT_FogVolume); - - - } - void CameraUpdateSharedProperties() - { - - //AspectRatio = (float)m_screenWidth / m_screenHeight; - - if (_FogVolumeCamera) - { - _FogVolumeCamera.farClipPlane = ThisCamera.farClipPlane; - _FogVolumeCamera.nearClipPlane = ThisCamera.nearClipPlane; - - _FogVolumeCamera.allowHDR = ThisCamera.allowHDR; - - if (_FogVolumeCamera.stereoEnabled == false) - _FogVolumeCamera.fieldOfView = ThisCamera.fieldOfView; - } - } - void TAASetup() - { - if (_Downsample > 1 && TAA) - { - if (_FogVolumeCameraGO.GetComponent() == null) - _FogVolumeCameraGO.AddComponent(); - _TAA = _FogVolumeCameraGO.GetComponent(); - _TAAvelocity = _FogVolumeCameraGO.GetComponent(); - _TAAjitter = _FogVolumeCameraGO.GetComponent(); - } - } - - void CreateFogCamera() - { - //if (_Downsample > 1) - { - _FogVolumeCameraGO = new GameObject(); - _FogVolumeCameraGO.transform.parent = gameObject.transform; - - _FogVolumeCameraGO.transform.localEulerAngles = Vector3.zero; - _FogVolumeCameraGO.transform.localPosition = Vector3.zero; - _FogVolumeCameraGO.name = "FogVolumeCamera"; - //_FogVolumeCamera = _FogVolumeCameraGO.AddComponent(); - _FogVolumeCamera = _FogVolumeCameraGO.AddComponent(); - - _FogVolumeCamera.depth = -666; - _FogVolumeCamera.clearFlags = CameraClearFlags.SolidColor; - _FogVolumeCamera.backgroundColor = new Color(0, 0, 0, 0); - // _FogVolumeCameraGO.hideFlags = HideFlags.HideInHierarchy; - _FogVolumeCamera.enabled = false; - _FogVolumeCamera.renderingPath = RenderingPath.Forward; - - _FogVolumeCamera.allowMSAA = false; -#if UNITY_EDITOR - EditorExtension.ToggleInHierarchy(_FogVolumeCameraGO, ShowCamera); -#endif - } - } - - void FindFogCamera() - { - _FogVolumeCameraGO = GameObject.Find("FogVolumeCamera"); - if (_FogVolumeCameraGO) - { - _FogVolumeCamera = _FogVolumeCameraGO.GetComponent(); - - - //_FogVolumeCameraGO.transform.parent = gameObject.transform; - - - } - //if (_FogVolumeCameraGO) - // DestroyImmediate(_FogVolumeCameraGO);//the RT is not created in VR on start. Resetting here for now - if (_FogVolumeCameraGO == null) - CreateFogCamera(); - //_FV_Baker = _FogVolumeCameraGO.GetComponent(); - TAASetup(); - } - Vector4 TexelSize = Vector4.zero; - void TexelUpdate() - { - //if (_FogVolumeCamera.RT_FogVolume) - { - TexelSize.x = 1.0f / ThisCamera.pixelWidth; - TexelSize.y = 1.0f / ThisCamera.pixelHeight; - TexelSize.z = ThisCamera.pixelWidth; - TexelSize.w = ThisCamera.pixelHeight; - Shader.SetGlobalVector("RT_FogVolume_TexelSize", TexelSize); - } - // print(TexelSize); - } - - void OnEnable() - { - SetUseBilateralUpsampling(_useBilateralUpsampling); - SetUpsampleMode(_upsampleMode); - ShowBilateralEdge(_showBilateralEdge); - ThisCamera = gameObject.GetComponent(); - - depthShader = Shader.Find("Hidden/Fog Volume/Depth"); - if (SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.RFloat)) - rt_DepthFormat = RenderTextureFormat.RFloat; - else - rt_DepthFormat = RenderTextureFormat.DefaultHDR; - if (depthShader == null) print("Hidden/Fog Volume/Depth #SHADER ERROR#"); - - FindFogCamera(); - - - - //clean old scenes . In 3.4 things are different. Find the existing camera and remove the unused scripts: - Component[] components = _FogVolumeCameraGO.GetComponents(); - if (_FogVolumeCamera.GetComponent("FogVolumeCamera")) - { - print("Destroyed Old Camera"); - SafeDestroy(_FogVolumeCameraGO); - CreateFogCamera(); - } - - for (int i = 0; i < components.Length; i++) - { - - if (components[i] == null) - { - print("Destroyed Old Camera"); - SafeDestroy(_FogVolumeCameraGO); - CreateFogCamera(); - break; - } - } - - //3.2.2 clean meshes. Some users pretends to add FogVolume.cs here ¬¬ - if (GetComponent()) - { - print("Don't add FogVolume here. Create a new one using the menu buttons and follow the instructions"); - DestroyImmediate(GetComponent()); - } - - if (ThisCamera.GetComponent()) - DestroyImmediate(ThisCamera.GetComponent()); - - if (ThisCamera.GetComponent()) - DestroyImmediate(ThisCamera.GetComponent()); - - SurrogateMaterial = (Material)Resources.Load("Fog Volume Surrogate"); - //UpdateParams(); - - if (DepthLayer2 == 0) - DepthLayer2 = 1; - //DepthLayer2 = ThisCamera.cullingMask; - } - void UpdateParams() - { - //_FV_Baker._Downsample = _Downsample; - // if (_FogVolumeCamera && _Downsample > 1) - { - // _FV_Baker.useBilateralUpsampling = BilateralUpsampling; - - - if (useBilateralUpsampling && GenerateDepth) - { - // _FV_Baker.upsampleMode = USMode; - - // _FV_Baker.showBilateralEdge = ShowBilateralEdge; - // _FV_Baker.upsampleDepthThreshold = upsampleDepthThreshold; - } - - if (GenerateDepth) - { - SurrogateMaterial.SetInt("_ztest", (int)UnityEngine.Rendering.CompareFunction.Always); - //_FogVolumeCamera.DepthMask = instance.DepthLayer; - // _FogVolumeCamera.DepthMask = ThisCamera.cullingMask; - //_FogVolumeCamera.DepthMask &= ~(1 << DepthLayer2); - DepthLayer2 &= ~(1 << LayerMask.NameToLayer("FogVolume"));//hide FogVolume - DepthLayer2 &= ~(1 << LayerMask.NameToLayer("FogVolumeShadowCaster"));//hide FogVolumeShadowCaster - DepthLayer2 &= ~(1 << LayerMask.NameToLayer("FogVolumeSurrogate"));//hide FogVolumeSurrogate - DepthLayer2 &= ~(1 << LayerMask.NameToLayer("FogVolumeUniform"));//hide FogVolumeUniform - DepthLayer2 &= ~(1 << LayerMask.NameToLayer("UI"));//hide UI - //_FV_Baker.DepthMask = DepthLayer2; - } - else - SurrogateMaterial.SetInt("_ztest", (int)UnityEngine.Rendering.CompareFunction.LessEqual); - - if (!_TAA) - TAASetup(); - - - -#if UNITY_5_6_OR_NEWER - HDR = ThisCamera.allowHDR; -#else - HDR = ThisCamera.hdr; -#endif - } - } - Material SurrogateMaterial; - - public bool SceneBlur = true; - - void OnPreRender() - { - m_screenWidth = ThisCamera.pixelWidth; - m_screenHeight = ThisCamera.pixelHeight; - -#if UNITY_EDITOR - if (ThisCamera == null) - ThisCamera = gameObject.GetComponent(); -#endif - //#if UNITY_EDITOR - // // if destroyed... - // FindFogCamera(); - //#endif - if (_FogVolumeCamera == null - && _Downsample > 1)//3.2.1 - FindFogCamera(); - if (_Downsample == 1) SafeDestroy(_FogVolumeCameraGO); - CameraUpdateSharedProperties(); - - if (_Downsample > 0 && _FogVolumeCameraGO && this.isActiveAndEnabled) - { - - ThisCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("FogVolume"));//hide FogVolume - ThisCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("FogVolumeShadowCaster"));//hide FogVolumeShadowCaster - FogVolumeResolution = m_screenWidth + " X " + m_screenHeight; - ThisCamera.cullingMask |= 1 << LayerMask.NameToLayer("FogVolumeSurrogate");//show surrogate - } - else - { - ThisCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("FogVolumeSurrogate"));//hide surrogate - - ThisCamera.cullingMask |= 1 << LayerMask.NameToLayer("FogVolume");//show FogVolume - ThisCamera.cullingMask |= 1 << LayerMask.NameToLayer("FogVolumeShadowCaster");//show FogVolumeShadowCaster - - - } - - - int InitialpixelLights = QualitySettings.pixelLightCount; - ShadowQuality InitialShadows = QualitySettings.shadows; - QualitySettings.pixelLightCount = 0; - QualitySettings.shadows = ShadowQuality.Disable; - -#if UNITY_EDITOR - - if (ThisCamera == null) - ThisCamera = gameObject.GetComponent(); -#endif - UpdateParams(); - SurrogateMaterial.SetInt("_SrcBlend", (int)_BlendMode); - if (_Downsample > 1 && _FogVolumeCamera) - { - //SurrogateMaterial.SetInt("_SrcBlend", (int)_BlendMode); - Shader.EnableKeyword("_FOG_LOWRES_RENDERER"); - - Profiler.BeginSample("FogVolume Render"); - RenderDepth(); - RenderColor(); - Profiler.EndSample(); - - - // TexelUpdate(); - - Shader.DisableKeyword("_FOG_LOWRES_RENDERER"); - } - else - { - Shader.DisableKeyword("_FOG_LOWRES_RENDERER"); - - - } - - QualitySettings.pixelLightCount = InitialpixelLights; - QualitySettings.shadows = InitialShadows; - } - - void Update() - { - -#if UNITY_EDITOR - if (ShowCamerasBack != ShowCamera) - { - EditorExtension.ToggleInHierarchy(_FogVolumeCameraGO, ShowCamera); - - ShowCamerasBack = ShowCamera; - } -#endif - } - void SafeDestroy(Object obj) - { - if (obj != null) - { - //print("Destroyed " + obj); - DestroyImmediate(obj); - } - obj = null; - } - void OnDisable() - { - // Shader.DisableKeyword("RENDER_SCENE_VIEW"); - Shader.DisableKeyword("_FOG_LOWRES_RENDERER"); - - ThisCamera.cullingMask |= (1 << LayerMask.NameToLayer("FogVolume")); - ThisCamera.cullingMask |= 1 << LayerMask.NameToLayer("FogVolumeShadowCaster"); - ThisCamera.cullingMask &= ~(1 << LayerMask.NameToLayer("FogVolumeSurrogate"));//hide surrogate - - SafeDestroy(_TAA); - SafeDestroy(_TAAvelocity); - SafeDestroy(_TAAjitter); - SafeDestroy(_FogVolumeCameraGO); - SafeDestroy(RT_FogVolume); - SafeDestroy(RT_FogVolumeR); - SafeDestroy(RT_Depth); - SafeDestroy(RT_DepthR); - - //if (ThisCamera.depthTextureMode == DepthTextureMode.None) - // Debug.LogWarning("............ATTENTION, this camera is not generating the required Depth for Fog Volume. " + - // "Add -EnableDepthInForwardCamera.cs- to this camera"); - } -} diff --git a/Assets/FogVolume/Scripts/FogVolumeRenderer.cs.meta b/Assets/FogVolume/Scripts/FogVolumeRenderer.cs.meta deleted file mode 100644 index 29224f7..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeRenderer.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e5367b3334ceb84458088c8e4f026f0e -timeCreated: 1488739662 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 925eb9f7b0e73dd438a616124964bba8, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/FogVolumeScreen.cs b/Assets/FogVolume/Scripts/FogVolumeScreen.cs deleted file mode 100644 index adf7dc5..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeScreen.cs +++ /dev/null @@ -1,385 +0,0 @@ -using UnityEngine; -using FogVolumeUtilities; - -[ExecuteInEditMode] -public class FogVolumeScreen : MonoBehaviour -{ - - [Header("Scene blur")] - [Range(1, 8)] - public int Downsample = 8; - [SerializeField] - [Range(.001f, 15)] - float _Falloff = 1; - public int screenX - { - get - { - - return SceneCamera.pixelWidth; - - } - } - float FOV_compensation = 0; - public int screenY - { - get - { - return SceneCamera.pixelHeight; - - } - } - Shader _BlurShader = null; - Camera UniformFogCamera; - GameObject UniformFogCameraGO; - - [HideInInspector] - public Camera SceneCamera; - //[SerializeField] - RenderTexture RT_FogVolumeConvolution; - // [SerializeField] - RenderTextureFormat RT_Format; - [HideInInspector] - public int FogVolumeLayer = -1; - [SerializeField] - [HideInInspector] - string _FogVolumeLayerName = "FogVolumeUniform"; - public string FogVolumeLayerName - { - get { return _FogVolumeLayerName; } - set - { - if (_FogVolumeLayerName != value) - SetFogVolumeLayer(value); - } - } - - void SetFogVolumeLayer(string NewFogVolumeLayerName) - { - _FogVolumeLayerName = NewFogVolumeLayerName; - FogVolumeLayer = LayerMask.NameToLayer(_FogVolumeLayerName); - } - void OnValidate() - { - SetFogVolumeLayer(_FogVolumeLayerName); - } - Material _BlurMaterial = null; - Material BlurMaterial - { - get - { - if (_BlurMaterial == null) - { - _BlurMaterial = new Material(_BlurShader); - _BlurMaterial.hideFlags = HideFlags.HideAndDontSave; - } - return _BlurMaterial; - } - } - - [Range(0, 10)] - public int iterations = 3; - // [Range(0, 1)] - // public float _Dither = .8f; - [Range(0.0f, 1.0f)] - public float blurSpread = 0.6f; - // [Range(0, 1)] - // public float ImageDistortion = 0; - //BLOOM stuff - - public enum BlurType - { - Standard = 0, - Sgx = 1, - } - - - [Header("Bloom")] - [Range(1, 5)] - public int _BloomDowsample = 8; - [Range(0.0f, 1.5f)] - public float threshold = 0.35f; - [Range(0.0f, 10)] - public float intensity = 2.5f; - [Range(0, 1)] - public float _Saturation = 1; - [Range(0, 5f)] - public float blurSize = 1; - - - [Range(1, 10)] - public int blurIterations = 4; - - BlurType blurType = BlurType.Standard; - - Shader fastBloomShader = null; - Material _fastBloomMaterial = null; - Material fastBloomMaterial - { - get - { - if (_fastBloomMaterial == null) - { - _fastBloomMaterial = new Material(fastBloomShader); - _fastBloomMaterial.hideFlags = HideFlags.HideAndDontSave; - } - return _fastBloomMaterial; - } - } - - void CreateUniformFogCamera() - { - - - UniformFogCameraGO = GameObject.Find("Uniform Fog Volume Camera"); - - if (UniformFogCameraGO == null) - { - UniformFogCameraGO = new GameObject(); - UniformFogCameraGO.name = "Uniform Fog Volume Camera"; - if (UniformFogCamera == null) - UniformFogCamera = UniformFogCameraGO.AddComponent(); - - UniformFogCamera.backgroundColor = new Color(0, 0, 0, 0); - UniformFogCamera.clearFlags = CameraClearFlags.SolidColor; - UniformFogCamera.renderingPath = RenderingPath.Forward; - UniformFogCamera.enabled = false; - UniformFogCamera.farClipPlane = SceneCamera.farClipPlane; - - -#if UNITY_5_6_OR_NEWER - UniformFogCamera.GetComponent().allowMSAA = false; -#endif - } - else - { - UniformFogCamera = UniformFogCameraGO.GetComponent(); - - } - - - //UniformFogCameraGO.hideFlags = HideFlags.None; - UniformFogCameraGO.hideFlags = HideFlags.HideInHierarchy; - - - initFOV = SceneCamera.fieldOfView; - } - float initFOV; - - void OnEnable() - { - SceneCamera = gameObject.GetComponent(); - - _BlurShader = Shader.Find("Hidden/FogVolumeDensityFilter"); - if (_BlurShader == null) print("Hidden/FogVolumeDensityFilter #SHADER ERROR#"); - - fastBloomShader = Shader.Find("Hidden/FogVolumeBloom"); - if (fastBloomShader == null) print("Hidden/FogVolumeBloom #SHADER ERROR#"); - - - - CreateUniformFogCamera(); - - } - - protected void OnDisable() - { - if (_BlurMaterial) - { - DestroyImmediate(_BlurMaterial); - } - - if (_fastBloomMaterial) - { - DestroyImmediate(_fastBloomMaterial); - } - - - //3.2.1 lets destroy it - if (UniformFogCameraGO) - DestroyImmediate(UniformFogCameraGO); - } - - - - public void FourTapCone(RenderTexture source, RenderTexture dest, int iteration) - { - - float off = 0.5f + iteration * blurSpread; - Graphics.BlitMultiTap(source, dest, BlurMaterial, - new Vector2(-off, -off), - new Vector2(-off, off), - new Vector2(off, off), - new Vector2(off, -off) - ); - } - // Downsamples the texture to a quarter resolution. - private void DownSample4x(RenderTexture source, RenderTexture dest) - { - float off = 1.0f; - Graphics.BlitMultiTap(source, dest, BlurMaterial, - new Vector2(-off, -off), - new Vector2(-off, off), - new Vector2(off, off), - new Vector2(off, -off) - ); - } - public RenderTextureFormat GetRTFormat() - { - -#if UNITY_5_6_OR_NEWER - RT_Format=(SceneCamera.allowHDR == true) ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default; - return RT_Format; -#else - RT_Format = (SceneCamera.hdr == true) ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.ARGBHalf; - return RT_Format; -#endif - //return RT_Format; - } - public void ReleaseRT(RenderTexture rt) - { - if (rt != null) - { - RenderTexture.ReleaseTemporary(rt); - rt = null; - } - } - public RenderTextureReadWrite GetRTReadWrite() - { - //return RenderTextureReadWrite.Default; -#if UNITY_5_6_OR_NEWER - return (SceneCamera.allowHDR) ? RenderTextureReadWrite.Default : RenderTextureReadWrite.Linear; -#else - return (SceneCamera.hdr) ? RenderTextureReadWrite.Default : RenderTextureReadWrite.Linear; -#endif - } - protected void GetRT(ref RenderTexture rt, int2 size, string name) - { - - // Release existing one - ReleaseRT(rt); - rt = RenderTexture.GetTemporary(size.x, size.y, 0, GetRTFormat(), GetRTReadWrite()); - rt.filterMode = FilterMode.Bilinear; - rt.name = name; - rt.wrapMode = TextureWrapMode.Repeat; - - } - - public void ConvolveFogVolume() - { - if (UniformFogCameraGO == null) CreateUniformFogCamera(); - - int2 resolution = new int2(screenX, screenY); - UniformFogCamera.projectionMatrix = SceneCamera.projectionMatrix; - UniformFogCamera.transform.position = SceneCamera.transform.position; - UniformFogCamera.transform.rotation = SceneCamera.transform.rotation; - GetRT(ref RT_FogVolumeConvolution, resolution, "RT_FogVolumeConvolution"); - UniformFogCamera.targetTexture = RT_FogVolumeConvolution; - - UniformFogCamera.Render(); - Shader.SetGlobalTexture("RT_FogVolumeConvolution", RT_FogVolumeConvolution); - } - public bool SceneBloom = false; - #region instance - private static FogVolumeScreen _instance; - public static FogVolumeScreen instance - { - get - { - if (_instance == null) - { - _instance = FindObjectOfType(); - - } - - return _instance; - } - } - #endregion - RenderTexture _source; - - void OnRenderImage(RenderTexture source, RenderTexture destination) - { - ConvolveFogVolume(); - GetRT(ref _source, new int2(Screen.width, Screen.height), "_source"); - Graphics.Blit(source, _source); - fastBloomMaterial.SetTexture("_source", _source); - BlurMaterial.SetTexture("_source", _source); - //Graphics.Blit(_source, destination, BlurMaterial); - // RT_Format = source.format; - #region Density convolution - UniformFogCamera.cullingMask = 1 << instance.FogVolumeLayer; - //UniformFogCamera.cullingMask |= 1 << LayerMask.NameToLayer("FogVolumeUniform");//add Fog volume uniforms - FOV_compensation = initFOV / SceneCamera.fieldOfView; - Shader.SetGlobalFloat("FOV_compensation", FOV_compensation); - fastBloomMaterial.SetFloat("_Falloff", _Falloff); - // BlurMaterial.SetFloat("_Dither", _Dither); - // BlurMaterial.SetFloat("_Distortion", ImageDistortion * -.08f); - - RenderTexture RT_DensityBlur = RenderTexture.GetTemporary(screenX / Downsample, screenY / Downsample, 0, RT_Format); - - - DownSample4x(source, RT_DensityBlur); - - for (int i = 0; i < iterations; i++) - { - RenderTexture RT_DensityBlur2 = RenderTexture.GetTemporary(screenX / Downsample, screenY / Downsample, 0, RT_Format); - FourTapCone(RT_DensityBlur, RT_DensityBlur2, i); - RenderTexture.ReleaseTemporary(RT_DensityBlur); - RT_DensityBlur = RT_DensityBlur2; - } - // Graphics.Blit(RT_DensityBlur, destination); - - #endregion - - #region Bloom - if (intensity > 0) - { - Rendering.EnsureKeyword(fastBloomMaterial, "BLOOM", true); - float widthMod = 2.0f / (float)_BloomDowsample; - fastBloomMaterial.SetFloat("_Saturation", _Saturation); - fastBloomMaterial.SetVector("_Parameter", new Vector4(blurSize * widthMod, 0.0f, threshold, intensity)); - var rtW = source.width / _BloomDowsample; - var rtH = source.height / _BloomDowsample; - - // downsample - RenderTexture rt = RenderTexture.GetTemporary(rtW, rtH, 0, RT_Format); - rt.filterMode = FilterMode.Bilinear; - - if (SceneBloom) - Graphics.Blit(source, rt, fastBloomMaterial, 1); - else - Graphics.Blit(RT_DensityBlur, rt, fastBloomMaterial, 1); - - var passOffs = blurType == BlurType.Standard ? 0 : 2; - - for (int i = 1; i < blurIterations; i++) - { - fastBloomMaterial.SetVector("_Parameter", new Vector4(blurSize * widthMod + (i * 1.0f), 0.0f, threshold, intensity)); - - // vertical blur - RenderTexture rt2 = RenderTexture.GetTemporary(rtW, rtH, 0, RT_Format); - rt2.filterMode = FilterMode.Bilinear; - Graphics.Blit(rt, rt2, fastBloomMaterial, 2 + passOffs); - RenderTexture.ReleaseTemporary(rt); - rt = rt2; - - // horizontal blur - rt2 = RenderTexture.GetTemporary(rtW, rtH, 0, RT_Format); - rt2.filterMode = FilterMode.Bilinear; - Graphics.Blit(rt, rt2, fastBloomMaterial, 3 + passOffs); - RenderTexture.ReleaseTemporary(rt); - rt = rt2; - } - - fastBloomMaterial.SetTexture("_Bloom", rt); - RenderTexture.ReleaseTemporary(rt); - } - else - Rendering.EnsureKeyword(fastBloomMaterial, "BLOOM", false); - #endregion - Graphics.Blit(RT_DensityBlur, destination, fastBloomMaterial, 0); - RenderTexture.ReleaseTemporary(RT_DensityBlur); - - } -} diff --git a/Assets/FogVolume/Scripts/FogVolumeScreen.cs.meta b/Assets/FogVolume/Scripts/FogVolumeScreen.cs.meta deleted file mode 100644 index b008ab2..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeScreen.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ae4521adbf26e2a4c952cc03f6ffdb34 -timeCreated: 1493126607 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 5aac178e436d68546ae151ed5ba76b94, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/FogVolumeTAA.cs b/Assets/FogVolume/Scripts/FogVolumeTAA.cs deleted file mode 100644 index 9bd8966..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeTAA.cs +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) <2015> -// This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT) -// AUTHOR: Lasse Jon Fuglsang Pedersen - -#if UNITY_5_5_OR_NEWER -#define SUPPORT_STEREO -#endif - -using UnityEngine; - - -[ExecuteInEditMode] -[RequireComponent(typeof(Camera), typeof(FogVolumePlaydeadTAA.FrustumJitter), typeof(FogVolumePlaydeadTAA.VelocityBuffer))] -//[AddComponentMenu("Playdead/TemporalReprojection")] -public class FogVolumeTAA : FogVolumePlaydeadTAA.EffectBase -{ - private static RenderBuffer[] mrt = new RenderBuffer[2]; - - private Camera _FogVolumeCamera; - private FogVolumePlaydeadTAA.FrustumJitter _frustumJitter; - private FogVolumePlaydeadTAA.VelocityBuffer _velocityBuffer; - - public Shader reprojectionShader; - private Material reprojectionMaterial; - private RenderTexture[,] reprojectionBuffer; - - private int[] reprojectionIndex = new int[2] { -1, -1 }; - - public enum Neighborhood - { - MinMax3x3, - MinMax3x3Rounded, - MinMax4TapVarying, - }; - - public Neighborhood neighborhood = Neighborhood.MinMax4TapVarying; - public bool unjitterColorSamples = true; - public bool unjitterNeighborhood = true; - public bool unjitterReprojection = true; - public bool useYCoCg = true; - public bool useClipping = true; - public bool useDilation = false; - public bool useMotionBlur = false; - public bool useOptimizations = false; - - [Range(0.0f, 1.0f)] - public float feedbackMin = 0.88f; - [Range(0.0f, 1.0f)] - public float feedbackMax = 0.97f; - - public float motionBlurStrength = 1.0f; - public bool motionBlurIgnoreFF = false; - - - void Reset() - { - _FogVolumeCamera = GetComponent(); - reprojectionShader = Shader.Find("Hidden/TAA"); - _FogVolumeCamera = GetComponent(); - _frustumJitter = GetComponent(); - //_frustumJitter.enabled = false; - _velocityBuffer = GetComponent(); - _velocityBuffer.velocityShader= Shader.Find("Hidden/VelocityBuffer"); - - - } - - void Clear() - { - EnsureArray(ref reprojectionIndex, 2); - reprojectionIndex[0] = -1; - reprojectionIndex[1] = -1; - } - - - void Awake() - { - - Reset(); - Clear(); - } - - void Resolve(RenderTexture source, RenderTexture destination) - { - _velocityBuffer.GenerateVelocityBuffer(); - EnsureArray(ref reprojectionBuffer, 2, 2); - EnsureArray(ref reprojectionIndex, 2, initialValue: -1); - - EnsureMaterial(ref reprojectionMaterial, reprojectionShader); - if (reprojectionMaterial == null) - { - Graphics.Blit(source, destination); - return; - } - -#if SUPPORT_STEREO - int eyeIndex = (_FogVolumeCamera.stereoActiveEye == Camera.MonoOrStereoscopicEye.Right) ? 1 : 0; -#else - int eyeIndex = 0; -#endif - int bufferW = source.width; - int bufferH = source.height; - - if (EnsureRenderTarget(ref reprojectionBuffer[eyeIndex, 0], bufferW, bufferH, source.format, FilterMode.Bilinear, antiAliasing: source.antiAliasing)) - Clear(); - if (EnsureRenderTarget(ref reprojectionBuffer[eyeIndex, 1], bufferW, bufferH, source.format, FilterMode.Bilinear, antiAliasing: source.antiAliasing)) - Clear(); - -#if SUPPORT_STEREO - bool stereoEnabled = _FogVolumeCamera.stereoEnabled; -#else - bool stereoEnabled = false; -#endif -#if UNITY_EDITOR - bool allowMotionBlur = !stereoEnabled && Application.isPlaying; -#else - bool allowMotionBlur = !stereoEnabled; -#endif - - EnsureKeyword(reprojectionMaterial, "CAMERA_PERSPECTIVE", !_FogVolumeCamera.orthographic); - EnsureKeyword(reprojectionMaterial, "CAMERA_ORTHOGRAPHIC", _FogVolumeCamera.orthographic); - - EnsureKeyword(reprojectionMaterial, "MINMAX_3X3", neighborhood == Neighborhood.MinMax3x3); - EnsureKeyword(reprojectionMaterial, "MINMAX_3X3_ROUNDED", neighborhood == Neighborhood.MinMax3x3Rounded); - EnsureKeyword(reprojectionMaterial, "MINMAX_4TAP_VARYING", neighborhood == Neighborhood.MinMax4TapVarying); - EnsureKeyword(reprojectionMaterial, "UNJITTER_COLORSAMPLES", unjitterColorSamples); - EnsureKeyword(reprojectionMaterial, "UNJITTER_NEIGHBORHOOD", unjitterNeighborhood); - EnsureKeyword(reprojectionMaterial, "UNJITTER_REPROJECTION", unjitterReprojection); - EnsureKeyword(reprojectionMaterial, "USE_YCOCG", useYCoCg); - EnsureKeyword(reprojectionMaterial, "USE_CLIPPING", useClipping); - EnsureKeyword(reprojectionMaterial, "USE_DILATION", useDilation); - EnsureKeyword(reprojectionMaterial, "USE_MOTION_BLUR", useMotionBlur && allowMotionBlur); - EnsureKeyword(reprojectionMaterial, "USE_MOTION_BLUR_NEIGHBORMAX", _velocityBuffer.activeVelocityNeighborMax != null); - EnsureKeyword(reprojectionMaterial, "USE_OPTIMIZATIONS", useOptimizations); - - if (reprojectionIndex[eyeIndex] == -1)// bootstrap - { - reprojectionIndex[eyeIndex] = 0; - reprojectionBuffer[eyeIndex, reprojectionIndex[eyeIndex]].DiscardContents(); - Graphics.Blit(source, reprojectionBuffer[eyeIndex, reprojectionIndex[eyeIndex]]); - } - - int indexRead = reprojectionIndex[eyeIndex]; - int indexWrite = (reprojectionIndex[eyeIndex] + 1) % 2; - - Vector4 jitterUV = _frustumJitter.activeSample; - jitterUV.x /= bufferW; - jitterUV.y /= bufferH; - jitterUV.z /= bufferW; - jitterUV.w /= bufferH; - - reprojectionMaterial.SetVector("_JitterUV", jitterUV); - reprojectionMaterial.SetTexture("_VelocityBuffer", _velocityBuffer.activeVelocityBuffer); - reprojectionMaterial.SetTexture("_VelocityNeighborMax", _velocityBuffer.activeVelocityNeighborMax); - reprojectionMaterial.SetTexture("_MainTex", source); - reprojectionMaterial.SetTexture("_PrevTex", reprojectionBuffer[eyeIndex, indexRead]); - reprojectionMaterial.SetFloat("_FeedbackMin", feedbackMin); - reprojectionMaterial.SetFloat("_FeedbackMax", feedbackMax); - // reprojectionMaterial.SetFloat("_MotionScale", motionBlurStrength * (motionBlurIgnoreFF ? Mathf.Min(1.0f, 1.0f / _velocityBuffer.timeScale) : 1.0f)); - - // reproject frame n-1 into output + history buffer - { - mrt[0] = reprojectionBuffer[eyeIndex, indexWrite].colorBuffer; - mrt[1] = destination.colorBuffer; - - Graphics.SetRenderTarget(mrt, source.depthBuffer); - reprojectionMaterial.SetPass(0); - reprojectionBuffer[eyeIndex, indexWrite].DiscardContents(); - - DrawFullscreenQuad(); - - reprojectionIndex[eyeIndex] = indexWrite; - } - } - /* - void OnRenderImage(RenderTexture source, RenderTexture destination) - { - - //if (destination != null && source.antiAliasing == destination.antiAliasing)// resolve without additional blit when not end of chain - //{ - // Resolve(source, destination); - //} - //else - //{ - RenderTexture internalDestination = RenderTexture.GetTemporary(bufferW, bufferH, 0, _FogVolumeCamera.GetRTFormat(), RenderTextureReadWrite.Default, source.antiAliasing); - { - Resolve(source, internalDestination); - Graphics.Blit(internalDestination, destination); - } - RenderTexture.ReleaseTemporary(internalDestination); - // } - - - } - */ - public void TAA(ref RenderTexture source) - { - // _FogVolumeCamera.depthTextureMode = DepthTextureMode.Depth; - RenderTexture internalDestination = RenderTexture.GetTemporary(source.width, source.height, 0, source.format); - { - Resolve(source, internalDestination); - Graphics.Blit(internalDestination, source); - } - RenderTexture.ReleaseTemporary(internalDestination); - } - - void OnDisable() - { - if (reprojectionBuffer != null) - { - ReleaseRenderTarget(ref reprojectionBuffer[0, 0]); - ReleaseRenderTarget(ref reprojectionBuffer[0, 1]); - ReleaseRenderTarget(ref reprojectionBuffer[1, 0]); - ReleaseRenderTarget(ref reprojectionBuffer[1, 1]); - } - } -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/FogVolumeTAA.cs.meta b/Assets/FogVolume/Scripts/FogVolumeTAA.cs.meta deleted file mode 100644 index 3f2a0a9..0000000 --- a/Assets/FogVolume/Scripts/FogVolumeTAA.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 67bc9e87f0248cc498e6a2a2051daf01 -timeCreated: 1491815962 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Gradients.meta b/Assets/FogVolume/Scripts/Gradients.meta deleted file mode 100644 index 936bfe3..0000000 --- a/Assets/FogVolume/Scripts/Gradients.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ba58364e62e185443ac0035f81a9369b -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Gradients/Clouds 09.psd b/Assets/FogVolume/Scripts/Gradients/Clouds 09.psd deleted file mode 100644 index 303a0de..0000000 --- a/Assets/FogVolume/Scripts/Gradients/Clouds 09.psd +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bce2384086a9b6e2974e4c95a5d4a0f0e40615b9b742ba8e67643540ae3b526a -size 37012 diff --git a/Assets/FogVolume/Scripts/Gradients/Clouds 09.psd.meta b/Assets/FogVolume/Scripts/Gradients/Clouds 09.psd.meta deleted file mode 100644 index f821e36..0000000 --- a/Assets/FogVolume/Scripts/Gradients/Clouds 09.psd.meta +++ /dev/null @@ -1,84 +0,0 @@ -fileFormatVersion: 2 -guid: 132bd45e1d3746f4ba36d53d9e19b1c9 -timeCreated: 1489060890 -licenseType: Store -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - filterMode: 0 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Android - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Gradients/Halo2.psd b/Assets/FogVolume/Scripts/Gradients/Halo2.psd deleted file mode 100644 index c068f99..0000000 --- a/Assets/FogVolume/Scripts/Gradients/Halo2.psd +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d1663b06c7f78d2ad57a608a17d83123cc9b0c95269f124798c0b0846a5f384 -size 47030 diff --git a/Assets/FogVolume/Scripts/Gradients/Halo2.psd.meta b/Assets/FogVolume/Scripts/Gradients/Halo2.psd.meta deleted file mode 100644 index 2ff0ce0..0000000 --- a/Assets/FogVolume/Scripts/Gradients/Halo2.psd.meta +++ /dev/null @@ -1,76 +0,0 @@ -fileFormatVersion: 2 -guid: fa2064f3c8dffc04f93f4f74eae0d72f -timeCreated: 1483799594 -licenseType: Store -TextureImporter: - fileIDToRecycleName: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapMode: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - textureFormat: -1 - textureCompression: 0 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other.meta b/Assets/FogVolume/Scripts/Other.meta deleted file mode 100644 index c933331..0000000 --- a/Assets/FogVolume/Scripts/Other.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 26d0f108d8786aa489110b6c6fc71d11 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/ColorAnimation.cs b/Assets/FogVolume/Scripts/Other/ColorAnimation.cs deleted file mode 100644 index 671203b..0000000 --- a/Assets/FogVolume/Scripts/Other/ColorAnimation.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -[ExecuteInEditMode] -public class ColorAnimation : MonoBehaviour { - - float X, Y, Z; - [Range(0, 10)] - public float _ColorSpeed = 6; - float ColorSpeed; - Vector3 RandomRangeXYZ; - [SerializeField] - [Range(1, 300)] - float Intensity=8; - void OnEnable () - { - RandomRangeXYZ.x = Random.Range(0f, 1f); - RandomRangeXYZ.y = Random.Range(0f, 1f); - RandomRangeXYZ.z = Random.Range(0f, 1f); - } - - // Update is called once per frame - void Update () { - ColorSpeed += Time.deltaTime * _ColorSpeed; - X = Mathf.Sin(ColorSpeed * RandomRangeXYZ.x) * 0.5f + 0.5f; - Y = Mathf.Sin(ColorSpeed * RandomRangeXYZ.y) * 0.5f + 0.5f; - Z = Mathf.Sin(ColorSpeed * RandomRangeXYZ.z) * 0.5f + 0.5f; - float IntensityVariable = Mathf.Sin(ColorSpeed * RandomRangeXYZ.z) * 0.5f + 0.5f; - - Color RandomColor = new Color(X, Y, Z, 1); - GetComponent().sharedMaterial.SetColor("_EmissionColor", IntensityVariable*Intensity * RandomColor); - } -} diff --git a/Assets/FogVolume/Scripts/Other/ColorAnimation.cs.meta b/Assets/FogVolume/Scripts/Other/ColorAnimation.cs.meta deleted file mode 100644 index b03980d..0000000 --- a/Assets/FogVolume/Scripts/Other/ColorAnimation.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f5d2330daeaa77e498d5ce30be3c3c4d -timeCreated: 1500080234 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/EnableDepthInForwardCamera.cs b/Assets/FogVolume/Scripts/Other/EnableDepthInForwardCamera.cs deleted file mode 100644 index a2ff292..0000000 --- a/Assets/FogVolume/Scripts/Other/EnableDepthInForwardCamera.cs +++ /dev/null @@ -1,21 +0,0 @@ -using UnityEngine; -using System.Collections; -[ExecuteInEditMode] -public class EnableDepthInForwardCamera : MonoBehaviour { - public string Message = "Add this script to generate depth if Fog Volume rendered is not used and rendering path is forward"; - // Use this for initialization - void OnEnable() { - - - } - - // Update is called once per frame - void Update() - { - - if (GetComponent().depthTextureMode != DepthTextureMode.Depth) - GetComponent().depthTextureMode |= DepthTextureMode.Depth; - } - - -} diff --git a/Assets/FogVolume/Scripts/Other/EnableDepthInForwardCamera.cs.meta b/Assets/FogVolume/Scripts/Other/EnableDepthInForwardCamera.cs.meta deleted file mode 100644 index 11348d9..0000000 --- a/Assets/FogVolume/Scripts/Other/EnableDepthInForwardCamera.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 9171b3ee906d3e140b7dab42245bd3d3 -timeCreated: 1485265329 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/ExplorationCamera.cs b/Assets/FogVolume/Scripts/Other/ExplorationCamera.cs deleted file mode 100644 index 8ee80a8..0000000 --- a/Assets/FogVolume/Scripts/Other/ExplorationCamera.cs +++ /dev/null @@ -1,277 +0,0 @@ -using UnityEngine; -using System.Collections; - -public class ExplorationCamera : MonoBehaviour -{ - //Turn - [Range(1f, 50)] - public float sensitivity = 30; - [Range(.1f, 50)] - public float smoothing = 5f; - - //Movement - private float speedZ; - private float speedX; - private float speedY; - [Range(.1f, 10)] - public float Speed = .1f; - [HideInInspector] - public float InitialSpeed = .1f; - [HideInInspector] - public float FOV; - private float initialFOV; - Vector2 initialLook; - Vector2 Look; - private Vector3 MovementDirection; - public float MaxAcceleration = 4; - [Range(1f, 10)] - public float AccelerationSmoothing = 10, SpeedSmooth = 1; - Vector2 _smoothMouse; - public bool HideCursor = false; - float focalLength = 0, focalSize = 1; - public bool ConstantMove = false; - Camera ThisCamera; - [HideInInspector] - public float tilt; - void Start() - { - - try - { - //gamepad - Input.GetAxis("LookHorizontal"); - } - catch - { - print("Import the custom input to support gamepad in this camera script\n http://davidmiranda.me/files/FogVolume3/InputManager.asset"); - } - - - //if (this.GetComponent()) - //{ - // focalLength = this.GetComponent().focalLength; - // focalSize = this.GetComponent().focalSize; - //} - } - Vector2 lastPos; - - void OnGUI() - { - //ratón - if (Event.current.type == EventType.MouseDown) - { - lastPos = Event.current.mousePosition; - } - else if (Event.current.type == EventType.MouseDrag || Event.current.type == EventType.MouseMove) - { - Vector3 diff = Event.current.mousePosition - lastPos; - Look += new Vector2(diff.x * sensitivity / 50, -diff.y * sensitivity / 50); - lastPos = Event.current.mousePosition; - } - } - public float tiltSmoothing = 50, FOVTransitionSpeed = .1f; - public float inclination = 13; - public bool ApplyGravity; - [Range(0f, 1)] - public float gravityAccelerationScale = .1f; - void OnDestroy() - { Cursor.visible = true; } - void FixedUpdate() - { - // if (Input.GetKey(KeyCode.Escape)) Application.Quit(); - - - - try - { - //gamepad - if (Mathf.Abs(Input.GetAxis("LookHorizontal")) > 0.017f || Mathf.Abs(Input.GetAxis("LookVertical")) > 0.017f) - { - Look += new Vector2(Input.GetAxis("LookHorizontal"), -Input.GetAxis("LookVertical")) * sensitivity; - - if (Input.GetAxis("LookHorizontal") > 0) - tilt = Mathf.Lerp(tilt, -inclination * Mathf.Abs(Input.GetAxis("LookHorizontal")) * sensitivity, 1f / tiltSmoothing); - else - tilt = Mathf.Lerp(tilt, inclination * Mathf.Abs(Input.GetAxis("LookHorizontal")) * sensitivity, 1f / tiltSmoothing); - - - } - } - catch - { - // - } - tilt = Mathf.Lerp(tilt, 0, 1f / tiltSmoothing); - //DOF - if (Input.GetKey(KeyCode.PageDown)) - focalLength -= .05f; - if (Input.GetKey(KeyCode.PageUp)) - focalLength += .05f; - - if (Input.GetKey(KeyCode.End)) - focalSize -= .05f; - if (Input.GetKey(KeyCode.Home)) - focalSize += .05f; - //if (this.GetComponent()) - //{ - // this.GetComponent().focalLength = focalLength; - // this.GetComponent().focalSize = focalSize; - //} - //Turn interpolation - _smoothMouse.x = Mathf.Lerp(_smoothMouse.x, Look.x, 1f / smoothing); - _smoothMouse.y = Mathf.Lerp(_smoothMouse.y, Look.y, 1f / smoothing); - - //Aplica giro suave - transform.localEulerAngles = new Vector3(-_smoothMouse.y, _smoothMouse.x, tilt); - - - //Traslación: - if (Input.GetKey(KeyCode.W) || Input.GetAxis("Vertical") > 0 || ConstantMove) - { - MovementDirection = new Vector3(0, 0, 1); - speedZ = Mathf.Lerp(speedZ, Speed, 1f / smoothing); - } - - - - if (Input.GetKey(KeyCode.S) || Input.GetAxis("Vertical") < 0) - { - MovementDirection = new Vector3(0, 0, -1); - speedZ = Mathf.Lerp(speedZ, -Speed, 1f / smoothing); - } - - - - if (Input.GetKey(KeyCode.A) || Input.GetAxis("Horizontal") < 0) - { - MovementDirection = new Vector3(-1, 0, 0); - speedX = Mathf.Lerp(speedX, -Speed, 1f / smoothing); - - } - - if (Input.GetKey(KeyCode.D) || Input.GetAxis("Horizontal") > 0) - { - MovementDirection = new Vector3(1, 0, 0); - speedX = Mathf.Lerp(speedX, Speed, 1f / smoothing); - - } - - - if (Input.GetKey(KeyCode.Q) || Input.GetKey(KeyCode.JoystickButton4)) - { - MovementDirection = new Vector3(0, -1, 0); - speedY = Mathf.Lerp(speedY, -Speed, 1f / smoothing); - } - if (Input.GetKey(KeyCode.E) || Input.GetKey(KeyCode.JoystickButton5)) - { - MovementDirection = new Vector3(0, 1, 0); - speedY = Mathf.Lerp(speedY, Speed, 1f / smoothing); - } - - //desaceleración - speedZ = Mathf.Lerp(speedZ, 0, 1f / smoothing); - MovementDirection.z = speedZ; - speedY = Mathf.Lerp(speedY, 0, 1f / smoothing); - MovementDirection.y = speedY; - speedX = Mathf.Lerp(speedX, 0, 1f / smoothing); - MovementDirection = new Vector3(speedX, speedY, speedZ); - if (ApplyGravity) - { - MovementDirection += Physics.gravity * gravityAccelerationScale; - } - transform.Translate(MovementDirection); - // transform.Rotate(Vector3.forward, tilt * 150); - //Speed Ratón - Speed = Mathf.Clamp(Speed, .001f, 100f); - if (Input.GetMouseButton(1)) - { - InitialSpeed += Input.GetAxis("Mouse ScrollWheel") * .5f; - InitialSpeed = Mathf.Max(.1f, InitialSpeed); - } - //FOV - if (Input.GetMouseButton(1) & Input.GetKey(KeyCode.C) & FOV > 5) - { - FOV -= 1; - } - if (Input.GetMouseButton(1) & Input.GetKey(KeyCode.Z) & FOV < 120) - { - FOV += 1; - } - - //Al soltar la tecla: - if (Input.GetMouseButton(1) == false) - { - FOV = Mathf.Lerp(FOV, initialFOV, FOVTransitionSpeed);//El último valor sería la velocidad a la que vuelve al fov original - //Rueda: - // speedZ += Input.GetAxis("Mouse ScrollWheel"); - } - //Aplicar - // - // - if (ThisCamera) - if (ThisCamera.stereoEnabled == false) - GetComponent().fieldOfView = FOV; - - - } - float TriggerValue = 0; - - void Update() - { - - - //Extra velocidad: - try - { - TriggerValue = Mathf.Pow(Input.GetAxis("FasterCamera") * 1 / AccelerationSmoothing + 1, 2); - } - catch { } - //print(Speed); - if (Input.GetKeyDown(KeyCode.LeftShift)) - { - - Speed *= MaxAcceleration; - - } - - try - { - if (Input.GetAxis("FasterCamera") > 0 && Speed < InitialSpeed * MaxAcceleration) - { - Speed *= TriggerValue; - - } - else - if (!Input.GetKey(KeyCode.LeftShift)) - Speed = Mathf.Lerp(Speed, InitialSpeed, 1 / AccelerationSmoothing); - } - catch - { - if (!Input.GetKey(KeyCode.LeftShift)) - Speed = Mathf.Lerp(Speed, InitialSpeed, 1 / AccelerationSmoothing); - } - // print(Speed); - if (Input.GetKeyUp(KeyCode.LeftShift)) - { - Speed /= MaxAcceleration; - } - } - - - void OnEnable() - { - if (GetComponent()) - ThisCamera = GetComponent(); - InitialSpeed = Speed; - if (HideCursor) - Cursor.visible = false; - - if(ThisCamera) - FOV = this.gameObject.GetComponent().fieldOfView; - initialFOV = FOV; - initialLook = new Vector2(transform.eulerAngles.y, transform.eulerAngles.x * -1); - // Debug.Log (transform.eulerAngles); - Look = initialLook; - _smoothMouse = initialLook; - } -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/Other/ExplorationCamera.cs.meta b/Assets/FogVolume/Scripts/Other/ExplorationCamera.cs.meta deleted file mode 100644 index 6ebca11..0000000 --- a/Assets/FogVolume/Scripts/Other/ExplorationCamera.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 857bc2eca15f6a442b001c052ebee65a -timeCreated: 1466361682 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/FPS counter.meta b/Assets/FogVolume/Scripts/Other/FPS counter.meta deleted file mode 100644 index 187559a..0000000 --- a/Assets/FogVolume/Scripts/Other/FPS counter.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7ddae6a1dd4f8f04e8e3c3fb3c9e1c7a -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/FPS counter/FPSCounter.cs b/Assets/FogVolume/Scripts/Other/FPS counter/FPSCounter.cs deleted file mode 100644 index 5216f0c..0000000 --- a/Assets/FogVolume/Scripts/Other/FPS counter/FPSCounter.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using UnityEngine; -using UnityEngine.UI; - -namespace FogVolumeUtils.FPSCounter -{ - [RequireComponent(typeof(Text))] - public class FPSCounter : MonoBehaviour - { - const float fpsMeasurePeriod = 0.5f; - private int m_FpsAccumulator = 0; - private float m_FpsNextPeriod = 0; - private int m_CurrentFps; - const string display = "{0} FPS"; - private Text m_Text; - - - private void Start() - { - m_FpsNextPeriod = Time.realtimeSinceStartup + fpsMeasurePeriod; - m_Text = GetComponent(); - } - - - private void Update() - { - // measure average frames per second - m_FpsAccumulator++; - if (Time.realtimeSinceStartup > m_FpsNextPeriod) - { - m_CurrentFps = (int)(m_FpsAccumulator / fpsMeasurePeriod); - m_FpsAccumulator = 0; - m_FpsNextPeriod += fpsMeasurePeriod; - m_Text.text = string.Format(display, m_CurrentFps); - } - } - } -} diff --git a/Assets/FogVolume/Scripts/Other/FPS counter/FPSCounter.cs.meta b/Assets/FogVolume/Scripts/Other/FPS counter/FPSCounter.cs.meta deleted file mode 100644 index 5a11ceb..0000000 --- a/Assets/FogVolume/Scripts/Other/FPS counter/FPSCounter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c7990fff9467341408ccc3feaad062a4 -timeCreated: 1492927761 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/FogVolumePriority.cs b/Assets/FogVolume/Scripts/Other/FogVolumePriority.cs deleted file mode 100644 index 76996ff..0000000 --- a/Assets/FogVolume/Scripts/Other/FogVolumePriority.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -[ExecuteInEditMode] -public class FogVolumePriority : MonoBehaviour { - public Camera GameCamera; - public int FogOrderCameraAbove=1; - public int FogOrderCameraBelow=-1; - public float HeightThreshold=30; - public FogVolume thisFog; - FogVolumeData _FogVolumeData; - public float CurrentHeight; - // public bool AutoAssignCameraCurrent = true; - public GameObject Horizon; - // Use this for initialization - void OnEnable () { - - thisFog = GetComponent(); - _FogVolumeData = thisFog._FogVolumeData; - - } - - // Update is called once per frame - void Update() - { - // if (AutoAssignCameraCurrent) - // GameCamera = Camera.current; - if(Horizon) - HeightThreshold = Horizon.transform.position.y; - //if(!Application.isPlaying) - // GameCamera = Camera.current; - if (_FogVolumeData) - GameCamera = _FogVolumeData.GameCamera; - else - GameCamera = Camera.main; - - if (GameCamera) - { - if (!Application.isPlaying) - { - if (Camera.current != null) - - CurrentHeight = Camera.current.gameObject.transform.position.y; - } - else - CurrentHeight = GameCamera.gameObject.transform.position.y; - if (HeightThreshold > CurrentHeight && Horizon != null) - thisFog.DrawOrder = FogOrderCameraBelow; - else - thisFog.DrawOrder = FogOrderCameraAbove; - } - } -} diff --git a/Assets/FogVolume/Scripts/Other/FogVolumePriority.cs.meta b/Assets/FogVolume/Scripts/Other/FogVolumePriority.cs.meta deleted file mode 100644 index 9d058e4..0000000 --- a/Assets/FogVolume/Scripts/Other/FogVolumePriority.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a65425c0575171a49b832f4d0a8cc88c -timeCreated: 1486352719 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/RenderPriority.cs b/Assets/FogVolume/Scripts/Other/RenderPriority.cs deleted file mode 100644 index 96266d0..0000000 --- a/Assets/FogVolume/Scripts/Other/RenderPriority.cs +++ /dev/null @@ -1,21 +0,0 @@ -using UnityEngine; -using System.Collections; - -namespace FogVolumeRenderPriority -{ - [ExecuteInEditMode] - public class RenderPriority : MonoBehaviour { - public int DrawOrder = 0; - public bool UpdateRealTime = false; - // Use this for initialization - void OnEnable () { - gameObject.GetComponent().sortingOrder = DrawOrder; - } - - // Update is called once per frame - void Update () { - if(UpdateRealTime) - gameObject.GetComponent().sortingOrder = DrawOrder; - } -} -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/Other/RenderPriority.cs.meta b/Assets/FogVolume/Scripts/Other/RenderPriority.cs.meta deleted file mode 100644 index d369f60..0000000 --- a/Assets/FogVolume/Scripts/Other/RenderPriority.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7fa1d7ed39f67024f9b90b2b4a365d3b -timeCreated: 1486352366 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/Rotator.cs b/Assets/FogVolume/Scripts/Other/Rotator.cs deleted file mode 100644 index 1c34449..0000000 --- a/Assets/FogVolume/Scripts/Other/Rotator.cs +++ /dev/null @@ -1,30 +0,0 @@ -using UnityEngine; -using System.Collections; - -public class Rotator : MonoBehaviour -{ - - public float SpinSpeed = 1.0f; - public Vector3 Axis =new Vector3(0, 1, 0); - //float X, Y, Z; - [SerializeField] - Material Skybox; - - public bool rotateSky = false; - float time; - void Start() - { - // X = transform.eulerAngles.x; - // Y = transform.eulerAngles.y; - // Z = transform.eulerAngles.z; - } - void FixedUpdate() - { - time += Time.deltaTime; - //transform.eulerAngles = new Vector3(X + time * SpinSpeed * Axis.x, Y + time * SpinSpeed* Axis.y, Z + time * SpinSpeed * Axis.z); - transform.Rotate(Axis, SpinSpeed, Space.World); - if (rotateSky && Skybox) - Skybox.SetFloat("_Rotation", -transform.eulerAngles.y); - } - -} diff --git a/Assets/FogVolume/Scripts/Other/Rotator.cs.meta b/Assets/FogVolume/Scripts/Other/Rotator.cs.meta deleted file mode 100644 index 317969d..0000000 --- a/Assets/FogVolume/Scripts/Other/Rotator.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: dac293a41da06984e89012fa19c70a2b -timeCreated: 1466361682 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/TAA.meta b/Assets/FogVolume/Scripts/Other/TAA.meta deleted file mode 100644 index 64e2679..0000000 --- a/Assets/FogVolume/Scripts/Other/TAA.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: c1cb44aeb3d9ad246a7f2f074d0cdf19 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/TAA/Scripts.meta b/Assets/FogVolume/Scripts/Other/TAA/Scripts.meta deleted file mode 100644 index 582386c..0000000 --- a/Assets/FogVolume/Scripts/Other/TAA/Scripts.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: ee378a5b972110a4baa58317a90a5c59 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/TAA/Scripts/EffectBase.cs b/Assets/FogVolume/Scripts/Other/TAA/Scripts/EffectBase.cs deleted file mode 100644 index 4085a66..0000000 --- a/Assets/FogVolume/Scripts/Other/TAA/Scripts/EffectBase.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) <2015> -// This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT) -// AUTHOR: Lasse Jon Fuglsang Pedersen - -using UnityEngine; -namespace FogVolumePlaydeadTAA -{ - public abstract class EffectBase : MonoBehaviour - { - public void EnsureArray(ref T[] array, int size, T initialValue = default(T)) - { - if (array == null || array.Length != size) - { - array = new T[size]; - for (int i = 0; i != size; i++) - array[i] = initialValue; - } - } - - public void EnsureArray(ref T[,] array, int size0, int size1, T defaultValue = default(T)) - { - if (array == null || array.Length != size0 * size1) - { - array = new T[size0, size1]; - for (int i = 0; i != size0; i++) - { - for (int j = 0; j != size1; j++) - array[i, j] = defaultValue; - } - } - } - - public void EnsureMaterial(ref Material material, Shader shader) - { - if (shader != null) - { - if (material == null || material.shader != shader) - material = new Material(shader); - if (material != null) - material.hideFlags = HideFlags.DontSave; - } - else - { - Debug.LogWarning("missing shader", this); - } - } - - public void EnsureDepthTexture(Camera camera) - { - if ((camera.depthTextureMode & DepthTextureMode.Depth) == 0) - camera.depthTextureMode |= DepthTextureMode.Depth; - } - - public void EnsureKeyword(Material material, string name, bool enabled) - { - if (enabled != material.IsKeywordEnabled(name)) - { - if (enabled) - material.EnableKeyword(name); - else - material.DisableKeyword(name); - } - } - - public bool EnsureRenderTarget(ref RenderTexture rt, int width, int height, RenderTextureFormat format, FilterMode filterMode, int depthBits = 0, int antiAliasing = 1) - { - if (rt != null && (rt.width != width || rt.height != height || rt.format != format || rt.filterMode != filterMode || rt.antiAliasing != antiAliasing)) - { - RenderTexture.ReleaseTemporary(rt); - rt = null; - } - if (rt == null) - { - rt = RenderTexture.GetTemporary(width, height, depthBits, format, RenderTextureReadWrite.Default, antiAliasing); - rt.filterMode = filterMode; - rt.wrapMode = TextureWrapMode.Clamp; - return true;// new target - } - return false;// same target - } - - public void ReleaseRenderTarget(ref RenderTexture rt) - { - if (rt != null) - { - RenderTexture.ReleaseTemporary(rt); - rt = null; - } - } - - public void DrawFullscreenQuad() - { - GL.PushMatrix(); - GL.LoadOrtho(); - GL.Begin(GL.QUADS); - { - GL.MultiTexCoord2(0, 0.0f, 0.0f); - GL.Vertex3(0.0f, 0.0f, 0.0f); // BL - - GL.MultiTexCoord2(0, 1.0f, 0.0f); - GL.Vertex3(1.0f, 0.0f, 0.0f); // BR - - GL.MultiTexCoord2(0, 1.0f, 1.0f); - GL.Vertex3(1.0f, 1.0f, 0.0f); // TR - - GL.MultiTexCoord2(0, 0.0f, 1.0f); - GL.Vertex3(0.0f, 1.0f, 0.0f); // TL - } - GL.End(); - GL.PopMatrix(); - } - } -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/Other/TAA/Scripts/EffectBase.cs.meta b/Assets/FogVolume/Scripts/Other/TAA/Scripts/EffectBase.cs.meta deleted file mode 100644 index f95b78c..0000000 --- a/Assets/FogVolume/Scripts/Other/TAA/Scripts/EffectBase.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 71653527b3785194f8b6d3fa76850e12 -timeCreated: 1438002115 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/TAA/Scripts/Extensions.cs b/Assets/FogVolume/Scripts/Other/TAA/Scripts/Extensions.cs deleted file mode 100644 index 5392723..0000000 --- a/Assets/FogVolume/Scripts/Other/TAA/Scripts/Extensions.cs +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) <2015> -// This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT) -// AUTHOR: Lasse Jon Fuglsang Pedersen - -#if UNITY_5_5_OR_NEWER -#define SUPPORT_STEREO -#endif - - -using UnityEngine; -namespace FogVolumePlaydeadTAA -{ - public static class Vector2Extension - { - // positive if v2 is on the left side of v1 - public static float SignedAngle(this Vector2 v1, Vector2 v2) - { - Vector2 n1 = v1.normalized; - Vector2 n2 = v2.normalized; - - float dot = Vector2.Dot(n1, n2); - if (dot > 1.0f) - dot = 1.0f; - if (dot < -1.0f) - dot = -1.0f; - - float theta = Mathf.Acos(dot); - float sgn = Vector2.Dot(new Vector2(-n1.y, n1.x), n2); - if (sgn >= 0.0f) - return theta; - else - return -theta; - } - - public static Vector2 Rotate(this Vector2 v, float theta) - { - float cs = Mathf.Cos(theta); - float sn = Mathf.Sin(theta); - float x1 = v.x * cs - v.y * sn; - float y1 = v.x * sn + v.y * cs; - return new Vector2(x1, y1); - } - } -} -namespace FogVolumePlaydeadTAA -{ - public static class Vector3Extension - { - public static Vector3 WithX(this Vector3 v, float x) - { - return new Vector3(x, v.y, v.z); - } - - public static Vector3 WithY(this Vector3 v, float y) - { - return new Vector3(v.x, y, v.z); - } - - public static Vector3 WithZ(this Vector3 v, float z) - { - return new Vector3(v.x, v.y, z); - } - } -} -namespace FogVolumePlaydeadTAA -{ - public static class Matrix4x4Extension - { - public static Matrix4x4 GetPerspectiveProjection(float left, float right, float bottom, float top, float near, float far) - { - float x = (2.0f * near) / (right - left); - float y = (2.0f * near) / (top - bottom); - float a = (right + left) / (right - left); - float b = (top + bottom) / (top - bottom); - float c = -(far + near) / (far - near); - float d = -(2.0f * far * near) / (far - near); - float e = -1.0f; - - Matrix4x4 m = new Matrix4x4(); - m[0, 0] = x; m[0, 1] = 0; m[0, 2] = a; m[0, 3] = 0; - m[1, 0] = 0; m[1, 1] = y; m[1, 2] = b; m[1, 3] = 0; - m[2, 0] = 0; m[2, 1] = 0; m[2, 2] = c; m[2, 3] = d; - m[3, 0] = 0; m[3, 1] = 0; m[3, 2] = e; m[3, 3] = 0; - return m; - } - - public static Matrix4x4 GetOrthographicProjection(float left, float right, float bottom, float top, float near, float far) - { - float x = 2.0f / (right - left); - float y = 2.0f / (top - bottom); - float z = -2.0f / (far - near); - float a = -(right + left) / (right - left); - float b = -(top + bottom) / (top - bottom); - float c = -(far + near) / (far - near); - float d = 1.0f; - - Matrix4x4 m = new Matrix4x4(); - m[0, 0] = x; m[0, 1] = 0; m[0, 2] = 0; m[0, 3] = a; - m[1, 0] = 0; m[1, 1] = y; m[1, 2] = 0; m[1, 3] = b; - m[2, 0] = 0; m[2, 1] = 0; m[2, 2] = z; m[2, 3] = c; - m[3, 0] = 0; m[3, 1] = 0; m[3, 2] = 0; m[3, 3] = d; - return m; - } - } - -} -namespace FogVolumePlaydeadTAA -{ - public static class CameraExtension - { - public static Vector4 GetProjectionExtents(this Camera camera) - { - return GetProjectionExtents(camera, 0.0f, 0.0f); - } - - public static Vector4 GetProjectionExtents(this Camera camera, float texelOffsetX, float texelOffsetY) - { - if (camera == null) - return Vector4.zero; - - float oneExtentY = camera.orthographic ? camera.orthographicSize : Mathf.Tan(0.5f * Mathf.Deg2Rad * camera.fieldOfView); - float oneExtentX = oneExtentY * camera.aspect; - float texelSizeX = oneExtentX / (0.5f * camera.pixelWidth); - float texelSizeY = oneExtentY / (0.5f * camera.pixelHeight); - float oneJitterX = texelSizeX * texelOffsetX; - float oneJitterY = texelSizeY * texelOffsetY; - - return new Vector4(oneExtentX, oneExtentY, oneJitterX, oneJitterY);// xy = frustum extents at distance 1, zw = jitter at distance 1 - } - -#if SUPPORT_STEREO - public static Vector4 GetProjectionExtents(this Camera camera, Camera.StereoscopicEye eye) - { - return GetProjectionExtents(camera, eye, 0.0f, 0.0f); - } - - public static Vector4 GetProjectionExtents(this Camera camera, Camera.StereoscopicEye eye, float texelOffsetX, float texelOffsetY) - { - Matrix4x4 inv = Matrix4x4.Inverse(camera.GetStereoProjectionMatrix(eye)); - Vector3 ray00 = inv.MultiplyPoint3x4(new Vector3(-1.0f, -1.0f, 0.95f)); - Vector3 ray11 = inv.MultiplyPoint3x4(new Vector3(1.0f, 1.0f, 0.95f)); - - ray00 /= -ray00.z; - ray11 /= -ray11.z; - - float oneExtentX = 0.5f * (ray11.x - ray00.x); - float oneExtentY = 0.5f * (ray11.y - ray00.y); - float texelSizeX = oneExtentX / (0.5f * camera.pixelWidth); - float texelSizeY = oneExtentY / (0.5f * camera.pixelHeight); - float oneJitterX = 0.5f * (ray11.x + ray00.x) + texelSizeX * texelOffsetX; - float oneJitterY = 0.5f * (ray11.y + ray00.y) + texelSizeY * texelOffsetY; - - return new Vector4(oneExtentX, oneExtentY, oneJitterX, oneJitterY);// xy = frustum extents at distance 1, zw = jitter at distance 1 - } -#endif - - public static Matrix4x4 GetProjectionMatrix(this Camera camera) - { - return GetProjectionMatrix(camera, 0.0f, 0.0f); - } - - public static Matrix4x4 GetProjectionMatrix(this Camera camera, float texelOffsetX, float texelOffsetY) - { - if (camera == null) - return Matrix4x4.identity; - - Vector4 extents = GetProjectionExtents(camera, texelOffsetX, texelOffsetY); - - float cf = camera.farClipPlane; - float cn = camera.nearClipPlane; - float xm = extents.z - extents.x; - float xp = extents.z + extents.x; - float ym = extents.w - extents.y; - float yp = extents.w + extents.y; - - if (camera.orthographic) - return Matrix4x4Extension.GetOrthographicProjection(xm, xp, ym, yp, cn, cf); - else - return Matrix4x4Extension.GetPerspectiveProjection(xm * cn, xp * cn, ym * cn, yp * cn, cn, cf); - } - } -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/Other/TAA/Scripts/Extensions.cs.meta b/Assets/FogVolume/Scripts/Other/TAA/Scripts/Extensions.cs.meta deleted file mode 100644 index fe5d410..0000000 --- a/Assets/FogVolume/Scripts/Other/TAA/Scripts/Extensions.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 7a15030261814fb4888105b7394a274c -timeCreated: 1437997052 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/TAA/Scripts/FrustumJitter.cs b/Assets/FogVolume/Scripts/Other/TAA/Scripts/FrustumJitter.cs deleted file mode 100644 index b8a99c3..0000000 --- a/Assets/FogVolume/Scripts/Other/TAA/Scripts/FrustumJitter.cs +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright (c) <2015> -// This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT) -// AUTHOR: Lasse Jon Fuglsang Pedersen - -#if UNITY_5_5_OR_NEWER -#define SUPPORT_STEREO -#endif - -using UnityEngine; -namespace FogVolumePlaydeadTAA -{ - public class FrustumJitter : MonoBehaviour - { - #region Static point data - private static float[] points_Still = new float[] { - 0.5f, 0.5f, - }; - private static float[] points_Uniform2 = new float[] { - -0.25f, -0.25f,//ll - 0.25f, 0.25f,//ur - }; - private static float[] points_Uniform4 = new float[] { - -0.25f, -0.25f,//ll - 0.25f, -0.25f,//lr - 0.25f, 0.25f,//ur - -0.25f, 0.25f,//ul - }; - private static float[] points_Uniform4_Helix = new float[] { - -0.25f, -0.25f,//ll 3 1 - 0.25f, 0.25f,//ur \/| - 0.25f, -0.25f,//lr /\| - -0.25f, 0.25f,//ul 0 2 - }; - private static float[] points_Uniform4_DoubleHelix = new float[] { - -0.25f, -0.25f,//ll 3 1 - 0.25f, 0.25f,//ur \/| - 0.25f, -0.25f,//lr /\| - -0.25f, 0.25f,//ul 0 2 - -0.25f, -0.25f,//ll 6--7 - 0.25f, -0.25f,//lr \ - -0.25f, 0.25f,//ul \ - 0.25f, 0.25f,//ur 4--5 - }; - private static float[] points_SkewButterfly = new float[] { - -0.250f, -0.250f, - 0.250f, 0.250f, - 0.125f, -0.125f, - -0.125f, 0.125f, - }; - private static float[] points_Rotated4 = new float[] { - -0.125f, -0.375f,//ll - 0.375f, -0.125f,//lr - 0.125f, 0.375f,//ur - -0.375f, 0.125f,//ul - }; - private static float[] points_Rotated4_Helix = new float[] { - -0.125f, -0.375f,//ll 3 1 - 0.125f, 0.375f,//ur \/| - 0.375f, -0.125f,//lr /\| - -0.375f, 0.125f,//ul 0 2 - }; - private static float[] points_Rotated4_Helix2 = new float[] { - -0.125f, -0.375f,//ll 2--1 - 0.125f, 0.375f,//ur \/ - -0.375f, 0.125f,//ul /\ - 0.375f, -0.125f,//lr 0 3 - }; - private static float[] points_Poisson10 = new float[] { - -0.16795960f*0.25f, 0.65544910f*0.25f, - -0.69096030f*0.25f, 0.59015970f*0.25f, - 0.49843820f*0.25f, 0.83099720f*0.25f, - 0.17230150f*0.25f, -0.03882703f*0.25f, - -0.60772670f*0.25f, -0.06013587f*0.25f, - 0.65606390f*0.25f, 0.24007600f*0.25f, - 0.80348370f*0.25f, -0.48096900f*0.25f, - 0.33436540f*0.25f, -0.73007030f*0.25f, - -0.47839520f*0.25f, -0.56005300f*0.25f, - -0.12388120f*0.25f, -0.96633990f*0.25f, - }; - private static float[] points_Pentagram = new float[] { - 0.000000f*0.5f, 0.525731f*0.5f,// head - -0.309017f*0.5f, -0.425325f*0.5f,// lleg - 0.500000f*0.5f, 0.162460f*0.5f,// rarm - -0.500000f*0.5f, 0.162460f*0.5f,// larm - 0.309017f*0.5f, -0.425325f*0.5f,// rleg - }; - private static float[] points_Halton_2_3_x8 = new float[8 * 2]; - private static float[] points_Halton_2_3_x16 = new float[16 * 2]; - private static float[] points_Halton_2_3_x32 = new float[32 * 2]; - private static float[] points_Halton_2_3_x256 = new float[256 * 2]; - private static float[] points_MotionPerp2 = new float[] { - 0.00f, -0.25f, - 0.00f, 0.25f, - }; - #endregion - - #region Static point data, static initialization - private static void TransformPattern(float[] seq, float theta, float scale) - { - float cs = Mathf.Cos(theta); - float sn = Mathf.Sin(theta); - for (int i = 0, j = 1, n = seq.Length; i != n; i += 2, j += 2) - { - float x = scale * seq[i]; - float y = scale * seq[j]; - seq[i] = x * cs - y * sn; - seq[j] = x * sn + y * cs; - } - } - - // http://en.wikipedia.org/wiki/Halton_sequence - private static float HaltonSeq(int prime, int index = 1/* NOT! zero-based */) - { - float r = 0.0f; - float f = 1.0f; - int i = index; - while (i > 0) - { - f /= prime; - r += f * (i % prime); - i = (int)Mathf.Floor(i / (float)prime); - } - return r; - } - - private static void InitializeHalton_2_3(float[] seq) - { - for (int i = 0, n = seq.Length / 2; i != n; i++) - { - float u = HaltonSeq(2, i + 1) - 0.5f; - float v = HaltonSeq(3, i + 1) - 0.5f; - seq[2 * i + 0] = u; - seq[2 * i + 1] = v; - } - } - - static FrustumJitter() - { - // points_Pentagram - Vector2 vh = new Vector2(points_Pentagram[0] - points_Pentagram[2], points_Pentagram[1] - points_Pentagram[3]); - Vector2 vu = new Vector2(0.0f, 1.0f); - TransformPattern(points_Pentagram, Mathf.Deg2Rad * (0.5f * Vector2.Angle(vu, vh)), 1.0f); - - // points_Halton_2_3_xN - InitializeHalton_2_3(points_Halton_2_3_x8); - InitializeHalton_2_3(points_Halton_2_3_x16); - InitializeHalton_2_3(points_Halton_2_3_x32); - InitializeHalton_2_3(points_Halton_2_3_x256); - } - #endregion - - #region Static point data accessors - public enum Pattern - { - Still, - Uniform2, - Uniform4, - Uniform4_Helix, - Uniform4_DoubleHelix, - SkewButterfly, - Rotated4, - Rotated4_Helix, - Rotated4_Helix2, - Poisson10, - Pentagram, - Halton_2_3_X8, - Halton_2_3_X16, - Halton_2_3_X32, - Halton_2_3_X256, - MotionPerp2, - }; - - private static float[] AccessPointData(Pattern pattern) - { - switch (pattern) - { - case Pattern.Still: - return points_Still; - case Pattern.Uniform2: - return points_Uniform2; - case Pattern.Uniform4: - return points_Uniform4; - case Pattern.Uniform4_Helix: - return points_Uniform4_Helix; - case Pattern.Uniform4_DoubleHelix: - return points_Uniform4_DoubleHelix; - case Pattern.SkewButterfly: - return points_SkewButterfly; - case Pattern.Rotated4: - return points_Rotated4; - case Pattern.Rotated4_Helix: - return points_Rotated4_Helix; - case Pattern.Rotated4_Helix2: - return points_Rotated4_Helix2; - case Pattern.Poisson10: - return points_Poisson10; - case Pattern.Pentagram: - return points_Pentagram; - case Pattern.Halton_2_3_X8: - return points_Halton_2_3_x8; - case Pattern.Halton_2_3_X16: - return points_Halton_2_3_x16; - case Pattern.Halton_2_3_X32: - return points_Halton_2_3_x32; - case Pattern.Halton_2_3_X256: - return points_Halton_2_3_x256; - case Pattern.MotionPerp2: - return points_MotionPerp2; - default: - Debug.LogError("missing point distribution"); - return points_Halton_2_3_x16; - } - } - - public static int AccessLength(Pattern pattern) - { - return AccessPointData(pattern).Length / 2; - } - - public Vector2 Sample(Pattern pattern, int index) - { - float[] points = AccessPointData(pattern); - int n = points.Length / 2; - int i = index % n; - - float x = patternScale * points[2 * i + 0]; - float y = patternScale * points[2 * i + 1]; - - if (pattern != Pattern.MotionPerp2) - return new Vector2(x, y); - else - return new Vector2(x, y).Rotate(Vector2.right.SignedAngle(focalMotionDir)); - } - #endregion - - private Camera _camera; - - private Vector3 focalMotionPos = Vector3.zero; - private Vector3 focalMotionDir = Vector3.right; - - public Pattern pattern = Pattern.Halton_2_3_X16; - public float patternScale = .2f; - - public Vector4 activeSample = Vector4.zero;// xy = current sample, zw = previous sample - public int activeIndex = -2; - - void Reset() - { - _camera = GetComponent(); - } - - void Clear() - { - _camera.ResetProjectionMatrix(); - - activeSample = Vector4.zero; - activeIndex = -2; - } - - void Awake() - { - Reset(); - Clear(); - } - - void OnPreCull() - { - // update motion dir - { - Vector3 oldWorld = focalMotionPos; - Vector3 newWorld = _camera.transform.TransformVector(_camera.nearClipPlane * Vector3.forward); - - Vector3 oldPoint = (_camera.worldToCameraMatrix * oldWorld); - Vector3 newPoint = (_camera.worldToCameraMatrix * newWorld); - Vector3 newDelta = (newPoint - oldPoint).WithZ(0.0f); - - var mag = newDelta.magnitude; - if (mag != 0.0f) - { - var dir = newDelta / mag;// yes, apparently this is necessary instead of newDelta.normalized... because facepalm - if (dir.sqrMagnitude != 0.0f) - { - focalMotionPos = newWorld; - focalMotionDir = Vector3.Slerp(focalMotionDir, dir, 0.2f); - //Debug.Log("CHANGE focalMotionDir " + focalMotionDir.ToString("G4") + " delta was " + newDelta.ToString("G4") + " delta.mag " + newDelta.magnitude); - } - } - } - - // update jitter -#if SUPPORT_STEREO - if (_camera.stereoEnabled) - { - Clear(); - } - else -#endif - { - if (activeIndex == -2) - { - activeSample = Vector4.zero; - activeIndex += 1; - - _camera.projectionMatrix = _camera.GetProjectionMatrix(); - } - else - { - activeIndex += 1; - activeIndex %= AccessLength(pattern); - - Vector2 sample = Sample(pattern, activeIndex); - activeSample.z = activeSample.x; - activeSample.w = activeSample.y; - activeSample.x = sample.x; - activeSample.y = sample.y; - - _camera.projectionMatrix = _camera.GetProjectionMatrix(sample.x, sample.y); - } - } - } - - void OnDisable() - { - Clear(); - } - } -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/Other/TAA/Scripts/FrustumJitter.cs.meta b/Assets/FogVolume/Scripts/Other/TAA/Scripts/FrustumJitter.cs.meta deleted file mode 100644 index 69a5ba7..0000000 --- a/Assets/FogVolume/Scripts/Other/TAA/Scripts/FrustumJitter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: f190843bed4dc784dbe5695ab8702345 -timeCreated: 1437991076 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/TAA/Scripts/VelocityBuffer.cs b/Assets/FogVolume/Scripts/Other/TAA/Scripts/VelocityBuffer.cs deleted file mode 100644 index 4e4b602..0000000 --- a/Assets/FogVolume/Scripts/Other/TAA/Scripts/VelocityBuffer.cs +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (c) <2015> -// This file is subject to the MIT License as seen in the root of this folder structure (LICENSE.TXT) -// AUTHOR: Lasse Jon Fuglsang Pedersen - -#if UNITY_5_5_OR_NEWER -#define SUPPORT_STEREO -#endif - -using UnityEngine; - -namespace FogVolumePlaydeadTAA -{ - public class VelocityBuffer : EffectBase - { -#if UNITY_PS4 - private const RenderTextureFormat velocityFormat = RenderTextureFormat.RGHalf; -#else - private const RenderTextureFormat velocityFormat = RenderTextureFormat.RGFloat; -#endif - - private Camera _camera; - private FrustumJitter _frustumJitter; - - public Shader velocityShader; - private Material velocityMaterial; - private RenderTexture[] velocityBuffer; - private RenderTexture[] velocityNeighborMax; - - private bool[] paramInitialized; - private Vector4[] paramProjectionExtents; - private Matrix4x4[] paramCurrV; - private Matrix4x4[] paramCurrVP; - private Matrix4x4[] paramPrevVP; - private Matrix4x4[] paramPrevVP_NoFlip; - - private int activeEyeIndex = -1; - public RenderTexture activeVelocityBuffer { get { return (activeEyeIndex != -1) ? velocityBuffer[activeEyeIndex] : null; } } - public RenderTexture activeVelocityNeighborMax { get { return (activeEyeIndex != -1) ? velocityNeighborMax[activeEyeIndex] : null; } } - - public enum NeighborMaxSupport - { - TileSize10, - TileSize20, - TileSize40, - }; - - public bool neighborMaxGen = false; - public NeighborMaxSupport neighborMaxSupport = NeighborMaxSupport.TileSize20; - - // private float timeScaleNextFrame; - // public float timeScale { get; private set; } - -#if UNITY_EDITOR - [Header("Stats")] - public int numResident = 0; - public int numRendered = 0; - public int numDrawCalls = 0; -#endif - - void Reset() - { - _camera = GetComponent(); - _frustumJitter = GetComponent(); - } - - void Clear() - { - EnsureArray(ref paramInitialized, 2); - paramInitialized[0] = false; - paramInitialized[1] = false; - } - - void OnEnable() - { - //field not assigned when added by code from Fog Volume. So: - velocityShader = Shader.Find("Hidden/VelocityBuffer"); - Reset(); - } - void Awake() - { - - Reset(); - Clear(); - } - - //void Start() - //{ - // timeScaleNextFrame = Time.timeScale; - //} - - void OnPreRender() - { - // EnsureDepthTexture(_camera); - } - - //void OnPostRender() - public void GenerateVelocityBuffer() - { - EnsureArray(ref velocityBuffer, 2); - EnsureArray(ref velocityNeighborMax, 2); - - EnsureArray(ref paramInitialized, 2, initialValue: false); - EnsureArray(ref paramProjectionExtents, 2); - EnsureArray(ref paramCurrV, 2); - EnsureArray(ref paramCurrVP, 2); - EnsureArray(ref paramPrevVP, 2); - EnsureArray(ref paramPrevVP_NoFlip, 2); - - EnsureMaterial(ref velocityMaterial, velocityShader); - if (velocityMaterial == null) - return; - - //timeScale = timeScaleNextFrame; - //timeScaleNextFrame = (Time.timeScale == 0.0f) ? timeScaleNextFrame : Time.timeScale; - if (_camera == null) _camera = GetComponent(); - if (_frustumJitter == null) _frustumJitter = GetComponent(); -#if SUPPORT_STEREO - int eyeIndex = 0; - - eyeIndex =(_camera.stereoActiveEye - == Camera.MonoOrStereoscopicEye.Right) ? 1 : 0; -#else - int eyeIndex = 0; -#endif - int bufferW = _camera.pixelWidth; - int bufferH = _camera.pixelHeight; - - - if (EnsureRenderTarget(ref velocityBuffer[eyeIndex], bufferW, bufferH, velocityFormat, FilterMode.Point, depthBits: 16)) - Clear(); - - EnsureKeyword(velocityMaterial, "CAMERA_PERSPECTIVE", !_camera.orthographic); - EnsureKeyword(velocityMaterial, "CAMERA_ORTHOGRAPHIC", _camera.orthographic); - - EnsureKeyword(velocityMaterial, "TILESIZE_10", neighborMaxSupport == NeighborMaxSupport.TileSize10); - EnsureKeyword(velocityMaterial, "TILESIZE_20", neighborMaxSupport == NeighborMaxSupport.TileSize20); - EnsureKeyword(velocityMaterial, "TILESIZE_40", neighborMaxSupport == NeighborMaxSupport.TileSize40); - -#if SUPPORT_STEREO - if (_camera.stereoEnabled) - { - for (int i = 0; i != 2; i++) - { - Camera.StereoscopicEye eye = (Camera.StereoscopicEye)i; - - Matrix4x4 currV = _camera.GetStereoViewMatrix(eye); - Matrix4x4 currP = GL.GetGPUProjectionMatrix(_camera.GetStereoProjectionMatrix(eye), true); - Matrix4x4 currP_NoFlip = GL.GetGPUProjectionMatrix(_camera.GetStereoProjectionMatrix(eye), false); - Matrix4x4 prevV = paramInitialized[i] ? paramCurrV[i] : currV; - - paramInitialized[i] = true; - paramProjectionExtents[i] = _camera.GetProjectionExtents(eye); - paramCurrV[i] = currV; - paramCurrVP[i] = currP * currV; - paramPrevVP[i] = currP * prevV; - paramPrevVP_NoFlip[i] = currP_NoFlip * prevV; - } - } - else -#endif - { - Matrix4x4 currV = _camera.worldToCameraMatrix; - Matrix4x4 currP = GL.GetGPUProjectionMatrix(_camera.projectionMatrix, true); - Matrix4x4 currP_NoFlip = GL.GetGPUProjectionMatrix(_camera.projectionMatrix, false); - Matrix4x4 prevV = paramInitialized[0] ? paramCurrV[0] : currV; - - paramInitialized[0] = true; - paramProjectionExtents[0] = _frustumJitter.enabled ? _camera.GetProjectionExtents(_frustumJitter.activeSample.x, _frustumJitter.activeSample.y) : _camera.GetProjectionExtents(); - paramCurrV[0] = currV; - paramCurrVP[0] = currP * currV; - paramPrevVP[0] = currP * prevV; - paramPrevVP_NoFlip[0] = currP_NoFlip * prevV; - } - - RenderTexture activeRT = RenderTexture.active; - RenderTexture.active = velocityBuffer[eyeIndex]; - { - GL.Clear(true, true, Color.black); - - const int kPrepass = 0; - // const int kVertices = 1; - //const int kVerticesSkinned = 2; - const int kTileMax = 3; - const int kNeighborMax = 4; - - // 0: prepass -#if SUPPORT_STEREO - velocityMaterial.SetVectorArray("_ProjectionExtents", paramProjectionExtents); - velocityMaterial.SetMatrixArray("_CurrV", paramCurrV); - velocityMaterial.SetMatrixArray("_CurrVP", paramCurrVP); - velocityMaterial.SetMatrixArray("_PrevVP", paramPrevVP); - velocityMaterial.SetMatrixArray("_PrevVP_NoFlip", paramPrevVP_NoFlip); -#else - velocityMaterial.SetVector("_ProjectionExtents", paramProjectionExtents[0]); - velocityMaterial.SetMatrix("_CurrV", paramCurrV[0]); - velocityMaterial.SetMatrix("_CurrVP", paramCurrVP[0]); - velocityMaterial.SetMatrix("_PrevVP", paramPrevVP[0]); - velocityMaterial.SetMatrix("_PrevVP_NoFlip", paramPrevVP_NoFlip[0]); -#endif - velocityMaterial.SetPass(kPrepass); - DrawFullscreenQuad(); - - // 1 + 2: vertices + vertices skinned -// var obs = VelocityBufferTag.activeObjects; -//#if UNITY_EDITOR -// numResident = obs.Count; -// numRendered = 0; -// numDrawCalls = 0; -//#endif -// for (int i = 0, n = obs.Count; i != n; i++) -// { -// var ob = obs[i]; -// if (ob != null && ob.rendering && ob.mesh != null) -// { -// velocityMaterial.SetMatrix("_CurrM", ob.localToWorldCurr); -// velocityMaterial.SetMatrix("_PrevM", ob.localToWorldPrev); -// velocityMaterial.SetPass(ob.meshSmrActive ? kVerticesSkinned : kVertices); - -// for (int j = 0; j != ob.mesh.subMeshCount; j++) -// { -// Graphics.DrawMeshNow(ob.mesh, Matrix4x4.identity, j); -//#if UNITY_EDITOR -// numDrawCalls++; -//#endif -// } -//#if UNITY_EDITOR -// numRendered++; -//#endif -// } -// } - - // 3 + 4: tilemax + neighbormax - if (neighborMaxGen) - { - int tileSize = 1; - - switch (neighborMaxSupport) - { - case NeighborMaxSupport.TileSize10: tileSize = 10; break; - case NeighborMaxSupport.TileSize20: tileSize = 20; break; - case NeighborMaxSupport.TileSize40: tileSize = 40; break; - } - - int neighborMaxW = bufferW / tileSize; - int neighborMaxH = bufferH / tileSize; - - EnsureRenderTarget(ref velocityNeighborMax[eyeIndex], neighborMaxW, neighborMaxH, velocityFormat, FilterMode.Bilinear); - - // tilemax - RenderTexture tileMax = RenderTexture.GetTemporary(neighborMaxW, neighborMaxH, 0, velocityFormat); - RenderTexture.active = tileMax; - { - velocityMaterial.SetTexture("_VelocityTex", velocityBuffer[eyeIndex]); - velocityMaterial.SetVector("_VelocityTex_TexelSize", new Vector4(1.0f / bufferW, 1.0f / bufferH, 0.0f, 0.0f)); - velocityMaterial.SetPass(kTileMax); - DrawFullscreenQuad(); - } - - // neighbormax - RenderTexture.active = velocityNeighborMax[eyeIndex]; - { - velocityMaterial.SetTexture("_VelocityTex", tileMax); - velocityMaterial.SetVector("_VelocityTex_TexelSize", new Vector4(1.0f / neighborMaxW, 1.0f / neighborMaxH, 0.0f, 0.0f)); - velocityMaterial.SetPass(kNeighborMax); - DrawFullscreenQuad(); - } - - RenderTexture.ReleaseTemporary(tileMax); - } - else - { - ReleaseRenderTarget(ref velocityNeighborMax[0]); - ReleaseRenderTarget(ref velocityNeighborMax[1]); - } - } - RenderTexture.active = activeRT; - - activeEyeIndex = eyeIndex; - } - - void OnDisable() - { - if (velocityBuffer != null) - { - ReleaseRenderTarget(ref velocityBuffer[0]); - ReleaseRenderTarget(ref velocityBuffer[1]); - } - if (velocityNeighborMax != null) - { - ReleaseRenderTarget(ref velocityNeighborMax[0]); - ReleaseRenderTarget(ref velocityNeighborMax[1]); - } - } - } -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/Other/TAA/Scripts/VelocityBuffer.cs.meta b/Assets/FogVolume/Scripts/Other/TAA/Scripts/VelocityBuffer.cs.meta deleted file mode 100644 index 49d14cf..0000000 --- a/Assets/FogVolume/Scripts/Other/TAA/Scripts/VelocityBuffer.cs.meta +++ /dev/null @@ -1,15 +0,0 @@ -fileFormatVersion: 2 -guid: 3b72bf67d4b8dea4ca604f04602a7128 -timeCreated: 1438011374 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: - - velocityShader: {fileID: 4800000, guid: 0d7f09e63dd99504ca6e04212a21ec72, type: 3} - - velocityBuffer: {instanceID: 0} - - velocityNeighborMax: {instanceID: 0} - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Other/ToggleChildren.cs b/Assets/FogVolume/Scripts/Other/ToggleChildren.cs deleted file mode 100644 index 2868752..0000000 --- a/Assets/FogVolume/Scripts/Other/ToggleChildren.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -[ExecuteInEditMode] -public class ToggleChildren : MonoBehaviour { - public KeyCode Key = KeyCode.F; - // Use this for initialization - GameObject[] Children=null; - bool active=true; - void OnEnable () { - Children = new GameObject[gameObject.transform.childCount]; - for (int i = 0; i < gameObject.transform.childCount; i++) - { - Children[i] = gameObject.transform.GetChild(i).gameObject; - } - } - - // Update is called once per frame - void Update () { - if (Input.GetKeyDown(Key)) - { - active = !active; - for (int i = 0; i < gameObject.transform.childCount; i++) - { - Children[i].SetActive(active); - } - - } - - - - } -} diff --git a/Assets/FogVolume/Scripts/Other/ToggleChildren.cs.meta b/Assets/FogVolume/Scripts/Other/ToggleChildren.cs.meta deleted file mode 100644 index d4e0306..0000000 --- a/Assets/FogVolume/Scripts/Other/ToggleChildren.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 04cf04c76bf3412439681a871e089add -timeCreated: 1485998379 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/ShadowCamera.cs b/Assets/FogVolume/Scripts/ShadowCamera.cs deleted file mode 100644 index 3e5e0ae..0000000 --- a/Assets/FogVolume/Scripts/ShadowCamera.cs +++ /dev/null @@ -1,261 +0,0 @@ -using UnityEngine; -using UnityEngine.Profiling; -[ExecuteInEditMode] -public class ShadowCamera : MonoBehaviour -{ - Camera ThisCamera = null; - GameObject Dad = null; - FogVolume Fog = null; - public RenderTexture RT_Opacity, RT_OpacityBlur, RT_PostProcess; - public RenderTexture GetOpacityRT() - { - return RT_Opacity; - } - public RenderTexture GetOpacityBlurRT() - { - return RT_OpacityBlur; - } - - [System.Serializable] - public enum TextureSize - { - _64 = 64, - _128 = 128, - _256 = 256, - _512 = 512, - _1024 = 1024 - }; - - public TextureSize SetTextureSize - { - set - { - if (value != textureSize) - SetQuality(value); - } - get - { - return textureSize; - } - } - public TextureSize textureSize = TextureSize._128; - /// Blur iterations - larger number means more blur. - [Range(0, 10)] - public int iterations = 3; - - /// Blur spread for each iteration. Lower values - /// give better looking blur, but require more iterations to - /// get large blurs. Value is usually between 0.5 and 1.0. - [Range(0.0f, 1)] - public float blurSpread = 0.6f; - public int Downsampling = 2; - void SetQuality(TextureSize value) - { - textureSize = value; - // print((int)textureSize); - } - Shader blurShader = null; - Shader PostProcessShader = null; - Material blurMaterial = null; - Material postProcessMaterial = null; - protected Material BlurMaterial - { - get - { - if (blurMaterial == null) - { - blurMaterial = new Material(blurShader); - blurMaterial.hideFlags = HideFlags.DontSave; - } - return blurMaterial; - } - } - protected Material PostProcessMaterial - { - get - { - if (postProcessMaterial == null) - { - postProcessMaterial = new Material(PostProcessShader); - postProcessMaterial.hideFlags = HideFlags.DontSave; - } - return postProcessMaterial; - } - } - protected void GetRT(ref RenderTexture rt, int size, string name) - { - // Release existing one - ReleaseRT(rt); - rt = RenderTexture.GetTemporary(size, size, 0, RenderTextureFormat.R8, RenderTextureReadWrite.Linear); - rt.filterMode = FilterMode.Bilinear; - rt.name = name; - rt.wrapMode = TextureWrapMode.Repeat; - - } - public void ReleaseRT(RenderTexture rt) - { - if (rt != null) - { - RenderTexture.ReleaseTemporary(rt); - rt = null; - } - } - - // Performs one blur iteration. - public void FourTapCone(RenderTexture source, RenderTexture dest, int iteration) - { - float off = 0.5f + iteration * blurSpread; - Graphics.BlitMultiTap(source, dest, BlurMaterial, - new Vector2(-off, -off), - new Vector2(-off, off), - new Vector2(off, off), - new Vector2(off, -off) - ); - } - - // Downsamples the texture to a quarter resolution. - private void DownSample(RenderTexture source, RenderTexture dest) - { - float off = 1.0f; - Graphics.BlitMultiTap(source, dest, BlurMaterial, - new Vector2(-off, -off), - new Vector2(-off, off), - new Vector2(off, off), - new Vector2(off, -off) - ); - } - - void Blur(RenderTexture Input, int BlurRTSize) - { - RenderTexture RT_OpacityBlur2 = null; - GetRT(ref RT_OpacityBlur, BlurRTSize, "Shadow blurred"); - GetRT(ref RT_OpacityBlur2, BlurRTSize, "Shadow blurred"); - // Copy source to the smaller texture. - DownSample(Input, RT_OpacityBlur); - //Graphics.Blit(Input, RT_OpacityBlur); - - // Blur the small texture - for (int i = 0; i < iterations; i++) - { - FourTapCone(RT_OpacityBlur, RT_OpacityBlur2, i); - FogVolumeUtilities.ExtensionMethods.Swap(ref RT_OpacityBlur, ref RT_OpacityBlur2); - } - - - Shader.SetGlobalTexture("RT_OpacityBlur", RT_OpacityBlur); - Fog.RT_OpacityBlur = RT_OpacityBlur; - } - - - - void RenderShadowMap() - { - //ideally, a cheaper version should be rendered here. - //So lets render a version with no lighting stuff - Profiler.BeginSample(Fog.name + " shadows"); - Fog.FogVolumeShader.maximumLOD = 100; - - SetQuality(textureSize); - GetRT(ref RT_Opacity, (int)textureSize, "Opacity"); - ThisCamera.targetTexture = RT_Opacity; - // print(Fog.ShadowCameraSkippedFrames); - ThisCamera.Render(); - Fog.RT_Opacity = RT_Opacity; - - // Shader.SetGlobalTexture("RT_Opacity", RT_Opacity); - if (RT_Opacity != null) - { - GetRT(ref RT_PostProcess, (int)textureSize, "Shadow PostProcess"); - PostProcessMaterial.SetFloat("ShadowColor", Fog.ShadowColor.a); - // PostProcessMaterial.SetFloat("_jitter", Fog._jitter); - Graphics.Blit(RT_Opacity, RT_PostProcess, PostProcessMaterial); - // ThisCamera.targetTexture = null; - Graphics.Blit(RT_PostProcess, RT_Opacity); - //RenderTexture.ReleaseTemporary(RT_Opacity); - if (iterations > 0) - { - Blur(RT_Opacity, (int)textureSize >> Downsampling); - } - else - { - Shader.SetGlobalTexture("RT_OpacityBlur", RT_Opacity); - Fog.RT_OpacityBlur = RT_Opacity; - } - Fog.RT_Opacity = RT_Opacity; - } - //Shader.SetGlobalTexture("RT_Opacity", RT_Opacity); - BlurMaterial.SetFloat("ShadowColor", Fog.ShadowColor.a); - - // back to normal - Fog.FogVolumeShader.maximumLOD = 600; - - Profiler.EndSample(); - } - - void ShaderLoad() - { - blurShader = Shader.Find("Hidden/Fog Volume/BlurEffectConeTap"); - if (blurShader == null) print("Hidden / Fog Volume / BlurEffectConeTap #SHADER ERROR#"); - - PostProcessShader = Shader.Find("Hidden/Fog Volume/Shadow Postprocess"); - if (PostProcessShader == null) print("Hidden/Fog Volume/Shadow Postprocess #SHADER ERROR#"); - } - - void OnEnable() - { - ShaderLoad(); - Dad = transform.parent.gameObject; - Fog = Dad.GetComponent(); - ThisCamera = gameObject.GetComponent(); - ThisCamera.depthTextureMode = DepthTextureMode.Depth; - CameraTransform(); - } - - public void CameraTransform() - { - if (ThisCamera != null) - { - ThisCamera.orthographicSize = Dad.GetComponent().fogVolumeScale.x / 2; - ThisCamera.transform.position = Dad.transform.position; - ThisCamera.farClipPlane = Fog.fogVolumeScale.y + Fog.shadowCameraPosition; - // print(ThisCamera.farClipPlane); - Vector3 VerticalTranslate = new Vector3(0, 0, Fog.fogVolumeScale.y / 2 - Fog.shadowCameraPosition); - // print(Fog.ShadowCameraPosition); - - ThisCamera.transform.Translate(VerticalTranslate, Space.Self); - Quaternion target = Quaternion.Euler(90, 0, 0); - ThisCamera.transform.rotation = Dad.transform.rotation * target; - - ThisCamera.enabled = false; - - if (Fog.SunAttached) - { - Fog.Sun.transform.rotation = Dad.transform.rotation * target; - } - } - } - // Update is called once per frame - void Update() - { - // print(Fog.name + " visibility: " + Fog.IsVisible); - if (Fog.IsVisible && Fog.CastShadows)//3.1.7 - { - if (FogVolumeUtilities.ExtensionMethods.TimeSnap(Fog.ShadowCameraSkippedFrames)) - RenderShadowMap(); -#if UNITY_EDITOR - CameraTransform(); -#endif - } - } - - void OnDisable() - { - RenderTexture.active = null; - ThisCamera.targetTexture = null; - if (RT_Opacity) DestroyImmediate(RT_Opacity); - if (RT_OpacityBlur) DestroyImmediate(RT_OpacityBlur); - if (RT_PostProcess) DestroyImmediate(RT_PostProcess); - if (blurMaterial) DestroyImmediate(blurMaterial); - if (postProcessMaterial) DestroyImmediate(postProcessMaterial); - } -} diff --git a/Assets/FogVolume/Scripts/ShadowCamera.cs.meta b/Assets/FogVolume/Scripts/ShadowCamera.cs.meta deleted file mode 100644 index 4ba2f2f..0000000 --- a/Assets/FogVolume/Scripts/ShadowCamera.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 68069141b4834cc4c9ba4adc8aabbf07 -timeCreated: 1483291907 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/FogVolume/Scripts/Utilities.cs b/Assets/FogVolume/Scripts/Utilities.cs deleted file mode 100644 index 2877c0e..0000000 --- a/Assets/FogVolume/Scripts/Utilities.cs +++ /dev/null @@ -1,146 +0,0 @@ -using UnityEngine; -using System.Collections.Generic; -#if UNITY_EDITOR -using UnityEditor; -#endif -namespace FogVolumeUtilities -{ - public static class ExtensionMethods - { - public static float Remap(this float value, float from1, float to1, float from2, float to2) - { - return (value - from1) / (to1 - from1) * (to2 - from2) + from2; - } - public static bool TimeSnap(int Frames) - { - bool refresh = true; - if (Application.isPlaying) - { - refresh = Time.frameCount <= 3 || (Time.frameCount % (1 + Frames)) == 0; - - return (refresh); - } - else - return true; - } - - public static void Swap(ref T lhs, ref T rhs) - { - T temp = lhs; - lhs = rhs; - rhs = temp; - } - } - public class Rendering - { - public static void EnsureKeyword(Material material, string name, bool enabled) - { - if (enabled != material.IsKeywordEnabled(name)) - { - if (enabled) - material.EnableKeyword(name); - else - material.DisableKeyword(name); - } - } - } - public struct int2 - { - public int x; - public int y; - public int2(int x, int y) - { - this.x = x; this.y = y; - } - - } - - - - - - public static class EditorExtension - { - private static string[] m_LayerNames = null; - private static int[] m_LayerMasks = null; - - static EditorExtension() - { - var tmpNames = new List(); - var tmpMasks = new List(); - for (int i = 0; i < 32; i++) - { - try - { - var name = LayerMask.LayerToName(i); - if (name != "") - { - tmpNames.Add(name); - tmpMasks.Add(1 << i); - } - } - catch { } - } - m_LayerNames = tmpNames.ToArray(); - m_LayerMasks = tmpMasks.ToArray(); - } - - public static void ToggleInHierarchy(Object obj, bool visible) - { - #if UNITY_EDITOR - if (visible) - obj.hideFlags = HideFlags.None; - else - obj.hideFlags = HideFlags.HideInHierarchy; - try - { - EditorApplication.RepaintHierarchyWindow(); - EditorApplication.DirtyHierarchyWindowSorting(); - } - catch { } - #endif - } -#if UNITY_EDITOR - public static int DrawLayerMaskField(Rect aPosition, int aMask, GUIContent aLabel) - { - int val = aMask; - int maskVal = 0; - for (int i = 0; i < m_LayerNames.Length; i++) - { - if (m_LayerMasks[i] != 0) - { - if ((val & m_LayerMasks[i]) == m_LayerMasks[i]) - maskVal |= 1 << i; - } - else if (val == 0) - maskVal |= 1 << i; - } - int newMaskVal = UnityEditor.EditorGUI.MaskField(aPosition, aLabel, maskVal, m_LayerNames); - int changes = maskVal ^ newMaskVal; - - for (int i = 0; i < m_LayerMasks.Length; i++) - { - if ((changes & (1 << i)) != 0) // has this list item changed? - { - if ((newMaskVal & (1 << i)) != 0) // has it been set? - { - if (m_LayerMasks[i] == 0) // special case: if "0" is set, just set the val to 0 - { - val = 0; - break; - } - else - val |= m_LayerMasks[i]; - } - else // it has been reset - { - val &= ~m_LayerMasks[i]; - } - } - } - return val; - } -#endif - } - -} \ No newline at end of file diff --git a/Assets/FogVolume/Scripts/Utilities.cs.meta b/Assets/FogVolume/Scripts/Utilities.cs.meta deleted file mode 100644 index e760b3f..0000000 --- a/Assets/FogVolume/Scripts/Utilities.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 65754784b98fd9549891eeac85132c62 -timeCreated: 1494535658 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Prefabs/RealLocalPlayer.prefab b/Assets/Prefabs/RealLocalPlayer.prefab index 5e5e701..c690b4f 100644 --- a/Assets/Prefabs/RealLocalPlayer.prefab +++ b/Assets/Prefabs/RealLocalPlayer.prefab @@ -1209,7 +1209,7 @@ MonoBehaviour: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1067952265812482} - m_Enabled: 0 + m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 890fed67893ffdd44a4cef0b351ae1f0, type: 3} m_Name: @@ -1331,7 +1331,6 @@ SkinnedMeshRenderer: m_Materials: - {fileID: 2100002, guid: 236e7961efac5a74bb87438b563e964a, type: 3} - {fileID: 2100004, guid: 236e7961efac5a74bb87438b563e964a, type: 3} - - {fileID: 2100000, guid: d6004bad2743f734a8d9d595aa7ac0df, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1390,7 +1389,6 @@ SkinnedMeshRenderer: - {fileID: 2100008, guid: 236e7961efac5a74bb87438b563e964a, type: 3} - {fileID: 2100010, guid: 236e7961efac5a74bb87438b563e964a, type: 3} - {fileID: 2100012, guid: 236e7961efac5a74bb87438b563e964a, type: 3} - - {fileID: 2100000, guid: d6004bad2743f734a8d9d595aa7ac0df, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1451,7 +1449,6 @@ SkinnedMeshRenderer: - {fileID: 2100000, guid: 236e7961efac5a74bb87438b563e964a, type: 3} - {fileID: 2100004, guid: 236e7961efac5a74bb87438b563e964a, type: 3} - {fileID: 2100002, guid: 236e7961efac5a74bb87438b563e964a, type: 3} - - {fileID: 2100000, guid: d6004bad2743f734a8d9d595aa7ac0df, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1521,7 +1518,6 @@ SkinnedMeshRenderer: m_RenderingLayerMask: 4294967295 m_Materials: - {fileID: 2100006, guid: 236e7961efac5a74bb87438b563e964a, type: 3} - - {fileID: 2100000, guid: d6004bad2743f734a8d9d595aa7ac0df, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1584,7 +1580,6 @@ SkinnedMeshRenderer: m_RenderingLayerMask: 4294967295 m_Materials: - {fileID: 2100008, guid: 236e7961efac5a74bb87438b563e964a, type: 3} - - {fileID: 2100000, guid: d6004bad2743f734a8d9d595aa7ac0df, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -1637,7 +1632,6 @@ SkinnedMeshRenderer: m_RenderingLayerMask: 4294967295 m_Materials: - {fileID: 2100000, guid: 236e7961efac5a74bb87438b563e964a, type: 3} - - {fileID: 2100000, guid: d6004bad2743f734a8d9d595aa7ac0df, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Prefabs/RealRemotePlayer.prefab b/Assets/Prefabs/RealRemotePlayer.prefab index 02750e6..2393cc4 100644 --- a/Assets/Prefabs/RealRemotePlayer.prefab +++ b/Assets/Prefabs/RealRemotePlayer.prefab @@ -331,6 +331,26 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1705150859031784 +GameObject: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 6 + m_Component: + - component: {fileID: 224528538980668020} + - component: {fileID: 33549816894566170} + - component: {fileID: 23639379694349108} + - component: {fileID: 222899667835698686} + - component: {fileID: 114506612135202606} + - component: {fileID: 114965865230975338} + m_Layer: 0 + m_Name: Name + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!1 &1722052290219116 GameObject: m_ObjectHideFlags: 1 @@ -543,6 +563,7 @@ Transform: - {fileID: 4917860688760742} - {fileID: 4782548186067570} - {fileID: 4915888162687118} + - {fileID: 224528538980668020} m_Father: {fileID: 4032659460318234} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -569,7 +590,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1899238032005644} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -1.59, y: 0, z: 0} + m_LocalPosition: {x: 446.41446, y: 170.64719, z: -459.8867} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4027472219740106} @@ -1005,6 +1026,48 @@ Transform: m_Father: {fileID: 4246815440049278} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23639379694349108 +MeshRenderer: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1705150859031784} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 4294967295 + m_Materials: + - {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &33549816894566170 +MeshFilter: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1705150859031784} + m_Mesh: {fileID: 0} --- !u!95 &95748578200216180 Animator: serializedVersion: 3 @@ -1023,6 +1086,119 @@ Animator: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &114506612135202606 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1705150859031784} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_text: Name + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_outlineColor: + serializedVersion: 2 + rgba: 4278190080 + m_fontSize: 18 + m_fontSizeBase: 18 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_textAlignment: 514 + m_isAlignmentEnumConverted: 1 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_firstOverflowCharacterIndex: -1 + m_linkedTextComponent: {fileID: 0} + m_isLinkedTextComponent: 0 + m_isTextTruncated: 0 + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 0 + m_isCullingEnabled: 0 + m_ignoreRectMaskCulling: 0 + m_ignoreCulling: 1 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_firstVisibleCharacter: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: -0.000061035156, w: 0} + m_textInfo: + textComponent: {fileID: 114506612135202606} + characterCount: 4 + spriteCount: 0 + spaceCount: 0 + wordCount: 1 + linkCount: 0 + lineCount: 1 + pageCount: 1 + materialCount: 1 + m_havePropertiesChanged: 0 + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_spriteAnimator: {fileID: 0} + m_isInputParsingRequired: 0 + m_inputSource: 0 + m_hasFontAssetChanged: 0 + m_renderer: {fileID: 23639379694349108} + m_subTextObjects: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + m_maskType: 0 --- !u!114 &114618418423467214 MonoBehaviour: m_ObjectHideFlags: 1 @@ -1044,6 +1220,17 @@ MonoBehaviour: scale: 1 Animator: {fileID: 95748578200216180} PlayerModel: {fileID: 1067210703148028} +--- !u!114 &114965865230975338 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1705150859031784} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 023d1c96a12b5d94c938163298757714, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!136 &136963308744459646 CapsuleCollider: m_ObjectHideFlags: 1 @@ -1412,3 +1599,28 @@ SkinnedMeshRenderer: m_Center: {x: -0.4721041, y: 0.06282863, z: 0.025050133} m_Extent: {x: 0.468519, y: 0.29526034, z: 0.95972633} m_DirtyAABB: 0 +--- !u!222 &222899667835698686 +CanvasRenderer: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1705150859031784} + m_CullTransparentMesh: 0 +--- !u!224 &224528538980668020 +RectTransform: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1705150859031784} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4027472219740106} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.02, y: 3.34} + m_SizeDelta: {x: 12.004, y: 2.33} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Assets/Renderator FREE.meta b/Assets/Renderator FREE.meta deleted file mode 100644 index bb8d245..0000000 --- a/Assets/Renderator FREE.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 1b96af3070ee1f444b3f68d8b32e030e -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Renderator FREE/scripts.meta b/Assets/Renderator FREE/scripts.meta deleted file mode 100644 index e5d92a4..0000000 --- a/Assets/Renderator FREE/scripts.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: fc4482545329b3240bff6dd94beb6102 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Renderator FREE/scripts/Renderator_FREE_EN.cs b/Assets/Renderator FREE/scripts/Renderator_FREE_EN.cs deleted file mode 100644 index c36ce53..0000000 --- a/Assets/Renderator FREE/scripts/Renderator_FREE_EN.cs +++ /dev/null @@ -1,70 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.IO; -using UnityEditor; - -[RequireComponent(typeof(Camera))] -public class Renderator_FREE_EN : MonoBehaviour { - - public int multipler; // multipling Game window resolution - public KeyCode render; // press it to make render - public bool renderAtStart; // if true it will render at start - public string path; // path where renders will be saved - - void Start () - { - if(path == "") - { - if(!Directory.Exists("Assets/Screenshots")) // check if folder exist - Directory.CreateDirectory("Assets/Screenshots"); // if not it creates one - }else if(!Directory.Exists(path)) // the same for our path - Directory.CreateDirectory(path); - - - if(renderAtStart) - { - if(path == "") // saving in Asset folder - { - ScreenCapture.CaptureScreenshot("Assets/Screenshots/Render" // path to folder with renders and firts part of the name (Render) - + System.DateTime.Now.ToString("_yyyy-MM-dd_") // giving date to name - + System.DateTime.Now.ToString ("hh-mm-ss_") // giving current time to name - + ".png", multipler); //screenshot with resolution multipler - }else - { // saving in our folder we choose - ScreenCapture.CaptureScreenshot(path + "/Render" // path to folder with renders and firts part of the name (Render) - + System.DateTime.Now.ToString("_yyyy-MM-dd_") // giving date to name - + System.DateTime.Now.ToString ("hh-mm-ss_") // giving current time to name - + ".png", multipler); //screenshot with resolution multipler - } - } - } - - void Update() - { - if(Input.GetKeyDown(render)) - { - if(path == "") // saving in Asset folder - { - ScreenCapture.CaptureScreenshot("Assets/Screenshots/Render" // path to folder with renders and firts part of the name (Render) - + System.DateTime.Now.ToString("_yyyy-MM-dd_") // giving date to name - + System.DateTime.Now.ToString ("hh-mm-ss_") // giving current time to name - + ".png", multipler); //screenshot with resolution multipler - }else - { // saving in our folder we choose - ScreenCapture.CaptureScreenshot(path + "/Render" // path to folder with renders and firts part of the name (Render) - + System.DateTime.Now.ToString("_yyyy-MM-dd_") // giving date to name - + System.DateTime.Now.ToString ("hh-mm-ss_") // giving current time to name - + ".png", multipler); //screenshot with resolution multipler - } - } - } - [ContextMenu("Choose save folder")] - void Kalesony() - { - string piach = EditorUtility.OpenFolderPanel("Choose save folder", "", ""); - if( piach.Length != 0 ) - { - path = piach; - } - } -} diff --git a/Assets/Renderator FREE/scripts/Renderator_FREE_EN.cs.meta b/Assets/Renderator FREE/scripts/Renderator_FREE_EN.cs.meta deleted file mode 100644 index 0cc3c07..0000000 --- a/Assets/Renderator FREE/scripts/Renderator_FREE_EN.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1a7b288fe101458479bf42a1052ae34d -timeCreated: 1454087420 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Renderator FREE/scripts/Renderator_FREE_PL.cs b/Assets/Renderator FREE/scripts/Renderator_FREE_PL.cs deleted file mode 100644 index df78eab..0000000 --- a/Assets/Renderator FREE/scripts/Renderator_FREE_PL.cs +++ /dev/null @@ -1,69 +0,0 @@ -using UnityEngine; -using System.Collections; -using System.IO; -using UnityEditor; - -[RequireComponent(typeof(Camera))] -public class Renderator_FREE_PL : MonoBehaviour { - - public int mnoznikRozdzielczosci; // Mnoży wirtualnie okno Game - public KeyCode render; // tym przyciskiem robimy render - public bool renderNaStarcie; // jak jest włączony to renderuje pierwszą klatkę - public string sciezka; // ścieżka, gdzie rendery będą zapisywane - - void Start () - { - if(sciezka == "") - { - if(!Directory.Exists("Assets/Screenshots")) // sprawdzanie czy folder istnieje - Directory.CreateDirectory("Assets/Screenshots"); // jeśli nie to go tworzy - }else if(!Directory.Exists(sciezka)) // tak samo dla wybranego przez nas - Directory.CreateDirectory(sciezka); - - if(renderNaStarcie) - { - if(sciezka == "") // zapisze w folderze z assetami - { - ScreenCapture.CaptureScreenshot("Assets/Screenshots/Render" // ścieżka do pliku oraz początek nazwy (Render) - + System.DateTime.Now.ToString("_yyyy-MM-dd_") // dodanie daty do nazwy - + System.DateTime.Now.ToString ("hh-mm-ss_") // dodanie obecnej godziny do nazwy - + ".png", mnoznikRozdzielczosci); //screenshot z mnożnikiem rozdzielczości - }else - { // zapisze w wybranym folderze - ScreenCapture.CaptureScreenshot(sciezka + "/Render" // ścieżka do pliku oraz początek nazwy (Render) - + System.DateTime.Now.ToString("_yyyy-MM-dd_") // dodanie daty do nazwy - + System.DateTime.Now.ToString ("hh-mm-ss_") // dodanie obecnej godziny do nazwy - + ".png", mnoznikRozdzielczosci); //screenshot z mnożnikiem rozdzielczości); - } - } - } - void Update() - { - if(Input.GetKeyDown(render)) - { - if(sciezka == "") - { - ScreenCapture.CaptureScreenshot("Assets/Screenshots/Render" // ścieżka do pliku oraz początek nazwy (Render) - + System.DateTime.Now.ToString("_yyyy-MM-dd_") // dodanie daty do nazwy - + System.DateTime.Now.ToString ("hh-mm-ss_") // dodanie obecnej godziny do nazwy - + ".png", mnoznikRozdzielczosci); //screenshot z mnożnikiem rozdzielczości - } - else - { - ScreenCapture.CaptureScreenshot(sciezka + "/Render" // ścieżka do pliku oraz początek nazwy (Render) - + System.DateTime.Now.ToString("_yyyy-MM-dd_") // dodanie daty do nazwy - + System.DateTime.Now.ToString ("hh-mm-ss_") // dodanie obecnej godziny do nazwy - + ".png", mnoznikRozdzielczosci); //screenshot z mnożnikiem rozdzielczości); - } - } - } - [ContextMenu("Wybierz folder do zapisu")] - void Kalesony() - { - string piach = EditorUtility.OpenFolderPanel("Wybierz folder do zapisu", "", ""); - if( piach.Length != 0 ) - { - sciezka = piach; - } - } -} diff --git a/Assets/Renderator FREE/scripts/Renderator_FREE_PL.cs.meta b/Assets/Renderator FREE/scripts/Renderator_FREE_PL.cs.meta deleted file mode 100644 index 733313e..0000000 --- a/Assets/Renderator FREE/scripts/Renderator_FREE_PL.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 0d29750727f1f634980f33b5f067e42d -timeCreated: 1454087420 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Renderator FREE/scripts/wireframe.cs b/Assets/Renderator FREE/scripts/wireframe.cs deleted file mode 100644 index 3f5474f..0000000 --- a/Assets/Renderator FREE/scripts/wireframe.cs +++ /dev/null @@ -1,26 +0,0 @@ -using UnityEngine; -using System.Collections; - -[RequireComponent(typeof(Camera))] -public class wireframe : MonoBehaviour { - - public KeyCode wireFrameKey; - public bool wireFrameMode; - - public void Start() - { - - } - - void OnPreRender() { - if(wireFrameMode) - GL.wireframe = true; - else - GL.wireframe = false; - } - void Update() - { - if(Input.GetKeyDown(wireFrameKey)) - wireFrameMode = !wireFrameMode; - } -} diff --git a/Assets/Renderator FREE/scripts/wireframe.cs.meta b/Assets/Renderator FREE/scripts/wireframe.cs.meta deleted file mode 100644 index 55e4492..0000000 --- a/Assets/Renderator FREE/scripts/wireframe.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: c5b6163b8ecae2943a2987cdfcf329af -timeCreated: 1456400616 -licenseType: Store -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index fa153b0..5f8ef2c 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -116,9 +116,9 @@ NavMeshSettings: --- !u!1 &10419655 GameObject: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 10419658} - component: {fileID: 10419657} @@ -133,7 +133,7 @@ GameObject: --- !u!114 &10419656 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 10419655} m_Enabled: 1 @@ -154,7 +154,7 @@ MonoBehaviour: --- !u!223 &10419657 Canvas: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 10419655} m_Enabled: 1 @@ -174,7 +174,7 @@ Canvas: --- !u!224 &10419658 RectTransform: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 10419655} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -183,7 +183,7 @@ RectTransform: m_Children: - {fileID: 1771486826} m_Father: {fileID: 0} - m_RootOrder: 18 + m_RootOrder: 17 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -193,9 +193,9 @@ RectTransform: --- !u!1 &35195568 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 35195569} - component: {fileID: 35195572} @@ -211,7 +211,7 @@ GameObject: --- !u!224 &35195569 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 35195568} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -229,7 +229,7 @@ RectTransform: --- !u!114 &35195570 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 35195568} m_Enabled: 1 @@ -281,7 +281,7 @@ MonoBehaviour: --- !u!114 &35195571 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 35195568} m_Enabled: 1 @@ -308,15 +308,16 @@ MonoBehaviour: --- !u!222 &35195572 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 35195568} + m_CullTransparentMesh: 0 --- !u!1 &73397751 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 73397752} - component: {fileID: 73397753} @@ -331,7 +332,7 @@ GameObject: --- !u!224 &73397752 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 73397751} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -349,13 +350,14 @@ RectTransform: --- !u!222 &73397753 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 73397751} + m_CullTransparentMesh: 0 --- !u!114 &73397754 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 73397751} m_Enabled: 1 @@ -382,9 +384,9 @@ MonoBehaviour: --- !u!1 &105326697 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 105326698} - component: {fileID: 105326700} @@ -399,7 +401,7 @@ GameObject: --- !u!224 &105326698 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 105326697} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -417,7 +419,7 @@ RectTransform: --- !u!114 &105326699 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 105326697} m_Enabled: 1 @@ -450,15 +452,16 @@ MonoBehaviour: --- !u!222 &105326700 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 105326697} + m_CullTransparentMesh: 0 --- !u!1 &147102618 GameObject: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 147102621} - component: {fileID: 147102620} @@ -473,7 +476,7 @@ GameObject: --- !u!114 &147102619 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 147102618} m_Enabled: 1 @@ -494,7 +497,7 @@ MonoBehaviour: --- !u!223 &147102620 Canvas: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 147102618} m_Enabled: 1 @@ -514,7 +517,7 @@ Canvas: --- !u!224 &147102621 RectTransform: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 147102618} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -523,7 +526,7 @@ RectTransform: m_Children: - {fileID: 675000576} m_Father: {fileID: 0} - m_RootOrder: 15 + m_RootOrder: 14 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -533,9 +536,9 @@ RectTransform: --- !u!1 &167278085 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 167278086} m_Layer: 0 @@ -548,7 +551,7 @@ GameObject: --- !u!4 &167278086 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 167278085} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -561,9 +564,9 @@ Transform: --- !u!1 &221906467 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 221906470} - component: {fileID: 221906469} @@ -578,7 +581,7 @@ GameObject: --- !u!114 &221906468 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 221906467} m_Enabled: 1 @@ -613,7 +616,7 @@ MonoBehaviour: --- !u!108 &221906469 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 221906467} m_Enabled: 1 @@ -640,6 +643,7 @@ Light: serializedVersion: 2 m_Bits: 4294959615 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 @@ -649,7 +653,7 @@ Light: --- !u!4 &221906470 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 221906467} m_LocalRotation: {x: -0.3876005, y: 0.46317276, z: -0.49651274, w: 0.6234677} @@ -657,14 +661,14 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: -1.3390001, y: 74.303, z: -78.08} --- !u!1 &227900152 GameObject: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 227900155} - component: {fileID: 227900154} @@ -679,7 +683,7 @@ GameObject: --- !u!114 &227900153 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 227900152} m_Enabled: 1 @@ -700,7 +704,7 @@ MonoBehaviour: --- !u!223 &227900154 Canvas: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 227900152} m_Enabled: 1 @@ -720,7 +724,7 @@ Canvas: --- !u!224 &227900155 RectTransform: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 227900152} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -729,7 +733,7 @@ RectTransform: m_Children: - {fileID: 1673073037} m_Father: {fileID: 0} - m_RootOrder: 13 + m_RootOrder: 12 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -739,9 +743,9 @@ RectTransform: --- !u!1 &252633541 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 252633542} - component: {fileID: 252633545} @@ -757,7 +761,7 @@ GameObject: --- !u!224 &252633542 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 252633541} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -775,7 +779,7 @@ RectTransform: --- !u!114 &252633543 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 252633541} m_Enabled: 1 @@ -827,7 +831,7 @@ MonoBehaviour: --- !u!114 &252633544 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 252633541} m_Enabled: 1 @@ -854,15 +858,16 @@ MonoBehaviour: --- !u!222 &252633545 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 252633541} + m_CullTransparentMesh: 0 --- !u!1 &264010774 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 264010775} - component: {fileID: 264010777} @@ -877,7 +882,7 @@ GameObject: --- !u!224 &264010775 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 264010774} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -895,7 +900,7 @@ RectTransform: --- !u!114 &264010776 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 264010774} m_Enabled: 1 @@ -922,15 +927,16 @@ MonoBehaviour: --- !u!222 &264010777 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 264010774} + m_CullTransparentMesh: 0 --- !u!1 &274218296 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 274218297} - component: {fileID: 274218299} @@ -945,7 +951,7 @@ GameObject: --- !u!224 &274218297 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 274218296} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -964,7 +970,7 @@ RectTransform: --- !u!114 &274218298 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 274218296} m_Enabled: 1 @@ -991,15 +997,16 @@ MonoBehaviour: --- !u!222 &274218299 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 274218296} + m_CullTransparentMesh: 0 --- !u!1 &275025827 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 275025828} - component: {fileID: 275025829} @@ -1014,7 +1021,7 @@ GameObject: --- !u!224 &275025828 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 275025827} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -1032,13 +1039,14 @@ RectTransform: --- !u!222 &275025829 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 275025827} + m_CullTransparentMesh: 0 --- !u!114 &275025830 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 275025827} m_Enabled: 1 @@ -1151,9 +1159,9 @@ MonoBehaviour: --- !u!1 &325613277 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 325613278} - component: {fileID: 325613280} @@ -1168,7 +1176,7 @@ GameObject: --- !u!224 &325613278 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 325613277} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -1186,7 +1194,7 @@ RectTransform: --- !u!114 &325613279 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 325613277} m_Enabled: 1 @@ -1213,15 +1221,16 @@ MonoBehaviour: --- !u!222 &325613280 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 325613277} + m_CullTransparentMesh: 0 --- !u!1 &337291643 GameObject: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 337291646} - component: {fileID: 337291645} @@ -1236,7 +1245,7 @@ GameObject: --- !u!114 &337291644 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 337291643} m_Enabled: 1 @@ -1257,7 +1266,7 @@ MonoBehaviour: --- !u!223 &337291645 Canvas: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 337291643} m_Enabled: 1 @@ -1277,7 +1286,7 @@ Canvas: --- !u!224 &337291646 RectTransform: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 337291643} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -1286,7 +1295,7 @@ RectTransform: m_Children: - {fileID: 1589464057} m_Father: {fileID: 0} - m_RootOrder: 10 + m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -1296,9 +1305,9 @@ RectTransform: --- !u!1 &340012148 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 340012150} - component: {fileID: 340012154} @@ -1318,7 +1327,7 @@ GameObject: --- !u!114 &340012149 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 340012148} m_Enabled: 1 @@ -1339,7 +1348,7 @@ MonoBehaviour: --- !u!4 &340012150 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 340012148} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -1348,12 +1357,12 @@ Transform: m_Children: - {fileID: 167278086} m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &340012151 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 340012148} m_Enabled: 1 @@ -1387,7 +1396,7 @@ MonoBehaviour: --- !u!114 &340012152 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 340012148} m_Enabled: 1 @@ -1420,7 +1429,7 @@ MonoBehaviour: --- !u!114 &340012153 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 340012148} m_Enabled: 1 @@ -1436,7 +1445,7 @@ MonoBehaviour: --- !u!114 &340012154 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 340012148} m_Enabled: 1 @@ -1454,7 +1463,7 @@ MonoBehaviour: --- !u!114 &340012155 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 340012148} m_Enabled: 1 @@ -1469,7 +1478,7 @@ MonoBehaviour: --- !u!114 &340012156 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 340012148} m_Enabled: 1 @@ -1484,9 +1493,9 @@ MonoBehaviour: --- !u!1 &413141712 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 413141713} - component: {fileID: 413141715} @@ -1501,7 +1510,7 @@ GameObject: --- !u!224 &413141713 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 413141712} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -1519,7 +1528,7 @@ RectTransform: --- !u!114 &413141714 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 413141712} m_Enabled: 1 @@ -1552,15 +1561,16 @@ MonoBehaviour: --- !u!222 &413141715 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 413141712} + m_CullTransparentMesh: 0 --- !u!1 &426060142 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 426060145} - component: {fileID: 426060144} @@ -1575,7 +1585,7 @@ GameObject: --- !u!114 &426060143 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 426060142} m_Enabled: 1 @@ -1593,7 +1603,7 @@ MonoBehaviour: --- !u!114 &426060144 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 426060142} m_Enabled: 1 @@ -1607,7 +1617,7 @@ MonoBehaviour: --- !u!4 &426060145 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 426060142} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -1615,14 +1625,14 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &444780594 GameObject: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 444780597} - component: {fileID: 444780596} @@ -1637,7 +1647,7 @@ GameObject: --- !u!114 &444780595 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 444780594} m_Enabled: 1 @@ -1658,7 +1668,7 @@ MonoBehaviour: --- !u!223 &444780596 Canvas: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 444780594} m_Enabled: 1 @@ -1678,7 +1688,7 @@ Canvas: --- !u!224 &444780597 RectTransform: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 444780594} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -1687,7 +1697,7 @@ RectTransform: m_Children: - {fileID: 1565844027} m_Father: {fileID: 0} - m_RootOrder: 9 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -1697,9 +1707,9 @@ RectTransform: --- !u!1 &460711545 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 460711548} - component: {fileID: 460711547} @@ -1714,7 +1724,7 @@ GameObject: --- !u!114 &460711546 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 460711545} m_Enabled: 1 @@ -1749,7 +1759,7 @@ MonoBehaviour: --- !u!108 &460711547 Light: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 460711545} m_Enabled: 1 @@ -1776,6 +1786,7 @@ Light: serializedVersion: 2 m_Bits: 4294959615 m_Lightmapping: 4 + m_LightShadowCasterMode: 0 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 m_ColorTemperature: 6570 @@ -1785,7 +1796,7 @@ Light: --- !u!4 &460711548 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 460711545} m_LocalRotation: {x: -0.032943666, y: 0.5968051, z: -0.7768844, w: 0.19796236} @@ -1793,14 +1804,14 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 19 + m_RootOrder: 18 m_LocalEulerAnglesHint: {x: 66.1, y: 45.2, z: -121.1} --- !u!1 &497923737 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 497923738} - component: {fileID: 497923740} @@ -1815,7 +1826,7 @@ GameObject: --- !u!224 &497923738 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 497923737} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -1835,7 +1846,7 @@ RectTransform: --- !u!114 &497923739 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 497923737} m_Enabled: 1 @@ -1862,15 +1873,16 @@ MonoBehaviour: --- !u!222 &497923740 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 497923737} + m_CullTransparentMesh: 0 --- !u!1 &561042605 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 561042606} - component: {fileID: 561042609} @@ -1886,7 +1898,7 @@ GameObject: --- !u!224 &561042606 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 561042605} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -1905,7 +1917,7 @@ RectTransform: --- !u!114 &561042607 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 561042605} m_Enabled: 1 @@ -1957,7 +1969,7 @@ MonoBehaviour: --- !u!114 &561042608 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 561042605} m_Enabled: 1 @@ -1984,15 +1996,16 @@ MonoBehaviour: --- !u!222 &561042609 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 561042605} + m_CullTransparentMesh: 0 --- !u!1 &638241847 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 638241848} - component: {fileID: 638241850} @@ -2007,7 +2020,7 @@ GameObject: --- !u!224 &638241848 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 638241847} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -2026,7 +2039,7 @@ RectTransform: --- !u!114 &638241849 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 638241847} m_Enabled: 1 @@ -2053,15 +2066,16 @@ MonoBehaviour: --- !u!222 &638241850 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 638241847} + m_CullTransparentMesh: 0 --- !u!1 &675000575 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 675000576} - component: {fileID: 675000578} @@ -2076,7 +2090,7 @@ GameObject: --- !u!224 &675000576 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 675000575} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -2094,7 +2108,7 @@ RectTransform: --- !u!114 &675000577 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 675000575} m_Enabled: 1 @@ -2121,15 +2135,16 @@ MonoBehaviour: --- !u!222 &675000578 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 675000575} + m_CullTransparentMesh: 0 --- !u!1 &714930134 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 714930135} - component: {fileID: 714930137} @@ -2144,7 +2159,7 @@ GameObject: --- !u!224 &714930135 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 714930134} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -2162,7 +2177,7 @@ RectTransform: --- !u!114 &714930136 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 714930134} m_Enabled: 1 @@ -2189,15 +2204,16 @@ MonoBehaviour: --- !u!222 &714930137 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 714930134} + m_CullTransparentMesh: 0 --- !u!1 &791470959 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 791470960} - component: {fileID: 791470962} @@ -2212,7 +2228,7 @@ GameObject: --- !u!224 &791470960 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 791470959} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -2232,7 +2248,7 @@ RectTransform: --- !u!114 &791470961 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 791470959} m_Enabled: 1 @@ -2259,15 +2275,16 @@ MonoBehaviour: --- !u!222 &791470962 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 791470959} + m_CullTransparentMesh: 0 --- !u!1 &839077256 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 839077257} - component: {fileID: 839077258} @@ -2282,7 +2299,7 @@ GameObject: --- !u!224 &839077257 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 839077256} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -2300,13 +2317,14 @@ RectTransform: --- !u!222 &839077258 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 839077256} + m_CullTransparentMesh: 0 --- !u!114 &839077259 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 839077256} m_Enabled: 1 @@ -2419,9 +2437,9 @@ MonoBehaviour: --- !u!1 &892339023 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 892339024} - component: {fileID: 892339027} @@ -2437,7 +2455,7 @@ GameObject: --- !u!224 &892339024 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 892339023} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -2446,7 +2464,7 @@ RectTransform: m_Children: - {fileID: 2000861316} m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -2456,7 +2474,7 @@ RectTransform: --- !u!114 &892339025 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 892339023} m_Enabled: 1 @@ -2472,7 +2490,7 @@ MonoBehaviour: --- !u!114 &892339026 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 892339023} m_Enabled: 1 @@ -2493,7 +2511,7 @@ MonoBehaviour: --- !u!223 &892339027 Canvas: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 892339023} m_Enabled: 1 @@ -2513,9 +2531,9 @@ Canvas: --- !u!1 &918399140 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 918399144} - component: {fileID: 918399143} @@ -2531,7 +2549,7 @@ GameObject: --- !u!114 &918399141 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 918399140} m_Enabled: 1 @@ -2547,7 +2565,7 @@ MonoBehaviour: --- !u!114 &918399142 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 918399140} m_Enabled: 1 @@ -2568,7 +2586,7 @@ MonoBehaviour: --- !u!223 &918399143 Canvas: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 918399140} m_Enabled: 1 @@ -2588,7 +2606,7 @@ Canvas: --- !u!224 &918399144 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 918399140} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -2597,7 +2615,7 @@ RectTransform: m_Children: - {fileID: 1132689897} m_Father: {fileID: 0} - m_RootOrder: 8 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -2607,9 +2625,9 @@ RectTransform: --- !u!1 &950266418 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 950266419} - component: {fileID: 950266421} @@ -2624,7 +2642,7 @@ GameObject: --- !u!224 &950266419 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 950266418} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -2644,7 +2662,7 @@ RectTransform: --- !u!114 &950266420 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 950266418} m_Enabled: 1 @@ -2671,15 +2689,16 @@ MonoBehaviour: --- !u!222 &950266421 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 950266418} + m_CullTransparentMesh: 0 --- !u!1 &952511602 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 952511603} - component: {fileID: 952511604} @@ -2694,7 +2713,7 @@ GameObject: --- !u!224 &952511603 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 952511602} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -2712,13 +2731,14 @@ RectTransform: --- !u!222 &952511604 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 952511602} + m_CullTransparentMesh: 0 --- !u!114 &952511605 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 952511602} m_Enabled: 1 @@ -2831,9 +2851,9 @@ MonoBehaviour: --- !u!1 &1001341747 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1001341748} - component: {fileID: 1001341750} @@ -2848,7 +2868,7 @@ GameObject: --- !u!224 &1001341748 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1001341747} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -2868,7 +2888,7 @@ RectTransform: --- !u!114 &1001341749 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1001341747} m_Enabled: 1 @@ -2895,15 +2915,16 @@ MonoBehaviour: --- !u!222 &1001341750 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1001341747} + m_CullTransparentMesh: 0 --- !u!1 &1039419383 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1039419384} - component: {fileID: 1039419386} @@ -2918,7 +2939,7 @@ GameObject: --- !u!224 &1039419384 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1039419383} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -2938,7 +2959,7 @@ RectTransform: --- !u!114 &1039419385 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1039419383} m_Enabled: 1 @@ -2965,15 +2986,16 @@ MonoBehaviour: --- !u!222 &1039419386 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1039419383} + m_CullTransparentMesh: 0 --- !u!1 &1117275275 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1117275276} - component: {fileID: 1117275278} @@ -2988,7 +3010,7 @@ GameObject: --- !u!224 &1117275276 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1117275275} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -3007,7 +3029,7 @@ RectTransform: --- !u!114 &1117275277 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1117275275} m_Enabled: 1 @@ -3034,15 +3056,16 @@ MonoBehaviour: --- !u!222 &1117275278 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1117275275} + m_CullTransparentMesh: 0 --- !u!1 &1132689896 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1132689897} - component: {fileID: 1132689899} @@ -3057,7 +3080,7 @@ GameObject: --- !u!224 &1132689897 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1132689896} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -3077,7 +3100,7 @@ RectTransform: --- !u!114 &1132689898 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1132689896} m_Enabled: 1 @@ -3104,15 +3127,16 @@ MonoBehaviour: --- !u!222 &1132689899 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1132689896} + m_CullTransparentMesh: 0 --- !u!1 &1143995163 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1143995164} - component: {fileID: 1143995165} @@ -3127,7 +3151,7 @@ GameObject: --- !u!224 &1143995164 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1143995163} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -3145,13 +3169,14 @@ RectTransform: --- !u!222 &1143995165 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1143995163} + m_CullTransparentMesh: 0 --- !u!114 &1143995166 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1143995163} m_Enabled: 1 @@ -3178,9 +3203,9 @@ MonoBehaviour: --- !u!1 &1146806696 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1146806697} - component: {fileID: 1146806699} @@ -3195,7 +3220,7 @@ GameObject: --- !u!224 &1146806697 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1146806696} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -3214,7 +3239,7 @@ RectTransform: --- !u!114 &1146806698 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1146806696} m_Enabled: 1 @@ -3241,15 +3266,16 @@ MonoBehaviour: --- !u!222 &1146806699 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1146806696} + m_CullTransparentMesh: 0 --- !u!1 &1178411775 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1178411776} - component: {fileID: 1178411778} @@ -3264,7 +3290,7 @@ GameObject: --- !u!224 &1178411776 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1178411775} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -3282,7 +3308,7 @@ RectTransform: --- !u!114 &1178411777 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1178411775} m_Enabled: 1 @@ -3315,136 +3341,16 @@ MonoBehaviour: --- !u!222 &1178411778 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1178411775} ---- !u!1 &1190802516 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1190802517} - - component: {fileID: 1190802520} - - component: {fileID: 1190802519} - - component: {fileID: 1190802518} - m_Layer: 5 - m_Name: Button - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1190802517 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1190802516} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 1266934409} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 800, y: 480} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1190802518 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1190802516} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 1190802519} - m_OnClick: - m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 340012155} - m_MethodName: mouseClick - m_Mode: 1 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 0 - m_FloatArgument: 0 - m_StringArgument: - m_BoolArgument: 0 - m_CallState: 2 - m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, - Culture=neutral, PublicKeyToken=null ---- !u!114 &1190802519 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1190802516} - m_Enabled: 0 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &1190802520 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1190802516} + m_CullTransparentMesh: 0 --- !u!1 &1266934408 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1266934409} - component: {fileID: 1266934412} @@ -3460,7 +3366,7 @@ GameObject: --- !u!224 &1266934409 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1266934408} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -3471,9 +3377,8 @@ RectTransform: - {fileID: 264010775} - {fileID: 1039419384} - {fileID: 35195569} - - {fileID: 1190802517} m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -3483,7 +3388,7 @@ RectTransform: --- !u!114 &1266934410 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1266934408} m_Enabled: 1 @@ -3499,7 +3404,7 @@ MonoBehaviour: --- !u!114 &1266934411 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1266934408} m_Enabled: 1 @@ -3520,7 +3425,7 @@ MonoBehaviour: --- !u!223 &1266934412 Canvas: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1266934408} m_Enabled: 1 @@ -3540,9 +3445,9 @@ Canvas: --- !u!1 &1293333579 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1293333580} - component: {fileID: 1293333581} @@ -3557,7 +3462,7 @@ GameObject: --- !u!224 &1293333580 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1293333579} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -3575,13 +3480,14 @@ RectTransform: --- !u!222 &1293333581 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1293333579} + m_CullTransparentMesh: 0 --- !u!114 &1293333582 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1293333579} m_Enabled: 1 @@ -3608,9 +3514,9 @@ MonoBehaviour: --- !u!1 &1376576714 GameObject: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1376576717} - component: {fileID: 1376576716} @@ -3618,6 +3524,11 @@ GameObject: - component: {fileID: 1376576718} - component: {fileID: 1376576719} - component: {fileID: 1376576720} + - component: {fileID: 1376576721} + - component: {fileID: 1376576722} + - component: {fileID: 1376576723} + - component: {fileID: 1376576724} + - component: {fileID: 1376576725} m_Layer: 5 m_Name: FogVolume Debug Canvas m_TagString: Untagged @@ -3628,7 +3539,7 @@ GameObject: --- !u!114 &1376576715 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1376576714} m_Enabled: 1 @@ -3649,7 +3560,7 @@ MonoBehaviour: --- !u!223 &1376576716 Canvas: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1376576714} m_Enabled: 1 @@ -3669,16 +3580,15 @@ Canvas: --- !u!224 &1376576717 RectTransform: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1376576714} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} - m_Children: - - {fileID: 1978482796} + m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 20 + m_RootOrder: 19 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -3688,7 +3598,7 @@ RectTransform: --- !u!114 &1376576718 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1376576714} m_Enabled: 1 @@ -3709,7 +3619,7 @@ MonoBehaviour: --- !u!114 &1376576719 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1376576714} m_Enabled: 1 @@ -3730,7 +3640,112 @@ MonoBehaviour: --- !u!114 &1376576720 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1376576714} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &1376576721 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1376576714} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &1376576722 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1376576714} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &1376576723 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1376576714} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &1376576724 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1376576714} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!114 &1376576725 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1376576714} m_Enabled: 1 @@ -3751,9 +3766,9 @@ MonoBehaviour: --- !u!1 &1427235361 GameObject: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1427235364} - component: {fileID: 1427235363} @@ -3768,7 +3783,7 @@ GameObject: --- !u!114 &1427235362 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1427235361} m_Enabled: 1 @@ -3789,7 +3804,7 @@ MonoBehaviour: --- !u!223 &1427235363 Canvas: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1427235361} m_Enabled: 1 @@ -3809,7 +3824,7 @@ Canvas: --- !u!224 &1427235364 RectTransform: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1427235361} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -3818,7 +3833,7 @@ RectTransform: m_Children: - {fileID: 2012151645} m_Father: {fileID: 0} - m_RootOrder: 12 + m_RootOrder: 11 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -3828,9 +3843,9 @@ RectTransform: --- !u!1 &1433329687 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1433329688} - component: {fileID: 1433329690} @@ -3845,7 +3860,7 @@ GameObject: --- !u!224 &1433329688 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1433329687} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -3863,7 +3878,7 @@ RectTransform: --- !u!114 &1433329689 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1433329687} m_Enabled: 1 @@ -3896,15 +3911,16 @@ MonoBehaviour: --- !u!222 &1433329690 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1433329687} + m_CullTransparentMesh: 0 --- !u!1 &1465098066 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1465098067} - component: {fileID: 1465098069} @@ -3919,7 +3935,7 @@ GameObject: --- !u!224 &1465098067 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1465098066} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -3937,7 +3953,7 @@ RectTransform: --- !u!114 &1465098068 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1465098066} m_Enabled: 1 @@ -3964,15 +3980,16 @@ MonoBehaviour: --- !u!222 &1465098069 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1465098066} + m_CullTransparentMesh: 0 --- !u!1 &1465134982 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1465134983} - component: {fileID: 1465134985} @@ -3987,7 +4004,7 @@ GameObject: --- !u!224 &1465134983 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1465134982} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -4006,7 +4023,7 @@ RectTransform: --- !u!114 &1465134984 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1465134982} m_Enabled: 1 @@ -4033,15 +4050,16 @@ MonoBehaviour: --- !u!222 &1465134985 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1465134982} + m_CullTransparentMesh: 0 --- !u!1 &1478211784 GameObject: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1478211787} - component: {fileID: 1478211786} @@ -4056,7 +4074,7 @@ GameObject: --- !u!114 &1478211785 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1478211784} m_Enabled: 1 @@ -4077,7 +4095,7 @@ MonoBehaviour: --- !u!223 &1478211786 Canvas: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1478211784} m_Enabled: 1 @@ -4097,7 +4115,7 @@ Canvas: --- !u!224 &1478211787 RectTransform: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1478211784} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -4106,47 +4124,19 @@ RectTransform: m_Children: - {fileID: 325613278} m_Father: {fileID: 0} - m_RootOrder: 16 + m_RootOrder: 15 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} ---- !u!1 &1524955281 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 1658753719} - serializedVersion: 5 - m_Component: - - component: {fileID: 1524955282} - m_Layer: 0 - m_Name: Missing Prefab - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1524955282 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 1658753719} - m_GameObject: {fileID: 1524955281} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1565844026 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1565844027} - component: {fileID: 1565844029} @@ -4161,7 +4151,7 @@ GameObject: --- !u!224 &1565844027 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1565844026} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -4179,7 +4169,7 @@ RectTransform: --- !u!114 &1565844028 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1565844026} m_Enabled: 1 @@ -4206,15 +4196,16 @@ MonoBehaviour: --- !u!222 &1565844029 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1565844026} + m_CullTransparentMesh: 0 --- !u!1 &1589464056 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1589464057} - component: {fileID: 1589464059} @@ -4229,7 +4220,7 @@ GameObject: --- !u!224 &1589464057 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1589464056} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -4247,7 +4238,7 @@ RectTransform: --- !u!114 &1589464058 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1589464056} m_Enabled: 1 @@ -4274,15 +4265,16 @@ MonoBehaviour: --- !u!222 &1589464059 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1589464056} + m_CullTransparentMesh: 0 --- !u!1 &1590904418 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1590904419} - component: {fileID: 1590904422} @@ -4298,7 +4290,7 @@ GameObject: --- !u!224 &1590904419 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1590904418} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -4317,7 +4309,7 @@ RectTransform: --- !u!114 &1590904420 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1590904418} m_Enabled: 1 @@ -4369,7 +4361,7 @@ MonoBehaviour: --- !u!114 &1590904421 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1590904418} m_Enabled: 1 @@ -4396,15 +4388,16 @@ MonoBehaviour: --- !u!222 &1590904422 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1590904418} + m_CullTransparentMesh: 0 --- !u!1 &1640978391 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1640978395} - component: {fileID: 1640978394} @@ -4420,7 +4413,7 @@ GameObject: --- !u!114 &1640978392 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1640978391} m_Enabled: 1 @@ -4436,7 +4429,7 @@ MonoBehaviour: --- !u!114 &1640978393 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1640978391} m_Enabled: 1 @@ -4457,7 +4450,7 @@ MonoBehaviour: --- !u!223 &1640978394 Canvas: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1640978391} m_Enabled: 1 @@ -4477,7 +4470,7 @@ Canvas: --- !u!224 &1640978395 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1640978391} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -4486,7 +4479,7 @@ RectTransform: m_Children: - {fileID: 497923738} m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -4496,9 +4489,9 @@ RectTransform: --- !u!1 &1657349537 GameObject: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1657349540} - component: {fileID: 1657349539} @@ -4514,7 +4507,7 @@ GameObject: --- !u!114 &1657349538 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1657349537} m_Enabled: 1 @@ -4535,7 +4528,7 @@ MonoBehaviour: --- !u!223 &1657349539 Canvas: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1657349537} m_Enabled: 1 @@ -4555,7 +4548,7 @@ Canvas: --- !u!224 &1657349540 RectTransform: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1657349537} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -4564,7 +4557,7 @@ RectTransform: m_Children: - {fileID: 2110293336} m_Father: {fileID: 0} - m_RootOrder: 17 + m_RootOrder: 16 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -4574,7 +4567,7 @@ RectTransform: --- !u!114 &1657349541 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1657349537} m_Enabled: 1 @@ -4592,196 +4585,12 @@ MonoBehaviour: m_FallbackScreenDPI: 96 m_DefaultSpriteDPI: 96 m_DynamicPixelsPerUnit: 1 ---- !u!1001 &1658753719 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_RootOrder - value: 8 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_RootOrder - value: 8 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchorMax.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_Pivot.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22451668, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_Pivot.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224000011886223928, guid: 0abab5bb77339e4428787a870eb31bd3, - type: 2} - propertyPath: m_AnchoredPosition.x - value: 0.024978638 - objectReference: {fileID: 0} - - target: {fileID: 224000011886223928, guid: 0abab5bb77339e4428787a870eb31bd3, - type: 2} - propertyPath: m_AnchoredPosition.y - value: 0.0000038146973 - objectReference: {fileID: 0} - - target: {fileID: 22424132, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchoredPosition.x - value: -0.19995117 - objectReference: {fileID: 0} - - target: {fileID: 22477518, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchoredPosition.x - value: -0.19995117 - objectReference: {fileID: 0} - - target: {fileID: 22445198, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchoredPosition.x - value: -0.19995117 - objectReference: {fileID: 0} - - target: {fileID: 224000011192146308, guid: 0abab5bb77339e4428787a870eb31bd3, - type: 2} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224000011192146308, guid: 0abab5bb77339e4428787a870eb31bd3, - type: 2} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22450346, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchoredPosition.x - value: -0.19995117 - objectReference: {fileID: 0} - - target: {fileID: 224000010628903916, guid: 0abab5bb77339e4428787a870eb31bd3, - type: 2} - propertyPath: m_AnchoredPosition.x - value: 0.12501526 - objectReference: {fileID: 0} - - target: {fileID: 224000010628903916, guid: 0abab5bb77339e4428787a870eb31bd3, - type: 2} - propertyPath: m_AnchoredPosition.y - value: 0.42485046 - objectReference: {fileID: 0} - - target: {fileID: 224000010565031288, guid: 0abab5bb77339e4428787a870eb31bd3, - type: 2} - propertyPath: m_AnchoredPosition.x - value: 0.024932861 - objectReference: {fileID: 0} - - target: {fileID: 22460488, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchoredPosition.x - value: -0.19995117 - objectReference: {fileID: 0} - - target: {fileID: 22439978, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchoredPosition.x - value: -0.19995117 - objectReference: {fileID: 0} - - target: {fileID: 22465754, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_AnchoredPosition.x - value: -0.19995117 - objectReference: {fileID: 0} - - target: {fileID: 224000010937413736, guid: 0abab5bb77339e4428787a870eb31bd3, - type: 2} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224000010243477314, guid: 0abab5bb77339e4428787a870eb31bd3, - type: 2} - propertyPath: m_AnchoredPosition.x - value: -0.19995117 - objectReference: {fileID: 0} - - target: {fileID: 224000010243477314, guid: 0abab5bb77339e4428787a870eb31bd3, - type: 2} - propertyPath: m_AnchoredPosition.y - value: 11.599998 - objectReference: {fileID: 0} - - target: {fileID: 11496292, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_graphModulePosition - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 11496292, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_graphyMode - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 11496292, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_fpsGraphResolution - value: 128 - objectReference: {fileID: 0} - - target: {fileID: 11496292, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_ramGraphResolution - value: 128 - objectReference: {fileID: 0} - - target: {fileID: 11496292, guid: 0abab5bb77339e4428787a870eb31bd3, type: 2} - propertyPath: m_audioModuleState - value: 2 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_IsPrefabParent: 0 --- !u!1 &1673073036 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1673073037} - component: {fileID: 1673073039} @@ -4796,7 +4605,7 @@ GameObject: --- !u!224 &1673073037 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1673073036} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -4814,7 +4623,7 @@ RectTransform: --- !u!114 &1673073038 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1673073036} m_Enabled: 1 @@ -4841,15 +4650,16 @@ MonoBehaviour: --- !u!222 &1673073039 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1673073036} + m_CullTransparentMesh: 0 --- !u!1 &1695138042 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1695138043} - component: {fileID: 1695138045} @@ -4864,7 +4674,7 @@ GameObject: --- !u!224 &1695138043 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1695138042} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -4882,7 +4692,7 @@ RectTransform: --- !u!114 &1695138044 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1695138042} m_Enabled: 0 @@ -4909,15 +4719,16 @@ MonoBehaviour: --- !u!222 &1695138045 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1695138042} + m_CullTransparentMesh: 0 --- !u!1 &1741404086 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1741404087} - component: {fileID: 1741404089} @@ -4932,7 +4743,7 @@ GameObject: --- !u!224 &1741404087 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1741404086} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -4950,7 +4761,7 @@ RectTransform: --- !u!114 &1741404088 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1741404086} m_Enabled: 1 @@ -4977,15 +4788,16 @@ MonoBehaviour: --- !u!222 &1741404089 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1741404086} + m_CullTransparentMesh: 0 --- !u!1 &1771486825 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1771486826} - component: {fileID: 1771486828} @@ -5000,7 +4812,7 @@ GameObject: --- !u!224 &1771486826 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1771486825} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -5018,7 +4830,7 @@ RectTransform: --- !u!114 &1771486827 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1771486825} m_Enabled: 1 @@ -5045,15 +4857,16 @@ MonoBehaviour: --- !u!222 &1771486828 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1771486825} + m_CullTransparentMesh: 0 --- !u!1 &1777541744 GameObject: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1777541747} - component: {fileID: 1777541746} @@ -5068,7 +4881,7 @@ GameObject: --- !u!114 &1777541745 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1777541744} m_Enabled: 1 @@ -5089,7 +4902,7 @@ MonoBehaviour: --- !u!223 &1777541746 Canvas: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1777541744} m_Enabled: 1 @@ -5109,7 +4922,7 @@ Canvas: --- !u!224 &1777541747 RectTransform: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1777541744} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -5118,7 +4931,7 @@ RectTransform: m_Children: - {fileID: 1465098067} m_Father: {fileID: 0} - m_RootOrder: 14 + m_RootOrder: 13 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -5128,9 +4941,9 @@ RectTransform: --- !u!1 &1791178145 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1791178146} - component: {fileID: 1791178148} @@ -5145,7 +4958,7 @@ GameObject: --- !u!224 &1791178146 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1791178145} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -5165,7 +4978,7 @@ RectTransform: --- !u!114 &1791178147 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1791178145} m_Enabled: 1 @@ -5192,15 +5005,16 @@ MonoBehaviour: --- !u!222 &1791178148 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1791178145} + m_CullTransparentMesh: 0 --- !u!1 &1963101659 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 1963101663} - component: {fileID: 1963101662} @@ -5216,7 +5030,7 @@ GameObject: --- !u!65 &1963101660 BoxCollider: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1963101659} m_Material: {fileID: 0} @@ -5228,7 +5042,7 @@ BoxCollider: --- !u!23 &1963101661 MeshRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1963101659} m_Enabled: 1 @@ -5264,14 +5078,14 @@ MeshRenderer: --- !u!33 &1963101662 MeshFilter: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1963101659} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} --- !u!4 &1963101663 Transform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1963101659} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -5279,82 +5093,14 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1978482795 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 1978482796} - - component: {fileID: 1978482798} - - component: {fileID: 1978482797} - m_Layer: 5 - m_Name: FogVolume Image - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &1978482796 -RectTransform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1978482795} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 2, y: 2, z: 2} - m_Children: [] - m_Father: {fileID: 1376576717} - m_RootOrder: 0 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 110, y: 320} - m_SizeDelta: {x: 100, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1978482797 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1978482795} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, - Version=1.0.0.0, Culture=neutral, PublicKeyToken=null - m_Sprite: {fileID: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 ---- !u!222 &1978482798 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1978482795} --- !u!1 &2000861315 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 2000861316} - component: {fileID: 2000861318} @@ -5369,7 +5115,7 @@ GameObject: --- !u!224 &2000861316 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2000861315} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -5393,7 +5139,7 @@ RectTransform: --- !u!114 &2000861317 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2000861315} m_Enabled: 1 @@ -5420,15 +5166,16 @@ MonoBehaviour: --- !u!222 &2000861318 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2000861315} + m_CullTransparentMesh: 0 --- !u!1 &2012151644 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 2012151645} - component: {fileID: 2012151647} @@ -5443,7 +5190,7 @@ GameObject: --- !u!224 &2012151645 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2012151644} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -5461,7 +5208,7 @@ RectTransform: --- !u!114 &2012151646 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2012151644} m_Enabled: 1 @@ -5488,15 +5235,16 @@ MonoBehaviour: --- !u!222 &2012151647 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2012151644} + m_CullTransparentMesh: 0 --- !u!1 &2018855990 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 2018855991} - component: {fileID: 2018855993} @@ -5511,7 +5259,7 @@ GameObject: --- !u!224 &2018855991 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2018855990} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -5529,7 +5277,7 @@ RectTransform: --- !u!114 &2018855992 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2018855990} m_Enabled: 1 @@ -5556,15 +5304,16 @@ MonoBehaviour: --- !u!222 &2018855993 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2018855990} + m_CullTransparentMesh: 0 --- !u!1 &2024537677 GameObject: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 2024537680} - component: {fileID: 2024537679} @@ -5579,7 +5328,7 @@ GameObject: --- !u!114 &2024537678 MonoBehaviour: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2024537677} m_Enabled: 1 @@ -5600,7 +5349,7 @@ MonoBehaviour: --- !u!223 &2024537679 Canvas: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2024537677} m_Enabled: 1 @@ -5620,7 +5369,7 @@ Canvas: --- !u!224 &2024537680 RectTransform: m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2024537677} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -5629,7 +5378,7 @@ RectTransform: m_Children: - {fileID: 714930135} m_Father: {fileID: 0} - m_RootOrder: 11 + m_RootOrder: 10 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -5639,9 +5388,9 @@ RectTransform: --- !u!1 &2038484978 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 2038484981} - component: {fileID: 2038484980} @@ -5656,7 +5405,7 @@ GameObject: --- !u!114 &2038484979 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2038484978} m_Enabled: 1 @@ -5769,13 +5518,14 @@ MonoBehaviour: --- !u!222 &2038484980 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2038484978} + m_CullTransparentMesh: 0 --- !u!224 &2038484981 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2038484978} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} @@ -5793,9 +5543,9 @@ RectTransform: --- !u!1 &2039058202 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 2039058203} - component: {fileID: 2039058206} @@ -5811,7 +5561,7 @@ GameObject: --- !u!224 &2039058203 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2039058202} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -5829,7 +5579,7 @@ RectTransform: --- !u!114 &2039058204 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2039058202} m_Enabled: 1 @@ -5870,7 +5620,7 @@ MonoBehaviour: --- !u!114 &2039058205 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2039058202} m_Enabled: 1 @@ -5897,15 +5647,16 @@ MonoBehaviour: --- !u!222 &2039058206 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2039058202} + m_CullTransparentMesh: 0 --- !u!1 &2043975904 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 2043975905} - component: {fileID: 2043975906} @@ -5920,7 +5671,7 @@ GameObject: --- !u!224 &2043975905 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2043975904} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -5938,13 +5689,14 @@ RectTransform: --- !u!222 &2043975906 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2043975904} + m_CullTransparentMesh: 0 --- !u!114 &2043975907 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2043975904} m_Enabled: 1 @@ -5971,9 +5723,9 @@ MonoBehaviour: --- !u!1 &2110293335 GameObject: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - serializedVersion: 5 + serializedVersion: 6 m_Component: - component: {fileID: 2110293336} - component: {fileID: 2110293338} @@ -5988,7 +5740,7 @@ GameObject: --- !u!224 &2110293336 RectTransform: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2110293335} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} @@ -6006,7 +5758,7 @@ RectTransform: --- !u!114 &2110293337 MonoBehaviour: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2110293335} m_Enabled: 1 @@ -6033,6 +5785,7 @@ MonoBehaviour: --- !u!222 &2110293338 CanvasRenderer: m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} + m_CorrespondingSourceObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2110293335} + m_CullTransparentMesh: 0 diff --git a/Assets/Scipts/CharacterMovement.cs b/Assets/Scipts/CharacterMovement.cs index 1095ea5..efa48df 100644 --- a/Assets/Scipts/CharacterMovement.cs +++ b/Assets/Scipts/CharacterMovement.cs @@ -2,7 +2,8 @@ using System.Collections.Generic; using UnityEngine; -public class CharacterMovement : MonoBehaviour { +public class CharacterMovement : MonoBehaviour +{ public float Speed; GameObject localPlayer; @@ -17,23 +18,23 @@ public class CharacterMovement : MonoBehaviour { private void Start() { - localPlayer = Multiplayer.PlayersManager.Instance.LocalPlayer; + localPlayer = Multiplayer.PlayersManager.Instance.LocalPlayer.gameObject; Players.Add(localPlayer); Nearby.Add(false); - foreach (GameObject curPlayer in Multiplayer.PlayersManager.Instance.RemotePlayers.Values) + foreach (PlayerData curPlayer in Multiplayer.PlayersManager.Instance.Players.Values) { - Players.Add(curPlayer); + Players.Add(curPlayer.gameObject); Nearby.Add(false); } cam = localPlayer.GetComponentInChildren(); - + } public bool CheckNearby() { for (int i = 0; i < Players.Count; i++) { - bool found = false; + bool found = false; if ((localPlayer.transform.position - Players[i].transform.position).magnitude < DistanceToWin) { Greet(); diff --git a/Assets/Scipts/GameMode.cs b/Assets/Scipts/GameMode.cs index a34b17f..1299c7d 100644 --- a/Assets/Scipts/GameMode.cs +++ b/Assets/Scipts/GameMode.cs @@ -6,25 +6,14 @@ using Multiplayer; public class GameMode : MonoBehaviour { - //references to all players - List Players = new List(); + public Recipe recipe; - GameObject LocalPlayer; public CharacterMovement charMove; public Timer timer; public GameObject winCanvas; public GameObject loseCanvas; - private void Start() - { - LocalPlayer = Multiplayer.PlayersManager.Instance.LocalPlayer; - Players.Add(LocalPlayer); - foreach (GameObject curPlayer in Multiplayer.PlayersManager.Instance.RemotePlayers.Values) - { - Players.Add(curPlayer); - } - } private void OnEnable() { diff --git a/Assets/Scipts/HomeScreenManager.cs b/Assets/Scipts/HomeScreenManager.cs index 0e7333f..26fc940 100644 --- a/Assets/Scipts/HomeScreenManager.cs +++ b/Assets/Scipts/HomeScreenManager.cs @@ -31,6 +31,7 @@ public class HomeScreenManager : MonoBehaviour { if (Succeeded) { //Destroy(ServerManager.Instance.gameObject); + ClientManager.Instance.Name = Name.text; ClientManager.Instance.StartClient(IP.text, intVal); } PlayerPrefs.SetString("IP", IP.text); diff --git a/Assets/Scipts/LookAtCamera.cs b/Assets/Scipts/LookAtCamera.cs new file mode 100644 index 0000000..c552b0c --- /dev/null +++ b/Assets/Scipts/LookAtCamera.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LookAtCamera : MonoBehaviour { + + // Update is called once per frame + void Update () { + if (Camera.main != null) + { + transform.rotation = Quaternion.LookRotation(transform.position - Camera.main.transform.position); + } + else + { + Debug.Log("Cannot find Camera"); + } + } +} diff --git a/Assets/FogVolume/Scripts/FogVolumeCreator.cs.meta b/Assets/Scipts/LookAtCamera.cs.meta similarity index 74% rename from Assets/FogVolume/Scripts/FogVolumeCreator.cs.meta rename to Assets/Scipts/LookAtCamera.cs.meta index 5f9cb3d..fcc4f00 100644 --- a/Assets/FogVolume/Scripts/FogVolumeCreator.cs.meta +++ b/Assets/Scipts/LookAtCamera.cs.meta @@ -1,6 +1,7 @@ fileFormatVersion: 2 -guid: e1ca8118fc675de46aaadaf22b652071 +guid: 023d1c96a12b5d94c938163298757714 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Scipts/Map.cs b/Assets/Scipts/Map.cs index 38c120f..5ade964 100644 --- a/Assets/Scipts/Map.cs +++ b/Assets/Scipts/Map.cs @@ -5,8 +5,6 @@ using UnityEngine; public class Map : MonoBehaviour { - GameObject LocalPlayer; - List Players = new List(); public GameObject[] Tiles; public List Landmarks; @@ -24,28 +22,21 @@ public class Map : MonoBehaviour #region StartupFunctions private void Start() { - LocalPlayer = Multiplayer.PlayersManager.Instance.LocalPlayer; - Players.Add(LocalPlayer); - foreach (GameObject curPlayer in Multiplayer.PlayersManager.Instance.RemotePlayers.Values) - { - Players.Add(curPlayer); - } GenerateTiles(); CreateDummys(); Random.State state = Random.state; Random.InitState((int)System.DateTime.Now.Ticks); - LocalPlayer.transform.position = new Vector3(Random.Range(minX, maxX), 5, Random.Range(minX, maxX)); + Multiplayer.PlayersManager.Instance.LocalPlayer.transform.position = new Vector3(Random.Range(minX, maxX), 5, Random.Range(minX, maxX)); Random.state = state; } //Create dummy players for the world wrapping void CreateDummys() { - foreach (GameObject Player in Players) + foreach (PlayerData playerData in Multiplayer.PlayersManager.Instance.Players.Values) { - Player PS = Player.GetComponent(); - PS.CreateDummies(this); + playerData.Player.CreateDummies(this); } } diff --git a/Assets/Scipts/Multiplayer/Client/ClientLoginManager.cs b/Assets/Scipts/Multiplayer/Client/ClientLoginManager.cs index 3bfb234..4ba56e7 100644 --- a/Assets/Scipts/Multiplayer/Client/ClientLoginManager.cs +++ b/Assets/Scipts/Multiplayer/Client/ClientLoginManager.cs @@ -59,12 +59,15 @@ namespace Multiplayer private void StartLobby() { + if (PlayersManager.Instance != null) + PlayersManager.Instance.DestroyPlayers(); + UnityEngine.SceneManagement.SceneManager.LoadScene(ClientManager.LobbyScene); } private void StartGame(NetworkMessage msg) { - PlayersManager.Instance.LocalPlayer.GetComponent().enabled = true; + PlayersManager.Instance.InstantiatePlayers(); UnityEngine.SceneManagement.SceneManager.LoadScene(ClientManager.GameScene); } @@ -76,6 +79,8 @@ namespace Multiplayer Random.InitState((int)longMsg.Long); } + + } } \ No newline at end of file diff --git a/Assets/Scipts/Multiplayer/Client/ClientManager.cs b/Assets/Scipts/Multiplayer/Client/ClientManager.cs index 0fedc04..ee1ba55 100644 --- a/Assets/Scipts/Multiplayer/Client/ClientManager.cs +++ b/Assets/Scipts/Multiplayer/Client/ClientManager.cs @@ -66,7 +66,6 @@ namespace Multiplayer loginManager = new ClientLoginManager(this); Client.Configure(ChannelConfig.DefaultTopology()); - Client.RegisterHandler(PlayerMsgID.Lobby, StartLobby); Client.Connect(ServerAddress, Port); } @@ -93,11 +92,6 @@ namespace Multiplayer SendMessage(msgType, new PlayerMsg(ID)); } - public void StartLobby(NetworkMessage msg) - { - UnityEngine.SceneManagement.SceneManager.LoadScene(LobbyScene); - } - public void StartGame(NetworkMessage msg) { diff --git a/Assets/Scipts/Multiplayer/Client/PlayaData.cs b/Assets/Scipts/Multiplayer/Client/PlayaData.cs new file mode 100644 index 0000000..2ce6c79 --- /dev/null +++ b/Assets/Scipts/Multiplayer/Client/PlayaData.cs @@ -0,0 +1,39 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PlayerData { + + public Vector3 Position; + public string Name; + public Color Color; + public byte ID; + + public bool isLocalPlayer = false; + + public Player Player; + + public GameObject gameObject { get { return Player.gameObject; }} + public Transform transform { get { return Player.transform; } } + + public PlayerData(byte ID, string Name, Color Color) + { + this.ID = ID; + this.Name = Name; + this.Color = Color; + } + + public void SetPosition(Vector3 position) + { + if (Player != null) + Player.transform.position = position; + } + + public void Instantiate(GameObject remotePlayerPrefab,Transform parent) + { + Player = GameObject.Instantiate(remotePlayerPrefab, parent).GetComponent(); + Player.SetName(Name); + transform.position = Vector3.zero + Vector3.up * 5.0f; + } + +} diff --git a/Assets/FogVolume/Scripts/Editor/FogVolumeDataEditor.cs.meta b/Assets/Scipts/Multiplayer/Client/PlayaData.cs.meta similarity index 68% rename from Assets/FogVolume/Scripts/Editor/FogVolumeDataEditor.cs.meta rename to Assets/Scipts/Multiplayer/Client/PlayaData.cs.meta index 57ed554..984b5c5 100644 --- a/Assets/FogVolume/Scripts/Editor/FogVolumeDataEditor.cs.meta +++ b/Assets/Scipts/Multiplayer/Client/PlayaData.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 67c6279c882435349837b0230f66338b -timeCreated: 1490476289 -licenseType: Store +guid: a8d01beb199d7ac49b5e420912c8b223 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Scipts/Multiplayer/Client/PlayersManager.cs b/Assets/Scipts/Multiplayer/Client/PlayersManager.cs index b7f84f5..a37aac0 100644 --- a/Assets/Scipts/Multiplayer/Client/PlayersManager.cs +++ b/Assets/Scipts/Multiplayer/Client/PlayersManager.cs @@ -15,33 +15,47 @@ namespace Multiplayer [SerializeField] public GameObject RemotePlayerPrefab; - public Dictionary RemotePlayers = new Dictionary(); - public GameObject LocalPlayer; + public Dictionary Players = new Dictionary(); + public PlayerData LocalPlayer; private void Start() { - OnGameStart(); + RegisterHandlers(); + + PlayerData localPlayer = new PlayerData(ClientManager.Instance.ID, ClientManager.Instance.Name, Color.white); + localPlayer.isLocalPlayer = true; + Players.Add(localPlayer.ID, localPlayer); + LocalPlayer = localPlayer; } - public void OnGameStart() + public void RegisterHandlers() { ClientManager.Instance.Client.RegisterHandler(PlayerMsgID.Position, RecievePosition); - InstantaiateLocalPlayer(); + ClientManager.Instance.Client.RegisterHandler(LoginMsgID.RemotePlayerJoin, OnRemotePlayerJoin); + ClientManager.Instance.Client.RegisterHandler(LoginMsgID.RemotePlayerExit, OnRemotePlayerLeave); } - public void InstantaiateLocalPlayer() + public void InstantiatePlayers() { - LocalPlayer = GameObject.Instantiate(LocalPlayerPrefab,transform); - LocalPlayer.transform.position = Vector3.zero + Vector3.up * 5.0f; - ClientManager.Instance.SendMessage(PlayerMsgID.QueryPosition); + foreach (PlayerData playerData in Players.Values) + { + if (playerData.isLocalPlayer) + playerData.Instantiate(LocalPlayerPrefab, transform); + else + playerData.Instantiate(RemotePlayerPrefab, transform); + } } - public void InstantiateRemotePlayer(byte playerID) + public void DestroyPlayers() { - RemotePlayers.Add(playerID, Instantiate(RemotePlayerPrefab,transform)); + foreach (PlayerData player in Players.Values) + if (player.gameObject != null) + Destroy(player.gameObject); } - public void SendPosition(Vector3 position) { + + public void SendPosition(Vector3 position) + { ClientManager.Instance.SendMessage(PlayerMsgID.Position, new VectorMsg(ClientManager.Instance.ID, position)); } @@ -52,11 +66,41 @@ namespace Multiplayer if (!Utility.ReadMessage(msg, out vectorMsg)) return; - if (!RemotePlayers.ContainsKey(vectorMsg.ID)) - InstantiateRemotePlayer(vectorMsg.ID); + if (Players.ContainsKey(vectorMsg.ID)) + Players[vectorMsg.ID].SetPosition(vectorMsg.vector); + } + + public void OnRemotePlayerJoin(NetworkMessage msg) + { + + PlayerDataMsg playerMsg; + + if (!Utility.ReadMessage(msg, out playerMsg)) + return; + + if (Players.ContainsKey(playerMsg.ID)) + Debug.Log(Players[playerMsg.ID].Name + ", trying to join twice"); + + PlayerData newPlayer = new PlayerData(playerMsg.ID, playerMsg.Name, playerMsg.Color); + Players.Add(playerMsg.ID, newPlayer); + } + + public void OnRemotePlayerLeave(NetworkMessage msg) + { + PlayerMsg playerMsg; + + if (!Utility.ReadMessage(msg, out playerMsg)) + return; + + if (!Players.ContainsKey(playerMsg.ID)) + Debug.Log("Unknown Player Left"); + + PlayerData leftPlayer = Players[playerMsg.ID]; + Players.Remove(playerMsg.ID); - RemotePlayers[vectorMsg.ID].transform.position = vectorMsg.vector; + if (leftPlayer.gameObject != null) + Destroy(leftPlayer.gameObject); } - } + } } diff --git a/Assets/Scipts/Multiplayer/Core/LoginProtocol.cs b/Assets/Scipts/Multiplayer/Core/LoginProtocol.cs index d5dea20..178abbf 100644 --- a/Assets/Scipts/Multiplayer/Core/LoginProtocol.cs +++ b/Assets/Scipts/Multiplayer/Core/LoginProtocol.cs @@ -11,5 +11,8 @@ namespace Multiplayer public const short EnterLobby = 302; public const short LobbyCount = 303; public const short Seed = 304; + public const short RemotePlayerJoin = 305; + public const short RemotePlayerExit = 306 ; + } } \ No newline at end of file diff --git a/Assets/Scipts/Multiplayer/Core/PlayerProtocol.cs b/Assets/Scipts/Multiplayer/Core/PlayerProtocol.cs index 4705552..c7af08f 100644 --- a/Assets/Scipts/Multiplayer/Core/PlayerProtocol.cs +++ b/Assets/Scipts/Multiplayer/Core/PlayerProtocol.cs @@ -173,4 +173,35 @@ namespace Multiplayer } } + + public class PlayerDataMsg : PlayerMsg + { + public string Name; + public Color Color; + + public PlayerDataMsg() { } + + public PlayerDataMsg(byte PlayerID, string Name, Color Color) : base(PlayerID) + { + this.Name = Name; + this.Color = Color; + } + + public override void Serialize(NetworkWriter writer) + { + base.Serialize(writer); + writer.Write(Name); + writer.Write(Color); + } + + + public override void Deserialize(NetworkReader reader) + { + base.Deserialize(reader); + Name = reader.ReadString(); + Color = reader.ReadColor(); + } + + } + } diff --git a/Assets/Scipts/Multiplayer/Server/LoginManager.cs b/Assets/Scipts/Multiplayer/Server/LoginManager.cs index c3e6629..3faea75 100644 --- a/Assets/Scipts/Multiplayer/Server/LoginManager.cs +++ b/Assets/Scipts/Multiplayer/Server/LoginManager.cs @@ -25,6 +25,8 @@ namespace Multiplayer ServerManager.Server.RegisterHandler(MsgType.Disconnect, OnDisconnect); ServerManager.Server.RegisterHandler(PlayerMsgID.GameStart, ClientStartsGame); ServerManager.Server.RegisterHandler(PlayerMsgID.Lobby, GoToLobby); + ServerManager.Server.RegisterHandler(PlayerMsgID.GameWin, OnGameWin); + ServerManager.Server.RegisterHandler(PlayerMsgID.GameOver, OnGameOver); } @@ -45,6 +47,18 @@ namespace Multiplayer Player newPlayer = new Player(msg.conn, stringMsg.String); ServerManager.AllPlayers.Add(newPlayer.ID, newPlayer); + + foreach (Player player in ServerManager.AllPlayers.Values) + { + if (!player.Equals(newPlayer)) + { + player.Connection.Send(LoginMsgID.RemotePlayerJoin, new PlayerDataMsg(newPlayer.ID, newPlayer.Name, Color.white)); + newPlayer.Connection.Send(LoginMsgID.RemotePlayerJoin, new PlayerDataMsg(player.ID, player.Name, Color.white)); + } + } + + + } @@ -58,8 +72,16 @@ namespace Multiplayer { if (ServerManager.AllPlayers.ContainsKey(msg.conn.connectionId)) { + + Player leftPlayer = ServerManager.AllPlayers[msg.conn.connectionId]; Debug.Log(ServerManager.AllPlayers[msg.conn.connectionId].Name + "has disconnected."); ServerManager.AllPlayers.Remove(msg.conn.connectionId); + + foreach(Player player in ServerManager.AllPlayers.Values) + { + player.Connection.Send(LoginMsgID.RemotePlayerExit, new PlayerMsg(leftPlayer.ID)); + } + } else Debug.Log("Unkown player has disconnected."); @@ -79,7 +101,27 @@ namespace Multiplayer } } + private void OnGameWin(NetworkMessage msg) + { + + ServerManager.Seed = System.DateTime.Now.Ticks; + foreach (Player player in ServerManager.AllPlayers.Values) + { + PlayerMsg winMsg = new PlayerMsg(player.ID); + player.Connection.Send(PlayerMsgID.GameWin, winMsg); + } + } + + private void OnGameOver(NetworkMessage msg) + { + foreach (Player player in ServerManager.AllPlayers.Values) + { + + PlayerMsg winMsg = new PlayerMsg(player.ID); + player.Connection.Send(PlayerMsgID.GameOver, winMsg); + } + } private void GoToLobby(NetworkMessage msg) { diff --git a/Assets/Scipts/Multiplayer/Server/PlayerServerManager.cs b/Assets/Scipts/Multiplayer/Server/PlayerServerManager.cs index 70a367b..7d810d8 100644 --- a/Assets/Scipts/Multiplayer/Server/PlayerServerManager.cs +++ b/Assets/Scipts/Multiplayer/Server/PlayerServerManager.cs @@ -22,8 +22,6 @@ namespace Multiplayer ServerManager.Server.RegisterHandler(PlayerMsgID.Position, RecievePosition); ServerManager.Server.RegisterHandler(PlayerMsgID.QueryPosition, QueryPosition); ServerManager.Server.RegisterHandler(PlayerMsgID.Vegetable, PickUpVeg); - ServerManager.Server.RegisterHandler(PlayerMsgID.GameWin, OnGameWin); - ServerManager.Server.RegisterHandler(PlayerMsgID.GameOver, OnGameOver); } private void RecievePosition(NetworkMessage msg) @@ -74,25 +72,9 @@ namespace Multiplayer } } - private void OnGameWin(NetworkMessage msg) - { - foreach (Player player in ServerManager.AllPlayers.Values) - { - - PlayerMsg winMsg = new PlayerMsg(player.ID); - player.Connection.Send(PlayerMsgID.GameWin, winMsg); - } - } + - private void OnGameOver(NetworkMessage msg) - { - foreach (Player player in ServerManager.AllPlayers.Values) - { - - PlayerMsg winMsg = new PlayerMsg(player.ID); - player.Connection.Send(PlayerMsgID.GameOver, winMsg); - } - } + private void PickUpVeg(NetworkMessage msg) { diff --git a/Assets/Scipts/PlayerControllers/Player.cs b/Assets/Scipts/PlayerControllers/Player.cs index d584b8e..0643709 100644 --- a/Assets/Scipts/PlayerControllers/Player.cs +++ b/Assets/Scipts/PlayerControllers/Player.cs @@ -14,7 +14,7 @@ public class Player : MonoBehaviour public float scale = 0.1f; - public void Start() + protected virtual void Start() { playerAnim = playerModel.GetComponent(); } @@ -68,4 +68,9 @@ public class Player : MonoBehaviour dummieAnims[count].SetTrigger("PickUp"); } } + + public virtual void SetName(string Name) + { + + } } diff --git a/Assets/Scipts/PlayerControllers/RemotePlayer.cs b/Assets/Scipts/PlayerControllers/RemotePlayer.cs index a6a4474..ea18ea5 100644 --- a/Assets/Scipts/PlayerControllers/RemotePlayer.cs +++ b/Assets/Scipts/PlayerControllers/RemotePlayer.cs @@ -12,8 +12,9 @@ public class RemotePlayer : Player { private float LastSpeed = 0; - public void Start() + protected override void Start() { + base.Start(); lastPosition = transform.position; } @@ -39,4 +40,11 @@ public class RemotePlayer : Player { PlayerModel.transform.LookAt(PlayerModel.transform.position + dir, Vector3.up); //PlayerModel.transform.forward = dir.normalized; } + + public override void SetName(string Name) + { + TMPro.TextMeshPro textMesh = GetComponentInChildren(); + if (textMesh != null) + textMesh.text = Name; + } } diff --git a/Assets/Scipts/Recipe.cs b/Assets/Scipts/Recipe.cs index ad6024e..6e1bbbc 100644 --- a/Assets/Scipts/Recipe.cs +++ b/Assets/Scipts/Recipe.cs @@ -22,9 +22,9 @@ public class Recipe : MonoBehaviour { // Use this for initialization void Start () { - - localPlayer = PlayersManager.Instance.LocalPlayer.GetComponent(); - PlayerCount = PlayersManager.Instance.RemotePlayers.Count + 1; + + localPlayer = PlayersManager.Instance.LocalPlayer.Player; + PlayerCount = PlayersManager.Instance.Players.Count; localPlayer.GetComponent().recipe = this; int count = 0; diff --git a/Assets/Scipts/Timer.cs b/Assets/Scipts/Timer.cs index 45ad567..235129a 100644 --- a/Assets/Scipts/Timer.cs +++ b/Assets/Scipts/Timer.cs @@ -49,7 +49,6 @@ public class Timer : MonoBehaviour { sunG += offset; } Color32 col = new Color32((byte)sunR, (byte)sunG, (byte)sunB, (byte)255); - Debug.Log(col); SunImage.color = col; Sun.RotateAround(Pivot.transform.position, -1 * Sun.transform.forward, (180 / MaxTimer) * Time.deltaTime); lightObj.transform.RotateAround(lightObj.transform.position, -1 * Sun.transform.forward, (180 / MaxTimer) * Time.deltaTime); diff --git a/Assets/Scipts/UI/LobbyUIController.cs b/Assets/Scipts/UI/LobbyUIController.cs index efdc174..69ac413 100644 --- a/Assets/Scipts/UI/LobbyUIController.cs +++ b/Assets/Scipts/UI/LobbyUIController.cs @@ -6,7 +6,7 @@ public class LobbyUIController : MonoBehaviour { private void Start() { - Multiplayer.PlayersManager.Instance.LocalPlayer.GetComponent().heldVeggie = null; + Multiplayer.PlayersManager.Instance.LocalPlayer.gameObject.GetComponent().heldVeggie = null; } public void OnClickStartGame() diff --git a/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset b/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset index c02a963..c264842 100644 --- a/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset +++ b/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f304c62a5f0ae05d242f436f372e541d7761497233e4022f606341380148a78f -size 2173902 +oid sha256:b286f0b5e84a118f6c58908a57643df7d8b0a3659a717b3d69ba6d9a0099c730 +size 2173994 diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index b171987..96fdb1a 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2018.1.3f1 +m_EditorVersion: 2018.2.2f1