├── .gitignore
├── Assets
├── EntroPi.meta
└── EntroPi
│ ├── Cloud Shadows.meta
│ └── Cloud Shadows
│ ├── Cloud Shadows Manual v1.1.1.pdf
│ ├── Cloud Shadows Manual v1.1.1.pdf.meta
│ ├── Editor.meta
│ ├── Editor
│ ├── InternalResources.meta
│ └── InternalResources
│ │ ├── CloudLayerBlendArrow.png
│ │ ├── CloudLayerBlendArrow.png.meta
│ │ ├── CloudLayersIcon.png
│ │ ├── CloudLayersIcon.png.meta
│ │ ├── EntroPiIcon.png
│ │ ├── EntroPiIcon.png.meta
│ │ ├── EntroPiLogo.png
│ │ └── EntroPiLogo.png.meta
│ ├── Prefabs.meta
│ ├── Prefabs
│ ├── Clouds_Layered_A.asset
│ ├── Clouds_Layered_A.asset.meta
│ ├── Clouds_Layered_B.asset
│ ├── Clouds_Layered_B.asset.meta
│ ├── Clouds_Morphing_A.asset
│ ├── Clouds_Morphing_A.asset.meta
│ ├── Clouds_Morphing_B.asset
│ ├── Clouds_Morphing_B.asset.meta
│ ├── Clouds_Overcast_A.asset
│ ├── Clouds_Overcast_A.asset.meta
│ ├── Clouds_Overcast_B.asset
│ ├── Clouds_Overcast_B.asset.meta
│ ├── Clouds_Simple_A.asset
│ ├── Clouds_Simple_A.asset.meta
│ ├── Clouds_Simple_B.asset
│ └── Clouds_Simple_B.asset.meta
│ ├── Resources.meta
│ ├── Resources
│ ├── Shaders.meta
│ └── Shaders
│ │ ├── CloudShadows.shader
│ │ └── CloudShadows.shader.meta
│ ├── Scripts.meta
│ ├── Scripts
│ ├── CloudLayer.cs
│ ├── CloudLayer.cs.meta
│ ├── CloudLayerData.cs
│ ├── CloudLayerData.cs.meta
│ ├── CloudLayers.cs
│ ├── CloudLayers.cs.meta
│ ├── CloudShadows.cs
│ ├── CloudShadows.cs.meta
│ ├── Editor.meta
│ ├── Editor
│ │ ├── CloudLayersEditor.cs
│ │ ├── CloudLayersEditor.cs.meta
│ │ ├── CloudShadowsEditor.cs
│ │ ├── CloudShadowsEditor.cs.meta
│ │ ├── EditorUtil.cs
│ │ └── EditorUtil.cs.meta
│ ├── Util.cs
│ └── Util.cs.meta
│ ├── Textures.meta
│ └── Textures
│ ├── CloudsFineDetail.png
│ ├── CloudsFineDetail.png.meta
│ ├── CloudsLargeDetail.png
│ ├── CloudsLargeDetail.png.meta
│ ├── CloudsMediumDetail.png
│ └── CloudsMediumDetail.png.meta
├── LICENSE
├── ProjectSettings
├── AudioManager.asset
├── DynamicsManager.asset
├── EditorBuildSettings.asset
├── EditorSettings.asset
├── GraphicsSettings.asset
├── InputManager.asset
├── NavMeshAreas.asset
├── NetworkManager.asset
├── Physics2DSettings.asset
├── ProjectSettings.asset
├── ProjectVersion.txt
├── QualitySettings.asset
├── TagManager.asset
├── TimeManager.asset
├── UnityAdsSettings.asset
└── UnityAnalyticsManager.asset
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # This .gitignore file should be placed at the root of your Unity project directory
2 | #
3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
4 | #
5 | /[Ll]ibrary/
6 | /[Tt]emp/
7 | /[Oo]bj/
8 | /[Bb]uild/
9 | /[Bb]uilds/
10 | /[Ll]ogs/
11 | /[Mm]emoryCaptures/
12 |
13 | # Asset meta data should only be ignored when the corresponding asset is also ignored
14 | !/[Aa]ssets/**/*.meta
15 |
16 | # Uncomment this line if you wish to ignore the asset store tools plugin
17 | # /[Aa]ssets/AssetStoreTools*
18 |
19 | # Autogenerated Jetbrains Rider plugin
20 | [Aa]ssets/Plugins/Editor/JetBrains*
21 |
22 | # Visual Studio cache directory
23 | .vs/
24 |
25 | # Gradle cache directory
26 | .gradle/
27 |
28 | # Autogenerated VS/MD/Consulo solution and project files
29 | ExportedObj/
30 | .consulo/
31 | *.csproj
32 | *.unityproj
33 | *.sln
34 | *.suo
35 | *.tmp
36 | *.user
37 | *.userprefs
38 | *.pidb
39 | *.booproj
40 | *.svd
41 | *.pdb
42 | *.mdb
43 | *.opendb
44 | *.VC.db
45 |
46 | # Unity3D generated meta files
47 | *.pidb.meta
48 | *.pdb.meta
49 | *.mdb.meta
50 |
51 | # Unity3D generated file on crash reports
52 | sysinfo.txt
53 |
54 | # Builds
55 | *.apk
56 | *.unitypackage
57 |
58 | # Crashlytics generated file
59 | crashlytics-build.properties
60 |
61 |
--------------------------------------------------------------------------------
/Assets/EntroPi.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4bae61ebe4225b548823dbbd7eb6b635
3 | folderAsset: yes
4 | timeCreated: 1460493744
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: af0dd8aa68fc7fc43a2753a49f52e808
3 | folderAsset: yes
4 | timeCreated: 1460493752
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Cloud Shadows Manual v1.1.1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Cloud Shadows Manual v1.1.1.pdf
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Cloud Shadows Manual v1.1.1.pdf.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b0ab98b8f2991fe4ab90b22670192921
3 | timeCreated: 1509278919
4 | licenseType: Free
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 74570b79522318a4ca47506a5a7ee675
3 | folderAsset: yes
4 | timeCreated: 1488319790
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Editor/InternalResources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6b3296f3293088041886e8737cbe4b7a
3 | folderAsset: yes
4 | timeCreated: 1488317704
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Editor/InternalResources/CloudLayerBlendArrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Editor/InternalResources/CloudLayerBlendArrow.png
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Editor/InternalResources/CloudLayerBlendArrow.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 42d77cf9ebc667045a8f9696199c48ee
3 | timeCreated: 1488470024
4 | licenseType: Free
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 2
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 0
11 | linearTexture: 1
12 | correctGamma: 0
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: .25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 0
25 | cubemapConvolution: 0
26 | cubemapConvolutionSteps: 8
27 | cubemapConvolutionExponent: 1.5
28 | seamlessCubemap: 0
29 | textureFormat: -1
30 | maxTextureSize: 2048
31 | textureSettings:
32 | filterMode: -1
33 | aniso: 0
34 | mipBias: -1
35 | wrapMode: 1
36 | nPOTScale: 0
37 | lightmap: 0
38 | rGBM: 0
39 | compressionQuality: 50
40 | allowsAlphaSplitting: 0
41 | spriteMode: 0
42 | spriteExtrude: 1
43 | spriteMeshType: 1
44 | alignment: 0
45 | spritePivot: {x: .5, y: .5}
46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
47 | spritePixelsToUnits: 100
48 | alphaIsTransparency: 1
49 | textureType: 5
50 | buildTargetSettings: []
51 | spriteSheet:
52 | sprites: []
53 | spritePackingTag:
54 | userData:
55 | assetBundleName:
56 | assetBundleVariant:
57 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Editor/InternalResources/CloudLayersIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Editor/InternalResources/CloudLayersIcon.png
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Editor/InternalResources/CloudLayersIcon.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 623d91210e297d7438bbdffc8bcbb52b
3 | timeCreated: 1488471161
4 | licenseType: Free
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 2
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 0
11 | linearTexture: 1
12 | correctGamma: 0
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: .25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 0
25 | cubemapConvolution: 0
26 | cubemapConvolutionSteps: 8
27 | cubemapConvolutionExponent: 1.5
28 | seamlessCubemap: 0
29 | textureFormat: -1
30 | maxTextureSize: 2048
31 | textureSettings:
32 | filterMode: -1
33 | aniso: 0
34 | mipBias: -1
35 | wrapMode: 1
36 | nPOTScale: 0
37 | lightmap: 0
38 | rGBM: 0
39 | compressionQuality: 50
40 | allowsAlphaSplitting: 0
41 | spriteMode: 0
42 | spriteExtrude: 1
43 | spriteMeshType: 1
44 | alignment: 0
45 | spritePivot: {x: .5, y: .5}
46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
47 | spritePixelsToUnits: 100
48 | alphaIsTransparency: 1
49 | textureType: 5
50 | buildTargetSettings: []
51 | spriteSheet:
52 | sprites: []
53 | spritePackingTag:
54 | userData:
55 | assetBundleName:
56 | assetBundleVariant:
57 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Editor/InternalResources/EntroPiIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Editor/InternalResources/EntroPiIcon.png
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Editor/InternalResources/EntroPiIcon.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6d064c543946ec848b43311457ef00ea
3 | timeCreated: 1488471562
4 | licenseType: Free
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 2
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 0
11 | linearTexture: 1
12 | correctGamma: 0
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: .25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 0
25 | cubemapConvolution: 0
26 | cubemapConvolutionSteps: 8
27 | cubemapConvolutionExponent: 1.5
28 | seamlessCubemap: 0
29 | textureFormat: -1
30 | maxTextureSize: 2048
31 | textureSettings:
32 | filterMode: -1
33 | aniso: 0
34 | mipBias: -1
35 | wrapMode: 1
36 | nPOTScale: 0
37 | lightmap: 0
38 | rGBM: 0
39 | compressionQuality: 50
40 | allowsAlphaSplitting: 0
41 | spriteMode: 0
42 | spriteExtrude: 1
43 | spriteMeshType: 1
44 | alignment: 0
45 | spritePivot: {x: .5, y: .5}
46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
47 | spritePixelsToUnits: 100
48 | alphaIsTransparency: 1
49 | textureType: 5
50 | buildTargetSettings: []
51 | spriteSheet:
52 | sprites: []
53 | spritePackingTag:
54 | userData:
55 | assetBundleName:
56 | assetBundleVariant:
57 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Editor/InternalResources/EntroPiLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Editor/InternalResources/EntroPiLogo.png
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Editor/InternalResources/EntroPiLogo.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 75649fb319f128743acb38350ea5d3e5
3 | timeCreated: 1488317704
4 | licenseType: Free
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 2
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 0
11 | linearTexture: 1
12 | correctGamma: 0
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: .25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 0
25 | cubemapConvolution: 0
26 | cubemapConvolutionSteps: 8
27 | cubemapConvolutionExponent: 1.5
28 | seamlessCubemap: 0
29 | textureFormat: -1
30 | maxTextureSize: 2048
31 | textureSettings:
32 | filterMode: -1
33 | aniso: 0
34 | mipBias: -1
35 | wrapMode: 1
36 | nPOTScale: 0
37 | lightmap: 0
38 | rGBM: 0
39 | compressionQuality: 50
40 | allowsAlphaSplitting: 0
41 | spriteMode: 0
42 | spriteExtrude: 1
43 | spriteMeshType: 1
44 | alignment: 0
45 | spritePivot: {x: .5, y: .5}
46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
47 | spritePixelsToUnits: 100
48 | alphaIsTransparency: 1
49 | textureType: 5
50 | buildTargetSettings: []
51 | spriteSheet:
52 | sprites: []
53 | spritePackingTag:
54 | userData:
55 | assetBundleName:
56 | assetBundleVariant:
57 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 54094c39946c304449c341f6a013b03e
3 | folderAsset: yes
4 | timeCreated: 1461093817
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Layered_A.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Layered_A.asset
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Layered_A.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9d26fea6489fa44419fd4609f3e55259
3 | timeCreated: 1488474424
4 | licenseType: Free
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Layered_B.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Layered_B.asset
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Layered_B.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4d21c532da5168b4fab9c4ed001a5214
3 | timeCreated: 1488477054
4 | licenseType: Free
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Morphing_A.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Morphing_A.asset
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Morphing_A.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d0f41c0285b4ada49a11c4ed634d69fa
3 | timeCreated: 1488474813
4 | licenseType: Free
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Morphing_B.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Morphing_B.asset
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Morphing_B.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 22490645da268a84fa8ab365455b8792
3 | timeCreated: 1488475999
4 | licenseType: Free
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Overcast_A.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Overcast_A.asset
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Overcast_A.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a2d714637b934f44bbd9251c29db1ee6
3 | timeCreated: 1488474880
4 | licenseType: Free
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Overcast_B.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Overcast_B.asset
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Overcast_B.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 673d073a8a7c6974ea6f6de6c81c4626
3 | timeCreated: 1488476479
4 | licenseType: Free
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Simple_A.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Simple_A.asset
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Simple_A.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4ef3dd0f85de48541b2ea0ded6b2b669
3 | timeCreated: 1488475167
4 | licenseType: Free
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Simple_B.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Simple_B.asset
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Prefabs/Clouds_Simple_B.asset.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 33b8a549f70d3d340ac1c0eca48b64a3
3 | timeCreated: 1488476991
4 | licenseType: Free
5 | NativeFormatImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: faac6b778ec5fc347b3303c4d5e6123d
3 | folderAsset: yes
4 | timeCreated: 1460493917
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Resources/Shaders.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f6a0da684ec85e843962d3d6754a4182
3 | folderAsset: yes
4 | timeCreated: 1460493917
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Resources/Shaders/CloudShadows.shader:
--------------------------------------------------------------------------------
1 | Shader "Hidden/EntroPi/CloudShadow"
2 | {
3 | Properties
4 | {
5 | _MainTex ("Texture", 2D) = "" {}
6 | _LayerTex ("Layer Texture", 2D) = "" {}
7 | _LayerParams ("Layer Parameters", Vector) = (0,0,0,0)
8 | _LayerOpacity ("Layer Opacity", Float) = 1
9 | }
10 |
11 | CGINCLUDE
12 |
13 | #include "UnityCG.cginc"
14 |
15 | // Blend Macros
16 | #define BlendSubtract(base, blend) (blend - base)
17 | #define BlendMultiply(base, blend) (blend * base)
18 | #define BlendLightenf(base, blend) max(blend, base)
19 | #define BlendDarkenf(base, blend) min(blend, base)
20 | #define BlendColorDodgef(base, blend) ((blend == 1.0) ? blend : min(base / (1.0 - blend), 1.0))
21 | #define BlendColorBurnf(base, blend) ((blend == 0.0) ? blend : max((1.0 - ((1.0 - base) / blend)), 0.0))
22 | #define BlendVividLightf(base, blend) ((blend < 0.5) ? BlendColorBurnf(base, (2.0 * blend)) : BlendColorDodgef(base, (2.0 * (blend - 0.5))))
23 | #define BlendPinLightf(base, blend) ((blend < 0.5) ? BlendDarkenf(base, (2.0 * blend)) : BlendLightenf(base, (2.0 *(blend - 0.5))))
24 | #define BlendOpacity(base, blend, function, opacity) (function(base, blend) * opacity + blend * (1.0 - opacity))
25 |
26 | sampler2D _MainTex;
27 | sampler2D _LayerTex;
28 |
29 | uniform float4 _LayerTex_ST;
30 | uniform float4 _LayerParams;
31 | uniform float _LayerOpacity;
32 |
33 | struct appdata_t
34 | {
35 | float4 vertex : POSITION;
36 | float2 texcoord : TEXCOORD0;
37 | };
38 |
39 | struct VertexOut
40 | {
41 | float4 vertex : SV_POSITION;
42 | float2 texcoord : TEXCOORD0;
43 | float2 texcoordClouds : TEXCOORD1;
44 | };
45 |
46 | VertexOut Vert (appdata_t v)
47 | {
48 | VertexOut o;
49 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
50 | o.texcoord = v.texcoord.xy;
51 |
52 | o.texcoordClouds = TRANSFORM_TEX(v.texcoord.xy, _LayerTex);
53 | o.texcoordClouds -= _LayerParams.xy;
54 |
55 | return o;
56 | }
57 |
58 | float CalculateLayerAlpha(VertexOut i)
59 | {
60 | float coverage = _LayerParams.z;
61 | float softness = _LayerParams.w;
62 |
63 | // Correct range
64 | float stepValue = - softness + (1 - coverage) * (1 + (softness * 2));
65 |
66 | float coverageMin = stepValue - softness;
67 | float coverageMax = stepValue + softness;
68 |
69 | float alpha = tex2D(_LayerTex, i.texcoordClouds).g;
70 | alpha = smoothstep(coverageMin, coverageMax, alpha);
71 |
72 | return alpha;
73 | }
74 |
75 | fixed4 FragSubtract (VertexOut i) : SV_Target
76 | {
77 | fixed4 color = tex2D(_MainTex, i.texcoord);
78 | float layerAlpha = CalculateLayerAlpha(i);
79 |
80 | color.a = BlendOpacity(layerAlpha, color.a, BlendSubtract, _LayerOpacity);
81 |
82 | return color;
83 | }
84 |
85 | fixed4 FragMultiply (VertexOut i) : SV_Target
86 | {
87 | fixed4 color = tex2D(_MainTex, i.texcoord);
88 | float layerAlpha = (1 - CalculateLayerAlpha(i));
89 |
90 | color.a = BlendOpacity(layerAlpha, color.a, BlendMultiply, _LayerOpacity);
91 |
92 | return color;
93 | }
94 |
95 | fixed4 FragColorBurn (VertexOut i) : SV_Target
96 | {
97 | fixed4 color = tex2D(_MainTex, i.texcoord);
98 | float layerAlpha = (1 - CalculateLayerAlpha(i));
99 |
100 | color.a = BlendOpacity(layerAlpha, color.a, BlendColorBurnf, _LayerOpacity);
101 |
102 | return color;
103 | }
104 |
105 | fixed4 FragVividLight (VertexOut i) : SV_Target
106 | {
107 | fixed4 color = tex2D(_MainTex, i.texcoord);
108 | float layerAlpha = (1 - CalculateLayerAlpha(i));
109 |
110 | color.a = BlendOpacity(layerAlpha, color.a, BlendVividLightf, _LayerOpacity);
111 |
112 | return color;
113 | }
114 |
115 | fixed4 FragPinLight (VertexOut i) : SV_Target
116 | {
117 | fixed4 color = tex2D(_MainTex, i.texcoord);
118 | float layerAlpha = (1 - CalculateLayerAlpha(i));
119 |
120 | color.a = BlendOpacity(layerAlpha, color.a, BlendPinLightf, _LayerOpacity);
121 |
122 | return color;
123 | }
124 |
125 | ENDCG
126 |
127 | SubShader
128 | {
129 | // Pass 0: Subtract
130 | Pass
131 | {
132 | ZTest Always Cull Off ZWrite Off
133 |
134 | CGPROGRAM
135 | #pragma vertex Vert
136 | #pragma fragment FragSubtract
137 | ENDCG
138 |
139 | }
140 |
141 | // Pass 1: Multiply Inverse
142 | Pass
143 | {
144 | ZTest Always Cull Off ZWrite Off
145 |
146 | CGPROGRAM
147 | #pragma vertex Vert
148 | #pragma fragment FragMultiply
149 | ENDCG
150 |
151 | }
152 |
153 | // Pass 2: Color Burn
154 | Pass
155 | {
156 | ZTest Always Cull Off ZWrite Off
157 |
158 | CGPROGRAM
159 | #pragma vertex Vert
160 | #pragma fragment FragColorBurn
161 | ENDCG
162 |
163 | }
164 |
165 | // Pass 3: Vivid Light
166 | Pass
167 | {
168 | ZTest Always Cull Off ZWrite Off
169 |
170 | CGPROGRAM
171 | #pragma vertex Vert
172 | #pragma fragment FragVividLight
173 | ENDCG
174 |
175 | }
176 |
177 | // Pass 4: Pin Light
178 | Pass
179 | {
180 | ZTest Always Cull Off ZWrite Off
181 |
182 | CGPROGRAM
183 | #pragma vertex Vert
184 | #pragma fragment FragPinLight
185 | ENDCG
186 |
187 | }
188 | }
189 |
190 | Fallback Off
191 | }
192 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Resources/Shaders/CloudShadows.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5a82ec2a4a4b9524fad302429a30fee0
3 | timeCreated: 1460493919
4 | licenseType: Free
5 | ShaderImporter:
6 | defaultTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9fd0bcc89c879994bbc41db1cc2cec6c
3 | folderAsset: yes
4 | timeCreated: 1460493766
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/CloudLayer.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace EntroPi
4 | {
5 | public class CloudLayer : MonoBehaviour
6 | {
7 | public enum BlendMode { Subtract, MultiplyInverse, ColorBurn, VividLight, PinLight }
8 |
9 | #region Exposed Data Members
10 |
11 | [Header("Texture Settings", order = 0)]
12 | [Tooltip("Cloud texture used by this layer.")]
13 | [SerializeField]
14 | private Texture2D m_Texture;
15 |
16 | [Tooltip("Texture tiling. Values will be rounded to nearest int value.")]
17 | [SerializeField]
18 | private Vector2 m_Tiling = Vector2.one;
19 |
20 | [Tooltip("Initial texture offset.")]
21 | [SerializeField]
22 | private Vector2 m_Offset = Vector2.zero;
23 |
24 | [Header("Blend Settings", order = 1)]
25 | [Tooltip("Mode used for blending this layer.")]
26 | [SerializeField]
27 | private BlendMode m_BlendMode = BlendMode.Subtract;
28 |
29 | [Tooltip("Opacity of this layer.")]
30 | [SerializeField]
31 | [Range(0, 1)]
32 | private float m_Opacity = 1.0f;
33 |
34 | [Header("Cloud Settings", order = 2)]
35 | [Tooltip("Cloud coverage. (0 = no clouds, 1 = overcast)")]
36 | [SerializeField]
37 | [Range(0, 1)]
38 | private float m_Coverage = 0.5f;
39 |
40 | [Tooltip("The softness of the clouds outline.")]
41 | [SerializeField]
42 | [Range(0.1f, 1)]
43 | private float m_Softness = 0.25f;
44 |
45 | [Tooltip("The velocity of the clouds in world space.")]
46 | [SerializeField]
47 | private Vector2 m_Velocity = Vector2.zero;
48 |
49 | [Header("Advanced Settings", order = 2)]
50 | [Tooltip("The angle from the horizon at which the cloud shadows fade out completely.")]
51 | [SerializeField]
52 | [Range(0, 90)]
53 | private float m_HorizonAngleThreshold = 10.0f;
54 |
55 | [Tooltip("The angle from the horizon over which the cloud shadows fade out.")]
56 | [SerializeField]
57 | [Range(0, 90)]
58 | private float m_HorizonAngleFade = 10.0f;
59 |
60 | #endregion Exposed Data Members
61 |
62 | #region Public Properties
63 |
64 | public Texture2D Texture
65 | {
66 | get { return m_Texture; }
67 | set { m_Texture = value; }
68 | }
69 |
70 | public Vector4 TextureTransform
71 | {
72 | get { return new Vector4(m_Tiling.x, m_Tiling.y, m_Offset.x, m_Offset.y); }
73 | }
74 |
75 | public Vector2 TextureTiling
76 | {
77 | get { return m_Tiling; }
78 | set { m_Tiling = value; }
79 | }
80 |
81 | public Vector2 TextureOffset
82 | {
83 | get { return m_Offset; }
84 | set { m_Offset = value; }
85 | }
86 |
87 | public BlendMode TextureBlendMode
88 | {
89 | get { return m_BlendMode; }
90 | set { m_BlendMode = value; }
91 | }
92 |
93 | public float Opacity
94 | {
95 | get { return m_Opacity; }
96 | set { m_Opacity = value; }
97 | }
98 |
99 | public float Coverage
100 | {
101 | get { return m_Coverage; }
102 | set { m_Coverage = value; }
103 | }
104 |
105 | public float Softness
106 | {
107 | get { return m_Softness; }
108 | set { m_Softness = value; }
109 | }
110 |
111 | public Vector2 Velocity
112 | {
113 | get { return m_Velocity; }
114 | set { m_Velocity = value; }
115 | }
116 |
117 | public float HorizonAngleThreshold
118 | {
119 | get { return m_HorizonAngleThreshold; }
120 | set { m_HorizonAngleThreshold = value; }
121 | }
122 |
123 | public float HorizonAngleFade
124 | {
125 | get { return m_HorizonAngleFade; }
126 | set { m_HorizonAngleFade = value; }
127 | }
128 |
129 | #endregion Public Properties
130 |
131 | #region MonoBehaviour Functions
132 |
133 | private void OnValidate()
134 | {
135 | // Validate that Texture scale is always larger than 1 and rounded to int
136 | m_Tiling.x = Mathf.Max(m_Tiling.x, 1);
137 | m_Tiling.y = Mathf.Max(m_Tiling.y, 1);
138 |
139 | m_Tiling.x = Mathf.Round(m_Tiling.x);
140 | m_Tiling.y = Mathf.Round(m_Tiling.y);
141 | }
142 |
143 | private void OnEnable()
144 | {
145 | // Verify that this component can be enabled.
146 | enabled &= Debug.Verify(m_Texture != null, "Cloud Layer texture not assigned!");
147 | }
148 |
149 | #endregion MonoBehaviour Functions
150 | }
151 | }
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/CloudLayer.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f813bb7e71c700145b7948dd63ea5ef9
3 | timeCreated: 1488557864
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences:
8 | - m_Texture: {fileID: 2800000, guid: b7ea5ddf3846fda4b83841e793233176, type: 3}
9 | executionOrder: 0
10 | icon: {fileID: 2800000, guid: 6d064c543946ec848b43311457ef00ea, type: 3}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/CloudLayerData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UnityEngine;
3 |
4 | namespace EntroPi
5 | {
6 | ///
7 | /// Plain Old Data container for storing Cloud Layer properties
8 | ///
9 | [Serializable]
10 | public class CloudLayerData
11 | {
12 | #region Public Constants
13 |
14 | public const string PATH_IS_VISIBLE = "m_IsVisible";
15 | public const string PATH_LAYER_NAME = "m_LayerName";
16 | public const string PATH_BLEND_MODE = "m_BlendMode";
17 | public const string PATH_OPACITY = "m_Opacity";
18 | public const string PATH_COVERAGE = "m_Coverage";
19 | public const string PATH_SOFTNESS = "m_Softness";
20 | public const string PATH_SPEED = "m_Speed";
21 | public const string PATH_DIRECTION = "m_Direction";
22 | public const string PATH_TEXTURE = "m_Texture";
23 | public const string PATH_TEXTURE_TILING = "m_TextureTiling";
24 | public const string PATH_TEXTURE_OFFSET = "m_TextureOffset";
25 |
26 | #endregion Public Constants
27 |
28 | #region Exposed Data Members
29 |
30 | [SerializeField]
31 | private bool m_IsVisible = true;
32 |
33 | [SerializeField]
34 | private string m_LayerName = "Layer Name";
35 |
36 | [Tooltip("Mode used for blending this layer")]
37 | [SerializeField]
38 | private CloudLayer.BlendMode m_BlendMode = CloudLayer.BlendMode.Subtract;
39 |
40 | [Tooltip("Opacity of this layer")]
41 | [Range(0f, 1f)]
42 | [SerializeField]
43 | private float m_Opacity = 1f;
44 |
45 | [Tooltip("Cloud coverage (0 = no clouds, 1 = overcast)")]
46 | [Range(0f, 1f)]
47 | [SerializeField]
48 | private float m_Coverage = 0.5f;
49 |
50 | [Tooltip("The softness of the clouds outline")]
51 | [Range(0f, 1f)]
52 | [SerializeField]
53 | private float m_Softness = 0.5f;
54 |
55 | [Tooltip("Movement speed of the clouds")]
56 | [SerializeField]
57 | private float m_Speed = 1.0f;
58 |
59 | [Tooltip("Movement direction of the clouds in degrees")]
60 | [Range(0f, 360f)]
61 | [SerializeField]
62 | private float m_Direction = 0f;
63 |
64 | [Tooltip("Cloud texture used by this layer")]
65 | [SerializeField]
66 | private Texture2D m_Texture = null;
67 |
68 | [Tooltip("Texture tiling (Values are rounded to nearest int value)")]
69 | [SerializeField]
70 | private Vector2 m_TextureTiling = Vector2.one;
71 |
72 | [Tooltip("Initial texture offset")]
73 | [SerializeField]
74 | private Vector2 m_TextureOffset = Vector2.zero;
75 |
76 | #endregion Exposed Data Members
77 |
78 | #region Public Properties
79 |
80 | public bool IsVisible
81 | {
82 | get { return m_IsVisible; }
83 | set { m_IsVisible = value; }
84 | }
85 |
86 | public string LayerName
87 | {
88 | get { return m_LayerName; }
89 | set { m_LayerName = value; }
90 | }
91 |
92 | public CloudLayer.BlendMode BlendMode
93 | {
94 | get { return m_BlendMode; }
95 | set { m_BlendMode = value; }
96 | }
97 |
98 | public float Opacity
99 | {
100 | get { return m_Opacity; }
101 | set { m_Opacity = Mathf.Clamp01(value); }
102 | }
103 |
104 | public float Coverage
105 | {
106 | get { return m_Coverage; }
107 | set { m_Coverage = Mathf.Clamp01(value); }
108 | }
109 |
110 | public float Softness
111 | {
112 | get { return m_Softness; }
113 | set { m_Softness = Mathf.Clamp01(value); }
114 | }
115 |
116 | public float Speed
117 | {
118 | get { return m_Speed; }
119 | set { m_Speed = Mathf.Max(0, value); }
120 | }
121 |
122 | public float DirectionAngle
123 | {
124 | get { return m_Direction; }
125 | set { m_Direction = Mathf.Clamp(value, 0, 360); }
126 | }
127 |
128 | public Texture2D Texture
129 | {
130 | get { return m_Texture; }
131 | set { m_Texture = value; }
132 | }
133 |
134 | public Vector2 TextureTiling
135 | {
136 | get { return m_TextureTiling; }
137 | set
138 | {
139 | m_TextureTiling = LimitTextureTiling(value);
140 | }
141 | }
142 |
143 | public Vector2 TextureOffset
144 | {
145 | get { return m_TextureOffset; }
146 | set { m_TextureOffset = value; }
147 | }
148 |
149 | public Vector4 TextureTransform
150 | {
151 | get { return new Vector4(m_TextureTiling.x, m_TextureTiling.y, m_TextureOffset.x, m_TextureOffset.y); }
152 | }
153 |
154 | public Vector2 AnimationOffset
155 | {
156 | get { return m_AnimationOffset; }
157 | set { m_AnimationOffset = value; }
158 | }
159 |
160 | #endregion Public Properties
161 |
162 | #region Private Data Members
163 |
164 | private Vector2 m_AnimationOffset = Vector2.zero;
165 |
166 | #endregion Private Data Members
167 |
168 | #region Public Static Functions
169 |
170 | ///
171 | /// Ensure that Texture tiling is always larger than 1 and rounded to int.
172 | ///
173 | public static Vector2 LimitTextureTiling(Vector2 tiling)
174 | {
175 | tiling.x = Mathf.Max(tiling.x, 1);
176 | tiling.y = Mathf.Max(tiling.y, 1);
177 |
178 | tiling.x = Mathf.Round(tiling.x);
179 | tiling.y = Mathf.Round(tiling.y);
180 |
181 | return tiling;
182 | }
183 |
184 | #endregion Public Static Functions
185 | }
186 | }
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/CloudLayerData.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 16acb870ec0dd0d4c94619565348dc87
3 | timeCreated: 1488557855
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {fileID: 2800000, guid: 6d064c543946ec848b43311457ef00ea, type: 3}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/CloudLayers.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using UnityEngine;
3 |
4 | namespace EntroPi
5 | {
6 | [CreateAssetMenu(fileName = "CloudLayers", menuName = "EntroPi/Cloud Shadows/Cloud Layers", order = 1)]
7 | public class CloudLayers : ScriptableObject
8 | {
9 | #region Exposed Data Members
10 |
11 | [SerializeField]
12 | private List m_LayerData = new List();
13 |
14 | #endregion Exposed Data Members
15 |
16 | #region Public Properties
17 |
18 | public IEnumerable Layers
19 | {
20 | get
21 | {
22 | foreach (CloudLayerData cloudLayer in m_LayerData)
23 | {
24 | yield return cloudLayer;
25 | }
26 | }
27 | }
28 |
29 | public CloudLayerData this[int index]
30 | {
31 | get
32 | {
33 | CloudLayerData cloudLayerData = null;
34 |
35 | if (index >= 0 && index < m_LayerData.Count)
36 | {
37 | cloudLayerData = m_LayerData[index];
38 | }
39 |
40 | UnityEngine.Debug.Assert(cloudLayerData != null, "Failed to get CloudLayerData. Index out of bounds");
41 |
42 | return cloudLayerData;
43 | }
44 | }
45 |
46 | public int LayerCount { get { return m_LayerData.Count; } }
47 |
48 | #endregion Public Properties
49 | }
50 | }
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/CloudLayers.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 231418edf53223d4ea079c2ea05ce8b3
3 | timeCreated: 1488471633
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {fileID: 2800000, guid: 623d91210e297d7438bbdffc8bcbb52b, type: 3}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/CloudShadows.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace EntroPi
4 | {
5 | [AddComponentMenu("EntroPi/Cloud Shadows/Cloud Shadows")]
6 | [ExecuteInEditMode]
7 | [DisallowMultipleComponent]
8 | [RequireComponent(typeof(Light))]
9 | public class CloudShadows : MonoBehaviour
10 | {
11 | #region Type Declarations
12 |
13 | public enum ProjectMode { Mode3D = 0, Mode2D = 1 }
14 |
15 | #endregion Type Declarations
16 |
17 | #region Public Constants
18 |
19 | public const string PATH_PREVIEW_IN_EDITOR = "m_PreviewInEditor";
20 | public const string PATH_PROJECT_MODE = "m_ProjectMode";
21 | public const string PATH_CLOUD_LAYERS = "m_CloudLayers";
22 | public const string PATH_WORLD_SIZE = "m_WorldSize";
23 | public const string PATH_RENDER_TEXTURE_RESOLUTION = "m_RenderTextureResolution";
24 | public const string PATH_OPACITY_MULTIPLIER = "m_OpacityMultiplier";
25 | public const string PATH_COVERAGE_MODIFIER = "m_CoverageModifier";
26 | public const string PATH_SOFTNESS_MODIFIER = "m_SoftnessModifier";
27 | public const string PATH_SPEED_MULTIPLIER = "m_SpeedMultiplier";
28 | public const string PATH_DIRECTION_MODIFIER = "m_DirectionModifier";
29 | public const string PATH_HORIZON_ANGLE_THRESHOLD = "m_HorizonAngleThreshold";
30 | public const string PATH_HORIZON_ANGLE_FADE = "m_HorizonAngleFade";
31 |
32 | #endregion Public Constants
33 |
34 | #region Private Constants
35 |
36 | private const string SHADER_PATH_CLOUD_SHADOWS = "Shaders/CloudShadows";
37 |
38 | private const float WORLD_SIZE_MIN = 1f;
39 | private const float ROTATION_MODIFIER_LIMIT = 180f;
40 | private const float HORIZON_ANGLE_MAX = 90f;
41 | private const float HORIZON_ANGLE_FADE_MIN = 0.1f;
42 |
43 | #endregion Private Constants
44 |
45 | #region Exposed Data Members
46 |
47 | #if UNITY_EDITOR
48 |
49 | [Tooltip("Toggle the visibility of the effect while in Edit Mode")]
50 | [SerializeField]
51 | private bool m_PreviewInEditor = true;
52 |
53 | #endif
54 |
55 | [Tooltip("Project Mode")]
56 | [SerializeField]
57 | private ProjectMode m_ProjectMode = ProjectMode.Mode3D;
58 |
59 | [Tooltip("Asset containing Cloud Layers")]
60 | [SerializeField]
61 | private CloudLayers m_CloudLayers;
62 |
63 | [Tooltip("Size in world units that the cloud layer textures will be projected on")]
64 | [SerializeField]
65 | private float m_WorldSize = 100;
66 |
67 | [Tooltip("Resolution of texture used to render layers into")]
68 | [SerializeField]
69 | private int m_RenderTextureResolution = 1024;
70 |
71 | [Tooltip("Multiplier which influences the opacity of all cloud layers")]
72 | [SerializeField]
73 | [Range(0, 1)]
74 | private float m_OpacityMultiplier = 1.0f;
75 |
76 | [Tooltip("Modifies the coverage of all cloud layers")]
77 | [SerializeField]
78 | [Range(-1, 1)]
79 | private float m_CoverageModifier = 0.0f;
80 |
81 | [Tooltip("Modifies the softness of all cloud layers")]
82 | [SerializeField]
83 | [Range(-1, 1)]
84 | private float m_SoftnessModifier = 0.0f;
85 |
86 | [Tooltip("Multiplier which influences the speed of all cloud layers")]
87 | [SerializeField]
88 | private float m_SpeedMultiplier = 1.0f;
89 |
90 | [Tooltip("Modifies the direction of all cloud layers")]
91 | [Range(-ROTATION_MODIFIER_LIMIT, ROTATION_MODIFIER_LIMIT)]
92 | [SerializeField]
93 | private float m_DirectionModifier = 0.0f;
94 |
95 | [Tooltip("The angle from the horizon at which the cloud shadows fade out completely")]
96 | [SerializeField]
97 | [Range(0, HORIZON_ANGLE_MAX)]
98 | private float m_HorizonAngleThreshold = 10.0f;
99 |
100 | [Tooltip("The angle from the horizon over which the cloud shadows fade out")]
101 | [SerializeField]
102 | [Range(HORIZON_ANGLE_FADE_MIN, HORIZON_ANGLE_MAX)]
103 | private float m_HorizonAngleFade = 10.0f;
104 |
105 | #endregion Exposed Data Members
106 |
107 | #region Public Properties
108 |
109 | public ProjectMode Mode
110 | {
111 | get { return m_ProjectMode; }
112 | set { m_ProjectMode = value; }
113 | }
114 |
115 | public CloudLayers CloudLayers
116 | {
117 | get { return m_CloudLayers; }
118 | set { m_CloudLayers = value; }
119 | }
120 |
121 | public float WorldSize
122 | {
123 | get { return m_WorldSize; }
124 | set { m_WorldSize = Mathf.Max(value, WORLD_SIZE_MIN); }
125 | }
126 |
127 | public int RenderTextureResolution
128 | {
129 | get { return m_RenderTextureResolution; }
130 | set
131 | {
132 | m_RenderTextureResolution = value;
133 | UpdateRenderTextureResolution();
134 | }
135 | }
136 |
137 | public float OpacityMultiplier
138 | {
139 | get { return m_OpacityMultiplier; }
140 | set { m_OpacityMultiplier = Mathf.Clamp01(value); }
141 | }
142 |
143 | public float CoverageModifier
144 | {
145 | get { return m_CoverageModifier; }
146 | set { m_CoverageModifier = Mathf.Clamp(value, -1, 1); }
147 | }
148 |
149 | public float SoftnessModifier
150 | {
151 | get { return m_SoftnessModifier; }
152 | set { m_SoftnessModifier = Mathf.Clamp(value, -1, 1); }
153 | }
154 |
155 | public float SpeedMultiplier
156 | {
157 | get { return m_SpeedMultiplier; }
158 | set { m_SpeedMultiplier = value; }
159 | }
160 |
161 | public float DirectionModifier
162 | {
163 | get { return m_DirectionModifier; }
164 | set { m_DirectionModifier = Mathf.Clamp(value, -ROTATION_MODIFIER_LIMIT, ROTATION_MODIFIER_LIMIT); }
165 | }
166 |
167 | public float HorizonAngleThreshold
168 | {
169 | get { return m_HorizonAngleThreshold; }
170 | set { m_HorizonAngleThreshold = Mathf.Clamp(value, 0, HORIZON_ANGLE_MAX); }
171 | }
172 |
173 | public float HorizonAngleFade
174 | {
175 | get { return m_HorizonAngleFade; }
176 | set { m_HorizonAngleFade = Mathf.Clamp(value, HORIZON_ANGLE_FADE_MIN, HORIZON_ANGLE_MAX); }
177 | }
178 |
179 | public RenderTexture RenderTexture
180 | {
181 | get { return m_RenderTexture1; }
182 | }
183 |
184 | #endregion Public Properties
185 |
186 | #region Private Data Members
187 |
188 | private Light m_Light;
189 | private Material m_CloudShadowMaterial;
190 | private RenderTexture m_RenderTexture1;
191 | private RenderTexture m_RenderTexture2;
192 |
193 | private int m_LayerTextureID;
194 | private int m_LayerTextureTransformID;
195 | private int m_LayerParamsID;
196 | private int m_LayerOpacityID;
197 |
198 | #endregion Private Data Members
199 |
200 | #region MonoBehaviour Functions
201 |
202 | private void OnValidate()
203 | {
204 | // Validate values changed in inspector.
205 | m_WorldSize = Mathf.Max(m_WorldSize, WORLD_SIZE_MIN);
206 | m_RenderTextureResolution = Mathf.Clamp(m_RenderTextureResolution, 2, 4096);
207 | }
208 |
209 | private void OnEnable()
210 | {
211 | m_Light = GetComponent();
212 |
213 | // Verify that this component can be enabled.
214 | enabled &= Debug.Verify(m_Light.type == LightType.Directional, "Light type needs to be directional");
215 | }
216 |
217 | private void OnDisable()
218 | {
219 | // Hide effect.
220 | DisableEffect();
221 | }
222 |
223 | private void Start()
224 | {
225 | // Create Shader IDs.
226 | m_LayerTextureID = Shader.PropertyToID("_LayerTex");
227 | m_LayerTextureTransformID = Shader.PropertyToID("_LayerTex_ST");
228 | m_LayerParamsID = Shader.PropertyToID("_LayerParams");
229 | m_LayerOpacityID = Shader.PropertyToID("_LayerOpacity");
230 |
231 | // Create render texture.
232 | m_RenderTexture1 = RenderTextureUtil.CreateRenderTexture(m_RenderTextureResolution);
233 | m_RenderTexture2 = RenderTextureUtil.CreateRenderTexture(m_RenderTextureResolution);
234 |
235 | // Create materials.
236 | m_CloudShadowMaterial = ResourceUtil.CreateMaterial(SHADER_PATH_CLOUD_SHADOWS);
237 |
238 | // Initial Update
239 | UpdateLightProperties();
240 | }
241 |
242 | private void Update()
243 | {
244 | #if UNITY_EDITOR
245 | // In the editor, only update when the "Preview in editor" setting is enabled or while playing the game.
246 | if (m_PreviewInEditor || UnityEditor.EditorApplication.isPlaying)
247 | {
248 | UpdateRenderTextureResolution();
249 | RenderCloudShadows();
250 | }
251 | else
252 | {
253 | DisableEffect();
254 | }
255 | #else
256 | RenderCloudShadows();
257 | #endif
258 | }
259 |
260 | #endregion MonoBehaviour Functions
261 |
262 | #region Private Functions
263 |
264 | ///
265 | /// Recreates render textures if their resolution differs from the set resolution.
266 | ///
267 | private void UpdateRenderTextureResolution()
268 | {
269 | if (m_RenderTexture1 != null && m_RenderTexture1.width != m_RenderTextureResolution)
270 | {
271 | RenderTextureUtil.RecreateRenderTexture(ref m_RenderTexture1, m_RenderTextureResolution);
272 | RenderTextureUtil.RecreateRenderTexture(ref m_RenderTexture2, m_RenderTextureResolution);
273 | }
274 | }
275 |
276 | ///
277 | /// Renders all of the layers to a single render texture and assigns it to the light.
278 | ///
279 | private void RenderCloudShadows()
280 | {
281 | // Clear alpha channel of first render texture to white.
282 | RenderTextureUtil.ClearRenderTexture(m_RenderTexture1, new Color(0, 0, 0, 1));
283 |
284 | // Don't render if Cloud Layers are not assigned or opacity is 0
285 | if (m_CloudLayers != null && m_OpacityMultiplier > 0.0f)
286 | {
287 | // Calculate the angle between the lights direction and the horizon.
288 | float angleToHorizon = Vector3.Angle(Vector3.up, transform.forward) - 90;
289 |
290 | // Render layers
291 | for (int i = 0; i < m_CloudLayers.LayerCount; ++i)
292 | {
293 | CloudLayerData cloudLayerData = m_CloudLayers[i];
294 |
295 | // Update cloud layer animation offsets.
296 | UpdateCloudLayerDataAnimationOffset(cloudLayerData, m_WorldSize, m_SpeedMultiplier, m_DirectionModifier);
297 |
298 | if (cloudLayerData.IsVisible)
299 | {
300 | // Set material texture properties.
301 | m_CloudShadowMaterial.SetTexture(m_LayerTextureID, cloudLayerData.Texture);
302 | m_CloudShadowMaterial.SetVector(m_LayerTextureTransformID, cloudLayerData.TextureTransform);
303 |
304 | // Set remaining material properties.
305 | m_CloudShadowMaterial.SetVector(m_LayerParamsID, ExtractCloudLayerParameters(cloudLayerData));
306 | m_CloudShadowMaterial.SetFloat(m_LayerOpacityID, CalculateCloudLayerOpacity(cloudLayerData, angleToHorizon));
307 |
308 | // Blit using material.
309 | Graphics.Blit(m_RenderTexture1, m_RenderTexture2, m_CloudShadowMaterial, (int)cloudLayerData.BlendMode);
310 |
311 | // Swap render texture references.
312 | RenderTextureUtil.SwapRenderTextures(ref m_RenderTexture1, ref m_RenderTexture2);
313 | }
314 | }
315 | }
316 |
317 | UpdateLightProperties();
318 | }
319 |
320 | ///
321 | /// Updates cloud layer animation offsets
322 | ///
323 | private static void UpdateCloudLayerDataAnimationOffset(CloudLayerData cloudLayerData, float worldSize, float globalSpeedMultiplier, float globalDirectionModifier)
324 | {
325 | Vector2 cloudLayerDirection = CalculateLayerDirection(cloudLayerData.DirectionAngle, globalDirectionModifier);
326 | Vector2 translation = cloudLayerDirection * cloudLayerData.Speed * globalSpeedMultiplier * Time.deltaTime;
327 |
328 | // Make sure cloud translation is independent from world size and texture tiling.
329 | translation /= worldSize;
330 | translation.x *= cloudLayerData.TextureTiling.x;
331 | translation.y *= cloudLayerData.TextureTiling.y;
332 |
333 | Vector2 animationOffset = cloudLayerData.AnimationOffset;
334 | animationOffset += translation;
335 |
336 | // Repeat floats to avoid precision loss problems.
337 | animationOffset.x = Mathf.Repeat(animationOffset.x, worldSize);
338 | animationOffset.y = Mathf.Repeat(animationOffset.y, worldSize);
339 |
340 | cloudLayerData.AnimationOffset = animationOffset;
341 | }
342 |
343 | ///
344 | /// Adds global direction modifier to cloud layer angle direction and converts it into a Vector2D
345 | ///
346 | private static Vector2 CalculateLayerDirection(float cloudLayerDirectionAngle, float globalDirectionModifier)
347 | {
348 | float angle = (cloudLayerDirectionAngle + globalDirectionModifier) * Mathf.Deg2Rad;
349 | Vector2 direction = Vector3.zero;
350 |
351 | direction.x = Mathf.Cos(angle);
352 | direction.y = Mathf.Sin(angle);
353 |
354 | return direction;
355 | }
356 |
357 | ///
358 | /// Combines layer properties into a single Vector4 to be used as a shader property.
359 | ///
360 | private Vector4 ExtractCloudLayerParameters(CloudLayerData cloudLayerData)
361 | {
362 | float coverage = Mathf.Clamp01(cloudLayerData.Coverage + m_CoverageModifier);
363 | float softness = Mathf.Clamp01(cloudLayerData.Softness + m_SoftnessModifier);
364 |
365 | return new Vector4(cloudLayerData.AnimationOffset.x, cloudLayerData.AnimationOffset.y, coverage, softness);
366 | }
367 |
368 | ///
369 | /// Calculates the final opacity for the passed in layer.
370 | ///
371 | private float CalculateCloudLayerOpacity(CloudLayerData cloudLayerData, float angleToHorizon)
372 | {
373 | float opacity = 1;
374 |
375 | // In 3D Mode calculate the opacity based on the angle between the lights direction and horizon.
376 | if (m_ProjectMode == ProjectMode.Mode3D)
377 | {
378 | opacity = Mathf.Clamp01((angleToHorizon - m_HorizonAngleThreshold) / m_HorizonAngleFade);
379 | }
380 |
381 | opacity *= cloudLayerData.Opacity;
382 | opacity *= m_OpacityMultiplier;
383 |
384 | return opacity;
385 | }
386 |
387 | ///
388 | /// Updates the light component properties.
389 | ///
390 | private void UpdateLightProperties()
391 | {
392 | m_Light.cookie = m_RenderTexture1;
393 | m_Light.cookieSize = m_WorldSize;
394 | }
395 |
396 | ///
397 | /// Disables the effect.
398 | ///
399 | private void DisableEffect()
400 | {
401 | // Release render texture resources
402 | if (m_RenderTexture1 != null && m_RenderTexture2 != null)
403 | {
404 | m_RenderTexture1.Release();
405 | m_RenderTexture2.Release();
406 | }
407 |
408 | // Remove render texture from light cookie.
409 | m_Light.cookie = null;
410 | }
411 |
412 | #endregion Private Functions
413 | }
414 | }
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/CloudShadows.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6ceb7dc61d7899947a6040600e0562c4
3 | timeCreated: 1488478867
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences:
8 | - m_CloudLayers: {fileID: 11400000, guid: 33b8a549f70d3d340ac1c0eca48b64a3, type: 2}
9 | executionOrder: 0
10 | icon: {fileID: 2800000, guid: 6d064c543946ec848b43311457ef00ea, type: 3}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1bb7c79fd57bd2248b4deecc65f8d39b
3 | folderAsset: yes
4 | timeCreated: 1488298613
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/Editor/CloudLayersEditor.cs:
--------------------------------------------------------------------------------
1 | using UnityEditor;
2 | using UnityEngine;
3 |
4 | namespace EntroPi
5 | {
6 | [CustomEditor(typeof(CloudLayers))]
7 | public class CloudLayersEditor : Editor
8 | {
9 | private static GUIContent s_ExpandOn = new GUIContent("\u25BC", "Hide layer properties");
10 | private static GUIContent s_ExpandOff = new GUIContent("\u25B6", "Show layer properties");
11 | private static GUIContent s_VisibilityOn = new GUIContent("\u2714", "Toggle layer visibility");
12 | private static GUIContent s_VisibilityOff = new GUIContent("\u2718", "Toggle layer visibility");
13 | private static GUIContent s_DuplicateLayer = new GUIContent("\u274F", "Duplicate layer");
14 | private static GUIContent s_MoveLayerUp = new GUIContent("\u25B2", "Move layer up");
15 | private static GUIContent s_MoveLayerDown = new GUIContent("\u25BC", "Move layer down");
16 | private static GUIContent s_DeleteLayer = new GUIContent("\u2716", "Delete layer");
17 | private static GUILayoutOption s_MiniButtonWidth = GUILayout.Width(22f);
18 |
19 | private GUIContent m_AddLayer = new GUIContent("+", "Add Cloud Shadow layer");
20 | private GUIContent m_ConvertPrefabButton = new GUIContent("Convert Prefab", "Converts prefabs created with older versions of this asset into the new format.");
21 | private GameObject m_CloudLayerPrefab;
22 | private Texture2D m_Logo;
23 | private Texture2D m_BlendArrow;
24 |
25 | private void OnEnable()
26 | {
27 | string pathEntroPiFolder = EditorUtil.GetEntroPiFolderPath(this);
28 | m_Logo = AssetDatabase.LoadAssetAtPath(pathEntroPiFolder + EditorUtil.PATH_RELATIVE_LOGO, typeof(Texture2D)) as Texture2D;
29 | m_BlendArrow = AssetDatabase.LoadAssetAtPath(pathEntroPiFolder + EditorUtil.PATH_RELATIVE_BLEND_ARROW, typeof(Texture2D)) as Texture2D;
30 | }
31 |
32 | public override void OnInspectorGUI()
33 | {
34 | GUILayout.Label(m_Logo);
35 |
36 | serializedObject.Update();
37 |
38 | SerializedProperty layerList = serializedObject.FindProperty("m_LayerData");
39 |
40 | DrawCloudLayers(layerList, m_BlendArrow);
41 | DrawFooter(layerList);
42 |
43 | serializedObject.ApplyModifiedProperties();
44 | }
45 |
46 | private static void DrawCloudLayers(SerializedProperty layerList, Texture2D blendArrow)
47 | {
48 | for (int i = 0; i < layerList.arraySize; i++)
49 | {
50 | EditorGUILayout.BeginVertical(EditorStyles.helpBox);
51 |
52 | bool isListDirty = DrawCloudLayerHeader(layerList, i);
53 | if (isListDirty)
54 | {
55 | break;
56 | }
57 |
58 | SerializedProperty cloudLayerProperty = layerList.GetArrayElementAtIndex(i);
59 | if (cloudLayerProperty.isExpanded)
60 | {
61 | bool isVisible = cloudLayerProperty.FindPropertyRelative(CloudLayerData.PATH_IS_VISIBLE).boolValue;
62 | EditorGUI.BeginDisabledGroup(!isVisible);
63 |
64 | DrawCloudLayer(cloudLayerProperty);
65 |
66 | EditorGUI.EndDisabledGroup();
67 | }
68 |
69 | EditorGUILayout.EndVertical();
70 |
71 | if (cloudLayerProperty.isExpanded && i < layerList.arraySize - 1)
72 | {
73 | GUILayout.BeginHorizontal();
74 | GUILayout.FlexibleSpace();
75 | GUILayout.Label(blendArrow);
76 | GUILayout.FlexibleSpace();
77 | GUILayout.EndHorizontal();
78 | }
79 | }
80 | }
81 |
82 | private static bool DrawCloudLayerHeader(SerializedProperty layerList, int index)
83 | {
84 | bool isListDirty = false;
85 | SerializedProperty cloudLayerProperty = layerList.GetArrayElementAtIndex(index);
86 |
87 | EditorGUILayout.BeginHorizontal();
88 |
89 | if (GUILayout.Button(cloudLayerProperty.isExpanded ? s_ExpandOn : s_ExpandOff, EditorStyles.miniButtonLeft, s_MiniButtonWidth))
90 | {
91 | cloudLayerProperty.isExpanded = !cloudLayerProperty.isExpanded;
92 | }
93 |
94 | SerializedProperty isVisible = cloudLayerProperty.FindPropertyRelative(CloudLayerData.PATH_IS_VISIBLE);
95 | if (GUILayout.Button(isVisible.boolValue ? s_VisibilityOn : s_VisibilityOff, EditorStyles.miniButtonRight, s_MiniButtonWidth))
96 | {
97 | isVisible.boolValue = !isVisible.boolValue;
98 | }
99 |
100 | EditorGUILayout.PropertyField(cloudLayerProperty.FindPropertyRelative(CloudLayerData.PATH_LAYER_NAME), GUIContent.none);
101 |
102 | if (GUILayout.Button(s_DuplicateLayer, EditorStyles.miniButtonMid, s_MiniButtonWidth))
103 | {
104 | layerList.InsertArrayElementAtIndex(index);
105 | isListDirty = true;
106 | }
107 |
108 | if (GUILayout.Button(s_MoveLayerUp, EditorStyles.miniButtonMid, s_MiniButtonWidth))
109 | {
110 | SwapCloudLayers(layerList, index, index - 1);
111 | isListDirty = true;
112 | }
113 |
114 | if (GUILayout.Button(s_MoveLayerDown, EditorStyles.miniButtonMid, s_MiniButtonWidth))
115 | {
116 | SwapCloudLayers(layerList, index, index + 1);
117 | isListDirty = true;
118 | }
119 |
120 | if (GUILayout.Button(s_DeleteLayer, EditorStyles.miniButtonRight, s_MiniButtonWidth))
121 | {
122 | int initialSize = layerList.arraySize;
123 | int lastIndex = initialSize - 1;
124 | // Swap index with last index
125 | if (index != lastIndex)
126 | {
127 | SwapCloudLayers(layerList, index, lastIndex);
128 | }
129 |
130 | // Clear reference in list.
131 | layerList.DeleteArrayElementAtIndex(lastIndex);
132 |
133 | // Remove element from list.
134 | if (layerList.arraySize == initialSize)
135 | {
136 | layerList.DeleteArrayElementAtIndex(lastIndex);
137 | }
138 |
139 | isListDirty = true;
140 | }
141 |
142 | EditorGUILayout.EndHorizontal();
143 |
144 | return isListDirty;
145 | }
146 |
147 | private static void DrawCloudLayer(SerializedProperty cloudLayerElement)
148 | {
149 | EditorGUILayout.Space();
150 | DrawBlendingOptions(cloudLayerElement);
151 | DrawCloudOptions(cloudLayerElement);
152 | DrawTextureOptions(cloudLayerElement);
153 | }
154 |
155 | private static void DrawBlendingOptions(SerializedProperty cloudLayerElement)
156 | {
157 | EditorGUILayout.BeginVertical(EditorStyles.helpBox);
158 |
159 | EditorGUILayout.LabelField("Blend Settings", EditorStyles.boldLabel);
160 |
161 | EditorGUI.indentLevel += 1;
162 | EditorGUILayout.PropertyField(cloudLayerElement.FindPropertyRelative(CloudLayerData.PATH_BLEND_MODE));
163 | EditorGUILayout.PropertyField(cloudLayerElement.FindPropertyRelative(CloudLayerData.PATH_OPACITY));
164 | EditorGUI.indentLevel -= 1;
165 |
166 | EditorGUILayout.EndVertical();
167 | }
168 |
169 | private static void DrawCloudOptions(SerializedProperty cloudLayerElement)
170 | {
171 | EditorGUILayout.BeginVertical(EditorStyles.helpBox);
172 | EditorGUILayout.LabelField("Cloud Settings", EditorStyles.boldLabel);
173 |
174 | EditorGUI.indentLevel += 1;
175 |
176 | EditorGUILayout.PropertyField(cloudLayerElement.FindPropertyRelative(CloudLayerData.PATH_COVERAGE));
177 | EditorGUILayout.PropertyField(cloudLayerElement.FindPropertyRelative(CloudLayerData.PATH_SOFTNESS));
178 |
179 | SerializedProperty speedProperty = cloudLayerElement.FindPropertyRelative(CloudLayerData.PATH_SPEED);
180 | EditorGUILayout.PropertyField(speedProperty);
181 | speedProperty.floatValue = Mathf.Max(speedProperty.floatValue, 0);
182 |
183 | EditorGUILayout.PropertyField(cloudLayerElement.FindPropertyRelative(CloudLayerData.PATH_DIRECTION));
184 |
185 | EditorGUI.indentLevel -= 1;
186 |
187 | EditorGUILayout.EndVertical();
188 | }
189 |
190 | private static void DrawTextureOptions(SerializedProperty cloudLayerElement)
191 | {
192 | EditorGUILayout.BeginVertical(EditorStyles.helpBox);
193 | EditorGUILayout.LabelField("Texture Settings", EditorStyles.boldLabel);
194 |
195 | EditorGUI.indentLevel += 1;
196 |
197 | SerializedProperty textureProperty = cloudLayerElement.FindPropertyRelative(CloudLayerData.PATH_TEXTURE);
198 | EditorGUILayout.PropertyField(textureProperty);
199 |
200 | if (textureProperty.objectReferenceValue == null)
201 | {
202 | EditorGUILayout.HelpBox("No Texture assigned.", MessageType.Warning);
203 | }
204 |
205 | SerializedProperty tilingProperty = cloudLayerElement.FindPropertyRelative(CloudLayerData.PATH_TEXTURE_TILING);
206 | EditorGUILayout.PropertyField(tilingProperty);
207 | tilingProperty.vector2Value = CloudLayerData.LimitTextureTiling(tilingProperty.vector2Value);
208 |
209 | EditorGUILayout.PropertyField(cloudLayerElement.FindPropertyRelative(CloudLayerData.PATH_TEXTURE_OFFSET));
210 |
211 | EditorGUI.indentLevel -= 1;
212 |
213 | EditorGUILayout.EndVertical();
214 | }
215 |
216 | private void DrawFooter(SerializedProperty layerList)
217 | {
218 | if (GUILayout.Button(m_AddLayer))
219 | {
220 | SerializedProperty element = AddCloudLayer(layerList);
221 | ResetCloudLayerDataElement(element);
222 | }
223 |
224 | if (layerList.arraySize == 0)
225 | {
226 | EditorGUILayout.HelpBox("Press the \"+\" button to add a new Cloud Layer.", MessageType.Info);
227 |
228 | EditorGUILayout.Space();
229 |
230 | EditorGUILayout.BeginHorizontal();
231 |
232 | EditorGUI.BeginDisabledGroup(m_CloudLayerPrefab == null || !PrefabContainsCloudLayerComponents(m_CloudLayerPrefab));
233 | if (GUILayout.Button(m_ConvertPrefabButton))
234 | {
235 | ConvertPrefabToCloudLayerData(m_CloudLayerPrefab, layerList);
236 | }
237 |
238 | EditorGUI.EndDisabledGroup();
239 |
240 | m_CloudLayerPrefab = EditorGUILayout.ObjectField(m_CloudLayerPrefab, typeof(GameObject), false) as GameObject;
241 |
242 | EditorGUILayout.EndHorizontal();
243 |
244 | if (m_CloudLayerPrefab == null)
245 | {
246 | EditorGUILayout.HelpBox("Convert Cloud Layer Prefabs created with older version of this asset to the new format.", MessageType.Info);
247 | }
248 | else
249 | {
250 | if (PrefabContainsCloudLayerComponents(m_CloudLayerPrefab))
251 | {
252 | EditorGUILayout.HelpBox("Press the \"Convert\" button to convert the prefab into the new format.", MessageType.Info);
253 | }
254 | else
255 | {
256 | EditorGUILayout.HelpBox("Invalid Prefab!\nIt does not contain any Cloud Layer components.", MessageType.Error);
257 | }
258 | }
259 | }
260 | }
261 |
262 | private static void ConvertPrefabToCloudLayerData(GameObject prefab, SerializedProperty layerList)
263 | {
264 | CloudLayer[] cloudLayers = prefab.GetComponents();
265 |
266 | for (int i = 0; i < cloudLayers.Length; ++i)
267 | {
268 | SerializedProperty element = AddCloudLayer(layerList);
269 | ConvertCloudLayerToCloudLayerData(cloudLayers[i], element, i);
270 | }
271 | }
272 |
273 | private static SerializedProperty AddCloudLayer(SerializedProperty layerList)
274 | {
275 | int index = layerList.arraySize;
276 | layerList.arraySize++;
277 |
278 | SerializedProperty element = layerList.GetArrayElementAtIndex(index);
279 |
280 | return element;
281 | }
282 |
283 | private static void SwapCloudLayers(SerializedProperty layerList, int index1, int index2)
284 | {
285 | int listSize = layerList.arraySize;
286 |
287 | if (index1 >= 0 && index2 >= 0 && index1 < listSize && index2 < listSize)
288 | {
289 | bool isIndex1Expanded = layerList.GetArrayElementAtIndex(index1).isExpanded;
290 | layerList.GetArrayElementAtIndex(index1).isExpanded = layerList.GetArrayElementAtIndex(index2).isExpanded;
291 | layerList.GetArrayElementAtIndex(index2).isExpanded = isIndex1Expanded;
292 |
293 | layerList.MoveArrayElement(index1, index2);
294 | }
295 | }
296 |
297 | private static void ResetCloudLayerDataElement(SerializedProperty element)
298 | {
299 | element.isExpanded = true;
300 |
301 | element.FindPropertyRelative(CloudLayerData.PATH_IS_VISIBLE).boolValue = true;
302 | element.FindPropertyRelative(CloudLayerData.PATH_LAYER_NAME).stringValue = "New Cloud Layer";
303 | element.FindPropertyRelative(CloudLayerData.PATH_BLEND_MODE).enumValueIndex = (int)CloudLayer.BlendMode.Subtract;
304 | element.FindPropertyRelative(CloudLayerData.PATH_OPACITY).floatValue = 1f;
305 | element.FindPropertyRelative(CloudLayerData.PATH_COVERAGE).floatValue = 0.5f;
306 | element.FindPropertyRelative(CloudLayerData.PATH_SOFTNESS).floatValue = 0.25f;
307 | element.FindPropertyRelative(CloudLayerData.PATH_SPEED).floatValue = 1f;
308 | element.FindPropertyRelative(CloudLayerData.PATH_DIRECTION).floatValue = 0f;
309 | element.FindPropertyRelative(CloudLayerData.PATH_TEXTURE).objectReferenceValue = null;
310 | element.FindPropertyRelative(CloudLayerData.PATH_TEXTURE_TILING).vector2Value = Vector2.one;
311 | element.FindPropertyRelative(CloudLayerData.PATH_TEXTURE_OFFSET).vector2Value = Vector2.zero;
312 | }
313 |
314 | private static void ConvertCloudLayerToCloudLayerData(CloudLayer cloudLayer, SerializedProperty element, int index)
315 | {
316 | element.isExpanded = true;
317 |
318 | element.FindPropertyRelative(CloudLayerData.PATH_IS_VISIBLE).boolValue = cloudLayer.enabled;
319 | element.FindPropertyRelative(CloudLayerData.PATH_LAYER_NAME).stringValue = "Cloud Layer " + (index + 1);
320 | element.FindPropertyRelative(CloudLayerData.PATH_BLEND_MODE).enumValueIndex = (int)cloudLayer.TextureBlendMode;
321 | element.FindPropertyRelative(CloudLayerData.PATH_OPACITY).floatValue = cloudLayer.Opacity;
322 | element.FindPropertyRelative(CloudLayerData.PATH_COVERAGE).floatValue = cloudLayer.Coverage;
323 | element.FindPropertyRelative(CloudLayerData.PATH_SOFTNESS).floatValue = cloudLayer.Softness;
324 | element.FindPropertyRelative(CloudLayerData.PATH_SPEED).floatValue = cloudLayer.Velocity.magnitude;
325 | element.FindPropertyRelative(CloudLayerData.PATH_DIRECTION).floatValue = ConvertVelocityToDirectionAngle(cloudLayer.Velocity);
326 | element.FindPropertyRelative(CloudLayerData.PATH_TEXTURE).objectReferenceValue = cloudLayer.Texture;
327 | element.FindPropertyRelative(CloudLayerData.PATH_TEXTURE_TILING).vector2Value = cloudLayer.TextureTiling;
328 | element.FindPropertyRelative(CloudLayerData.PATH_TEXTURE_OFFSET).vector2Value = cloudLayer.TextureOffset;
329 | }
330 |
331 | private static bool PrefabContainsCloudLayerComponents(GameObject prefab)
332 | {
333 | return prefab.GetComponent() != null;
334 | }
335 |
336 | private static float ConvertVelocityToDirectionAngle(Vector2 velocity)
337 | {
338 | float directionAngle = Mathf.Rad2Deg * Mathf.Atan2(velocity.y, velocity.x);
339 |
340 | if (directionAngle < 0)
341 | {
342 | directionAngle = 360 + directionAngle;
343 | }
344 |
345 | return directionAngle;
346 | }
347 | }
348 | }
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/Editor/CloudLayersEditor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f6c9f8ffb5016314abb09035d5c06540
3 | timeCreated: 1488557898
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {fileID: 2800000, guid: 6d064c543946ec848b43311457ef00ea, type: 3}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/Editor/CloudShadowsEditor.cs:
--------------------------------------------------------------------------------
1 | using UnityEditor;
2 | using UnityEngine;
3 |
4 | namespace EntroPi
5 | {
6 | [CustomEditor(typeof(CloudShadows))]
7 | public class CloudShadowsEditor : Editor
8 | {
9 | private Texture2D m_Logo;
10 | private bool m_ShowGlobalMultipliers = true;
11 | private bool m_ShowAdvancedSettings = true;
12 |
13 | private void OnEnable()
14 | {
15 | string logoAssetPath = EditorUtil.GetEntroPiFolderPath(this) + EditorUtil.PATH_RELATIVE_LOGO;
16 | m_Logo = AssetDatabase.LoadAssetAtPath(logoAssetPath, typeof(Texture2D)) as Texture2D;
17 | }
18 |
19 | public override void OnInspectorGUI()
20 | {
21 | serializedObject.Update();
22 |
23 | EditorGUILayout.Space();
24 | GUILayout.Label(m_Logo);
25 |
26 | if (ContainsObsoleteCloudLayerComponents())
27 | {
28 | EditorGUILayout.HelpBox("There are obsolete Cloud Layer Script components attached to this GameObject.\nYou can safely remove these components.", MessageType.Warning);
29 | }
30 |
31 | EditorGUILayout.Space();
32 |
33 | EditorGUILayout.PropertyField(serializedObject.FindProperty(CloudShadows.PATH_PREVIEW_IN_EDITOR));
34 |
35 | SerializedProperty projectModeProperty = serializedObject.FindProperty(CloudShadows.PATH_PROJECT_MODE);
36 | EditorGUILayout.PropertyField(projectModeProperty);
37 |
38 | EditorGUILayout.Space();
39 |
40 | SerializedProperty cloudLayersProperty = serializedObject.FindProperty(CloudShadows.PATH_CLOUD_LAYERS);
41 | EditorGUILayout.PropertyField(cloudLayersProperty);
42 |
43 | if (cloudLayersProperty.objectReferenceValue == null)
44 | {
45 | EditorGUILayout.HelpBox("No Cloud Layers asset assigned.", MessageType.Warning);
46 | }
47 |
48 | EditorGUILayout.PropertyField(serializedObject.FindProperty(CloudShadows.PATH_WORLD_SIZE));
49 | EditorGUILayout.PropertyField(serializedObject.FindProperty(CloudShadows.PATH_RENDER_TEXTURE_RESOLUTION));
50 |
51 | EditorGUILayout.Space();
52 |
53 | m_ShowGlobalMultipliers = EditorGUILayout.Foldout(m_ShowGlobalMultipliers, "Global Mutators");
54 |
55 | if (m_ShowGlobalMultipliers)
56 | {
57 | EditorGUI.indentLevel += 1;
58 |
59 | EditorGUILayout.PropertyField(serializedObject.FindProperty(CloudShadows.PATH_OPACITY_MULTIPLIER));
60 | EditorGUILayout.PropertyField(serializedObject.FindProperty(CloudShadows.PATH_COVERAGE_MODIFIER));
61 | EditorGUILayout.PropertyField(serializedObject.FindProperty(CloudShadows.PATH_SOFTNESS_MODIFIER));
62 | EditorGUILayout.PropertyField(serializedObject.FindProperty(CloudShadows.PATH_SPEED_MULTIPLIER));
63 | EditorGUILayout.PropertyField(serializedObject.FindProperty(CloudShadows.PATH_DIRECTION_MODIFIER));
64 |
65 | EditorGUI.indentLevel -= 1;
66 | }
67 |
68 | if (projectModeProperty.enumValueIndex == (int)CloudShadows.ProjectMode.Mode3D)
69 | {
70 | m_ShowAdvancedSettings = EditorGUILayout.Foldout(m_ShowAdvancedSettings, "Advanced 3D Settings");
71 |
72 | if (m_ShowAdvancedSettings)
73 | {
74 | EditorGUI.indentLevel += 1;
75 |
76 | EditorGUILayout.PropertyField(serializedObject.FindProperty(CloudShadows.PATH_HORIZON_ANGLE_THRESHOLD));
77 | EditorGUILayout.PropertyField(serializedObject.FindProperty(CloudShadows.PATH_HORIZON_ANGLE_FADE));
78 |
79 | EditorGUI.indentLevel -= 1;
80 | }
81 | }
82 |
83 | serializedObject.ApplyModifiedProperties();
84 | }
85 |
86 | private bool ContainsObsoleteCloudLayerComponents()
87 | {
88 | MonoBehaviour targetScript = target as MonoBehaviour;
89 |
90 | CloudLayer cloudLayerScript = targetScript.GetComponent();
91 |
92 | bool containsObsoleteComponents = cloudLayerScript != null;
93 |
94 | return containsObsoleteComponents;
95 | }
96 | }
97 | }
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/Editor/CloudShadowsEditor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c6dbe76c1c2273a4b87fe8cead1744d4
3 | timeCreated: 1488557892
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {fileID: 2800000, guid: 6d064c543946ec848b43311457ef00ea, type: 3}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/Editor/EditorUtil.cs:
--------------------------------------------------------------------------------
1 | using UnityEditor;
2 | using UnityEngine;
3 |
4 | namespace EntroPi
5 | {
6 | public static class EditorUtil
7 | {
8 | public const string PATH_RELATIVE_LOGO = "/Cloud Shadows/Editor/InternalResources/EntroPiLogo.png";
9 | public const string PATH_RELATIVE_BLEND_ARROW = "/Cloud Shadows/Editor/InternalResources/CloudLayerBlendArrow.png";
10 |
11 | public static string GetEntroPiFolderPath(ScriptableObject scriptableObject)
12 | {
13 | string scriptFilePath = GetScriptFilePath(scriptableObject);
14 | int index = scriptFilePath.IndexOf("/Cloud Shadows");
15 |
16 | return scriptFilePath.Substring(0, index);
17 | }
18 |
19 | private static string GetScriptFilePath(ScriptableObject scriptableObject)
20 | {
21 | MonoScript monoScript = MonoScript.FromScriptableObject(scriptableObject);
22 | string scriptFilePath = AssetDatabase.GetAssetPath(monoScript);
23 |
24 | return scriptFilePath;
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/Editor/EditorUtil.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 69730d52fa788984f8cff37ba64572b6
3 | timeCreated: 1488557887
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {fileID: 2800000, guid: 6d064c543946ec848b43311457ef00ea, type: 3}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/Util.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace EntroPi
4 | {
5 | ///
6 | /// Verify functions
7 | ///
8 | public class Debug
9 | {
10 | ///
11 | /// Verifies and returns a condition
12 | /// Raises an assert exception with message if condition is false
13 | ///
14 | public static bool Verify(bool condition, string message)
15 | {
16 | UnityEngine.Debug.Assert(condition, "Verify Failed: " + message);
17 |
18 | return condition;
19 | }
20 |
21 | ///
22 | /// Verifies and returns a condition
23 | /// Raises an assert exception if condition is false
24 | ///
25 | public static bool Verify(bool condition)
26 | {
27 | UnityEngine.Debug.Assert(condition, "Verify Failed!");
28 |
29 | return condition;
30 | }
31 | }
32 |
33 | ///
34 | /// Util class for creating and loading resources
35 | ///
36 | public class ResourceUtil
37 | {
38 | ///
39 | /// Creates and returns material from shader.
40 | ///
41 | public static Material CreateMaterial(string shaderResource)
42 | {
43 | Material material = null;
44 |
45 | Shader shader = LoadShader(shaderResource);
46 |
47 | if (Debug.Verify(CheckShader(shader)))
48 | {
49 | material = new Material(shader);
50 | material.hideFlags = HideFlags.HideAndDontSave;
51 | }
52 |
53 | UnityEngine.Debug.Assert(material != null, "Failed to created material from shader: " + shaderResource);
54 |
55 | return material;
56 | }
57 |
58 | ///
59 | /// Creates and returns shader.
60 | ///
61 | public static Shader LoadShader(string shaderResource)
62 | {
63 | Shader shader = Resources.Load(shaderResource, typeof(Shader)) as Shader;
64 |
65 | UnityEngine.Debug.Assert(CheckShader(shader), "Shader not supported: " + shaderResource);
66 |
67 | return shader;
68 | }
69 |
70 | ///
71 | /// Checks if shader exists and is supported.
72 | ///
73 | public static bool CheckShader(Shader shader)
74 | {
75 | return (shader != null && shader.isSupported);
76 | }
77 | }
78 |
79 | ///
80 | /// Util class for managing Render Textures
81 | ///
82 | public class RenderTextureUtil
83 | {
84 | ///
85 | /// Creates and returns new render texture.
86 | ///
87 | public static RenderTexture CreateRenderTexture(int resolution, int depth = 0, TextureWrapMode wrapMode = TextureWrapMode.Repeat, FilterMode filterMode = FilterMode.Bilinear)
88 | {
89 | RenderTexture renderTexture = new RenderTexture(resolution, resolution, depth);
90 | renderTexture.wrapMode = wrapMode;
91 | renderTexture.filterMode = filterMode;
92 |
93 | return renderTexture;
94 | }
95 |
96 | ///
97 | /// Recreates and returns new render texture.
98 | ///
99 | public static void RecreateRenderTexture(ref RenderTexture renderTexture, int resolution)
100 | {
101 | renderTexture.Release();
102 | renderTexture = CreateRenderTexture(resolution);
103 | }
104 |
105 | ///
106 | /// Clears render texture.
107 | ///
108 | public static void ClearRenderTexture(RenderTexture renderTexture, Color clearColor)
109 | {
110 | // Store currently active render texture
111 | RenderTexture lastActive = RenderTexture.active;
112 |
113 | // Set render texture parameter active and clear
114 | RenderTexture.active = renderTexture;
115 | GL.Clear(false, true, clearColor);
116 |
117 | // Revert active render texture
118 | RenderTexture.active = lastActive;
119 | }
120 |
121 | ///
122 | /// Swaps the references of 2 render textures
123 | ///
124 | public static void SwapRenderTextures(ref RenderTexture renderTexture1, ref RenderTexture renderTexture2)
125 | {
126 | RenderTexture tempRenderTexture = renderTexture1;
127 | renderTexture1 = renderTexture2;
128 | renderTexture2 = tempRenderTexture;
129 | }
130 | }
131 | }
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Scripts/Util.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 511d02306c22c5743a8004d8f9513a3f
3 | timeCreated: 1488557871
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {fileID: 2800000, guid: 6d064c543946ec848b43311457ef00ea, type: 3}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Textures.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ea4f1eddeaf60404a96dc71c1c064c9f
3 | folderAsset: yes
4 | timeCreated: 1460493917
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Textures/CloudsFineDetail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Textures/CloudsFineDetail.png
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Textures/CloudsFineDetail.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3771f9535c4ad6d4c8fb4ef63a941479
3 | timeCreated: 1461615193
4 | licenseType: Free
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 2
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 1
11 | linearTexture: 1
12 | correctGamma: 1
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: .25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 0
25 | cubemapConvolution: 0
26 | cubemapConvolutionSteps: 8
27 | cubemapConvolutionExponent: 1.5
28 | seamlessCubemap: 0
29 | textureFormat: -1
30 | maxTextureSize: 4096
31 | textureSettings:
32 | filterMode: -1
33 | aniso: -1
34 | mipBias: -1
35 | wrapMode: -1
36 | nPOTScale: 1
37 | lightmap: 0
38 | rGBM: 0
39 | compressionQuality: 50
40 | spriteMode: 0
41 | spriteExtrude: 1
42 | spriteMeshType: 1
43 | alignment: 0
44 | spritePivot: {x: .5, y: .5}
45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
46 | spritePixelsToUnits: 100
47 | alphaIsTransparency: 0
48 | textureType: 5
49 | buildTargetSettings: []
50 | spriteSheet:
51 | sprites: []
52 | spritePackingTag:
53 | userData:
54 | assetBundleName:
55 | assetBundleVariant:
56 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Textures/CloudsLargeDetail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Textures/CloudsLargeDetail.png
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Textures/CloudsLargeDetail.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a632e081d36089d49b94a287b6b816b1
3 | timeCreated: 1461614754
4 | licenseType: Free
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 2
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 1
11 | linearTexture: 1
12 | correctGamma: 1
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: .25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 0
25 | cubemapConvolution: 0
26 | cubemapConvolutionSteps: 8
27 | cubemapConvolutionExponent: 1.5
28 | seamlessCubemap: 0
29 | textureFormat: -1
30 | maxTextureSize: 2048
31 | textureSettings:
32 | filterMode: -1
33 | aniso: -1
34 | mipBias: -1
35 | wrapMode: -1
36 | nPOTScale: 1
37 | lightmap: 0
38 | rGBM: 0
39 | compressionQuality: 50
40 | spriteMode: 0
41 | spriteExtrude: 1
42 | spriteMeshType: 1
43 | alignment: 0
44 | spritePivot: {x: .5, y: .5}
45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
46 | spritePixelsToUnits: 100
47 | alphaIsTransparency: 0
48 | textureType: 5
49 | buildTargetSettings: []
50 | spriteSheet:
51 | sprites: []
52 | spritePackingTag:
53 | userData:
54 | assetBundleName:
55 | assetBundleVariant:
56 |
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Textures/CloudsMediumDetail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/Assets/EntroPi/Cloud Shadows/Textures/CloudsMediumDetail.png
--------------------------------------------------------------------------------
/Assets/EntroPi/Cloud Shadows/Textures/CloudsMediumDetail.png.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fb2532bfbc2e6eb498e342b76748273a
3 | timeCreated: 1461615225
4 | licenseType: Free
5 | TextureImporter:
6 | fileIDToRecycleName: {}
7 | serializedVersion: 2
8 | mipmaps:
9 | mipMapMode: 0
10 | enableMipMap: 1
11 | linearTexture: 1
12 | correctGamma: 1
13 | fadeOut: 0
14 | borderMipMap: 0
15 | mipMapFadeDistanceStart: 1
16 | mipMapFadeDistanceEnd: 3
17 | bumpmap:
18 | convertToNormalMap: 0
19 | externalNormalMap: 0
20 | heightScale: .25
21 | normalMapFilter: 0
22 | isReadable: 0
23 | grayScaleToAlpha: 0
24 | generateCubemap: 0
25 | cubemapConvolution: 0
26 | cubemapConvolutionSteps: 8
27 | cubemapConvolutionExponent: 1.5
28 | seamlessCubemap: 0
29 | textureFormat: -1
30 | maxTextureSize: 2048
31 | textureSettings:
32 | filterMode: -1
33 | aniso: -1
34 | mipBias: -1
35 | wrapMode: -1
36 | nPOTScale: 1
37 | lightmap: 0
38 | rGBM: 0
39 | compressionQuality: 50
40 | spriteMode: 0
41 | spriteExtrude: 1
42 | spriteMeshType: 1
43 | alignment: 0
44 | spritePivot: {x: .5, y: .5}
45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
46 | spritePixelsToUnits: 100
47 | alphaIsTransparency: 0
48 | textureType: 5
49 | buildTargetSettings: []
50 | spriteSheet:
51 | sprites: []
52 | spritePackingTag:
53 | userData:
54 | assetBundleName:
55 | assetBundleVariant:
56 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/ProjectSettings/AudioManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/AudioManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/DynamicsManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/DynamicsManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/EditorBuildSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/EditorBuildSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/EditorSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/EditorSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/GraphicsSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/GraphicsSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/InputManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/InputManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/NavMeshAreas.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/NavMeshAreas.asset
--------------------------------------------------------------------------------
/ProjectSettings/NetworkManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/NetworkManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/Physics2DSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/Physics2DSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/ProjectSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/ProjectSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/ProjectVersion.txt:
--------------------------------------------------------------------------------
1 | m_EditorVersion: 5.2.0f3
2 | m_StandardAssetsVersion: 0
3 |
--------------------------------------------------------------------------------
/ProjectSettings/QualitySettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/QualitySettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/TagManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/TagManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/TimeManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/TimeManager.asset
--------------------------------------------------------------------------------
/ProjectSettings/UnityAdsSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/UnityAdsSettings.asset
--------------------------------------------------------------------------------
/ProjectSettings/UnityAnalyticsManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EntroPi-Games/Unity-Cloud-Shadows/b332d4f05fedf4f2113b31624911e0647fd09919/ProjectSettings/UnityAnalyticsManager.asset
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Unity Cloud Shadows
2 |
3 | ## Description
4 | Adding animated cloud shadows is a quick, easy and effective way to breath extra life into any outdoor environment. This asset is perfectly suited for top-down strategy or city-building games, but also looks great from other viewpoints and in other type of games.
5 |
6 | * [**WebGL Demo**](http://entropi-games.com/files/cloud-shadows-demo/)
7 | * [**Video**](https://youtu.be/PmlUwmOPqIw)
8 |
9 | 
10 | 
11 | 
12 | 
13 |
14 | ## Main Features
15 | * **Customization:** The layer system enables you to customize the effect so that it matches the visual style of your project seamlessly
16 | * **Editor preview:** The cloud shadows are previewed inside the Unity scene editor, so tweaking is easy and straightforward
17 | * **Easy to use:** Full source code is included Includes several ready-to-use prefabs and full documentation
18 | * **Performance:** Designed with performance in mind, zero allocation during run-time
19 |
20 | ## Requirements
21 | * The scene needs to contain a Directional Light which is used to simulate sunlight.
22 | * This directional light needs to be rendered in real-time, baked light maps are not supported for this light (other lights can still use light maps).
23 | * The rendering path must be set to either forward or deferred. Vertex lit is not supported.
24 |
25 | ## Supported platforms
26 | * Unity 5.2 or above
27 | * Desktop (PC, Mac, Linux)
28 | * Mobile
29 | * Virtual Reality
30 |
31 | ## NOT Supported
32 | * Scriptable Render Pipelines (URP, HDRP)
33 |
--------------------------------------------------------------------------------