├── .gitignore ├── Assets ├── kode80.meta └── kode80 │ ├── Effects.meta │ └── Effects │ ├── Resources.meta │ ├── Resources │ ├── FilmicTonemapping.shader │ └── FilmicTonemapping.shader.meta │ ├── Scripts.meta │ └── Scripts │ ├── FilmicTonemapping.cs │ └── FilmicTonemapping.cs.meta ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.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 └── UnityConnectSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/unity 2 | 3 | ### Unity ### 4 | /[Ll]ibrary/ 5 | /[Tt]emp/ 6 | /[Oo]bj/ 7 | /[Bb]uild/ 8 | 9 | # Autogenerated VS/MD solution and project files 10 | *.csproj 11 | *.unityproj 12 | *.sln 13 | *.suo 14 | *.tmp 15 | *.user 16 | *.userprefs 17 | *.pidb 18 | *.booproj 19 | 20 | # Unity3D generated meta files 21 | *.pidb.meta 22 | 23 | # Unity3D Generated File On Crash Reports 24 | sysinfo.txt 25 | VolumeClouds.app 26 | .vscode 27 | Clouds Notes.oo3 28 | ios 29 | Creative 30 | VolumeClouds_Data/ 31 | VolumeClouds.exe 32 | player_win_development_x86.pdb 33 | PixelRender_Shooter.app 34 | PixelRender Notes.oo3 35 | PixelRenderTitle.app 36 | CreditsRoll.app 37 | Assets/IgnoredK80EffectsTests 38 | IgnoredK80EffectsTests.meta 39 | -------------------------------------------------------------------------------- /Assets/kode80.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9857a6801a5344c40be8ff3a5e62b9ff 3 | folderAsset: yes 4 | timeCreated: 1457718224 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/kode80/Effects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: edbd23b7a13cd43519440437fb07fca0 3 | folderAsset: yes 4 | timeCreated: 1457718224 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/kode80/Effects/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a7bd5805522b4982b670f219f4cec23 3 | folderAsset: yes 4 | timeCreated: 1457718224 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/kode80/Effects/Resources/FilmicTonemapping.shader: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, Ben Hopkins (kode80) 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without modification, 5 | // are permitted provided that the following conditions are met: 6 | // 7 | // 1. Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 15 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 16 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 17 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 19 | // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 22 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | 24 | Shader "Hidden/kode80/Effects/FilmicTonemapping" 25 | { 26 | Properties 27 | { 28 | _MainTex ("Texture", 2D) = "white" {} 29 | _Exposure ("Exposure", Range( 0.0, 16.0)) = 1.5 30 | } 31 | SubShader 32 | { 33 | // No culling or depth 34 | Cull Off ZWrite Off ZTest Always 35 | 36 | Pass 37 | { 38 | CGPROGRAM 39 | #pragma vertex vert 40 | #pragma fragment frag 41 | 42 | #include "UnityCG.cginc" 43 | 44 | struct appdata 45 | { 46 | float4 vertex : POSITION; 47 | float2 uv : TEXCOORD0; 48 | }; 49 | 50 | struct v2f 51 | { 52 | float2 uv : TEXCOORD0; 53 | float4 vertex : SV_POSITION; 54 | }; 55 | 56 | v2f vert (appdata v) 57 | { 58 | v2f o; 59 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 60 | o.uv = v.uv; 61 | return o; 62 | } 63 | 64 | sampler2D _MainTex; 65 | float _Exposure; 66 | float _Dither; 67 | 68 | static const float A = 0.15; 69 | static const float B = 0.50; 70 | static const float C = 0.10; 71 | static const float D = 0.20; 72 | static const float E = 0.02; 73 | static const float F = 0.30; 74 | static const float W = 11.2; 75 | 76 | // Uncharted 2 tonemap from http://filmicgames.com/archives/75 77 | float3 FilmicTonemap( float3 x) 78 | { 79 | return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F; 80 | } 81 | 82 | float3 Hash( float2 seed) 83 | { 84 | return float3( frac(sin(dot( seed, float2(12.9898,78.233))) * 43758.5453) * 2.0 - 1.0, 85 | frac(sin(dot( -seed, float2(12.9898,78.233))) * 21879.27265) * 2.0 - 1.0, 86 | frac(sin(dot( seed.yx, float2(12.9898,78.233))) * 43758.5453) * 2.0 - 1.0); 87 | } 88 | 89 | fixed4 frag (v2f i) : SV_Target 90 | { 91 | float3 texColor = tex2D( _MainTex, i.uv); 92 | texColor *= _Exposure; 93 | 94 | float ExposureBias = 2.0f; 95 | texColor *= ExposureBias; 96 | 97 | float3 curr = FilmicTonemap( texColor); 98 | 99 | float3 whiteScale = 1.0f/FilmicTonemap(W); 100 | float3 color = _Dither ? (curr + Hash( i.vertex) / 1024.0) * whiteScale : 101 | curr * whiteScale; 102 | 103 | return float4( color, 1); 104 | } 105 | ENDCG 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Assets/kode80/Effects/Resources/FilmicTonemapping.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 357770cb365944ae2879f9b084d22151 3 | timeCreated: 1457718226 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/kode80/Effects/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c5e9585adf414745a2812998e5a3499 3 | folderAsset: yes 4 | timeCreated: 1457718224 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/kode80/Effects/Scripts/FilmicTonemapping.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016, Ben Hopkins (kode80) 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without modification, 5 | // are permitted provided that the following conditions are met: 6 | // 7 | // 1. Redistributions of source code must retain the above copyright notice, 8 | // this list of conditions and the following disclaimer. 9 | // 10 | // 2. Redistributions in binary form must reproduce the above copyright notice, 11 | // this list of conditions and the following disclaimer in the documentation 12 | // and/or other materials provided with the distribution. 13 | // 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 15 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 16 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 17 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 19 | // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 22 | // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | 24 | using UnityEngine; 25 | using System.Collections; 26 | 27 | namespace kode80.Effects 28 | { 29 | [ExecuteInEditMode] 30 | public class FilmicTonemapping : MonoBehaviour 31 | { 32 | [Range( 0.0f, 16.0f)] 33 | public float exposure = 1.5f; 34 | public bool dither = false; 35 | 36 | private Material _material; 37 | 38 | // Use this for initialization 39 | void Start () { 40 | 41 | } 42 | 43 | // Update is called once per frame 44 | void Update () { 45 | 46 | } 47 | 48 | [ImageEffectTransformsToLDR] 49 | void OnRenderImage( RenderTexture source, RenderTexture destination) 50 | { 51 | if( _material == null) 52 | { 53 | _material = new Material( Shader.Find( "Hidden/kode80/Effects/FilmicTonemapping")); 54 | _material.hideFlags = HideFlags.HideAndDontSave; 55 | } 56 | 57 | _material.SetFloat( "_Exposure", exposure); 58 | _material.SetFloat( "_Dither", dither ? 1.0f : 0.0f); 59 | 60 | Graphics.Blit( source, destination, _material); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Assets/kode80/Effects/Scripts/FilmicTonemapping.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 751f35967aeee4893bcab85365c2b258 3 | timeCreated: 1457718226 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.3.4f1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/UnityAdsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kode80/UnityEffects/ffd9d736a3423b9a255a16ec5b0e9a81f58412f8/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnityEffects 2 | A collection of [kode80](http://kode80.com/) effects for Unity3D. Free to use for both non-commercial and commercial purposes. 3 | 4 | ## Effects 5 | * **FilmicTonemapping**: The Uncharted 2 tonemapping operator, mimics film. Includes optional dithering to remove LDR banding. 6 | --------------------------------------------------------------------------------