├── .gitignore ├── Assets ├── LUTColorGrading.meta └── LUTColorGrading │ ├── Filters.meta │ ├── Filters │ ├── Grayscale.asset │ ├── Grayscale.asset.meta │ ├── LevelControlFilter.asset │ ├── LevelControlFilter.asset.meta │ ├── Posterization.asset │ ├── Posterization.asset.meta │ ├── ToneCurve.asset │ └── ToneCurve.asset.meta │ ├── Materials.meta │ ├── Materials │ ├── Grayscale.mat │ ├── Grayscale.mat.meta │ ├── LevelControl.mat │ ├── LevelControl.mat.meta │ ├── ToneCurve.mat │ └── ToneCurve.mat.meta │ ├── Scenes.meta │ ├── Scenes │ ├── Test.unity │ └── Test.unity.meta │ ├── Scripts.meta │ ├── Scripts │ ├── Editor.meta │ ├── Editor │ │ ├── Filters.meta │ │ ├── Filters │ │ │ ├── LUTFilterEditor.cs │ │ │ └── LUTFilterEditor.cs.meta │ │ ├── LUTGeneratorEditor.cs │ │ └── LUTGeneratorEditor.cs.meta │ ├── Filters.meta │ ├── Filters │ │ ├── CurveFilter.cs │ │ ├── CurveFilter.cs.meta │ │ ├── LUTFilter.cs │ │ ├── LUTFilter.cs.meta │ │ ├── LevelControlFilter.cs │ │ ├── LevelControlFilter.cs.meta │ │ ├── ToneCurveFilter.cs │ │ └── ToneCurveFilter.cs.meta │ ├── LUTColorGrading.cs │ ├── LUTColorGrading.cs.meta │ ├── LUTGenerator.cs │ ├── LUTGenerator.cs.meta │ ├── OutputTexture.cs │ └── OutputTexture.cs.meta │ ├── Shaders.meta │ ├── Shaders │ ├── Filters.meta │ ├── Filters │ │ ├── CurveFilter.cginc │ │ ├── CurveFilter.cginc.meta │ │ ├── Grayscale.shader │ │ ├── Grayscale.shader.meta │ │ ├── LevelControl.shader │ │ ├── LevelControl.shader.meta │ │ ├── ToneCurve.shader │ │ └── ToneCurve.shader.meta │ ├── LUT.cginc │ ├── LUT.cginc.meta │ ├── LUTColorGrading.shader │ ├── LUTColorGrading.shader.meta │ ├── Test.meta │ └── Test │ │ ├── Texture.shader │ │ └── Texture.shader.meta │ ├── Textures.meta │ └── Textures │ ├── shibuya.jpg │ └── shibuya.jpg.meta ├── Captures ├── Sample1.png ├── Sample2.png ├── Sample3.png └── Sample4.png └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Pp]rojectSettings/ 6 | 7 | # Autogenerated VS/MD solution and project files 8 | *.csproj 9 | *.unityproj 10 | *.sln 11 | *.suo 12 | *.user 13 | *.userprefs 14 | *.pidb 15 | *.booproj 16 | 17 | # Unity3D Generated File On Crash Reports 18 | sysinfo.txt -------------------------------------------------------------------------------- /Assets/LUTColorGrading.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3dcc25be53171d94db21237f23df8a42 3 | folderAsset: yes 4 | timeCreated: 1501576499 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Filters.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b8cb9ebb83f049fcad88e9ae297e103 3 | folderAsset: yes 4 | timeCreated: 1501590179 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Filters/Grayscale.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: 5653d07834996408ba3ad4bfdd6a945d, type: 3} 12 | m_Name: Grayscale 13 | m_EditorClassIdentifier: 14 | material: {fileID: 2100000, guid: 7705d6e86a28244519a9669dc75acd01, type: 2} 15 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Filters/Grayscale.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 123a1ddabd8304e7a8958280d443458b 3 | timeCreated: 1501590186 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 11400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Filters/LevelControlFilter.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: ddfafb6ab9c4d4237a36cd0983cd163c, type: 3} 12 | m_Name: LevelControlFilter 13 | m_EditorClassIdentifier: 14 | onFilterUpdate: 15 | m_PersistentCalls: 16 | m_Calls: [] 17 | m_TypeName: LUTColorGrading.LUTEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, 18 | PublicKeyToken=null 19 | material: {fileID: 2100000, guid: bcc3cafe0b8fa4ad990817659b182861, type: 2} 20 | level: 21 | serializedVersion: 2 22 | m_Curve: 23 | - serializedVersion: 2 24 | time: 0 25 | value: 0 26 | inSlope: 2 27 | outSlope: 2 28 | tangentMode: 0 29 | - serializedVersion: 2 30 | time: 0.6522732 31 | value: 0.5297668 32 | inSlope: 1.1205673 33 | outSlope: 1.1205673 34 | tangentMode: 0 35 | - serializedVersion: 2 36 | time: 1 37 | value: 1 38 | inSlope: 0 39 | outSlope: 0 40 | tangentMode: 0 41 | m_PreInfinity: 2 42 | m_PostInfinity: 2 43 | m_RotationOrder: 0 44 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Filters/LevelControlFilter.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddf02e69631634e0b8afdf5698590b60 3 | timeCreated: 1501592781 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 11400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Filters/Posterization.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: dee67109cf247447f9673737665a1f9d, type: 3} 12 | m_Name: Posterization 13 | m_EditorClassIdentifier: 14 | onFilterUpdate: 15 | m_PersistentCalls: 16 | m_Calls: [] 17 | m_TypeName: LUTColorGrading.LUTEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, 18 | PublicKeyToken=null 19 | material: {fileID: 2100000, guid: bd0199c28dfb649dd881f2804a049fca, type: 2} 20 | red: 21 | serializedVersion: 2 22 | m_Curve: 23 | - serializedVersion: 2 24 | time: 0 25 | value: 0.1990509 26 | inSlope: 0 27 | outSlope: 0 28 | tangentMode: 0 29 | - serializedVersion: 2 30 | time: 0.2053719 31 | value: 0.4004718 32 | inSlope: Infinity 33 | outSlope: Infinity 34 | tangentMode: 0 35 | - serializedVersion: 2 36 | time: 0.40307423 37 | value: 0.5995178 38 | inSlope: Infinity 39 | outSlope: Infinity 40 | tangentMode: 0 41 | - serializedVersion: 2 42 | time: 0.6026807 43 | value: 0.8056887 44 | inSlope: Infinity 45 | outSlope: Infinity 46 | tangentMode: 0 47 | - serializedVersion: 2 48 | time: 0.80230325 49 | value: 0.9976318 50 | inSlope: Infinity 51 | outSlope: Infinity 52 | tangentMode: 0 53 | - serializedVersion: 2 54 | time: 1.0000064 55 | value: 0.99524957 56 | inSlope: 0 57 | outSlope: 0 58 | tangentMode: 0 59 | m_PreInfinity: 2 60 | m_PostInfinity: 2 61 | m_RotationOrder: 0 62 | green: 63 | serializedVersion: 2 64 | m_Curve: 65 | - serializedVersion: 2 66 | time: 0 67 | value: 0 68 | inSlope: 1 69 | outSlope: 1 70 | tangentMode: 0 71 | - serializedVersion: 2 72 | time: 0.70254946 73 | value: 0.552196 74 | inSlope: 1.0001659 75 | outSlope: 1.0001659 76 | tangentMode: 0 77 | - serializedVersion: 2 78 | time: 1 79 | value: 1 80 | inSlope: 1 81 | outSlope: 1 82 | tangentMode: 0 83 | m_PreInfinity: 2 84 | m_PostInfinity: 2 85 | m_RotationOrder: 0 86 | blue: 87 | serializedVersion: 2 88 | m_Curve: 89 | - serializedVersion: 2 90 | time: 0 91 | value: 0 92 | inSlope: 1 93 | outSlope: 1 94 | tangentMode: 0 95 | - serializedVersion: 2 96 | time: 1 97 | value: 1 98 | inSlope: 1 99 | outSlope: 1 100 | tangentMode: 0 101 | m_PreInfinity: 2 102 | m_PostInfinity: 2 103 | m_RotationOrder: 0 104 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Filters/Posterization.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c68787ca715644930bdbbc954bc4562b 3 | timeCreated: 1501590355 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 11400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Filters/ToneCurve.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: dee67109cf247447f9673737665a1f9d, type: 3} 12 | m_Name: ToneCurve 13 | m_EditorClassIdentifier: 14 | onFilterUpdate: 15 | m_PersistentCalls: 16 | m_Calls: [] 17 | m_TypeName: LUTColorGrading.LUTEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, 18 | PublicKeyToken=null 19 | material: {fileID: 2100000, guid: bd0199c28dfb649dd881f2804a049fca, type: 2} 20 | red: 21 | serializedVersion: 2 22 | m_Curve: 23 | - serializedVersion: 2 24 | time: 0 25 | value: -0.006378174 26 | inSlope: 1 27 | outSlope: 1 28 | tangentMode: 0 29 | - serializedVersion: 2 30 | time: 0.6413587 31 | value: 0.5566472 32 | inSlope: 1.9541383 33 | outSlope: 1.9541383 34 | tangentMode: 0 35 | - serializedVersion: 2 36 | time: 0.7327017 37 | value: 0.70778924 38 | inSlope: 2.317425 39 | outSlope: 2.317425 40 | tangentMode: 0 41 | - serializedVersion: 2 42 | time: 0.9642334 43 | value: 0.4693985 44 | inSlope: 0.295302 45 | outSlope: 0.295302 46 | tangentMode: 0 47 | m_PreInfinity: 2 48 | m_PostInfinity: 2 49 | m_RotationOrder: 0 50 | green: 51 | serializedVersion: 2 52 | m_Curve: 53 | - serializedVersion: 2 54 | time: 0 55 | value: 0 56 | inSlope: 1 57 | outSlope: 1 58 | tangentMode: 0 59 | - serializedVersion: 2 60 | time: 0.6123395 61 | value: 0.6943774 62 | inSlope: 1.0001659 63 | outSlope: 1.0001659 64 | tangentMode: 0 65 | - serializedVersion: 2 66 | time: 1 67 | value: 1 68 | inSlope: 1 69 | outSlope: 1 70 | tangentMode: 0 71 | m_PreInfinity: 2 72 | m_PostInfinity: 2 73 | m_RotationOrder: 0 74 | blue: 75 | serializedVersion: 2 76 | m_Curve: 77 | - serializedVersion: 2 78 | time: 0 79 | value: 0 80 | inSlope: 1 81 | outSlope: 1 82 | tangentMode: 0 83 | - serializedVersion: 2 84 | time: 0.51642287 85 | value: 0.51642287 86 | inSlope: 0.03156554 87 | outSlope: 0.03156554 88 | tangentMode: 0 89 | - serializedVersion: 2 90 | time: 1 91 | value: 1 92 | inSlope: 1 93 | outSlope: 1 94 | tangentMode: 0 95 | m_PreInfinity: 2 96 | m_PostInfinity: 2 97 | m_RotationOrder: 0 98 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Filters/ToneCurve.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23789586c3a274c4f805cbd1686f5414 3 | timeCreated: 1501590355 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 11400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1ce7968ac55446e587616f49ece149d 3 | folderAsset: yes 4 | timeCreated: 1501588037 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Materials/Grayscale.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Grayscale 10 | m_Shader: {fileID: 4800000, guid: 6004356b62b7447f797d6fa761ec2801, type: 3} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 1, g: 1, b: 1, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Materials/Grayscale.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7705d6e86a28244519a9669dc75acd01 3 | timeCreated: 1501588045 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Materials/LevelControl.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: LevelControl 10 | m_Shader: {fileID: 4800000, guid: 94b5018f6ae6e4a188c9cab4fd0cf99c, type: 3} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _Blue: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _BumpMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailAlbedoMap: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailMask: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _DetailNormalMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _EmissionMap: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _Green: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _Level: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _MainTex: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | - _MetallicGlossMap: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | - _OcclusionMap: 62 | m_Texture: {fileID: 0} 63 | m_Scale: {x: 1, y: 1} 64 | m_Offset: {x: 0, y: 0} 65 | - _ParallaxMap: 66 | m_Texture: {fileID: 0} 67 | m_Scale: {x: 1, y: 1} 68 | m_Offset: {x: 0, y: 0} 69 | - _Red: 70 | m_Texture: {fileID: 0} 71 | m_Scale: {x: 1, y: 1} 72 | m_Offset: {x: 0, y: 0} 73 | m_Floats: 74 | - _BumpScale: 1 75 | - _Cutoff: 0.5 76 | - _DetailNormalMapScale: 1 77 | - _DstBlend: 0 78 | - _GlossMapScale: 1 79 | - _Glossiness: 0.5 80 | - _GlossyReflections: 1 81 | - _Metallic: 0 82 | - _Mode: 0 83 | - _OcclusionStrength: 1 84 | - _Parallax: 0.02 85 | - _SmoothnessTextureChannel: 0 86 | - _SpecularHighlights: 1 87 | - _SrcBlend: 1 88 | - _UVSec: 0 89 | - _ZWrite: 1 90 | m_Colors: 91 | - _Color: {r: 1, g: 1, b: 1, a: 1} 92 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 93 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Materials/LevelControl.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcc3cafe0b8fa4ad990817659b182861 3 | timeCreated: 1501590651 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Materials/ToneCurve.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: ToneCurve 10 | m_Shader: {fileID: 4800000, guid: 0f4d526935f794e1fbbfe8bb48bd22ae, type: 3} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _Blue: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _BumpMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailAlbedoMap: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailMask: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _DetailNormalMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _EmissionMap: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _Green: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _MainTex: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _MetallicGlossMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | - _OcclusionMap: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | - _ParallaxMap: 62 | m_Texture: {fileID: 0} 63 | m_Scale: {x: 1, y: 1} 64 | m_Offset: {x: 0, y: 0} 65 | - _Red: 66 | m_Texture: {fileID: 0} 67 | m_Scale: {x: 1, y: 1} 68 | m_Offset: {x: 0, y: 0} 69 | m_Floats: 70 | - _BumpScale: 1 71 | - _Cutoff: 0.5 72 | - _DetailNormalMapScale: 1 73 | - _DstBlend: 0 74 | - _GlossMapScale: 1 75 | - _Glossiness: 0.5 76 | - _GlossyReflections: 1 77 | - _Metallic: 0 78 | - _Mode: 0 79 | - _OcclusionStrength: 1 80 | - _Parallax: 0.02 81 | - _SmoothnessTextureChannel: 0 82 | - _SpecularHighlights: 1 83 | - _SrcBlend: 1 84 | - _UVSec: 0 85 | - _ZWrite: 1 86 | m_Colors: 87 | - _Color: {r: 1, g: 1, b: 1, a: 1} 88 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 89 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Materials/ToneCurve.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd0199c28dfb649dd881f2804a049fca 3 | timeCreated: 1501590651 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9dc8e5946ef41844d947ac5d13e203a8 3 | folderAsset: yes 4 | timeCreated: 1501576944 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scenes/Test.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 8 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1} 42 | --- !u!157 &3 43 | LightmapSettings: 44 | m_ObjectHideFlags: 0 45 | serializedVersion: 11 46 | m_GIWorkflowMode: 0 47 | m_GISettings: 48 | serializedVersion: 2 49 | m_BounceScale: 1 50 | m_IndirectOutputScale: 1 51 | m_AlbedoBoost: 1 52 | m_TemporalCoherenceThreshold: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 9 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_TextureWidth: 1024 61 | m_TextureHeight: 1024 62 | m_AO: 0 63 | m_AOMaxDistance: 1 64 | m_CompAOExponent: 1 65 | m_CompAOExponentDirect: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 0 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVRFiltering: 0 81 | m_PVRFilteringMode: 1 82 | m_PVRCulling: 1 83 | m_PVRFilteringGaussRadiusDirect: 1 84 | m_PVRFilteringGaussRadiusIndirect: 5 85 | m_PVRFilteringGaussRadiusAO: 2 86 | m_PVRFilteringAtrousColorSigma: 1 87 | m_PVRFilteringAtrousNormalSigma: 1 88 | m_PVRFilteringAtrousPositionSigma: 1 89 | m_LightingDataAsset: {fileID: 0} 90 | m_UseShadowmask: 1 91 | --- !u!196 &4 92 | NavMeshSettings: 93 | serializedVersion: 2 94 | m_ObjectHideFlags: 0 95 | m_BuildSettings: 96 | serializedVersion: 2 97 | agentTypeID: 0 98 | agentRadius: 0.5 99 | agentHeight: 2 100 | agentSlope: 45 101 | agentClimb: 0.4 102 | ledgeDropHeight: 0 103 | maxJumpAcrossDistance: 0 104 | minRegionArea: 2 105 | manualCellSize: 0 106 | cellSize: 0.16666667 107 | manualTileSize: 0 108 | tileSize: 256 109 | accuratePlacement: 0 110 | m_NavMeshData: {fileID: 0} 111 | --- !u!1 &1035260578 112 | GameObject: 113 | m_ObjectHideFlags: 0 114 | m_PrefabParentObject: {fileID: 0} 115 | m_PrefabInternal: {fileID: 0} 116 | serializedVersion: 5 117 | m_Component: 118 | - component: {fileID: 1035260579} 119 | - component: {fileID: 1035260580} 120 | m_Layer: 0 121 | m_Name: LUTGenerator 122 | m_TagString: Untagged 123 | m_Icon: {fileID: 0} 124 | m_NavMeshLayer: 0 125 | m_StaticEditorFlags: 0 126 | m_IsActive: 1 127 | --- !u!4 &1035260579 128 | Transform: 129 | m_ObjectHideFlags: 0 130 | m_PrefabParentObject: {fileID: 0} 131 | m_PrefabInternal: {fileID: 0} 132 | m_GameObject: {fileID: 1035260578} 133 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 134 | m_LocalPosition: {x: 0, y: 0, z: 0} 135 | m_LocalScale: {x: 1, y: 1, z: 1} 136 | m_Children: [] 137 | m_Father: {fileID: 0} 138 | m_RootOrder: 1 139 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 140 | --- !u!114 &1035260580 141 | MonoBehaviour: 142 | m_ObjectHideFlags: 0 143 | m_PrefabParentObject: {fileID: 0} 144 | m_PrefabInternal: {fileID: 0} 145 | m_GameObject: {fileID: 1035260578} 146 | m_Enabled: 1 147 | m_EditorHideFlags: 0 148 | m_Script: {fileID: 11500000, guid: f42b3f479329c3e4babe250887f5e9b5, type: 3} 149 | m_Name: 150 | m_EditorClassIdentifier: 151 | colorGrading: {fileID: 1673277997} 152 | filters: 153 | - {fileID: 11400000, guid: 23789586c3a274c4f805cbd1686f5414, type: 2} 154 | debug: 1 155 | lut0: {fileID: 0} 156 | lut1: {fileID: 0} 157 | --- !u!84 &1472314558 158 | RenderTexture: 159 | m_ObjectHideFlags: 0 160 | m_PrefabParentObject: {fileID: 0} 161 | m_PrefabInternal: {fileID: 0} 162 | m_Name: 163 | m_ImageContentsHash: 164 | serializedVersion: 2 165 | Hash: 00000000000000000000000000000000 166 | m_Width: 1024 167 | m_Height: 32 168 | m_AntiAliasing: 1 169 | m_DepthFormat: 0 170 | m_ColorFormat: 11 171 | m_MipMap: 0 172 | m_GenerateMips: 1 173 | m_SRGB: 0 174 | m_TextureSettings: 175 | serializedVersion: 2 176 | m_FilterMode: 0 177 | m_Aniso: 1 178 | m_MipBias: 0 179 | m_WrapU: 1 180 | m_WrapV: 1 181 | m_WrapW: 1 182 | m_Dimension: 2 183 | m_VolumeDepth: 1 184 | --- !u!1 &1673277996 185 | GameObject: 186 | m_ObjectHideFlags: 0 187 | m_PrefabParentObject: {fileID: 0} 188 | m_PrefabInternal: {fileID: 0} 189 | serializedVersion: 5 190 | m_Component: 191 | - component: {fileID: 1673278001} 192 | - component: {fileID: 1673278000} 193 | - component: {fileID: 1673277998} 194 | - component: {fileID: 1673277997} 195 | - component: {fileID: 1673277999} 196 | m_Layer: 0 197 | m_Name: Camera 198 | m_TagString: MainCamera 199 | m_Icon: {fileID: 0} 200 | m_NavMeshLayer: 0 201 | m_StaticEditorFlags: 0 202 | m_IsActive: 1 203 | --- !u!114 &1673277997 204 | MonoBehaviour: 205 | m_ObjectHideFlags: 0 206 | m_PrefabParentObject: {fileID: 0} 207 | m_PrefabInternal: {fileID: 0} 208 | m_GameObject: {fileID: 1673277996} 209 | m_Enabled: 1 210 | m_EditorHideFlags: 0 211 | m_Script: {fileID: 11500000, guid: 77ccfbf7f6b2a8b4e8db704225a22eeb, type: 3} 212 | m_Name: 213 | m_EditorClassIdentifier: 214 | lut: {fileID: 1472314558} 215 | shader: {fileID: 4800000, guid: d9e7ef505c887c54bb1aad5aad949654, type: 3} 216 | --- !u!114 &1673277998 217 | MonoBehaviour: 218 | m_ObjectHideFlags: 0 219 | m_PrefabParentObject: {fileID: 0} 220 | m_PrefabInternal: {fileID: 0} 221 | m_GameObject: {fileID: 1673277996} 222 | m_Enabled: 1 223 | m_EditorHideFlags: 0 224 | m_Script: {fileID: 11500000, guid: dc5aa6733565e4dcd9b990dc83d0884b, type: 3} 225 | m_Name: 226 | m_EditorClassIdentifier: 227 | shader: {fileID: 4800000, guid: 43ecf87a6791943c6ab3758d0c9b9c8b, type: 3} 228 | texture: {fileID: 2800000, guid: a18883f6911244c27864491af7b0eb95, type: 3} 229 | --- !u!92 &1673277999 230 | Behaviour: 231 | m_ObjectHideFlags: 0 232 | m_PrefabParentObject: {fileID: 0} 233 | m_PrefabInternal: {fileID: 0} 234 | m_GameObject: {fileID: 1673277996} 235 | m_Enabled: 1 236 | --- !u!20 &1673278000 237 | Camera: 238 | m_ObjectHideFlags: 0 239 | m_PrefabParentObject: {fileID: 0} 240 | m_PrefabInternal: {fileID: 0} 241 | m_GameObject: {fileID: 1673277996} 242 | m_Enabled: 1 243 | serializedVersion: 2 244 | m_ClearFlags: 1 245 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 246 | m_NormalizedViewPortRect: 247 | serializedVersion: 2 248 | x: 0 249 | y: 0 250 | width: 1 251 | height: 1 252 | near clip plane: 0.3 253 | far clip plane: 1000 254 | field of view: 60 255 | orthographic: 0 256 | orthographic size: 5 257 | m_Depth: -1 258 | m_CullingMask: 259 | serializedVersion: 2 260 | m_Bits: 4294967295 261 | m_RenderingPath: -1 262 | m_TargetTexture: {fileID: 0} 263 | m_TargetDisplay: 0 264 | m_TargetEye: 3 265 | m_HDR: 0 266 | m_AllowMSAA: 0 267 | m_ForceIntoRT: 0 268 | m_OcclusionCulling: 1 269 | m_StereoConvergence: 10 270 | m_StereoSeparation: 0.022 271 | m_StereoMirrorMode: 0 272 | --- !u!4 &1673278001 273 | Transform: 274 | m_ObjectHideFlags: 0 275 | m_PrefabParentObject: {fileID: 0} 276 | m_PrefabInternal: {fileID: 0} 277 | m_GameObject: {fileID: 1673277996} 278 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 279 | m_LocalPosition: {x: 0, y: 1, z: -10} 280 | m_LocalScale: {x: 1, y: 1, z: 1} 281 | m_Children: [] 282 | m_Father: {fileID: 0} 283 | m_RootOrder: 0 284 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 285 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scenes/Test.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ed6f44a5bc8e284194bae0840cfbb56 3 | timeCreated: 1501576936 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc59bc491213ad9448c8dd10d42ea200 3 | folderAsset: yes 4 | timeCreated: 1501576504 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76db49459a216b14d8eef572bd886096 3 | folderAsset: yes 4 | timeCreated: 1501577051 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Editor/Filters.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1725c74c96f394785a27b91e7b1831c7 3 | folderAsset: yes 4 | timeCreated: 1501591664 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Editor/Filters/LUTFilterEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace LUTColorGrading { 7 | 8 | [CustomEditor (typeof(LUTFilter), true)] 9 | public class LUTFilterEditor : Editor { 10 | 11 | public override void OnInspectorGUI () { 12 | EditorGUI.BeginChangeCheck(); 13 | base.OnInspectorGUI(); 14 | if(EditorGUI.EndChangeCheck() && Application.isPlaying) { 15 | var filter = target as LUTFilter; 16 | filter.onFilterUpdate.Invoke(filter); 17 | } 18 | } 19 | 20 | } 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Editor/Filters/LUTFilterEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 956bbf15af91c4f1188be05e49501eb3 3 | timeCreated: 1501591673 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Editor/LUTGeneratorEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | 4 | using UnityEngine; 5 | using UnityEditor; 6 | 7 | namespace LUTColorGrading 8 | { 9 | 10 | [CustomEditor (typeof(LUTGenerator))] 11 | public class LUTGeneratorEditor : Editor { 12 | 13 | public override void OnInspectorGUI () { 14 | EditorGUI.BeginChangeCheck(); 15 | base.OnInspectorGUI(); 16 | if(EditorGUI.EndChangeCheck() && Application.isPlaying) { 17 | var generator = target as LUTGenerator; 18 | generator.Reset(); 19 | } 20 | } 21 | 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Editor/LUTGeneratorEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9cf529d26a2bd474dba82d7a123ea2b5 3 | timeCreated: 1501577058 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Filters.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a81e66440eeb5461a9698ee554a7f9d4 3 | folderAsset: yes 4 | timeCreated: 1501590162 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Filters/CurveFilter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace LUTColorGrading { 6 | 7 | public class CurveFilter : LUTFilter { 8 | 9 | protected Texture2D CreateCurve(AnimationCurve curve, int resolution = 64) { 10 | var tex = new Texture2D(resolution, 1, TextureFormat.RGBAFloat, false); 11 | tex.filterMode = FilterMode.Bilinear; 12 | tex.wrapMode = TextureWrapMode.Clamp; 13 | 14 | for(int i = 0; i < resolution; i++) { 15 | var t = 1f * i / resolution; 16 | var v = curve.Evaluate(t); 17 | tex.SetPixel(i, 0, new Color(v, v, v)); 18 | } 19 | tex.Apply(); 20 | return tex; 21 | } 22 | 23 | } 24 | 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Filters/CurveFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afc9e63b0a67e4b909c93bc890c3f1bc 3 | timeCreated: 1501592626 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Filters/LUTFilter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Events; 5 | 6 | namespace LUTColorGrading { 7 | 8 | [System.Serializable] public class LUTEvent : UnityEvent {} 9 | 10 | [CreateAssetMenu (fileName = "Filter", menuName = "LUTFilter/Filter")] 11 | public class LUTFilter : ScriptableObject { 12 | 13 | public LUTEvent onFilterUpdate; 14 | [SerializeField] protected Material material; 15 | 16 | public virtual void Setup() {} 17 | 18 | public virtual void Filter (RenderTexture src, RenderTexture dst) { 19 | Graphics.Blit(src, dst, material); 20 | } 21 | 22 | public virtual void Dispose () {} 23 | 24 | } 25 | 26 | } 27 | 28 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Filters/LUTFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5653d07834996408ba3ad4bfdd6a945d 3 | timeCreated: 1501589779 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Filters/LevelControlFilter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace LUTColorGrading { 6 | 7 | [CreateAssetMenu (fileName = "LevelControlFilter", menuName = "LUTFilter/LevelControlFilter")] 8 | public class LevelControlFilter : CurveFilter { 9 | 10 | [SerializeField] AnimationCurve level; 11 | 12 | Texture2D levelCurve; 13 | 14 | public override void Setup() { 15 | base.Setup(); 16 | levelCurve = CreateCurve(level); 17 | material.SetTexture("_Level", levelCurve); 18 | } 19 | 20 | public override void Dispose () { 21 | Destroy(levelCurve); 22 | } 23 | 24 | 25 | } 26 | 27 | } 28 | 29 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Filters/LevelControlFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddfafb6ab9c4d4237a36cd0983cd163c 3 | timeCreated: 1501592558 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Filters/ToneCurveFilter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace LUTColorGrading { 6 | 7 | [CreateAssetMenu (fileName = "ToneCurveFilter", menuName = "LUTFilter/ToneCurveFilter")] 8 | public class ToneCurveFilter : CurveFilter { 9 | 10 | [SerializeField] AnimationCurve red; 11 | [SerializeField] AnimationCurve green; 12 | [SerializeField] AnimationCurve blue; 13 | 14 | Texture2D redCurve, greenCurve, blueCurve; 15 | 16 | public override void Setup() { 17 | base.Setup(); 18 | redCurve = CreateCurve(red); 19 | greenCurve = CreateCurve(green); 20 | blueCurve = CreateCurve(blue); 21 | material.SetTexture("_Red", redCurve); 22 | material.SetTexture("_Green", greenCurve); 23 | material.SetTexture("_Blue", blueCurve); 24 | } 25 | 26 | public override void Dispose () { 27 | Destroy(redCurve); 28 | Destroy(greenCurve); 29 | Destroy(blueCurve); 30 | } 31 | 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/Filters/ToneCurveFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dee67109cf247447f9673737665a1f9d 3 | timeCreated: 1501590255 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/LUTColorGrading.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace LUTColorGrading 6 | { 7 | 8 | public class LUTColorGrading : MonoBehaviour { 9 | 10 | public Texture lut; 11 | [SerializeField] Shader shader; 12 | 13 | Material material; 14 | 15 | private void OnRenderImage(RenderTexture source, RenderTexture destination) 16 | { 17 | if(material != null) 18 | { 19 | material.SetTexture("_LUT", lut); 20 | } 21 | Graphics.Blit(source, destination, material); 22 | } 23 | 24 | private void OnEnable() 25 | { 26 | material = new Material(shader); 27 | } 28 | 29 | private void OnDestroy() 30 | { 31 | if(material != null) 32 | { 33 | Destroy(material); 34 | } 35 | } 36 | 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/LUTColorGrading.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77ccfbf7f6b2a8b4e8db704225a22eeb 3 | timeCreated: 1501577507 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - lut: {instanceID: 0} 9 | - shader: {fileID: 4800000, guid: d9e7ef505c887c54bb1aad5aad949654, type: 3} 10 | executionOrder: 0 11 | icon: {instanceID: 0} 12 | userData: 13 | assetBundleName: 14 | assetBundleVariant: 15 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/LUTGenerator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace LUTColorGrading 6 | { 7 | 8 | public class LUTGenerator : MonoBehaviour { 9 | 10 | public RenderTexture source 11 | { 12 | get 13 | { 14 | return (current == 0) ? lut0 : lut1; 15 | } 16 | } 17 | 18 | public RenderTexture destination 19 | { 20 | get 21 | { 22 | return (current == 0) ? lut1 : lut0; 23 | } 24 | } 25 | 26 | [SerializeField] LUTColorGrading colorGrading; 27 | [SerializeField] List filters; 28 | [SerializeField] bool debug; 29 | 30 | Texture2D origin; 31 | [SerializeField] RenderTexture lut0, lut1; 32 | int current = 0; 33 | 34 | Texture2D CreateLUT (int resolution = 32) 35 | { 36 | var tex = new Texture2D(resolution * resolution, resolution, TextureFormat.RGBAFloat, false); 37 | tex.filterMode = FilterMode.Point; 38 | tex.wrapMode = TextureWrapMode.Clamp; 39 | tex.anisoLevel = 0; 40 | 41 | var inv = 1f / (resolution - 1); 42 | 43 | for (int z = 0; z < resolution; z++) 44 | { 45 | var offset = z * resolution; 46 | var b = z * inv; 47 | for (int y = 0; y < resolution; y++) 48 | { 49 | var g = 1f - y * inv; 50 | for (int x = 0; x < resolution; x++) 51 | { 52 | var r = x * inv; 53 | tex.SetPixel(offset + x, y, new Color(r, g, b)); 54 | } 55 | } 56 | } 57 | 58 | tex.Apply(); 59 | 60 | return tex; 61 | } 62 | 63 | RenderTexture CreateRT (int width, int height) { 64 | var rt = new RenderTexture(width, height, 0, RenderTextureFormat.ARGBFloat); 65 | rt.filterMode = FilterMode.Point; 66 | rt.enableRandomWrite = true; 67 | rt.useMipMap = false; 68 | rt.wrapMode = TextureWrapMode.Clamp; 69 | rt.anisoLevel = 0; 70 | rt.Create(); 71 | return rt; 72 | } 73 | 74 | void UpdateLUT() { 75 | current = 0; 76 | Graphics.Blit(origin, source); 77 | Graphics.Blit(origin, destination); 78 | filters.ForEach(filter => { 79 | if(filter != null) { 80 | filter.Filter(source, destination); 81 | Swap(); 82 | } 83 | }); 84 | colorGrading.lut = source; 85 | } 86 | 87 | void Swap () 88 | { 89 | current = (1 - current); 90 | } 91 | 92 | void OnEnable() 93 | { 94 | Setup(); 95 | filters.ForEach(filter => { 96 | if(filter != null) { 97 | filter.onFilterUpdate.RemoveListener(OnFilterUpdate); 98 | filter.onFilterUpdate.AddListener(OnFilterUpdate); 99 | } 100 | }); 101 | } 102 | 103 | void OnDisable () { 104 | if(origin != null) { 105 | Clear(); 106 | } 107 | } 108 | 109 | void OnFilterUpdate (LUTFilter filter) { 110 | Reset(); 111 | } 112 | 113 | public void Reset () { 114 | Clear(); 115 | Setup(); 116 | } 117 | 118 | void Setup () { 119 | origin = CreateLUT(); 120 | lut0 = CreateRT(origin.width, origin.height); 121 | lut1 = CreateRT(origin.width, origin.height); 122 | filters.ForEach(filter => { 123 | if(filter != null) { 124 | filter.Setup(); 125 | } 126 | }); 127 | UpdateLUT(); 128 | } 129 | 130 | void Clear () { 131 | Destroy(origin); 132 | Destroy(lut0); 133 | Destroy(lut1); 134 | filters.ForEach(filter => { 135 | if(filter != null) { 136 | filter.Dispose(); 137 | } 138 | }); 139 | } 140 | 141 | void OnGUI() 142 | { 143 | if(debug) { 144 | var r = new Rect(10, 10, source.width, source.height); 145 | GUI.DrawTexture(r, source); 146 | } 147 | } 148 | 149 | } 150 | 151 | } 152 | 153 | 154 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/LUTGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f42b3f479329c3e4babe250887f5e9b5 3 | timeCreated: 1501576519 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/OutputTexture.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace LUTColorGrading.Test { 6 | 7 | public class OutputTexture : MonoBehaviour { 8 | 9 | [SerializeField] Shader shader; 10 | [SerializeField] Texture2D texture; 11 | 12 | Material material; 13 | 14 | void OnRenderImage (RenderTexture src, RenderTexture dst) { 15 | CheckInit(); 16 | Graphics.Blit(src, dst, material); 17 | } 18 | 19 | void CheckInit () { 20 | if(material == null) { 21 | material = new Material(shader); 22 | material.SetTexture("_Texture", texture); 23 | } 24 | } 25 | 26 | void OnDestroy () { 27 | if(material != null) { 28 | material = new Material(shader); 29 | } 30 | } 31 | 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Scripts/OutputTexture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc5aa6733565e4dcd9b990dc83d0884b 3 | timeCreated: 1501588244 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a84c48329a3ad524989bc02f5b428392 3 | folderAsset: yes 4 | timeCreated: 1501576504 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/Filters.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05d4ae4f3f0a245259bcf3678db87015 3 | folderAsset: yes 4 | timeCreated: 1501588051 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/Filters/CurveFilter.cginc: -------------------------------------------------------------------------------- 1 | #ifndef __INCLUDE_CURVE_FILTER__ 2 | #define __INCLUDE_CURVE_FILTER__ 3 | 4 | float evaluate(sampler2D curve, float t) { 5 | return saturate(tex2D(curve, float2(t, 0.5)).r); 6 | } 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/Filters/CurveFilter.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f7c2fbcba5f445629189f886dd9f8f3 3 | timeCreated: 1501577704 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/Filters/Grayscale.shader: -------------------------------------------------------------------------------- 1 | Shader "LUT/Filters/Grayscale" 2 | { 3 | 4 | Properties 5 | { 6 | _MainTex ("Texture", 2D) = "white" {} 7 | } 8 | 9 | SubShader 10 | { 11 | Cull Off ZWrite Off ZTest Always 12 | 13 | Pass 14 | { 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | 19 | #include "UnityCG.cginc" 20 | 21 | struct appdata 22 | { 23 | float4 vertex : POSITION; 24 | float2 uv : TEXCOORD0; 25 | }; 26 | 27 | struct v2f 28 | { 29 | float2 uv : TEXCOORD0; 30 | float4 vertex : SV_POSITION; 31 | }; 32 | 33 | v2f vert (appdata v) 34 | { 35 | v2f o; 36 | o.vertex = UnityObjectToClipPos(v.vertex); 37 | o.uv = v.uv; 38 | return o; 39 | } 40 | 41 | sampler2D _MainTex; 42 | 43 | fixed4 frag (v2f i) : SV_Target 44 | { 45 | fixed4 col = tex2D(_MainTex, i.uv); 46 | float gray = dot(col.rgb, float3(0.299, 0.587, 0.114)); 47 | return fixed4(gray, gray, gray, col.a); 48 | } 49 | ENDCG 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/Filters/Grayscale.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6004356b62b7447f797d6fa761ec2801 3 | timeCreated: 1501588058 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/Filters/LevelControl.shader: -------------------------------------------------------------------------------- 1 | Shader "LUT/Filters/LevelControl" 2 | { 3 | 4 | Properties 5 | { 6 | _MainTex ("Texture", 2D) = "white" {} 7 | _Level ("Level", 2D) = "white" {} 8 | } 9 | 10 | SubShader 11 | { 12 | Cull Off ZWrite Off ZTest Always 13 | 14 | Pass 15 | { 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | 20 | #include "UnityCG.cginc" 21 | #include "./CurveFilter.cginc" 22 | 23 | struct appdata 24 | { 25 | float4 vertex : POSITION; 26 | float2 uv : TEXCOORD0; 27 | }; 28 | 29 | struct v2f 30 | { 31 | float2 uv : TEXCOORD0; 32 | float4 vertex : SV_POSITION; 33 | }; 34 | 35 | v2f vert (appdata v) 36 | { 37 | v2f o; 38 | o.vertex = UnityObjectToClipPos(v.vertex); 39 | o.uv = v.uv; 40 | return o; 41 | } 42 | 43 | sampler2D _MainTex, _Level; 44 | 45 | fixed4 frag (v2f i) : SV_Target 46 | { 47 | fixed4 col = tex2D(_MainTex, i.uv); 48 | col.r = evaluate(_Level, col.r); 49 | col.g = evaluate(_Level, col.g); 50 | col.b = evaluate(_Level, col.b); 51 | return col; 52 | } 53 | ENDCG 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/Filters/LevelControl.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94b5018f6ae6e4a188c9cab4fd0cf99c 3 | timeCreated: 1501588058 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/Filters/ToneCurve.shader: -------------------------------------------------------------------------------- 1 | Shader "LUT/Filters/ToneCurve" 2 | { 3 | 4 | Properties 5 | { 6 | _MainTex ("Texture", 2D) = "white" {} 7 | _Red ("Red", 2D) = "white" {} 8 | _Green ("Green", 2D) = "white" {} 9 | _Blue ("Blue", 2D) = "white" {} 10 | } 11 | 12 | SubShader 13 | { 14 | Cull Off ZWrite Off ZTest Always 15 | 16 | Pass 17 | { 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | 22 | #include "UnityCG.cginc" 23 | #include "./CurveFilter.cginc" 24 | 25 | struct appdata 26 | { 27 | float4 vertex : POSITION; 28 | float2 uv : TEXCOORD0; 29 | }; 30 | 31 | struct v2f 32 | { 33 | float2 uv : TEXCOORD0; 34 | float4 vertex : SV_POSITION; 35 | }; 36 | 37 | v2f vert (appdata v) 38 | { 39 | v2f o; 40 | o.vertex = UnityObjectToClipPos(v.vertex); 41 | o.uv = v.uv; 42 | return o; 43 | } 44 | 45 | sampler2D _MainTex, _Red, _Green, _Blue; 46 | 47 | fixed4 frag (v2f i) : SV_Target 48 | { 49 | fixed4 col = tex2D(_MainTex, i.uv); 50 | col.r = evaluate(_Red, col.r); 51 | col.g = evaluate(_Green, col.g); 52 | col.b = evaluate(_Blue, col.b); 53 | return col; 54 | } 55 | ENDCG 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/Filters/ToneCurve.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f4d526935f794e1fbbfe8bb48bd22ae 3 | timeCreated: 1501588058 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/LUT.cginc: -------------------------------------------------------------------------------- 1 | #ifndef __INCLUDE_LUT__ 2 | #define __INCLUDE_LUT__ 3 | 4 | #define DIM 32.0 5 | static const float4 _ColorGrading_Scale = float4((DIM - 1) / (DIM * DIM), (DIM - 1) / DIM, 1 / DIM, 0); 6 | static const float4 _ColorGrading_Offset = float4(1 / (2 * DIM * DIM), 1 / (2 * DIM), 0, 0); 7 | 8 | float3 ColorGrade(sampler2D lut, float3 c) { 9 | float2 uv = float2(c.x, 1 - c.y) * _ColorGrading_Scale.xy + _ColorGrading_Offset.xy; 10 | float z = c.z * (DIM - 1); 11 | float2 uvz = min(floor(float2(z, z + 1)), DIM - 1); 12 | float t = z - uvz.x; 13 | uvz *= _ColorGrading_Scale.z; 14 | float3 c0 = tex2D(lut, uv + float2(uvz.x, 0)).rgb; 15 | float3 c1 = tex2D(lut, uv + float2(uvz.y, 0)).rgb; 16 | return lerp(c0, c1, t); 17 | } 18 | 19 | float4 ColorGrade(sampler2D lut, float4 c) { 20 | return float4(ColorGrade(lut, c.rgb), c.a); 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/LUT.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18b3548f8645eb44db00dbaf1873fc33 3 | timeCreated: 1501577704 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/LUTColorGrading.shader: -------------------------------------------------------------------------------- 1 | Shader "ImageEffects/LUTColorGrading" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | _LUT ("Lookup Table", 2D) = "white" {} 7 | } 8 | 9 | SubShader 10 | { 11 | Cull Off ZWrite Off ZTest Always 12 | 13 | Pass 14 | { 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | 19 | #include "UnityCG.cginc" 20 | #include "./LUT.cginc" 21 | 22 | struct appdata 23 | { 24 | float4 vertex : POSITION; 25 | float2 uv : TEXCOORD0; 26 | }; 27 | 28 | struct v2f 29 | { 30 | float2 uv : TEXCOORD0; 31 | float4 vertex : SV_POSITION; 32 | }; 33 | 34 | v2f vert (appdata v) 35 | { 36 | v2f o; 37 | o.vertex = UnityObjectToClipPos(v.vertex); 38 | o.uv = v.uv; 39 | return o; 40 | } 41 | 42 | sampler2D _MainTex, _LUT; 43 | 44 | fixed4 frag (v2f i) : SV_Target 45 | { 46 | fixed4 col = tex2D(_MainTex, i.uv); 47 | col = ColorGrade(_LUT, col); 48 | return col; 49 | } 50 | 51 | ENDCG 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/LUTColorGrading.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9e7ef505c887c54bb1aad5aad949654 3 | timeCreated: 1501577461 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3ae1f8cc1db74b7999b6b1e91c9f7ac 3 | folderAsset: yes 4 | timeCreated: 1501588361 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/Test/Texture.shader: -------------------------------------------------------------------------------- 1 | Shader "ImageEffects/Texture" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Main", 2D) = "white" {} 6 | _Texture ("Texture", 2D) = "white" {} 7 | } 8 | SubShader 9 | { 10 | // No culling or depth 11 | Cull Off ZWrite Off ZTest Always 12 | 13 | Pass 14 | { 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | 19 | #include "UnityCG.cginc" 20 | 21 | struct appdata 22 | { 23 | float4 vertex : POSITION; 24 | float2 uv : TEXCOORD0; 25 | }; 26 | 27 | struct v2f 28 | { 29 | float2 uv : TEXCOORD0; 30 | float4 vertex : SV_POSITION; 31 | }; 32 | 33 | v2f vert (appdata v) 34 | { 35 | v2f o; 36 | o.vertex = UnityObjectToClipPos(v.vertex); 37 | o.uv = v.uv; 38 | return o; 39 | } 40 | 41 | sampler2D _MainTex; 42 | float4 _MainTex_TexelSize; 43 | 44 | sampler2D _Texture; 45 | float4 _Texture_TexelSize; 46 | 47 | fixed4 frag (v2f i) : SV_Target 48 | { 49 | float2 scale = _Texture_TexelSize.xy / _MainTex_TexelSize.xy; 50 | float2 uv = i.uv; 51 | fixed4 col = tex2D(_Texture, uv); 52 | return col; 53 | } 54 | ENDCG 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Shaders/Test/Texture.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43ecf87a6791943c6ab3758d0c9b9c8b 3 | timeCreated: 1501588372 4 | licenseType: Free 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 258d07badf66e504daf3d4a98cb3fc0f 3 | folderAsset: yes 4 | timeCreated: 1501577990 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Textures/shibuya.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattatz/unity-lut-generator/0794da5228e4ed68efe2572f09716cdf5362938a/Assets/LUTColorGrading/Textures/shibuya.jpg -------------------------------------------------------------------------------- /Assets/LUTColorGrading/Textures/shibuya.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a18883f6911244c27864491af7b0eb95 3 | timeCreated: 1501588610 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: -1 34 | aniso: -1 35 | mipBias: -1 36 | wrapU: -1 37 | wrapV: -1 38 | wrapW: -1 39 | nPOTScale: 1 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 0 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 1 50 | alphaIsTransparency: 0 51 | spriteTessellationDetail: -1 52 | textureType: 0 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 2048 60 | textureFormat: -1 61 | textureCompression: 1 62 | compressionQuality: 50 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | spriteSheet: 67 | serializedVersion: 2 68 | sprites: [] 69 | outline: [] 70 | physicsShape: [] 71 | spritePackingTag: 72 | userData: 73 | assetBundleName: 74 | assetBundleVariant: 75 | -------------------------------------------------------------------------------- /Captures/Sample1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattatz/unity-lut-generator/0794da5228e4ed68efe2572f09716cdf5362938a/Captures/Sample1.png -------------------------------------------------------------------------------- /Captures/Sample2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattatz/unity-lut-generator/0794da5228e4ed68efe2572f09716cdf5362938a/Captures/Sample2.png -------------------------------------------------------------------------------- /Captures/Sample3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattatz/unity-lut-generator/0794da5228e4ed68efe2572f09716cdf5362938a/Captures/Sample3.png -------------------------------------------------------------------------------- /Captures/Sample4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattatz/unity-lut-generator/0794da5228e4ed68efe2572f09716cdf5362938a/Captures/Sample4.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | unity-lut-generator 2 | ================= 3 | 4 | LookUpTable generator for Unity. 5 | 6 | ## Examples 7 | 8 | ![Sample1](https://raw.githubusercontent.com/mattatz/unity-lut-generator/master/Captures/Sample1.png) 9 | ![Sample2](https://raw.githubusercontent.com/mattatz/unity-lut-generator/master/Captures/Sample2.png) 10 | ![Sample3](https://raw.githubusercontent.com/mattatz/unity-lut-generator/master/Captures/Sample3.png) 11 | 12 | ## Sources 13 | 14 | - nobnak/ColorCorrection - https://github.com/nobnak/ColorCorrection 15 | 16 | --------------------------------------------------------------------------------