mirror of
https://github.com/FriendshipIsEpic/FiE-Game.git
synced 2024-11-28 08:07:59 +01:00
Added Colorful FX library.
This commit is contained in:
parent
bba5df547d
commit
f484a7576f
600 changed files with 22105 additions and 0 deletions
201
Assets/Colorful FX/Changelog.txt
Normal file
201
Assets/Colorful FX/Changelog.txt
Normal file
|
@ -0,0 +1,201 @@
|
|||
4.1.1
|
||||
- Added: "Vertical Scanlines" options to "Analog TV".
|
||||
- Fixed: "Frost" not working correctly on iPhone 6/6S.
|
||||
- Fixed: "Glitch" not working correctly on iPhone 6/6S.
|
||||
|
||||
4.1
|
||||
- Added: A highly customizable "Comic Book" effect. Works great with untextured or low-poly scenes !
|
||||
- Added: "Letterbox", to add letter or pillarboxing to the render. Very handy for cinematics, can be animated as well.
|
||||
- Added: "TV Vignette", a new ultra fast vignette with a more natural shape. Less customizable than the other vignette effects but looks great.
|
||||
- Added: "Contrast Gain", a smart contrast adjustment effect. More limited than "S-Curve Contrast" but faster.
|
||||
- Added: "Smart Saturation", a port of the "Sat vs Sat" operator from Davinci Resolve, where you control the saturation using a curve to saturate according to the current saturation.
|
||||
- Added: "Luminance Contribution" to the "Noise" effect to reduce noise visibility in luminous areas.
|
||||
- Added: "Amount" sliders to "Gaussian Blur" and "Bilateral Gaussian Blur".
|
||||
- Modified: "Lookup Texture 3D", "Vintage (Fast)" and "LoFi Palette" now work on mobile platforms ! If you used any of them, please see the "Upgrade Guide" in the user manual. As a result, the slower "Lookup Filter" and "Vintage" effects have been deprecated.
|
||||
- Fixed: "Noise" not working correctly on some mobile devices.
|
||||
- Fixed: Small loss of detail with the "Hue, Saturation, Value" when HDR is enabled.
|
||||
- Fixed: Compilation error on DirectX 9 for some of the blur shaders.
|
||||
- Fixed: "Photo Filter" was broken.
|
||||
- Misc: More editor UI optimizations & tweaks.
|
||||
- Misc: Optimized the "Noise" effect ("RGB" mode).
|
||||
|
||||
4.0.1
|
||||
- Fixed: Performance issue with "Lookup Filter (3D)", "Vintage (Fast)" and "LoFi Palette".
|
||||
|
||||
4.0
|
||||
- Important: This major update breaks compatibility with previous versions. Please refer to the documentation if you need to update from an earlier version.
|
||||
- Modified: Complete code refactoring, cleanup, fixes & tweaks. Makes use of new Unity 5 features when available. Some effects have been optimized as well.
|
||||
- Modified: Re-organized the "Component -> Colorful" menu.
|
||||
- Modified: Rewrote the "Halftone" effect from scratch. It looks way, way better now.
|
||||
- Modified: Rewrote the "Levels" effect from scratch.
|
||||
- Modified: The "Kuwahara" radius limit has been bumped to 6.
|
||||
- Added: Tooltips (almost) everywhere.
|
||||
- Added: Unity 5.1+ users, you can click the top-right help button on Colorful components at any time to jump to the documentation.
|
||||
- Added: "LoFi Palette" effect, with 31 presets to give a retro look to your game.
|
||||
- Added: "Shadows, Midtones, Highlights" effect (lift/gamma/gain or ASC CDL), also known as the ultimate color correction tool.
|
||||
- Added: "Dynamic Lookup", a fast and powerful color corrector using a RGB cube.
|
||||
- Added: "Gradient Ramp (Dynamic)", an alternative to "Gradient Ramp" using the builtin gradient editor instead of a texture ramp.
|
||||
- Added: High quality "Gaussian Blur" effect.
|
||||
- Added: Edge aware, "Bilateral Gaussian Blur" effect.
|
||||
- Added: "Grainy Blur", where blur meets noise.
|
||||
- Added: "Lens Distortion Blur", an alternative to "Radial Blur" with barrel distortion.
|
||||
- Added: "Directional Blur" effect.
|
||||
- Added: "Wave Distortion" effect.
|
||||
- Added: "Lookup Filter 3D", faster LUT color grading for Shader Model 3.0+ compatible hardware.
|
||||
- Added: "Vintage (Fast)", variant of the "Vintage" effect for Shader Model 3.0+ compatible hardware.
|
||||
- Added: "Pixel Matrix" effect.
|
||||
- Added: "Noise" (monochrome or colored) to add some fine grain to your renders.
|
||||
- Added: "S-Curve Contrast", a powerful color correction operator.
|
||||
- Added: "Dithering", a fast ordered dithering effect.
|
||||
- Added: "Stroke", an artistic effect to turn your renders into brush strokes.
|
||||
- Added: "Histogram", a debug graph with Luminance, RGB, Red, Green and Blue view modes.
|
||||
- Added: "Vignette" option for "Radial Blur" so you can progressively blur toward the edges of the screen.
|
||||
- Added: An alternative algorithm for the "Sharpen" filter.
|
||||
- Added: "Wiggle" has been improved. You can now set the Amplitude and it also comes with a slightly slower but better looking mode (optional).
|
||||
- Added: A "Shape" slider on the "LED" filter to adjust the LEDs look.
|
||||
- Added: "Fast Vignette" now comes with a color mode.
|
||||
- Added: "Amount" slider for the "Posterize" effect.
|
||||
- Fixed: "Analog TV" and "Frost" not working correctly on some iOS devices.
|
||||
- Fixed: "Negative" now works as expected in Linear color space.
|
||||
- Fixed: Compilation error on PS4.
|
||||
- Misc: Brand new, faster and more complete documentation, as well as a dedicated website !
|
||||
|
||||
3.2
|
||||
- Added: "IsActive" public property to the "Glitch" effect to detect when it's on or off.
|
||||
- Misc: Better handling of shader includes.
|
||||
- Misc: Made the components easier to extend / inherit.
|
||||
- Fixed: Fixed a small "leak" in the "Vintage" effect. No more GC allocations on every frame.
|
||||
- Fixed: Compilation issue when upgrading to Unity 5.1 from an earlier Unity version (UnityEditor API change).
|
||||
|
||||
3.1
|
||||
- Added: "Hue Focus" to only display the colors in a given hue range and show the rest as black & white. Works great when used before a "Brightness / Contrast / Gamma" effect to give a sort of Sin City look, where only a few colors are visible and the rest is high-contrast black & white.
|
||||
- Added: 3 Instagram filters to the "Vintage" effect : Lark, Juno, Reyes.
|
||||
- Added: A "Random Activation" option to the "Glitch" effect with customizable time ranges.
|
||||
|
||||
3.0.1
|
||||
- Fixed: The "Halftone" effect not using the correct aspect ratio for the dots.
|
||||
- Fixed: Color-space error in the editor.
|
||||
- Fixed: Issue with the startup dialog.
|
||||
|
||||
3.0
|
||||
- Added: "Kuwahara", to give an oil painting look or simply soften the scene render.
|
||||
- Added: "Glitch". Comes with three glitching modes (interference, tearing, complete).
|
||||
- Added: "Technicolor", to mimic the classic coloring process from the early days of motion pictures.
|
||||
- Added: "Channel Clamper", to clamp each color channel independently to a minimum and maximum value.
|
||||
- Added: "Channel Swapper", to combine or swap color channels.
|
||||
- Added: "White Balance", to remove unrealistic color cast and shift the neutral tone of the render.
|
||||
- Added: A "Custom" quality mode to "Radial Blur". You can now put a custom sample count if you don't like the default presets.
|
||||
- Fixed: Better internal file path control. You should now be able to move the Colorful folder safely.
|
||||
- Misc: General UI fixes & usability tweaks.
|
||||
- Misc: Documentation fixes & additions (+ videos for animated effects).
|
||||
- Misc: Removed the documentation from the package, it's now online only. Benefits : the package size is a lot smaller and imports faster.
|
||||
- Misc: Bumped the minimum Unity version to 4.5.
|
||||
|
||||
2.2.3
|
||||
- Fixed: "Analog TV" failing on some platforms.
|
||||
- Fixed: A bug introduced in 2.2.1 with "Lookup Filter" and "Vintage" when working in Linear color space.
|
||||
|
||||
2.2.2
|
||||
- Fixed: Bug with "Led" and "Pixelate" in Unity 5.
|
||||
- Misc: Unity 5 package.
|
||||
|
||||
2.2.1
|
||||
- Added: An "Amount" slider to "Lookup Filter" and "Vintage" to allow blending on the effects.
|
||||
|
||||
2.2
|
||||
- Added: 5 Instagram filters to the "Vintage" effect : Aden, Crema, Ludwig, Perpetua, Slumber.
|
||||
|
||||
2.1.1
|
||||
- Added: A "Scanlines Offset" option to the "Analog TV" effect to scroll the scanlines upwards/downwards.
|
||||
|
||||
2.1
|
||||
- Added: "Vintage" comes with 19 fast Instagram filters : 1977, Amaro, Brannan, Earlybird, Hefe, Hudson, Inkwell, Kelvin, LoFi, Mayfair, Nashville, Rise, Sierra, Sutro, Toaster, Valencia, Walden, Willow, X-Pro II.
|
||||
|
||||
2.0.2
|
||||
- Fixed: Bug with "Lookup Filter" in linear mode.
|
||||
|
||||
2.0.1
|
||||
- Fixed: HDR bug with the "Lookup Filter".
|
||||
- Modified: The "Lookup Filter" documentation has been updated. Make sure the "Aniso Level" on your LUTs is set to 0.
|
||||
|
||||
2.0
|
||||
- Added: A new quickstart launcher when you import or update Colorful.
|
||||
- Added: "About Colorful" and "Colorful Manual" in the Help menu.
|
||||
- Added: "Contrast Vignette". The old "Fast Vignette" plays on darkness and saturation, this new one focuses on darkness and contrast enhancement which results in a more photographic look.
|
||||
- Added: A "Center" property to "Fast Vignette" to change the center point.
|
||||
- Added: "Hue / Saturation / Value" now comes with an optional advanced mode. This mode is a bit slower but way more powerful as you can now work separately on reds, yellows, greens, cyans, blues and magentas (like Photoshop).
|
||||
- Added: "Vibrance" now comes with an optional advanced mode which uses a different algorithm and let you tweak how channels (RGB) are affected.
|
||||
- Modified: The "Levels" editor has been rewritten from scratch. It's now more efficient and comes with a new "Auto B&W" feature (see the doc). Its public API hasn't changed so it should be compatible with the old one.
|
||||
- Modified: Bumped the minimum Unity version to 4.3. If for some reason you need a version compatible with Unity 3.5, please contact me.
|
||||
- Misc: Massive optimizations to the "Hue / Saturation / Value" shader.
|
||||
- Misc: Global cleanup pass and minor optimizations on all editor classes and shaders.
|
||||
- Misc: Lots of UI fixes & usability tweaks.
|
||||
- Misc: A few documentation fixes & additions.
|
||||
|
||||
1.7.1
|
||||
- Added: "Auto Timer" & "Auto Phase" options to "Wiggle" and "Analog TV".
|
||||
- Added: Icons for the components to make them easier to spot.
|
||||
- Fixed: The LUT texture used with "Lookup Filter" now bypasses sRGB sampling so it works correctly with the Linear color space.
|
||||
- Misc: A few documentation fixes & additions.
|
||||
|
||||
1.7
|
||||
- Added: "Halftone" (CMYK and Black & White).
|
||||
- Added: "Cross Stitch".
|
||||
- Fixed: Serialization bug affecting all effects' custom inspectors.
|
||||
|
||||
1.6.1
|
||||
- Added: Optional pixel perfect mode to the "Pixelate" and "LED" effects.
|
||||
- Added: A ratio settings (can be set to automatic) to the "Pixelate" and "LED" effects to change the cell shape.
|
||||
- Added: Optional noise pass on the Threshold effect.
|
||||
- Added: HeatRamp.png in the resources folder (can be used to emulate a thermal vision with the Gradient Ramp effect).
|
||||
- Misc: Documentation update.
|
||||
|
||||
1.6
|
||||
- Added: "Convolution Matrix 3x3".
|
||||
- Added: "Blend" (works with Texture2D and MovieTexture), featuring 21 blending modes : Darken, Multiply, Color Burn, Linear Burn, Darker Color, Lighten, Screen, Color Dodge, Linear Dodge (Add), Lighter Color, Overlay, Soft Light, Hard Light, Vivid Light, Linear Light, Pin Light, Hard Mix, Difference, Exclusion, Subtract, Divide.
|
||||
- Added: New option to desaturate the "Fast Vignette".
|
||||
- Misc: Refactoring, improvements and optimizations of the following effects : Analog TV, Fast Vignette, Frost, Grayscale, Radial Blur.
|
||||
|
||||
1.5
|
||||
- Added: "Gradient Ramp".
|
||||
- Added: "Lookup Filter" (advanced color grading).
|
||||
- Added: "Negative" (with proper transition).
|
||||
- Added: "Wiggle" (underwater distortion).
|
||||
- Fixed: Unity 4.3 compatibility.
|
||||
- Misc: General code cleaning, a few minor fixes and various optimizations.
|
||||
- Misc: Full documentation.
|
||||
|
||||
1.4.1
|
||||
- Fixed: A weird bug with "RGB Split" only working in Directx 11 mode in some setups.
|
||||
|
||||
1.4
|
||||
- Added: "RGB Split".
|
||||
- Added: "Sharpen".
|
||||
|
||||
1.3.4
|
||||
- Fixed: Bug with Unity 4.1 preventing most shaders to work correctly.
|
||||
|
||||
1.3.2
|
||||
- Added: A new slider to fade the "Double vision" effect.
|
||||
- Fixed: Brightness bug in "Double vision".
|
||||
- Fixed: A null pointer exception in "Levels" that could happen in the Editor.
|
||||
|
||||
1.3.1
|
||||
- Misc: Performance improvements.
|
||||
- Misc: Code cleaning.
|
||||
|
||||
1.3
|
||||
- Fixed: Now compatible with Unity 4 and DirectX 11.
|
||||
- Fixed: Lots of small bugs.
|
||||
|
||||
1.2
|
||||
- Added: "Analog TV", emulates a CRT screen with scanlines, static noise and barrel distortion !
|
||||
- Added: "Double Vision".
|
||||
- Added: "Frost", that looks like viewing through an ice-frosted glass (can be used as a vignette too, to "freeze" the screen progressively).
|
||||
|
||||
1.1
|
||||
- Modified: "Photo Filter" now takes a Color as input instead of three floats.
|
||||
- Added: "Radial Blur", also known as "Zoom" Blur.
|
||||
|
||||
1.0
|
||||
- Misc: Initial release.
|
6
Assets/Colorful FX/Changelog.txt.meta
Normal file
6
Assets/Colorful FX/Changelog.txt.meta
Normal file
|
@ -0,0 +1,6 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9705500cced88874d82a6a2f1df3ac97
|
||||
TextScriptImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Colorful FX/Editor.meta
Normal file
9
Assets/Colorful FX/Editor.meta
Normal file
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6ee6c3831e534a64583a1ac0ce6d2f68
|
||||
folderAsset: yes
|
||||
timeCreated: 1466165647
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
71
Assets/Colorful FX/Editor/BaseEffectEditor.cs
Normal file
71
Assets/Colorful FX/Editor/BaseEffectEditor.cs
Normal file
|
@ -0,0 +1,71 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class BaseEffectEditor : Editor
|
||||
{
|
||||
public static GUIStyle tabLeft;
|
||||
public static GUIStyle tabMiddle;
|
||||
public static GUIStyle tabRight;
|
||||
public static GUIStyle tabLeftOn;
|
||||
public static GUIStyle tabMiddleOn;
|
||||
public static GUIStyle tabRightOn;
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (tabLeft == null)
|
||||
{
|
||||
tabLeft = new GUIStyle(EditorStyles.miniButtonLeft);
|
||||
tabMiddle = new GUIStyle(EditorStyles.miniButtonMid);
|
||||
tabRight = new GUIStyle(EditorStyles.miniButtonRight);
|
||||
|
||||
tabLeftOn = new GUIStyle(tabLeft);
|
||||
tabLeftOn.active = tabLeft.onActive;
|
||||
tabLeftOn.normal = tabLeft.onNormal;
|
||||
tabLeftOn.hover = tabLeft.onHover;
|
||||
|
||||
tabMiddleOn = new GUIStyle(tabMiddle);
|
||||
tabMiddleOn.active = tabMiddle.onActive;
|
||||
tabMiddleOn.normal = tabMiddle.onNormal;
|
||||
tabMiddleOn.hover = tabMiddle.onHover;
|
||||
|
||||
tabRightOn = new GUIStyle(tabRight);
|
||||
tabRightOn.active = tabRight.onActive;
|
||||
tabRightOn.normal = tabRight.onNormal;
|
||||
tabRightOn.hover = tabRight.onHover;
|
||||
}
|
||||
}
|
||||
|
||||
static Dictionary<string, GUIContent> m_GUIContentCache;
|
||||
|
||||
protected static GUIContent GetContent(string textAndTooltip)
|
||||
{
|
||||
if (string.IsNullOrEmpty(textAndTooltip))
|
||||
return GUIContent.none;
|
||||
|
||||
if (m_GUIContentCache == null)
|
||||
m_GUIContentCache = new Dictionary<string, GUIContent>();
|
||||
|
||||
GUIContent content = null;
|
||||
|
||||
if (!m_GUIContentCache.TryGetValue(textAndTooltip, out content))
|
||||
{
|
||||
string[] s = textAndTooltip.Split('|');
|
||||
content = new GUIContent(s[0]);
|
||||
|
||||
if (s.Length > 1 && !string.IsNullOrEmpty(s[1]))
|
||||
content.tooltip = s[1];
|
||||
|
||||
m_GUIContentCache.Add(textAndTooltip, content);
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/BaseEffectEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/BaseEffectEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 51af486729aacac4a9de2f9e05dc5bb2
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
9
Assets/Colorful FX/Editor/Effects.meta
Normal file
9
Assets/Colorful FX/Editor/Effects.meta
Normal file
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c1428167942535d44b60d64340ec3e3b
|
||||
folderAsset: yes
|
||||
timeCreated: 1466165647
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
76
Assets/Colorful FX/Editor/Effects/AnalogTVEditor.cs
Normal file
76
Assets/Colorful FX/Editor/Effects/AnalogTVEditor.cs
Normal file
|
@ -0,0 +1,76 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(AnalogTV))]
|
||||
public class AnalogTVEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_AutomaticPhase;
|
||||
SerializedProperty p_Phase;
|
||||
SerializedProperty p_ConvertToGrayscale;
|
||||
SerializedProperty p_NoiseIntensity;
|
||||
SerializedProperty p_ScanlinesIntensity;
|
||||
SerializedProperty p_ScanlinesCount;
|
||||
SerializedProperty p_ScanlinesOffset;
|
||||
SerializedProperty p_VerticalScanlines;
|
||||
SerializedProperty p_Distortion;
|
||||
SerializedProperty p_CubicDistortion;
|
||||
SerializedProperty p_Scale;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_AutomaticPhase = serializedObject.FindProperty("AutomaticPhase");
|
||||
p_Phase = serializedObject.FindProperty("Phase");
|
||||
p_ConvertToGrayscale = serializedObject.FindProperty("ConvertToGrayscale");
|
||||
p_NoiseIntensity = serializedObject.FindProperty("NoiseIntensity");
|
||||
p_ScanlinesIntensity = serializedObject.FindProperty("ScanlinesIntensity");
|
||||
p_ScanlinesCount = serializedObject.FindProperty("ScanlinesCount");
|
||||
p_ScanlinesOffset = serializedObject.FindProperty("ScanlinesOffset");
|
||||
p_VerticalScanlines = serializedObject.FindProperty("VerticalScanlines");
|
||||
p_Distortion = serializedObject.FindProperty("Distortion");
|
||||
p_CubicDistortion = serializedObject.FindProperty("CubicDistortion");
|
||||
p_Scale = serializedObject.FindProperty("Scale");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_AutomaticPhase);
|
||||
EditorGUI.BeginDisabledGroup(p_AutomaticPhase.boolValue);
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_Phase);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUILayout.PropertyField(p_ConvertToGrayscale);
|
||||
|
||||
GUILayout.Label(GetContent("Analog Effect"), EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_NoiseIntensity);
|
||||
EditorGUILayout.PropertyField(p_ScanlinesIntensity);
|
||||
EditorGUILayout.PropertyField(p_ScanlinesCount);
|
||||
EditorGUILayout.PropertyField(p_ScanlinesOffset);
|
||||
EditorGUILayout.PropertyField(p_VerticalScanlines);
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
GUILayout.Label(GetContent("Barrel Distortion"), EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_Distortion);
|
||||
EditorGUILayout.PropertyField(p_CubicDistortion);
|
||||
EditorGUILayout.PropertyField(p_Scale, GetContent("Scale (Zoom)"));
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/AnalogTVEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/AnalogTVEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b50bbf63bbe2da2469b67479b47bf989
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,35 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(BilateralGaussianBlur))]
|
||||
public class BilateralGaussianBlurEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Passes;
|
||||
SerializedProperty p_Threshold;
|
||||
SerializedProperty p_Amount;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Passes = serializedObject.FindProperty("Passes");
|
||||
p_Threshold = serializedObject.FindProperty("Threshold");
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Passes);
|
||||
EditorGUILayout.PropertyField(p_Threshold);
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 66e81a5c475bf3c439b5a67027bc36fb
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
29
Assets/Colorful FX/Editor/Effects/BleachBypassEditor.cs
Normal file
29
Assets/Colorful FX/Editor/Effects/BleachBypassEditor.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(BleachBypass))]
|
||||
public class BleachBypassEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Amount;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/BleachBypassEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/BleachBypassEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f4576dc4584db1b4f9f1d80bdae148f6
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
63
Assets/Colorful FX/Editor/Effects/BlendEditor.cs
Normal file
63
Assets/Colorful FX/Editor/Effects/BlendEditor.cs
Normal file
|
@ -0,0 +1,63 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Blend))]
|
||||
public class BlendEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Amount;
|
||||
SerializedProperty p_Texture;
|
||||
SerializedProperty p_Mode;
|
||||
|
||||
static GUIContent[] modes = {
|
||||
new GUIContent("Darken"),
|
||||
new GUIContent("Multiply"),
|
||||
new GUIContent("Color Burn"),
|
||||
new GUIContent("Linear Burn"),
|
||||
new GUIContent("Darker Color"),
|
||||
new GUIContent(""),
|
||||
new GUIContent("Lighten"),
|
||||
new GUIContent("Screen"),
|
||||
new GUIContent("Color Dodge"),
|
||||
new GUIContent("Linear Dodge (Add)"),
|
||||
new GUIContent("Lighter Color"),
|
||||
new GUIContent(""),
|
||||
new GUIContent("Overlay"),
|
||||
new GUIContent("Soft Light"),
|
||||
new GUIContent("Hard Light"),
|
||||
new GUIContent("Vivid Light"),
|
||||
new GUIContent("Linear Light"),
|
||||
new GUIContent("Pin Light"),
|
||||
new GUIContent("Hard Mix"),
|
||||
new GUIContent(""),
|
||||
new GUIContent("Difference"),
|
||||
new GUIContent("Exclusion"),
|
||||
new GUIContent("Subtract"),
|
||||
new GUIContent("Divide")
|
||||
};
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
p_Texture = serializedObject.FindProperty("Texture");
|
||||
p_Mode = serializedObject.FindProperty("Mode");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
// Using intValue, enumValueIndex seems broken in some versions of Unity
|
||||
p_Mode.intValue = EditorGUILayout.Popup(GetContent("Mode|Blending Mode."), p_Mode.intValue, modes);
|
||||
EditorGUILayout.PropertyField(p_Texture);
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/BlendEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/BlendEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1e832d91494c75e458f49538da81924c
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,48 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(BrightnessContrastGamma))]
|
||||
public class BrightnessContrastGammaEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Brightness;
|
||||
SerializedProperty p_Contrast;
|
||||
SerializedProperty p_ContrastCoeff;
|
||||
SerializedProperty p_Gamma;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Brightness = serializedObject.FindProperty("Brightness");
|
||||
p_Contrast = serializedObject.FindProperty("Contrast");
|
||||
p_ContrastCoeff = serializedObject.FindProperty("ContrastCoeff");
|
||||
p_Gamma = serializedObject.FindProperty("Gamma");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Brightness);
|
||||
|
||||
EditorGUILayout.PropertyField(p_Contrast);
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
Vector3 coeff = p_ContrastCoeff.vector3Value;
|
||||
coeff.x = EditorGUILayout.Slider(GetContent("Red Channel|Contrast factor on the red channel."), coeff.x, 0f, 1f);
|
||||
coeff.y = EditorGUILayout.Slider(GetContent("Green Channel|Contrast factor on the green channel."), coeff.y, 0f, 1f);
|
||||
coeff.z = EditorGUILayout.Slider(GetContent("Blue Channel|Contrast factor on the blue channel."), coeff.z, 0f, 1f);
|
||||
p_ContrastCoeff.vector3Value = coeff;
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.PropertyField(p_Gamma);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7d54a49fbdf254545a0f584279ba005b
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
69
Assets/Colorful FX/Editor/Effects/ChannelClamperEditor.cs
Normal file
69
Assets/Colorful FX/Editor/Effects/ChannelClamperEditor.cs
Normal file
|
@ -0,0 +1,69 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(ChannelClamper))]
|
||||
public class ChannelClamperEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Red;
|
||||
SerializedProperty p_Green;
|
||||
SerializedProperty p_Blue;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Red = serializedObject.FindProperty("Red");
|
||||
p_Green = serializedObject.FindProperty("Green");
|
||||
p_Blue = serializedObject.FindProperty("Blue");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
Vector2 red = p_Red.vector2Value;
|
||||
Vector2 green = p_Green.vector2Value;
|
||||
Vector2 blue = p_Blue.vector2Value;
|
||||
|
||||
EditorGUILayout.MinMaxSlider(GetContent("Red Channel|Red channel limits."), ref red.x, ref red.y, 0f, 1f);
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
EditorGUILayout.PrefixLabel(" ");
|
||||
red.x = EditorGUILayout.FloatField(red.x, GUILayout.Width(60));
|
||||
GUILayout.FlexibleSpace();
|
||||
red.y = EditorGUILayout.FloatField(red.y, GUILayout.Width(60));
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.MinMaxSlider(GetContent("Green Channel|Green channel limits."), ref green.x, ref green.y, 0f, 1f);
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
EditorGUILayout.PrefixLabel(" ");
|
||||
green.x = EditorGUILayout.FloatField(green.x, GUILayout.Width(60));
|
||||
GUILayout.FlexibleSpace();
|
||||
green.y = EditorGUILayout.FloatField(green.y, GUILayout.Width(60));
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.MinMaxSlider(GetContent("Blue Channel|Blue channel limits."), ref blue.x, ref blue.y, 0f, 1f);
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
EditorGUILayout.PrefixLabel(" ");
|
||||
blue.x = EditorGUILayout.FloatField(blue.x, GUILayout.Width(60));
|
||||
GUILayout.FlexibleSpace();
|
||||
blue.y = EditorGUILayout.FloatField(blue.y, GUILayout.Width(60));
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
p_Red.vector2Value = red;
|
||||
p_Green.vector2Value = green;
|
||||
p_Blue.vector2Value = blue;
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dff6c3f440b091d42bc9c207fa8ca094
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
68
Assets/Colorful FX/Editor/Effects/ChannelMixerEditor.cs
Normal file
68
Assets/Colorful FX/Editor/Effects/ChannelMixerEditor.cs
Normal file
|
@ -0,0 +1,68 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(ChannelMixer))]
|
||||
public class ChannelMixerEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Red;
|
||||
SerializedProperty p_Green;
|
||||
SerializedProperty p_Blue;
|
||||
SerializedProperty p_Constant;
|
||||
|
||||
SerializedProperty p_CurrentChannel;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Red = serializedObject.FindProperty("Red");
|
||||
p_Green = serializedObject.FindProperty("Green");
|
||||
p_Blue = serializedObject.FindProperty("Blue");
|
||||
p_Constant = serializedObject.FindProperty("Constant");
|
||||
|
||||
p_CurrentChannel = serializedObject.FindProperty("e_CurrentChannel");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
int currentChannel = p_CurrentChannel.intValue;
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
if (GUILayout.Button(GetContent("Red"), (currentChannel == 0) ? tabLeftOn : tabLeft)) currentChannel = 0;
|
||||
if (GUILayout.Button(GetContent("Green"), (currentChannel == 1) ? tabMiddleOn : tabMiddle)) currentChannel = 1;
|
||||
if (GUILayout.Button(GetContent("Blue"), (currentChannel == 2) ? tabRightOn : tabRight)) currentChannel = 2;
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
Vector3 constant = p_Constant.vector3Value;
|
||||
|
||||
if (currentChannel == 0) ChannelUI(p_Red, ref constant.x);
|
||||
if (currentChannel == 1) ChannelUI(p_Green, ref constant.y);
|
||||
if (currentChannel == 2) ChannelUI(p_Blue, ref constant.z);
|
||||
|
||||
p_Constant.vector3Value = constant;
|
||||
p_CurrentChannel.intValue = currentChannel;
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
void ChannelUI(SerializedProperty channel, ref float constant)
|
||||
{
|
||||
Vector3 c = channel.vector3Value;
|
||||
c.x = EditorGUILayout.Slider(GetContent("% Red"), c.x, -200f, 200f);
|
||||
c.y = EditorGUILayout.Slider(GetContent("% Green"), c.y, -200f, 200f);
|
||||
c.z = EditorGUILayout.Slider(GetContent("% Blue"), c.z, -200f, 200f);
|
||||
constant = EditorGUILayout.Slider(GetContent("Constant"), constant, -200f, 200f);
|
||||
channel.vector3Value = c;
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/ChannelMixerEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/ChannelMixerEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5d45a191de515ea40bace7c61083bf36
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
35
Assets/Colorful FX/Editor/Effects/ChannelSwapperEditor.cs
Normal file
35
Assets/Colorful FX/Editor/Effects/ChannelSwapperEditor.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(ChannelSwapper))]
|
||||
public class ChannelSwapperEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_RedSource;
|
||||
SerializedProperty p_GreenSource;
|
||||
SerializedProperty p_BlueSource;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_RedSource = serializedObject.FindProperty("RedSource");
|
||||
p_GreenSource = serializedObject.FindProperty("GreenSource");
|
||||
p_BlueSource = serializedObject.FindProperty("BlueSource");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_RedSource);
|
||||
EditorGUILayout.PropertyField(p_GreenSource);
|
||||
EditorGUILayout.PropertyField(p_BlueSource);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 58395e03ec9542e40ba5b4dc7c6e84c0
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,38 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(ChromaticAberration))]
|
||||
public class ChromaticAberrationEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_RedRefraction;
|
||||
SerializedProperty p_GreenRefraction;
|
||||
SerializedProperty p_BlueRefraction;
|
||||
SerializedProperty p_PreserveAlpha;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_RedRefraction = serializedObject.FindProperty("RedRefraction");
|
||||
p_GreenRefraction = serializedObject.FindProperty("GreenRefraction");
|
||||
p_BlueRefraction = serializedObject.FindProperty("BlueRefraction");
|
||||
p_PreserveAlpha = serializedObject.FindProperty("PreserveAlpha");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_RedRefraction);
|
||||
EditorGUILayout.PropertyField(p_GreenRefraction);
|
||||
EditorGUILayout.PropertyField(p_BlueRefraction);
|
||||
EditorGUILayout.PropertyField(p_PreserveAlpha);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eec1e784f0174b44c891fdbfdb665931
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
87
Assets/Colorful FX/Editor/Effects/ComicBookEditor.cs
Normal file
87
Assets/Colorful FX/Editor/Effects/ComicBookEditor.cs
Normal file
|
@ -0,0 +1,87 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(ComicBook))]
|
||||
public class ComicBookEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_StripAngle;
|
||||
SerializedProperty p_StripDensity;
|
||||
SerializedProperty p_StripThickness;
|
||||
SerializedProperty p_StripLimits;
|
||||
SerializedProperty p_StripInnerColor;
|
||||
SerializedProperty p_StripOuterColor;
|
||||
|
||||
SerializedProperty p_FillColor;
|
||||
SerializedProperty p_BackgroundColor;
|
||||
|
||||
SerializedProperty p_EdgeDetection;
|
||||
SerializedProperty p_EdgeThreshold;
|
||||
SerializedProperty p_EdgeColor;
|
||||
|
||||
SerializedProperty p_Amount;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_StripAngle = serializedObject.FindProperty("StripAngle");
|
||||
p_StripDensity = serializedObject.FindProperty("StripDensity");
|
||||
p_StripThickness = serializedObject.FindProperty("StripThickness");
|
||||
p_StripLimits = serializedObject.FindProperty("StripLimits");
|
||||
p_StripInnerColor = serializedObject.FindProperty("StripInnerColor");
|
||||
p_StripOuterColor = serializedObject.FindProperty("StripOuterColor");
|
||||
|
||||
p_FillColor = serializedObject.FindProperty("FillColor");
|
||||
p_BackgroundColor = serializedObject.FindProperty("BackgroundColor");
|
||||
|
||||
p_EdgeDetection = serializedObject.FindProperty("EdgeDetection");
|
||||
p_EdgeThreshold = serializedObject.FindProperty("EdgeThreshold");
|
||||
p_EdgeColor = serializedObject.FindProperty("EdgeColor");
|
||||
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_FillColor);
|
||||
EditorGUILayout.PropertyField(p_BackgroundColor);
|
||||
|
||||
GUILayout.Label(GetContent("Strips"), EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_StripAngle, GetContent("Angle"));
|
||||
EditorGUILayout.PropertyField(p_StripDensity, GetContent("Density"));
|
||||
EditorGUILayout.PropertyField(p_StripThickness, GetContent("Thickness"));
|
||||
Vector2 l = p_StripLimits.vector2Value;
|
||||
EditorGUILayout.MinMaxSlider(GetContent("Limits|Luminance limits used to draw the strips. Pixel under the lower bound will be filled with the Fill Color."), ref l.x, ref l.y, 0f, 1.01f);
|
||||
p_StripLimits.vector2Value = l;
|
||||
EditorGUILayout.PropertyField(p_StripInnerColor, GetContent("Inner Color"));
|
||||
EditorGUILayout.PropertyField(p_StripOuterColor, GetContent("Outer Color"));
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
GUILayout.Label(GetContent("Edge Detection"), EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_EdgeDetection, GetContent("Toggle"));
|
||||
|
||||
if (p_EdgeDetection.boolValue)
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_EdgeThreshold, GetContent("Threshold"));
|
||||
EditorGUILayout.PropertyField(p_EdgeColor, GetContent("Color"));
|
||||
}
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/ComicBookEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/ComicBookEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d80d3ec9bf3002140a9db6278b1b0175
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
29
Assets/Colorful FX/Editor/Effects/ContrastGainEditor.cs
Normal file
29
Assets/Colorful FX/Editor/Effects/ContrastGainEditor.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(ContrastGain))]
|
||||
public class ContrastGainEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Gain;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Gain = serializedObject.FindProperty("Gain");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Gain);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/ContrastGainEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/ContrastGainEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5a6292e27063f6140b390ea247988848
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
58
Assets/Colorful FX/Editor/Effects/ContrastVignetteEditor.cs
Normal file
58
Assets/Colorful FX/Editor/Effects/ContrastVignetteEditor.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(ContrastVignette))]
|
||||
public class ContrastVignetteEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Center;
|
||||
SerializedProperty p_Sharpness;
|
||||
SerializedProperty p_Darkness;
|
||||
SerializedProperty p_Contrast;
|
||||
SerializedProperty p_ContrastCoeff;
|
||||
SerializedProperty p_EdgeBlending;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Center = serializedObject.FindProperty("Center");
|
||||
p_Sharpness = serializedObject.FindProperty("Sharpness");
|
||||
p_Darkness = serializedObject.FindProperty("Darkness");
|
||||
p_Contrast = serializedObject.FindProperty("Contrast");
|
||||
p_ContrastCoeff = serializedObject.FindProperty("ContrastCoeff");
|
||||
p_EdgeBlending = serializedObject.FindProperty("EdgeBlending");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Center);
|
||||
EditorGUILayout.PropertyField(p_Sharpness);
|
||||
EditorGUILayout.PropertyField(p_Darkness);
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Contrast);
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
Vector3 coeff = p_ContrastCoeff.vector3Value;
|
||||
coeff.x = EditorGUILayout.Slider(GetContent("Red Channel|Contrast factor on the red channel."), coeff.x, 0f, 1f);
|
||||
coeff.y = EditorGUILayout.Slider(GetContent("Green Channel|Contrast factor on the green channel."), coeff.y, 0f, 1f);
|
||||
coeff.z = EditorGUILayout.Slider(GetContent("Blue Channel|Contrast factor on the blue channel."), coeff.z, 0f, 1f);
|
||||
p_ContrastCoeff.vector3Value = coeff;
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
EditorGUILayout.PropertyField(p_EdgeBlending);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d01a95f6eb43e5442bd35d505c95e4eb
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
103
Assets/Colorful FX/Editor/Effects/Convolution3x3Editor.cs
Normal file
103
Assets/Colorful FX/Editor/Effects/Convolution3x3Editor.cs
Normal file
|
@ -0,0 +1,103 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Convolution3x3))]
|
||||
public class Convolution3x3Editor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Divisor;
|
||||
SerializedProperty p_KernelTop;
|
||||
SerializedProperty p_KernelMiddle;
|
||||
SerializedProperty p_KernelBottom;
|
||||
SerializedProperty p_Amount;
|
||||
|
||||
int selectedPreset = 0;
|
||||
static GUIContent[] presets = {
|
||||
new GUIContent("Default"),
|
||||
new GUIContent("Sharpen"),
|
||||
new GUIContent("Emboss"),
|
||||
new GUIContent("Gaussian Blur"),
|
||||
new GUIContent("Laplacian Edge Detection"),
|
||||
new GUIContent("Prewitt Edge Detection"),
|
||||
new GUIContent("Frei-Chen Edge Detection")
|
||||
};
|
||||
static Vector3[,] presetsData = { { new Vector3(0f, 0f, 0f), new Vector3(0f, 1f, 0f), new Vector3(0f, 0f, 0f) },
|
||||
{ new Vector3(0f, -1f, 0f), new Vector3(-1f, 5f, -1f), new Vector3(0f, -1f, 0f) },
|
||||
{ new Vector3(-2f, -1f, 0f), new Vector3(-1f, 1f, 1f), new Vector3(0f, 1f, 2f) },
|
||||
{ new Vector3(1f, 2f, 1f), new Vector3(2f, 4f, 2f), new Vector3(1f, 2f, 1f) },
|
||||
{ new Vector3(0f, -1f, 0f), new Vector3(-1f, 4f, -1f), new Vector3(0f, -1f, 0f) },
|
||||
{ new Vector3(0f, 1f, 1f), new Vector3(-1f, 0f, 1f), new Vector3(-1f, -1f, 0f) },
|
||||
{ new Vector3(-1f, -1.4142f, -1f), new Vector3(0f, 0f, 0f), new Vector3(1f, 1.4142f, 1f) } };
|
||||
static float[] presetsDiv = { 1f, 1f, 1f, 16f, 1f, 1f, 1f };
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Divisor = serializedObject.FindProperty("Divisor");
|
||||
p_KernelTop = serializedObject.FindProperty("KernelTop");
|
||||
p_KernelMiddle = serializedObject.FindProperty("KernelMiddle");
|
||||
p_KernelBottom = serializedObject.FindProperty("KernelBottom");
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Divisor);
|
||||
p_Divisor.floatValue = Mathf.Max(1e-5f, p_Divisor.floatValue);
|
||||
|
||||
Vector3 temp = p_KernelTop.vector3Value;
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
EditorGUILayout.PrefixLabel(GetContent("Kernel|The kernel matrix."));
|
||||
temp.x = EditorGUILayout.FloatField(temp.x);
|
||||
temp.y = EditorGUILayout.FloatField(temp.y);
|
||||
temp.z = EditorGUILayout.FloatField(temp.z);
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
p_KernelTop.vector3Value = temp;
|
||||
|
||||
temp = p_KernelMiddle.vector3Value;
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
EditorGUILayout.PrefixLabel(" ");
|
||||
temp.x = EditorGUILayout.FloatField(temp.x);
|
||||
temp.y = EditorGUILayout.FloatField(temp.y);
|
||||
temp.z = EditorGUILayout.FloatField(temp.z);
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
p_KernelMiddle.vector3Value = temp;
|
||||
|
||||
temp = p_KernelBottom.vector3Value;
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
EditorGUILayout.PrefixLabel(" ");
|
||||
temp.x = EditorGUILayout.FloatField(temp.x);
|
||||
temp.y = EditorGUILayout.FloatField(temp.y);
|
||||
temp.z = EditorGUILayout.FloatField(temp.z);
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
p_KernelBottom.vector3Value = temp;
|
||||
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
selectedPreset = EditorGUILayout.Popup(GetContent("Preset"), selectedPreset, presets);
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
p_KernelTop.vector3Value = presetsData[selectedPreset, 0];
|
||||
p_KernelMiddle.vector3Value = presetsData[selectedPreset, 1];
|
||||
p_KernelBottom.vector3Value = presetsData[selectedPreset, 2];
|
||||
p_Divisor.floatValue = presetsDiv[selectedPreset];
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d3bc843f4e64761439439cd8247a8d37
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
38
Assets/Colorful FX/Editor/Effects/CrossStitchEditor.cs
Normal file
38
Assets/Colorful FX/Editor/Effects/CrossStitchEditor.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(CrossStitch))]
|
||||
public class CrossStitchEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Size;
|
||||
SerializedProperty p_Brightness;
|
||||
SerializedProperty p_Invert;
|
||||
SerializedProperty p_Pixelize;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Size = serializedObject.FindProperty("Size");
|
||||
p_Brightness = serializedObject.FindProperty("Brightness");
|
||||
p_Invert = serializedObject.FindProperty("Invert");
|
||||
p_Pixelize = serializedObject.FindProperty("Pixelize");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Size);
|
||||
EditorGUILayout.PropertyField(p_Brightness);
|
||||
EditorGUILayout.PropertyField(p_Invert);
|
||||
EditorGUILayout.PropertyField(p_Pixelize);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/CrossStitchEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/CrossStitchEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f0b83e28ce69a184eb48e2606a945593
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
41
Assets/Colorful FX/Editor/Effects/DirectionalBlurEditor.cs
Normal file
41
Assets/Colorful FX/Editor/Effects/DirectionalBlurEditor.cs
Normal file
|
@ -0,0 +1,41 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(DirectionalBlur))]
|
||||
public class DirectionalBlurEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Quality;
|
||||
SerializedProperty p_Samples;
|
||||
SerializedProperty p_Strength;
|
||||
SerializedProperty p_Angle;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Quality = serializedObject.FindProperty("Quality");
|
||||
p_Samples = serializedObject.FindProperty("Samples");
|
||||
p_Strength = serializedObject.FindProperty("Strength");
|
||||
p_Angle = serializedObject.FindProperty("Angle");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Quality);
|
||||
|
||||
if (p_Quality.intValue == (int)DirectionalBlur.QualityPreset.Custom)
|
||||
EditorGUILayout.PropertyField(p_Samples);
|
||||
|
||||
EditorGUILayout.PropertyField(p_Strength);
|
||||
EditorGUILayout.PropertyField(p_Angle);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d96b81a86df7fc64ea61a25c473a2d93
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
53
Assets/Colorful FX/Editor/Effects/DitheringEditor.cs
Normal file
53
Assets/Colorful FX/Editor/Effects/DitheringEditor.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Dithering))]
|
||||
public class DitheringEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_ShowOriginal;
|
||||
SerializedProperty p_ConvertToGrayscale;
|
||||
SerializedProperty p_RedLuminance;
|
||||
SerializedProperty p_GreenLuminance;
|
||||
SerializedProperty p_BlueLuminance;
|
||||
SerializedProperty p_Amount;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_ShowOriginal = serializedObject.FindProperty("ShowOriginal");
|
||||
p_ConvertToGrayscale = serializedObject.FindProperty("ConvertToGrayscale");
|
||||
p_RedLuminance = serializedObject.FindProperty("RedLuminance");
|
||||
p_GreenLuminance = serializedObject.FindProperty("GreenLuminance");
|
||||
p_BlueLuminance = serializedObject.FindProperty("BlueLuminance");
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_ShowOriginal);
|
||||
EditorGUILayout.PropertyField(p_ConvertToGrayscale);
|
||||
|
||||
if (p_ConvertToGrayscale.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_RedLuminance, GetContent("Red"));
|
||||
EditorGUILayout.PropertyField(p_GreenLuminance, GetContent("Green"));
|
||||
EditorGUILayout.PropertyField(p_BlueLuminance, GetContent("Blue"));
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/DitheringEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/DitheringEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 43490eb5f605e514584169a9fcd414c8
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
32
Assets/Colorful FX/Editor/Effects/DoubleVisionEditor.cs
Normal file
32
Assets/Colorful FX/Editor/Effects/DoubleVisionEditor.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(DoubleVision))]
|
||||
public class DoubleVisionEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Displace;
|
||||
SerializedProperty p_Amount;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Displace = serializedObject.FindProperty("Displace");
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Displace);
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/DoubleVisionEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/DoubleVisionEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6ea8f17d16dc36b41b065f4aa0c4dcaf
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
227
Assets/Colorful FX/Editor/Effects/DynamicLookupEditor.cs
Normal file
227
Assets/Colorful FX/Editor/Effects/DynamicLookupEditor.cs
Normal file
|
@ -0,0 +1,227 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(DynamicLookup))]
|
||||
public class DynamicLookupEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Amount;
|
||||
SerializedProperty p_White;
|
||||
SerializedProperty p_Black;
|
||||
SerializedProperty p_Red;
|
||||
SerializedProperty p_Green;
|
||||
SerializedProperty p_Blue;
|
||||
SerializedProperty p_Yellow;
|
||||
SerializedProperty p_Magenta;
|
||||
SerializedProperty p_Cyan;
|
||||
|
||||
static Material m_GraphMaterial;
|
||||
static Texture2D m_CursorActive;
|
||||
static Texture2D m_CursorInactive;
|
||||
|
||||
SerializedProperty[] m_Colors;
|
||||
SerializedProperty m_SelectedColor;
|
||||
Rect[] m_ClickRectsWhite;
|
||||
Rect[] m_ClickRectsBlack;
|
||||
float m_InspectorWidth = 1f;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
p_White = serializedObject.FindProperty("White");
|
||||
p_Black = serializedObject.FindProperty("Black");
|
||||
p_Red = serializedObject.FindProperty("Red");
|
||||
p_Green = serializedObject.FindProperty("Green");
|
||||
p_Blue = serializedObject.FindProperty("Blue");
|
||||
p_Yellow = serializedObject.FindProperty("Yellow");
|
||||
p_Magenta = serializedObject.FindProperty("Magenta");
|
||||
p_Cyan = serializedObject.FindProperty("Cyan");
|
||||
|
||||
m_Colors = new SerializedProperty[] { p_White, p_Red, p_Magenta, p_Blue, p_Cyan, p_Green, p_Yellow };
|
||||
m_ClickRectsWhite = new Rect[7];
|
||||
m_ClickRectsBlack = new Rect[7];
|
||||
}
|
||||
|
||||
void CheckResources()
|
||||
{
|
||||
if (m_GraphMaterial == null)
|
||||
{
|
||||
m_GraphMaterial = new Material(Shader.Find("Hidden/Colorful/Editor/_DynamicLookup"));
|
||||
m_GraphMaterial.hideFlags = HideFlags.HideAndDontSave;
|
||||
}
|
||||
|
||||
if (m_CursorActive == null)
|
||||
m_CursorActive = Resources.Load<Texture2D>("UI/ColorCubeCursorActive");
|
||||
|
||||
if (m_CursorInactive == null)
|
||||
m_CursorInactive = Resources.Load<Texture2D>("UI/ColorCubeCursorInactive");
|
||||
}
|
||||
|
||||
void DrawIsometricCube(Rect r, SerializedProperty centerColor, bool seeThrough)
|
||||
{
|
||||
CheckResources();
|
||||
m_Colors[0] = centerColor;
|
||||
m_GraphMaterial.SetPass(0);
|
||||
|
||||
// Events
|
||||
Event e = Event.current;
|
||||
Rect[] clickRects = seeThrough ? m_ClickRectsBlack : m_ClickRectsWhite;
|
||||
|
||||
if (e.type == EventType.MouseDown)
|
||||
{
|
||||
Vector2 pos = e.mousePosition;
|
||||
|
||||
for (int i = 0; i < m_ClickRectsWhite.Length; i++)
|
||||
{
|
||||
if (clickRects[i].Contains(pos))
|
||||
{
|
||||
m_SelectedColor = m_Colors[i];
|
||||
e.Use();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Points
|
||||
float size = Mathf.Min(r.height, r.width) - 30f;
|
||||
float size_2 = size / 2f;
|
||||
float size_4 = size / 4f;
|
||||
float centerW = r.x + r.width / 2f;
|
||||
float centerH = r.y + r.height / 2f + 5f;
|
||||
|
||||
Vector3[] points = {
|
||||
new Vector3(centerW, centerH), // White / Black
|
||||
new Vector3(centerW, centerH - size_2), // Red
|
||||
new Vector3(centerW + size_2, centerH - size_4), // Magenta
|
||||
new Vector3(centerW + size_2, centerH + size_4), // Blue
|
||||
new Vector3(centerW, centerH + size_2), // Cyan
|
||||
new Vector3(centerW - size_2, centerH + size_4), // Green
|
||||
new Vector3(centerW - size_2, centerH - size_4), // Yellow
|
||||
};
|
||||
|
||||
// Fill
|
||||
GL.PushMatrix();
|
||||
{
|
||||
GL.Begin(GL.TRIANGLES);
|
||||
{
|
||||
// Top right
|
||||
GL.Color(centerColor.colorValue); GL.Vertex(points[0]);
|
||||
GL.Color(p_Red.colorValue); GL.Vertex(points[1]);
|
||||
GL.Color(p_Magenta.colorValue); GL.Vertex(points[2]);
|
||||
|
||||
// Right
|
||||
GL.Color(centerColor.colorValue); GL.Vertex(points[0]);
|
||||
GL.Color(p_Magenta.colorValue); GL.Vertex(points[2]);
|
||||
GL.Color(p_Blue.colorValue); GL.Vertex(points[3]);
|
||||
|
||||
// Bottom right
|
||||
GL.Color(centerColor.colorValue); GL.Vertex(points[0]);
|
||||
GL.Color(p_Blue.colorValue); GL.Vertex(points[3]);
|
||||
GL.Color(p_Cyan.colorValue); GL.Vertex(points[4]);
|
||||
|
||||
// Bottom left
|
||||
GL.Color(centerColor.colorValue); GL.Vertex(points[0]);
|
||||
GL.Color(p_Cyan.colorValue); GL.Vertex(points[4]);
|
||||
GL.Color(p_Green.colorValue); GL.Vertex(points[5]);
|
||||
|
||||
// Left
|
||||
GL.Color(centerColor.colorValue); GL.Vertex(points[0]);
|
||||
GL.Color(p_Green.colorValue); GL.Vertex(points[5]);
|
||||
GL.Color(p_Yellow.colorValue); GL.Vertex(points[6]);
|
||||
|
||||
// Top left
|
||||
GL.Color(centerColor.colorValue); GL.Vertex(points[0]);
|
||||
GL.Color(p_Yellow.colorValue); GL.Vertex(points[6]);
|
||||
GL.Color(p_Red.colorValue); GL.Vertex(points[1]);
|
||||
}
|
||||
GL.End();
|
||||
}
|
||||
GL.PopMatrix();
|
||||
|
||||
// Inlines
|
||||
if (!seeThrough)
|
||||
{
|
||||
Handles.DrawAAPolyLine(1f, new Vector3[] { points[0], points[2] });
|
||||
Handles.DrawAAPolyLine(1f, new Vector3[] { points[0], points[4] });
|
||||
Handles.DrawAAPolyLine(1f, new Vector3[] { points[0], points[6] });
|
||||
}
|
||||
else
|
||||
{
|
||||
Handles.DrawAAPolyLine(1f, new Vector3[] { points[0], points[1] });
|
||||
Handles.DrawAAPolyLine(1f, new Vector3[] { points[0], points[3] });
|
||||
Handles.DrawAAPolyLine(1f, new Vector3[] { points[0], points[5] });
|
||||
}
|
||||
|
||||
// Outlines
|
||||
Handles.color = new Color(1f, 1f, 1f, 2f);
|
||||
Handles.DrawAAPolyLine(4f, new Vector3[] {
|
||||
points[1], points[2], points[3], points[4],
|
||||
points[5], points[6], points[1]
|
||||
});
|
||||
|
||||
// Cursors
|
||||
for (int i = 0; i < points.Length; i++)
|
||||
{
|
||||
Rect cursorRect = new Rect(points[i].x - 8f, points[i].y - 8f, 16f, 16f);
|
||||
Texture2D cursor = m_CursorInactive;
|
||||
|
||||
if (m_SelectedColor == m_Colors[i])
|
||||
cursor = m_CursorActive;
|
||||
|
||||
GUI.DrawTexture(cursorRect, cursor);
|
||||
cursorRect = new Rect(cursorRect.x - 6f, cursorRect.y - 6f, cursorRect.width + 12f, cursorRect.height + 12f);
|
||||
|
||||
if (e.type == EventType.Repaint)
|
||||
{
|
||||
if (seeThrough)
|
||||
m_ClickRectsBlack[i] = cursorRect;
|
||||
else
|
||||
m_ClickRectsWhite[i] = cursorRect;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ComputeInspectorWidth()
|
||||
{
|
||||
// Dirty trick to get the inspector width, works with scrollbars too
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
float w = GUILayoutUtility.GetLastRect().width;
|
||||
|
||||
if (Event.current.type == EventType.Repaint)
|
||||
m_InspectorWidth = w;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
ComputeInspectorWidth();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
float h = Mathf.Min(m_InspectorWidth / 2f, 216f);
|
||||
|
||||
DrawIsometricCube(GUILayoutUtility.GetRect(50f, h), p_White, false);
|
||||
DrawIsometricCube(GUILayoutUtility.GetRect(50f, h), p_Black, true);
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
if (m_SelectedColor != null)
|
||||
EditorGUILayout.PropertyField(m_SelectedColor);
|
||||
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a18b5e6e202496840a9d0e1e138a7fd8
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
45
Assets/Colorful FX/Editor/Effects/FastVignetteEditor.cs
Normal file
45
Assets/Colorful FX/Editor/Effects/FastVignetteEditor.cs
Normal file
|
@ -0,0 +1,45 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using ColorMode = FastVignette.ColorMode;
|
||||
|
||||
[CustomEditor(typeof(FastVignette))]
|
||||
public class FastVignetteEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Mode;
|
||||
SerializedProperty p_Color;
|
||||
SerializedProperty p_Center;
|
||||
SerializedProperty p_Sharpness;
|
||||
SerializedProperty p_Darkness;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Mode = serializedObject.FindProperty("Mode");
|
||||
p_Color = serializedObject.FindProperty("Color");
|
||||
p_Center = serializedObject.FindProperty("Center");
|
||||
p_Sharpness = serializedObject.FindProperty("Sharpness");
|
||||
p_Darkness = serializedObject.FindProperty("Darkness");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Mode);
|
||||
|
||||
if (p_Mode.intValue == (int)ColorMode.Colored)
|
||||
EditorGUILayout.PropertyField(p_Color);
|
||||
|
||||
EditorGUILayout.PropertyField(p_Center);
|
||||
EditorGUILayout.PropertyField(p_Sharpness);
|
||||
EditorGUILayout.PropertyField(p_Darkness);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/FastVignetteEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/FastVignetteEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3be4d3353f6c1c44d9a88d51e4782b5b
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
44
Assets/Colorful FX/Editor/Effects/FrostEditor.cs
Normal file
44
Assets/Colorful FX/Editor/Effects/FrostEditor.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Frost))]
|
||||
public class FrostEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Scale;
|
||||
SerializedProperty p_Sharpness;
|
||||
SerializedProperty p_Darkness;
|
||||
SerializedProperty p_EnableVignette;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Scale = serializedObject.FindProperty("Scale");
|
||||
p_Sharpness = serializedObject.FindProperty("Sharpness");
|
||||
p_Darkness = serializedObject.FindProperty("Darkness");
|
||||
p_EnableVignette = serializedObject.FindProperty("EnableVignette");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Scale);
|
||||
EditorGUILayout.PropertyField(p_EnableVignette, new GUIContent("Vignette"));
|
||||
|
||||
if (p_EnableVignette.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(p_Sharpness);
|
||||
EditorGUILayout.PropertyField(p_Darkness);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/FrostEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/FrostEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4b789574aca839f4fb0bfcce638621ce
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
35
Assets/Colorful FX/Editor/Effects/GaussianBlurEditor.cs
Normal file
35
Assets/Colorful FX/Editor/Effects/GaussianBlurEditor.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(GaussianBlur))]
|
||||
public class GaussianBlurEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Passes;
|
||||
SerializedProperty p_Downscaling;
|
||||
SerializedProperty p_Amount;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Passes = serializedObject.FindProperty("Passes");
|
||||
p_Downscaling = serializedObject.FindProperty("Downscaling");
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Passes);
|
||||
EditorGUILayout.PropertyField(p_Downscaling);
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/GaussianBlurEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/GaussianBlurEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fcb034686274b6b45a17bf5fac223ad2
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
142
Assets/Colorful FX/Editor/Effects/GlitchEditor.cs
Normal file
142
Assets/Colorful FX/Editor/Effects/GlitchEditor.cs
Normal file
|
@ -0,0 +1,142 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Glitch))]
|
||||
public class GlitchEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_RandomActivation;
|
||||
SerializedProperty p_RandomEvery;
|
||||
SerializedProperty p_RandomDuration;
|
||||
|
||||
SerializedProperty p_Mode;
|
||||
SerializedProperty p_InterferencesSettings;
|
||||
SerializedProperty p_TearingSettings;
|
||||
|
||||
SerializedProperty p_InterferencesSpeed;
|
||||
SerializedProperty p_InterferencesDensity;
|
||||
SerializedProperty p_InterferencesMaxDisplacement;
|
||||
|
||||
SerializedProperty p_TearingSpeed;
|
||||
SerializedProperty p_TearingIntensity;
|
||||
SerializedProperty p_TearingMaxDisplacement;
|
||||
SerializedProperty p_TearingAllowFlipping;
|
||||
SerializedProperty p_TearingYuvColorBleeding;
|
||||
SerializedProperty p_TearingYuvOffset;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_RandomActivation = serializedObject.FindProperty("RandomActivation");
|
||||
p_RandomEvery = serializedObject.FindProperty("RandomEvery");
|
||||
p_RandomDuration = serializedObject.FindProperty("RandomDuration");
|
||||
|
||||
p_Mode = serializedObject.FindProperty("Mode");
|
||||
p_InterferencesSettings = serializedObject.FindProperty("SettingsInterferences");
|
||||
p_TearingSettings = serializedObject.FindProperty("SettingsTearing");
|
||||
|
||||
p_InterferencesSpeed = p_InterferencesSettings.FindPropertyRelative("Speed");
|
||||
p_InterferencesDensity = p_InterferencesSettings.FindPropertyRelative("Density");
|
||||
p_InterferencesMaxDisplacement = p_InterferencesSettings.FindPropertyRelative("MaxDisplacement");
|
||||
|
||||
p_TearingSpeed = p_TearingSettings.FindPropertyRelative("Speed");
|
||||
p_TearingIntensity = p_TearingSettings.FindPropertyRelative("Intensity");
|
||||
p_TearingMaxDisplacement = p_TearingSettings.FindPropertyRelative("MaxDisplacement");
|
||||
p_TearingAllowFlipping = p_TearingSettings.FindPropertyRelative("AllowFlipping");
|
||||
p_TearingYuvColorBleeding = p_TearingSettings.FindPropertyRelative("YuvColorBleeding");
|
||||
p_TearingYuvOffset = p_TearingSettings.FindPropertyRelative("YuvOffset");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_RandomActivation);
|
||||
|
||||
if (p_RandomActivation.boolValue)
|
||||
{
|
||||
DoTimingUI(p_RandomEvery, GetContent("Every"), 50f);
|
||||
DoTimingUI(p_RandomDuration, GetContent("For"), 50f);
|
||||
EditorGUILayout.Space();
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(p_Mode);
|
||||
|
||||
if (p_Mode.enumValueIndex == (int)Glitch.GlitchingMode.Interferences)
|
||||
{
|
||||
DoInterferencesUI();
|
||||
}
|
||||
else if (p_Mode.enumValueIndex == (int)Glitch.GlitchingMode.Tearing)
|
||||
{
|
||||
DoTearingUI();
|
||||
}
|
||||
else // Complete
|
||||
{
|
||||
EditorGUILayout.LabelField(GetContent("Interferences"), EditorStyles.boldLabel);
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
DoInterferencesUI();
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField(GetContent("Tearing"), EditorStyles.boldLabel);
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
DoTearingUI();
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
void DoInterferencesUI()
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_InterferencesSpeed);
|
||||
EditorGUILayout.PropertyField(p_InterferencesDensity);
|
||||
EditorGUILayout.PropertyField(p_InterferencesMaxDisplacement);
|
||||
}
|
||||
|
||||
void DoTearingUI()
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_TearingSpeed);
|
||||
EditorGUILayout.PropertyField(p_TearingIntensity);
|
||||
EditorGUILayout.PropertyField(p_TearingMaxDisplacement);
|
||||
EditorGUILayout.PropertyField(p_TearingYuvColorBleeding, GetContent("YUV Color Bleeding"));
|
||||
|
||||
if (p_TearingYuvColorBleeding.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(p_TearingYuvOffset, GetContent("Offset"));
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(p_TearingAllowFlipping);
|
||||
}
|
||||
|
||||
void DoTimingUI(SerializedProperty prop, GUIContent label, float labelWidth)
|
||||
{
|
||||
Vector2 v = prop.vector2Value;
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
GUILayout.Space(EditorGUIUtility.labelWidth - 3);
|
||||
GUILayout.Label(label, GUILayout.ExpandWidth(false), GUILayout.Width(labelWidth));
|
||||
v.x = EditorGUILayout.FloatField(v.x, GUILayout.MaxWidth(75));
|
||||
GUILayout.Label(GetContent("to"), GUILayout.ExpandWidth(false));
|
||||
v.y = EditorGUILayout.FloatField(v.y, GUILayout.MaxWidth(75));
|
||||
GUILayout.Label(GetContent("second(s)"), GUILayout.ExpandWidth(false));
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
prop.vector2Value = v;
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/GlitchEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/GlitchEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 57e2ab7d58ca1e4458448984e8309f1f
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,36 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(GradientRampDynamic))]
|
||||
public class GradientRampDynamicEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Ramp;
|
||||
SerializedProperty p_Amount;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Ramp = serializedObject.FindProperty("Ramp");
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.PropertyField(p_Ramp);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
(target as GradientRampDynamic).UpdateGradientCache();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8ee9d7d27f4dd3141955e9ad9da5626e
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
32
Assets/Colorful FX/Editor/Effects/GradientRampEditor.cs
Normal file
32
Assets/Colorful FX/Editor/Effects/GradientRampEditor.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(GradientRamp))]
|
||||
public class GradientRampEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_RampTexture;
|
||||
SerializedProperty p_Amount;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_RampTexture = serializedObject.FindProperty("RampTexture");
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_RampTexture);
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/GradientRampEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/GradientRampEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c770ef3f88fef48469dc767603d7861d
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
32
Assets/Colorful FX/Editor/Effects/GrainyBlurEditor.cs
Normal file
32
Assets/Colorful FX/Editor/Effects/GrainyBlurEditor.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(GrainyBlur))]
|
||||
public class GrainyBlurEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Radius;
|
||||
SerializedProperty p_Samples;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Radius = serializedObject.FindProperty("Radius");
|
||||
p_Samples = serializedObject.FindProperty("Samples");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Radius);
|
||||
EditorGUILayout.PropertyField(p_Samples);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/GrainyBlurEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/GrainyBlurEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6115c55fccefd0b4ab1c9ff4a54578c1
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
65
Assets/Colorful FX/Editor/Effects/GrayscaleEditor.cs
Normal file
65
Assets/Colorful FX/Editor/Effects/GrayscaleEditor.cs
Normal file
|
@ -0,0 +1,65 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Grayscale))]
|
||||
public class GrayscaleEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_RedLuminance;
|
||||
SerializedProperty p_GreenLuminance;
|
||||
SerializedProperty p_BlueLuminance;
|
||||
SerializedProperty p_Amount;
|
||||
|
||||
static GUIContent[] presets = {
|
||||
new GUIContent("Choose a preset..."),
|
||||
new GUIContent("Default"),
|
||||
new GUIContent("Unity Default"),
|
||||
new GUIContent("Naive")
|
||||
};
|
||||
static float[,] presetsData = { { 0.299f, 0.587f, 0.114f }, { 0.222f, 0.707f, 0.071f }, { 0.333f, 0.334f, 0.333f } };
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_RedLuminance = serializedObject.FindProperty("RedLuminance");
|
||||
p_GreenLuminance = serializedObject.FindProperty("GreenLuminance");
|
||||
p_BlueLuminance = serializedObject.FindProperty("BlueLuminance");
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
GUILayout.Label("Luminance", EditorStyles.boldLabel);
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_RedLuminance, GetContent("Red"));
|
||||
EditorGUILayout.PropertyField(p_GreenLuminance, GetContent("Green"));
|
||||
EditorGUILayout.PropertyField(p_BlueLuminance, GetContent("Blue"));
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
int selectedPreset = EditorGUILayout.Popup(GetContent("Preset"), 0, presets);
|
||||
|
||||
if (EditorGUI.EndChangeCheck() && selectedPreset > 0)
|
||||
{
|
||||
selectedPreset--;
|
||||
p_RedLuminance.floatValue = presetsData[selectedPreset, 0];
|
||||
p_GreenLuminance.floatValue = presetsData[selectedPreset, 1];
|
||||
p_BlueLuminance.floatValue = presetsData[selectedPreset, 2];
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/GrayscaleEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/GrayscaleEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2c77ef04cea05d44dad9f90afae3116d
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
50
Assets/Colorful FX/Editor/Effects/HalftoneEditor.cs
Normal file
50
Assets/Colorful FX/Editor/Effects/HalftoneEditor.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Halftone))]
|
||||
public class HalftoneEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Scale;
|
||||
SerializedProperty p_DotSize;
|
||||
SerializedProperty p_Angle;
|
||||
SerializedProperty p_Smoothness;
|
||||
SerializedProperty p_Center;
|
||||
SerializedProperty p_Desaturate;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Scale = serializedObject.FindProperty("Scale");
|
||||
p_DotSize = serializedObject.FindProperty("DotSize");
|
||||
p_Angle = serializedObject.FindProperty("Angle");
|
||||
p_Smoothness = serializedObject.FindProperty("Smoothness");
|
||||
p_Center = serializedObject.FindProperty("Center");
|
||||
p_Desaturate = serializedObject.FindProperty("Desaturate");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Scale);
|
||||
EditorGUILayout.PropertyField(p_DotSize);
|
||||
EditorGUILayout.PropertyField(p_Smoothness);
|
||||
EditorGUILayout.PropertyField(p_Angle);
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_Center);
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.PropertyField(p_Desaturate);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/HalftoneEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/HalftoneEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0e071755be1eea74c9284b5b29cbcd26
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
342
Assets/Colorful FX/Editor/Effects/HistogramEditor.cs
Normal file
342
Assets/Colorful FX/Editor/Effects/HistogramEditor.cs
Normal file
|
@ -0,0 +1,342 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditorInternal;
|
||||
using System;
|
||||
using Channel = Histogram.Channel;
|
||||
|
||||
[CustomEditor(typeof(Histogram))]
|
||||
public class HistogramEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_CurrentChannel;
|
||||
SerializedProperty p_Logarithmic;
|
||||
SerializedProperty p_AutoRefresh;
|
||||
|
||||
Histogram m_Target;
|
||||
int[] m_Histogram = new int[256];
|
||||
int[] m_HistogramRGB = new int[256 * 3];
|
||||
Rect m_HistogramRect = new Rect(0f, 0f, 1f, 1f);
|
||||
Texture2D m_TempTexture;
|
||||
|
||||
Color MasterColor = new Color(1f, 1f, 1f, 2f);
|
||||
Color RedColor = new Color(1f, 0f, 0f, 2f);
|
||||
Color GreenColor = new Color(0f, 1f, 0f, 2f);
|
||||
Color BlueColor = new Color(0f, 1f, 1f, 2f);
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_CurrentChannel = serializedObject.FindProperty("e_CurrentChannel");
|
||||
p_Logarithmic = serializedObject.FindProperty("e_Logarithmic");
|
||||
p_AutoRefresh = serializedObject.FindProperty("e_AutoRefresh");
|
||||
|
||||
m_Target = target as Histogram;
|
||||
m_Target.e_OnFrameEnd = UpdateHistogram;
|
||||
m_Target.InternalForceRefresh();
|
||||
|
||||
InternalEditorUtility.RepaintAllViews();
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
m_Target.e_OnFrameEnd = null;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
// Sizing
|
||||
if (!EditorGUIUtility.isProSkin)
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
Rect rect = GUILayoutUtility.GetRect(256f, 128f);
|
||||
float width = Mathf.Min(512f, rect.width);
|
||||
float height = Mathf.Min(128f, rect.height);
|
||||
|
||||
if (Event.current.type == EventType.Repaint)
|
||||
{
|
||||
m_HistogramRect = new Rect(
|
||||
Mathf.Floor(rect.x + rect.width / 2f - width / 2f),
|
||||
Mathf.Floor(rect.y + rect.height / 2f - height / 2f),
|
||||
width, height
|
||||
);
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
if (!EditorGUIUtility.isProSkin)
|
||||
EditorGUILayout.Space();
|
||||
|
||||
// Histogram
|
||||
if (!EditorGUIUtility.isProSkin)
|
||||
{
|
||||
Vector3[] verts = new Vector3[] {
|
||||
new Vector3(m_HistogramRect.x - 4, m_HistogramRect.y - 4),
|
||||
new Vector3(m_HistogramRect.xMax + 4, m_HistogramRect.y - 4),
|
||||
new Vector3(m_HistogramRect.xMax + 4, m_HistogramRect.yMax + 4),
|
||||
new Vector3(m_HistogramRect.x - 4, m_HistogramRect.yMax + 4)
|
||||
};
|
||||
Handles.DrawSolidRectangleWithOutline(verts, new Color(0.21f, 0.21f, 0.21f, 2.0f), new Color(0.21f, 0.21f, 0.21f, 2.0f));
|
||||
}
|
||||
|
||||
if (p_CurrentChannel.intValue == (int)Channel.RGB)
|
||||
DrawHistogramRGB(m_HistogramRect);
|
||||
else
|
||||
DrawHistogram(m_HistogramRect);
|
||||
|
||||
// UI
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.BeginHorizontal(GUILayout.Width(m_HistogramRect.width));
|
||||
{
|
||||
Channel currentChannel = (Channel)p_CurrentChannel.intValue;
|
||||
currentChannel = (Channel)EditorGUILayout.EnumPopup(currentChannel);
|
||||
p_CurrentChannel.intValue = (int)currentChannel;
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
|
||||
p_Logarithmic.boolValue = GUILayout.Toggle(p_Logarithmic.boolValue, GetContent("Log"), EditorStyles.miniButtonLeft);
|
||||
p_AutoRefresh.boolValue = GUILayout.Toggle(p_AutoRefresh.boolValue, GetContent("Auto Refresh"), EditorStyles.miniButtonMid);
|
||||
|
||||
EditorGUI.BeginDisabledGroup(p_AutoRefresh.boolValue);
|
||||
|
||||
if (GUILayout.Button(GetContent("Refresh"), EditorStyles.miniButtonRight))
|
||||
Refresh();
|
||||
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
Refresh();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
void Refresh()
|
||||
{
|
||||
m_Target.InternalForceRefresh();
|
||||
InternalEditorUtility.RepaintAllViews();
|
||||
}
|
||||
|
||||
void UpdateHistogram(RenderTexture source)
|
||||
{
|
||||
if (m_TempTexture == null || m_TempTexture.width != source.width || m_TempTexture.height != source.height)
|
||||
{
|
||||
if (m_TempTexture != null)
|
||||
DestroyImmediate(m_TempTexture);
|
||||
|
||||
m_TempTexture = new Texture2D(source.width, source.height, TextureFormat.RGB24, false);
|
||||
m_TempTexture.anisoLevel = 0;
|
||||
m_TempTexture.wrapMode = TextureWrapMode.Clamp;
|
||||
m_TempTexture.filterMode = FilterMode.Bilinear;
|
||||
m_TempTexture.hideFlags = HideFlags.HideAndDontSave;
|
||||
}
|
||||
|
||||
// Grab the screen content for the camera
|
||||
RenderTexture.active = source;
|
||||
m_TempTexture.ReadPixels(new Rect(0, 0, source.width, source.height), 0, 0, false);
|
||||
m_TempTexture.Apply();
|
||||
RenderTexture.active = null;
|
||||
|
||||
// Raw histogram data
|
||||
Color[] pixels = m_TempTexture.GetPixels();
|
||||
|
||||
switch (p_CurrentChannel.intValue)
|
||||
{
|
||||
case (int)Channel.RGB:
|
||||
Array.Clear(m_HistogramRGB, 0, 256 * 3);
|
||||
for (int i = 0; i < pixels.Length; i++)
|
||||
{
|
||||
Color c = pixels[i];
|
||||
m_HistogramRGB[(int)(c.r * 255)]++;
|
||||
m_HistogramRGB[(int)(c.g * 255) + 256]++;
|
||||
m_HistogramRGB[(int)(c.b * 255) + 512]++;
|
||||
}
|
||||
break;
|
||||
case (int)Channel.Luminance:
|
||||
Array.Clear(m_Histogram, 0, 256);
|
||||
for (int i = 0; i < pixels.Length; i++)
|
||||
{
|
||||
Color c = pixels[i];
|
||||
m_Histogram[(int)((c.r * 0.2125f + c.g * 0.7154f + c.b * 0.0721f) * 255)]++;
|
||||
}
|
||||
break;
|
||||
case (int)Channel.Red:
|
||||
Array.Clear(m_Histogram, 0, 256);
|
||||
for (int i = 0; i < pixels.Length; i++)
|
||||
m_Histogram[(int)(pixels[i].r * 255)]++;
|
||||
break;
|
||||
case (int)Channel.Green:
|
||||
Array.Clear(m_Histogram, 0, 256);
|
||||
for (int i = 0; i < pixels.Length; i++)
|
||||
m_Histogram[(int)(pixels[i].g * 255)]++;
|
||||
break;
|
||||
case (int)Channel.Blue:
|
||||
Array.Clear(m_Histogram, 0, 256);
|
||||
for (int i = 0; i < pixels.Length; i++)
|
||||
m_Histogram[(int)(pixels[i].b * 255)]++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void DrawHistogram(Rect rect)
|
||||
{
|
||||
// Scale histogram values
|
||||
int[] scaledHistogram = new int[256];
|
||||
|
||||
int max = 0;
|
||||
for (int i = 0; i < 256; i++)
|
||||
max = (max < m_Histogram[i]) ? m_Histogram[i] : max;
|
||||
|
||||
scaledHistogram = new int[256];
|
||||
|
||||
if (p_Logarithmic.boolValue)
|
||||
{
|
||||
float factor = rect.height / Mathf.Log10(max);
|
||||
|
||||
for (int i = 0; i < 256; i++)
|
||||
scaledHistogram[i] = (m_Histogram[i] == 0) ? 0 : Mathf.Max(Mathf.RoundToInt(Mathf.Log10(m_Histogram[i]) * factor), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
float factor = rect.height / max;
|
||||
|
||||
for (int i = 0; i < 256; i++)
|
||||
scaledHistogram[i] = Mathf.Max(Mathf.RoundToInt(m_Histogram[i] * factor), 1);
|
||||
}
|
||||
|
||||
// Color
|
||||
if (p_CurrentChannel.intValue == (int)Channel.Luminance)
|
||||
Handles.color = MasterColor;
|
||||
else if (p_CurrentChannel.intValue == (int)Channel.Red)
|
||||
Handles.color = RedColor;
|
||||
else if (p_CurrentChannel.intValue == (int)Channel.Green)
|
||||
Handles.color = GreenColor;
|
||||
else
|
||||
Handles.color = BlueColor;
|
||||
|
||||
// Base line
|
||||
Vector2 p1 = new Vector2(rect.x - 1, rect.yMax);
|
||||
Vector2 p2 = new Vector2(rect.xMax - 1, rect.yMax);
|
||||
Handles.DrawLine(p1, p2);
|
||||
|
||||
// Histogram
|
||||
for (int i = 0; i < (int)rect.width; i++)
|
||||
{
|
||||
float remapI = (float)i / rect.width * 255f;
|
||||
int index = Mathf.FloorToInt(remapI);
|
||||
float fract = remapI - (float)index;
|
||||
float v1 = scaledHistogram[index];
|
||||
float v2 = scaledHistogram[Mathf.Min(index + 1, 255)];
|
||||
float h = v1 * (1.0f - fract) + v2 * fract;
|
||||
Handles.DrawLine(
|
||||
new Vector2(rect.x + i, rect.yMax),
|
||||
new Vector2(rect.x + i, rect.yMin + (rect.height - h))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void DrawHistogramRGB(Rect rect)
|
||||
{
|
||||
// Scale histogram values
|
||||
Vector3 max = Vector3.zero;
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
max.x = (max.x < m_HistogramRGB[i]) ? m_HistogramRGB[i] : max.x;
|
||||
max.y = (max.y < m_HistogramRGB[i + 256]) ? m_HistogramRGB[i + 256] : max.y;
|
||||
max.z = (max.z < m_HistogramRGB[i + 512]) ? m_HistogramRGB[i + 512] : max.z;
|
||||
}
|
||||
|
||||
Vector3[] scaledHistogramRGB = new Vector3[256];
|
||||
|
||||
if (p_Logarithmic.boolValue)
|
||||
{
|
||||
Vector3 factor = new Vector3(
|
||||
rect.height / Mathf.Log10(max.x),
|
||||
rect.height / Mathf.Log10(max.y),
|
||||
rect.height / Mathf.Log10(max.z)
|
||||
);
|
||||
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
scaledHistogramRGB[i] = new Vector3(
|
||||
(m_HistogramRGB[i] == 0) ? 0 : Mathf.Max(Mathf.RoundToInt(Mathf.Log10(m_HistogramRGB[i]) * factor.x), 1),
|
||||
(m_HistogramRGB[i + 256] == 0) ? 0 : Mathf.Max(Mathf.RoundToInt(Mathf.Log10(m_HistogramRGB[i + 256]) * factor.y), 1),
|
||||
(m_HistogramRGB[i + 512] == 0) ? 0 : Mathf.Max(Mathf.RoundToInt(Mathf.Log10(m_HistogramRGB[i + 512]) * factor.z), 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector3 factor = new Vector3(rect.height / max.x, rect.height / max.y, rect.height / max.z);
|
||||
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
scaledHistogramRGB[i] = new Vector3(
|
||||
Mathf.Max(Mathf.RoundToInt(m_HistogramRGB[i] * factor.x), 1),
|
||||
Mathf.Max(Mathf.RoundToInt(m_HistogramRGB[i + 256] * factor.y), 1),
|
||||
Mathf.Max(Mathf.RoundToInt(m_HistogramRGB[i + 512] * factor.z), 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Base line
|
||||
Handles.color = MasterColor;
|
||||
Vector2 p1 = new Vector2(rect.x - 1, rect.yMax);
|
||||
Vector2 p2 = new Vector2(rect.xMax - 1, rect.yMax);
|
||||
Handles.DrawLine(p1, p2);
|
||||
Color[] colors = { RedColor, GreenColor, BlueColor };
|
||||
|
||||
// Histogram
|
||||
for (int i = 0; i < (int)rect.width; i++)
|
||||
{
|
||||
int[] heights = new int[3];
|
||||
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
float remapI = (float)i / rect.width * 255f;
|
||||
int index = Mathf.FloorToInt(remapI);
|
||||
float fract = remapI - (float)index;
|
||||
float v1 = scaledHistogramRGB[index][j];
|
||||
float v2 = scaledHistogramRGB[Mathf.Min(index + 1, 255)][j];
|
||||
heights[j] = (int)(v1 * (1.0f - fract) + v2 * fract);
|
||||
}
|
||||
|
||||
int[] indices = { 0, 1, 2 };
|
||||
Array.Sort<int>(indices, (a, b) => heights[a].CompareTo(heights[b]));
|
||||
|
||||
Handles.color = MasterColor;
|
||||
Handles.DrawLine(
|
||||
new Vector2(rect.x + i, rect.yMax),
|
||||
new Vector2(rect.x + i, rect.yMin + (rect.height - heights[indices[0]]))
|
||||
);
|
||||
|
||||
Handles.color = colors[indices[2]] + colors[indices[1]];
|
||||
Handles.DrawLine(
|
||||
new Vector2(rect.x + i, rect.yMin + (rect.height - heights[indices[0]])),
|
||||
new Vector2(rect.x + i, rect.yMin + (rect.height - heights[indices[1]]))
|
||||
);
|
||||
|
||||
Handles.color = colors[indices[2]];
|
||||
Handles.DrawLine(
|
||||
new Vector2(rect.x + i, rect.yMin + (rect.height - heights[indices[1]])),
|
||||
new Vector2(rect.x + i, rect.yMin + (rect.height - heights[indices[2]]))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/HistogramEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/HistogramEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9d071f1f04ead6742938ba8b073f2740
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
53
Assets/Colorful FX/Editor/Effects/HueFocusEditor.cs
Normal file
53
Assets/Colorful FX/Editor/Effects/HueFocusEditor.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(HueFocus))]
|
||||
public class HueFocusEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Hue;
|
||||
SerializedProperty p_Range;
|
||||
SerializedProperty p_Boost;
|
||||
SerializedProperty p_Amount;
|
||||
Texture2D m_HueRamp;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Hue = serializedObject.FindProperty("Hue");
|
||||
p_Range = serializedObject.FindProperty("Range");
|
||||
p_Boost = serializedObject.FindProperty("Boost");
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
|
||||
m_HueRamp = Resources.Load<Texture2D>("UI/HueRamp");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
|
||||
Rect rect = GUILayoutUtility.GetRect(0, 20);
|
||||
GUI.DrawTextureWithTexCoords(rect, m_HueRamp, new Rect(0.5f + p_Hue.floatValue / 360f, 0f, 1f, 1f));
|
||||
|
||||
GUI.enabled = false;
|
||||
float min = 180f - p_Range.floatValue;
|
||||
float max = 180f + p_Range.floatValue;
|
||||
EditorGUILayout.MinMaxSlider(ref min, ref max, 0f, 360f);
|
||||
GUI.enabled = true;
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
EditorGUILayout.PropertyField(p_Hue);
|
||||
EditorGUILayout.PropertyField(p_Range);
|
||||
EditorGUILayout.PropertyField(p_Boost);
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/HueFocusEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/HueFocusEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 95c14fb8c2a52394f9dfe787cbf36a7e
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
125
Assets/Colorful FX/Editor/Effects/HueSaturationValueEditor.cs
Normal file
125
Assets/Colorful FX/Editor/Effects/HueSaturationValueEditor.cs
Normal file
|
@ -0,0 +1,125 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(HueSaturationValue))]
|
||||
public class HueSaturationValueEditor : BaseEffectEditor
|
||||
{
|
||||
static string[] channels = { "Master", "Reds", "Yellows", "Greens", "Cyans", "Blues", "Magentas" };
|
||||
|
||||
SerializedProperty p_MasterHue;
|
||||
SerializedProperty p_MasterSaturation;
|
||||
SerializedProperty p_MasterValue;
|
||||
|
||||
SerializedProperty p_RedsHue;
|
||||
SerializedProperty p_RedsSaturation;
|
||||
SerializedProperty p_RedsValue;
|
||||
|
||||
SerializedProperty p_YellowsHue;
|
||||
SerializedProperty p_YellowsSaturation;
|
||||
SerializedProperty p_YellowsValue;
|
||||
|
||||
SerializedProperty p_GreensHue;
|
||||
SerializedProperty p_GreensSaturation;
|
||||
SerializedProperty p_GreensValue;
|
||||
|
||||
SerializedProperty p_CyansHue;
|
||||
SerializedProperty p_CyansSaturation;
|
||||
SerializedProperty p_CyansValue;
|
||||
|
||||
SerializedProperty p_BluesHue;
|
||||
SerializedProperty p_BluesSaturation;
|
||||
SerializedProperty p_BluesValue;
|
||||
|
||||
SerializedProperty p_MagentasHue;
|
||||
SerializedProperty p_MagentasSaturation;
|
||||
SerializedProperty p_MagentasValue;
|
||||
|
||||
SerializedProperty p_AdvancedMode;
|
||||
SerializedProperty p_CurrentChannel;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_MasterHue = serializedObject.FindProperty("MasterHue");
|
||||
p_MasterSaturation = serializedObject.FindProperty("MasterSaturation");
|
||||
p_MasterValue = serializedObject.FindProperty("MasterValue");
|
||||
|
||||
p_RedsHue = serializedObject.FindProperty("RedsHue");
|
||||
p_RedsSaturation = serializedObject.FindProperty("RedsSaturation");
|
||||
p_RedsValue = serializedObject.FindProperty("RedsValue");
|
||||
|
||||
p_YellowsHue = serializedObject.FindProperty("YellowsHue");
|
||||
p_YellowsSaturation = serializedObject.FindProperty("YellowsSaturation");
|
||||
p_YellowsValue = serializedObject.FindProperty("YellowsValue");
|
||||
|
||||
p_GreensHue = serializedObject.FindProperty("GreensHue");
|
||||
p_GreensSaturation = serializedObject.FindProperty("GreensSaturation");
|
||||
p_GreensValue = serializedObject.FindProperty("GreensValue");
|
||||
|
||||
p_CyansHue = serializedObject.FindProperty("CyansHue");
|
||||
p_CyansSaturation = serializedObject.FindProperty("CyansSaturation");
|
||||
p_CyansValue = serializedObject.FindProperty("CyansValue");
|
||||
|
||||
p_BluesHue = serializedObject.FindProperty("BluesHue");
|
||||
p_BluesSaturation = serializedObject.FindProperty("BluesSaturation");
|
||||
p_BluesValue = serializedObject.FindProperty("BluesValue");
|
||||
|
||||
p_MagentasHue = serializedObject.FindProperty("MagentasHue");
|
||||
p_MagentasSaturation = serializedObject.FindProperty("MagentasSaturation");
|
||||
p_MagentasValue = serializedObject.FindProperty("MagentasValue");
|
||||
|
||||
p_AdvancedMode = serializedObject.FindProperty("AdvancedMode");
|
||||
p_CurrentChannel = serializedObject.FindProperty("e_CurrentChannel");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
bool advanced = p_AdvancedMode.boolValue;
|
||||
int channel = p_CurrentChannel.intValue;
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
if (advanced) channel = EditorGUILayout.Popup(channel, channels);
|
||||
else channel = 0;
|
||||
|
||||
advanced = GUILayout.Toggle(advanced, GetContent("Advanced Mode"), EditorStyles.miniButton);
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
switch (channel)
|
||||
{
|
||||
case 1: Channel(p_RedsHue, p_RedsSaturation, p_RedsValue);
|
||||
break;
|
||||
case 2: Channel(p_YellowsHue, p_YellowsSaturation, p_YellowsValue);
|
||||
break;
|
||||
case 3: Channel(p_GreensHue, p_GreensSaturation, p_GreensValue);
|
||||
break;
|
||||
case 4: Channel(p_CyansHue, p_CyansSaturation, p_CyansValue);
|
||||
break;
|
||||
case 5: Channel(p_BluesHue, p_BluesSaturation, p_BluesValue);
|
||||
break;
|
||||
case 6: Channel(p_MagentasHue, p_MagentasSaturation, p_MagentasValue);
|
||||
break;
|
||||
default: Channel(p_MasterHue, p_MasterSaturation, p_MasterValue);
|
||||
break;
|
||||
}
|
||||
|
||||
p_AdvancedMode.boolValue = advanced;
|
||||
p_CurrentChannel.intValue = channel;
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
void Channel(SerializedProperty hue, SerializedProperty saturation, SerializedProperty value)
|
||||
{
|
||||
EditorGUILayout.PropertyField(hue, GetContent("Hue"));
|
||||
EditorGUILayout.PropertyField(saturation, GetContent("Saturation"));
|
||||
EditorGUILayout.PropertyField(value, GetContent("Value"));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 98648ea769b03bb4ea9a0f2fad531d98
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
29
Assets/Colorful FX/Editor/Effects/KuwaharaEditor.cs
Normal file
29
Assets/Colorful FX/Editor/Effects/KuwaharaEditor.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Kuwahara))]
|
||||
public class KuwaharaEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Radius;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Radius = serializedObject.FindProperty("Radius");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Radius);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/KuwaharaEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/KuwaharaEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ba3e4ad0653dd0b4eb0f1073baf77ad8
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
53
Assets/Colorful FX/Editor/Effects/LedEditor.cs
Normal file
53
Assets/Colorful FX/Editor/Effects/LedEditor.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Led))]
|
||||
public class LedEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Scale;
|
||||
SerializedProperty p_Ratio;
|
||||
SerializedProperty p_AutomaticRatio;
|
||||
SerializedProperty p_Brightness;
|
||||
SerializedProperty p_Shape;
|
||||
SerializedProperty p_Mode;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Scale = serializedObject.FindProperty("Scale");
|
||||
p_Ratio = serializedObject.FindProperty("Ratio");
|
||||
p_AutomaticRatio = serializedObject.FindProperty("AutomaticRatio");
|
||||
p_Brightness = serializedObject.FindProperty("Brightness");
|
||||
p_Shape = serializedObject.FindProperty("Shape");
|
||||
p_Mode = serializedObject.FindProperty("Mode");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Mode);
|
||||
EditorGUILayout.PropertyField(p_Scale);
|
||||
EditorGUILayout.PropertyField(p_Shape);
|
||||
EditorGUILayout.PropertyField(p_AutomaticRatio);
|
||||
|
||||
if (!p_AutomaticRatio.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_Ratio);
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(p_Brightness);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/LedEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/LedEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 493055e70fc53814b9c9fdd92f38e641
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,44 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(LensDistortionBlur))]
|
||||
public class LensDistortionBlurEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Quality;
|
||||
SerializedProperty p_Samples;
|
||||
SerializedProperty p_Distortion;
|
||||
SerializedProperty p_CubicDistortion;
|
||||
SerializedProperty p_Scale;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Quality = serializedObject.FindProperty("Quality");
|
||||
p_Samples = serializedObject.FindProperty("Samples");
|
||||
p_Distortion = serializedObject.FindProperty("Distortion");
|
||||
p_CubicDistortion = serializedObject.FindProperty("CubicDistortion");
|
||||
p_Scale = serializedObject.FindProperty("Scale");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Quality);
|
||||
|
||||
if (p_Quality.intValue == (int)LensDistortionBlur.QualityPreset.Custom)
|
||||
EditorGUILayout.PropertyField(p_Samples);
|
||||
|
||||
EditorGUILayout.PropertyField(p_Distortion);
|
||||
EditorGUILayout.PropertyField(p_CubicDistortion);
|
||||
EditorGUILayout.PropertyField(p_Scale, GetContent("Scale (Zoom)"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: db9b779b99d913b46942cfd97c31b5ba
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
53
Assets/Colorful FX/Editor/Effects/LetterboxEditor.cs
Normal file
53
Assets/Colorful FX/Editor/Effects/LetterboxEditor.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Letterbox))]
|
||||
public class LetterboxEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_FillColor;
|
||||
SerializedProperty p_Aspect;
|
||||
|
||||
static GUIContent[] presets = {
|
||||
new GUIContent("Choose a preset..."),
|
||||
new GUIContent("1:1"),
|
||||
new GUIContent("5:4"),
|
||||
new GUIContent("4:3"),
|
||||
new GUIContent("3:2"),
|
||||
new GUIContent("16:9"),
|
||||
new GUIContent("16:10"),
|
||||
new GUIContent("21:9")
|
||||
};
|
||||
static float[] presetsData = { 1f, 5f/4f, 4f/3f, 3f/2f, 16f/9f, 16f/10f, 21f/9f };
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_FillColor = serializedObject.FindProperty("FillColor");
|
||||
p_Aspect = serializedObject.FindProperty("Aspect");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_FillColor);
|
||||
EditorGUILayout.PropertyField(p_Aspect, GetContent("Aspect Ratio"));
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
int selectedPreset = EditorGUILayout.Popup(GetContent("Preset"), 0, presets);
|
||||
|
||||
if (EditorGUI.EndChangeCheck() && selectedPreset > 0)
|
||||
{
|
||||
selectedPreset--;
|
||||
p_Aspect.floatValue = presetsData[selectedPreset];
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/LetterboxEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/LetterboxEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a5783bc33aba2c044bd202431145954a
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
428
Assets/Colorful FX/Editor/Effects/LevelsEditor.cs
Normal file
428
Assets/Colorful FX/Editor/Effects/LevelsEditor.cs
Normal file
|
@ -0,0 +1,428 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditorInternal;
|
||||
using System;
|
||||
using ColorMode = Levels.ColorMode;
|
||||
using Channel = Levels.Channel;
|
||||
|
||||
[CustomEditor(typeof(Levels))]
|
||||
public class LevelsEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Mode;
|
||||
SerializedProperty p_InputL;
|
||||
SerializedProperty p_InputR;
|
||||
SerializedProperty p_InputG;
|
||||
SerializedProperty p_InputB;
|
||||
SerializedProperty p_OutputL;
|
||||
SerializedProperty p_OutputR;
|
||||
SerializedProperty p_OutputG;
|
||||
SerializedProperty p_OutputB;
|
||||
|
||||
SerializedProperty p_CurrentChannel;
|
||||
SerializedProperty p_Logarithmic;
|
||||
SerializedProperty p_AutoRefresh;
|
||||
|
||||
Levels m_Target;
|
||||
Texture2D m_TempTexture;
|
||||
int[] m_Histogram = new int[256];
|
||||
Rect m_HistogramRect = new Rect(0f, 0f, 1f, 1f);
|
||||
|
||||
Color MasterColor = EditorGUIUtility.isProSkin ? new Color(1f, 1f, 1f, 2f) : new Color(0.1f, 0.1f, 0.1f, 2f);
|
||||
Color RedColor = new Color(1f, 0f, 0f, 2f);
|
||||
Color GreenColor = EditorGUIUtility.isProSkin ? new Color(0f, 1f, 0f, 2f) : new Color(0.2f, 0.8f, 0.2f, 2f);
|
||||
Color BlueColor = EditorGUIUtility.isProSkin ? new Color(0f, 1f, 1f, 2f) : new Color(0f, 0f, 1f, 2f);
|
||||
Texture2D RampTexture;
|
||||
|
||||
static GUIContent[] presets = {
|
||||
new GUIContent("Choose a preset..."),
|
||||
new GUIContent("Default"),
|
||||
new GUIContent("Darker"),
|
||||
new GUIContent("Increase Contrast 1"),
|
||||
new GUIContent("Increase Contrast 2"),
|
||||
new GUIContent("Increase Contrast 3"),
|
||||
new GUIContent("Lighten Shadows"),
|
||||
new GUIContent("Lighter"),
|
||||
new GUIContent("Midtones Brighter"),
|
||||
new GUIContent("Midtones Darker")
|
||||
};
|
||||
|
||||
static float[,] presetsData = { { 0, 1, 255, 0, 255 }, { 15, 1, 255, 0, 255 }, { 10, 1, 245, 0, 255 },
|
||||
{ 20, 1, 235, 0, 255 }, { 30, 1, 225, 0, 255 }, { 0, 1.6f, 255, 0, 255 },
|
||||
{ 0, 1, 230, 0, 255 }, { 0, 1.25f, 255, 0, 255 }, { 0, 0.75f, 255, 0, 255 } };
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Mode = serializedObject.FindProperty("Mode");
|
||||
p_InputL = serializedObject.FindProperty("InputL");
|
||||
p_InputR = serializedObject.FindProperty("InputR");
|
||||
p_InputG = serializedObject.FindProperty("InputG");
|
||||
p_InputB = serializedObject.FindProperty("InputB");
|
||||
p_OutputL = serializedObject.FindProperty("OutputL");
|
||||
p_OutputR = serializedObject.FindProperty("OutputR");
|
||||
p_OutputG = serializedObject.FindProperty("OutputG");
|
||||
p_OutputB = serializedObject.FindProperty("OutputB");
|
||||
|
||||
p_CurrentChannel = serializedObject.FindProperty("e_CurrentChannel");
|
||||
p_Logarithmic = serializedObject.FindProperty("e_Logarithmic");
|
||||
p_AutoRefresh = serializedObject.FindProperty("e_AutoRefresh");
|
||||
|
||||
RampTexture = Resources.Load<Texture2D>(CLib.IsLinearColorSpace() ? "UI/GrayscaleRampLinear" : "UI/GrayscaleRamp");
|
||||
|
||||
m_Target = target as Levels;
|
||||
m_Target.e_OnFrameEnd = UpdateHistogram;
|
||||
m_Target.InternalForceRefresh();
|
||||
|
||||
InternalEditorUtility.RepaintAllViews();
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
m_Target.e_OnFrameEnd = null;
|
||||
|
||||
if (m_TempTexture != null)
|
||||
DestroyImmediate(m_TempTexture);
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
bool isRGB = p_Mode.intValue == (int)ColorMode.RGB;
|
||||
Channel currentChannel = (Channel)p_CurrentChannel.intValue;
|
||||
|
||||
if (isRGB) currentChannel = (Channel)EditorGUILayout.EnumPopup(currentChannel);
|
||||
isRGB = GUILayout.Toggle(isRGB, GetContent("Multi-channel Mode"), EditorStyles.miniButton);
|
||||
|
||||
p_Mode.intValue = isRGB ? (int)ColorMode.RGB : (int)ColorMode.Monochrome;
|
||||
p_CurrentChannel.intValue = (int)currentChannel;
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
if (GUILayout.Button(GetContent("Auto B&W"), EditorStyles.miniButton))
|
||||
{
|
||||
int min = 0, max = 255;
|
||||
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
if (m_Histogram[255 - i] > 0)
|
||||
min = 255 - i;
|
||||
|
||||
if (m_Histogram[i] > 0)
|
||||
max = i;
|
||||
}
|
||||
|
||||
if (p_Mode.intValue == (int)ColorMode.RGB)
|
||||
{
|
||||
if (p_CurrentChannel.intValue == (int)Channel.Red)
|
||||
{
|
||||
Vector3 input = p_InputR.vector3Value;
|
||||
input.x = min;
|
||||
input.y = max;
|
||||
p_InputR.vector3Value = input;
|
||||
}
|
||||
else if (p_CurrentChannel.intValue == (int)Channel.Green)
|
||||
{
|
||||
Vector3 input = p_InputG.vector3Value;
|
||||
input.x = min;
|
||||
input.y = max;
|
||||
p_InputG.vector3Value = input;
|
||||
}
|
||||
else if (p_CurrentChannel.intValue == (int)Channel.Blue)
|
||||
{
|
||||
Vector3 input = p_InputB.vector3Value;
|
||||
input.x = min;
|
||||
input.y = max;
|
||||
p_InputB.vector3Value = input;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector3 input = p_InputL.vector3Value;
|
||||
input.x = min;
|
||||
input.y = max;
|
||||
p_InputL.vector3Value = input;
|
||||
}
|
||||
}
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
|
||||
p_Logarithmic.boolValue = GUILayout.Toggle(p_Logarithmic.boolValue, GetContent("Log"), EditorStyles.miniButtonLeft);
|
||||
p_AutoRefresh.boolValue = GUILayout.Toggle(p_AutoRefresh.boolValue, GetContent("Auto Refresh"), EditorStyles.miniButtonMid);
|
||||
|
||||
EditorGUI.BeginDisabledGroup(p_AutoRefresh.boolValue);
|
||||
|
||||
if (GUILayout.Button(GetContent("Refresh"), EditorStyles.miniButtonRight))
|
||||
Refresh();
|
||||
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
Refresh();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
// Sizing
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
{
|
||||
Rect rect = GUILayoutUtility.GetRect(256f, 128f);
|
||||
float width = Mathf.Min(512f, rect.width);
|
||||
float height = Mathf.Min(128f, rect.height);
|
||||
|
||||
if (Event.current.type == EventType.Repaint)
|
||||
{
|
||||
m_HistogramRect = new Rect(
|
||||
Mathf.Floor(rect.x + rect.width / 2f - width / 2f),
|
||||
Mathf.Floor(rect.y + rect.height / 2f - height / 2f),
|
||||
width, height
|
||||
);
|
||||
}
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
// Histogram
|
||||
DrawHistogram(m_HistogramRect);
|
||||
|
||||
// Selected Channel UI
|
||||
if (p_Mode.intValue == (int)ColorMode.RGB)
|
||||
{
|
||||
if (p_CurrentChannel.intValue == (int)Channel.Red) ChannelUI(m_HistogramRect.width, p_InputR, p_OutputR);
|
||||
else if (p_CurrentChannel.intValue == (int)Channel.Green) ChannelUI(m_HistogramRect.width, p_InputG, p_OutputG);
|
||||
else if (p_CurrentChannel.intValue == (int)Channel.Blue) ChannelUI(m_HistogramRect.width, p_InputB, p_OutputB);
|
||||
}
|
||||
else
|
||||
{
|
||||
ChannelUI(m_HistogramRect.width, p_InputL, p_OutputL);
|
||||
}
|
||||
|
||||
// Presets
|
||||
EditorGUI.BeginChangeCheck();
|
||||
int selectedPreset = EditorGUILayout.Popup(GetContent("Preset"), 0, presets);
|
||||
if (EditorGUI.EndChangeCheck() && selectedPreset > 0)
|
||||
{
|
||||
selectedPreset--;
|
||||
p_Mode.intValue = (int)ColorMode.Monochrome;
|
||||
p_InputL.vector3Value = new Vector3(
|
||||
presetsData[selectedPreset, 0],
|
||||
presetsData[selectedPreset, 2],
|
||||
presetsData[selectedPreset, 1]
|
||||
);
|
||||
p_OutputL.vector2Value = new Vector2(
|
||||
presetsData[selectedPreset, 3],
|
||||
presetsData[selectedPreset, 4]
|
||||
);
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
void Refresh()
|
||||
{
|
||||
m_Target.InternalForceRefresh();
|
||||
InternalEditorUtility.RepaintAllViews();
|
||||
}
|
||||
|
||||
void ChannelUI(float width, SerializedProperty input, SerializedProperty output)
|
||||
{
|
||||
float inputMin = input.vector3Value.x;
|
||||
float inputGamma = input.vector3Value.z;
|
||||
float inputMax = input.vector3Value.y;
|
||||
float outputMin = output.vector2Value.x;
|
||||
float outputMax = output.vector2Value.y;
|
||||
|
||||
// Input
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.MinMaxSlider(ref inputMin, ref inputMax, 0f, 255f, GUILayout.Width(width));
|
||||
GUILayout.FlexibleSpace();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.BeginHorizontal(GUILayout.Width(width));
|
||||
{
|
||||
inputMin = EditorGUILayout.FloatField((int)inputMin, GUILayout.Width(50));
|
||||
GUILayout.FlexibleSpace();
|
||||
inputGamma = EditorGUILayout.FloatField(inputGamma, GUILayout.Width(50));
|
||||
GUILayout.FlexibleSpace();
|
||||
inputMax = EditorGUILayout.FloatField((int)inputMax, GUILayout.Width(50));
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.Space();
|
||||
|
||||
// Ramp
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
GUILayout.FlexibleSpace();
|
||||
GUI.DrawTexture(GUILayoutUtility.GetRect(width, 20f), RampTexture, ScaleMode.StretchToFill);
|
||||
GUILayout.FlexibleSpace();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
// Output
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.MinMaxSlider(ref outputMin, ref outputMax, 0f, 255f, GUILayout.Width(width));
|
||||
GUILayout.FlexibleSpace();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
{
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.BeginHorizontal(GUILayout.Width(width));
|
||||
{
|
||||
outputMin = EditorGUILayout.FloatField((int)outputMin, GUILayout.Width(50));
|
||||
GUILayout.FlexibleSpace();
|
||||
outputMax = EditorGUILayout.FloatField((int)outputMax, GUILayout.Width(50));
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
input.vector3Value = new Vector3(inputMin, inputMax, Mathf.Clamp(inputGamma, 0.1f, 9.99f));
|
||||
output.vector2Value = new Vector2(outputMin, outputMax);
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
}
|
||||
|
||||
void DrawHistogram(Rect rect)
|
||||
{
|
||||
// Scale histogram values
|
||||
int[] scaledHistogram = new int[256];
|
||||
|
||||
int max = 0;
|
||||
for (int i = 0; i < 256; i++)
|
||||
max = (max < m_Histogram[i]) ? m_Histogram[i] : max;
|
||||
|
||||
scaledHistogram = new int[256];
|
||||
|
||||
if (p_Logarithmic.boolValue)
|
||||
{
|
||||
float factor = rect.height / Mathf.Log10(max);
|
||||
|
||||
for (int i = 0; i < 256; i++)
|
||||
scaledHistogram[i] = (m_Histogram[i] == 0) ? 0 : Mathf.Max(Mathf.RoundToInt(Mathf.Log10(m_Histogram[i]) * factor), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
float factor = rect.height / max;
|
||||
|
||||
for (int i = 0; i < 256; i++)
|
||||
scaledHistogram[i] = Mathf.Max(Mathf.RoundToInt(m_Histogram[i] * factor), 1);
|
||||
}
|
||||
|
||||
// Color
|
||||
if (p_Mode.intValue == (int)ColorMode.RGB)
|
||||
{
|
||||
if (p_CurrentChannel.intValue == (int)Channel.Red)
|
||||
Handles.color = RedColor;
|
||||
else if (p_CurrentChannel.intValue == (int)Channel.Green)
|
||||
Handles.color = GreenColor;
|
||||
else if (p_CurrentChannel.intValue == (int)Channel.Blue)
|
||||
Handles.color = BlueColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
Handles.color = MasterColor;
|
||||
}
|
||||
|
||||
// Base line
|
||||
Vector2 p1 = new Vector2(rect.x - 1, rect.yMax);
|
||||
Vector2 p2 = new Vector2(rect.xMax - 1, rect.yMax);
|
||||
Handles.DrawLine(p1, p2);
|
||||
|
||||
// Histogram
|
||||
for (int i = 0; i < (int)rect.width; i++)
|
||||
{
|
||||
float remapI = (float)i / rect.width * 255f;
|
||||
int index = Mathf.FloorToInt(remapI);
|
||||
float fract = remapI - (float)index;
|
||||
float v1 = scaledHistogram[index];
|
||||
float v2 = scaledHistogram[Mathf.Min(index + 1, 255)];
|
||||
float h = v1 * (1.0f - fract) + v2 * fract;
|
||||
Handles.DrawLine(
|
||||
new Vector2(rect.x + i, rect.yMax),
|
||||
new Vector2(rect.x + i, rect.yMin + (rect.height - h))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateHistogram(RenderTexture source)
|
||||
{
|
||||
if (m_TempTexture == null || m_TempTexture.width != source.width || m_TempTexture.height != source.height)
|
||||
{
|
||||
if (m_TempTexture != null)
|
||||
DestroyImmediate(m_TempTexture);
|
||||
|
||||
m_TempTexture = new Texture2D(source.width, source.height, TextureFormat.RGB24, false);
|
||||
m_TempTexture.anisoLevel = 0;
|
||||
m_TempTexture.wrapMode = TextureWrapMode.Clamp;
|
||||
m_TempTexture.filterMode = FilterMode.Bilinear;
|
||||
m_TempTexture.hideFlags = HideFlags.HideAndDontSave;
|
||||
}
|
||||
|
||||
// Grab the screen content for the camera
|
||||
RenderTexture.active = source;
|
||||
m_TempTexture.ReadPixels(new Rect(0, 0, source.width, source.height), 0, 0, false);
|
||||
m_TempTexture.Apply();
|
||||
RenderTexture.active = null;
|
||||
|
||||
// Raw histogram data
|
||||
Color[] pixels = m_TempTexture.GetPixels();
|
||||
|
||||
if (m_Target.Mode == ColorMode.Monochrome)
|
||||
{
|
||||
Array.Clear(m_Histogram, 0, 256);
|
||||
for (int i = 0; i < pixels.Length; i++)
|
||||
{
|
||||
Color c = pixels[i];
|
||||
m_Histogram[(int)((c.r * 0.2125f + c.g * 0.7154f + c.b * 0.0721f) * 255)]++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (m_Target.e_CurrentChannel)
|
||||
{
|
||||
case Channel.Red:
|
||||
Array.Clear(m_Histogram, 0, 256);
|
||||
for (int i = 0; i < pixels.Length; i++)
|
||||
m_Histogram[(int)(pixels[i].r * 255)]++;
|
||||
break;
|
||||
case Channel.Green:
|
||||
Array.Clear(m_Histogram, 0, 256);
|
||||
for (int i = 0; i < pixels.Length; i++)
|
||||
m_Histogram[(int)(pixels[i].g * 255)]++;
|
||||
break;
|
||||
case Channel.Blue:
|
||||
Array.Clear(m_Histogram, 0, 256);
|
||||
for (int i = 0; i < pixels.Length; i++)
|
||||
m_Histogram[(int)(pixels[i].b * 255)]++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/LevelsEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/LevelsEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ac5d17dae0d68ac4fae73a57b0b964b8
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
85
Assets/Colorful FX/Editor/Effects/LoFiPaletteEditor.cs
Normal file
85
Assets/Colorful FX/Editor/Effects/LoFiPaletteEditor.cs
Normal file
|
@ -0,0 +1,85 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(LoFiPalette))]
|
||||
public class LoFiPaletteEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Palette;
|
||||
SerializedProperty p_Amount;
|
||||
SerializedProperty p_ForceCompatibility;
|
||||
SerializedProperty p_Pixelize;
|
||||
SerializedProperty p_PixelSize;
|
||||
|
||||
static GUIContent[] palettes = {
|
||||
new GUIContent("None"),
|
||||
new GUIContent(""),
|
||||
new GUIContent("Amstrad CPC"),
|
||||
new GUIContent("CGA"),
|
||||
new GUIContent("Commodore 64"),
|
||||
new GUIContent("Commodore Plus"),
|
||||
new GUIContent("EGA"),
|
||||
new GUIContent("GameBoy"),
|
||||
new GUIContent("MacOS 16"),
|
||||
new GUIContent("MacOS 256"),
|
||||
new GUIContent("Master System"),
|
||||
new GUIContent("RiscOS 16"),
|
||||
new GUIContent("Teletex"),
|
||||
new GUIContent("Windows 16"),
|
||||
new GUIContent("Windows 256"),
|
||||
new GUIContent("ZX Spectrum"),
|
||||
new GUIContent(""),
|
||||
new GUIContent("Andrae"),
|
||||
new GUIContent("Anodomani"),
|
||||
new GUIContent("Crayolo"),
|
||||
new GUIContent("DB16"),
|
||||
new GUIContent("DB32"),
|
||||
new GUIContent("DJinn"),
|
||||
new GUIContent("Drazile A"),
|
||||
new GUIContent("Drazile B"),
|
||||
new GUIContent("Drazile C"),
|
||||
new GUIContent("Eggy"),
|
||||
new GUIContent("Finlal A"),
|
||||
new GUIContent("Finlal B"),
|
||||
new GUIContent("Hapiel"),
|
||||
new GUIContent("Pavanz A"),
|
||||
new GUIContent("Pavanz B"),
|
||||
new GUIContent("Peyton"),
|
||||
new GUIContent("SpeedyCube")
|
||||
};
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Palette = serializedObject.FindProperty("Palette");
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
p_ForceCompatibility = serializedObject.FindProperty("ForceCompatibility");
|
||||
p_Pixelize = serializedObject.FindProperty("Pixelize");
|
||||
p_PixelSize = serializedObject.FindProperty("PixelSize");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
// Using intValue, enumValueIndex seems broken
|
||||
p_Palette.intValue = EditorGUILayout.Popup(GetContent("Palette"), p_Palette.intValue, palettes);
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
EditorGUILayout.PropertyField(p_ForceCompatibility);
|
||||
EditorGUILayout.PropertyField(p_Pixelize);
|
||||
|
||||
if (p_Pixelize.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(p_PixelSize);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/LoFiPaletteEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/LoFiPaletteEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 13a2b41bc1dfa8b45b0aa7806eedb14a
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
35
Assets/Colorful FX/Editor/Effects/LookupFilter3DEditor.cs
Normal file
35
Assets/Colorful FX/Editor/Effects/LookupFilter3DEditor.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(LookupFilter3D))]
|
||||
public class LookupFilter3DEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_LookupTexture;
|
||||
SerializedProperty p_Amout;
|
||||
SerializedProperty p_ForceCompatibility;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_LookupTexture = serializedObject.FindProperty("LookupTexture");
|
||||
p_Amout = serializedObject.FindProperty("Amount");
|
||||
p_ForceCompatibility = serializedObject.FindProperty("ForceCompatibility");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_LookupTexture);
|
||||
EditorGUILayout.PropertyField(p_Amout);
|
||||
EditorGUILayout.PropertyField(p_ForceCompatibility);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2185476e9656d32409b69f8792dccd82
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
34
Assets/Colorful FX/Editor/Effects/LookupFilterEditor.cs
Normal file
34
Assets/Colorful FX/Editor/Effects/LookupFilterEditor.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(LookupFilter))]
|
||||
public class LookupFilterEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_LookupTexture;
|
||||
SerializedProperty p_Amout;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_LookupTexture = serializedObject.FindProperty("LookupTexture");
|
||||
p_Amout = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.HelpBox("This effect is deprecated. Use \"Lookup Filter 3D\" instead for better performances!", MessageType.Warning);
|
||||
|
||||
EditorGUILayout.PropertyField(p_LookupTexture);
|
||||
EditorGUILayout.PropertyField(p_Amout);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/LookupFilterEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/LookupFilterEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d6489f28835764f49bc726c7bc74e89b
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
29
Assets/Colorful FX/Editor/Effects/NegativeEditor.cs
Normal file
29
Assets/Colorful FX/Editor/Effects/NegativeEditor.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Negative))]
|
||||
public class NegativeEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Amount;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/NegativeEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/NegativeEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c46e42cb6ddd5ff48832385a30fba226
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
47
Assets/Colorful FX/Editor/Effects/NoiseEditor.cs
Normal file
47
Assets/Colorful FX/Editor/Effects/NoiseEditor.cs
Normal file
|
@ -0,0 +1,47 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Noise))]
|
||||
public class NoiseEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Mode;
|
||||
SerializedProperty p_Animate;
|
||||
SerializedProperty p_Seed;
|
||||
SerializedProperty p_Strength;
|
||||
SerializedProperty p_LumContribution;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Mode = serializedObject.FindProperty("Mode");
|
||||
p_Animate = serializedObject.FindProperty("Animate");
|
||||
p_Seed = serializedObject.FindProperty("Seed");
|
||||
p_Strength = serializedObject.FindProperty("Strength");
|
||||
p_LumContribution = serializedObject.FindProperty("LumContribution");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Mode);
|
||||
EditorGUILayout.PropertyField(p_Animate);
|
||||
|
||||
EditorGUI.BeginDisabledGroup(p_Animate.boolValue);
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_Seed);
|
||||
}
|
||||
EditorGUI.EndDisabledGroup();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Strength);
|
||||
EditorGUILayout.PropertyField(p_LumContribution, GetContent("Luminance Contribution"));
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/NoiseEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/NoiseEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c675525fd1d05714ba52aae6a1da5e8c
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
77
Assets/Colorful FX/Editor/Effects/PhotoFilterEditor.cs
Normal file
77
Assets/Colorful FX/Editor/Effects/PhotoFilterEditor.cs
Normal file
|
@ -0,0 +1,77 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(PhotoFilter))]
|
||||
public class PhotoFilterEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Color;
|
||||
SerializedProperty p_Density;
|
||||
|
||||
static GUIContent[] presets = {
|
||||
new GUIContent("Choose a preset..."),
|
||||
new GUIContent("Warming Filter (85)"),
|
||||
new GUIContent("Warming Filter (LBA)"),
|
||||
new GUIContent("Warming Filter (81)"),
|
||||
new GUIContent("Cooling Filter (80)"),
|
||||
new GUIContent("Cooling Filter (LBB)"),
|
||||
new GUIContent("Cooling Filter (82)"),
|
||||
new GUIContent("Red"),
|
||||
new GUIContent("Orange"),
|
||||
new GUIContent("Yellow"),
|
||||
new GUIContent("Green"),
|
||||
new GUIContent("Cyan"),
|
||||
new GUIContent("Blue"),
|
||||
new GUIContent("Violet"),
|
||||
new GUIContent("Magenta"),
|
||||
new GUIContent("Sepia"),
|
||||
new GUIContent("Deep Red"),
|
||||
new GUIContent("Deep Blue"),
|
||||
new GUIContent("Deep Emerald"),
|
||||
new GUIContent("Deep Yellow"),
|
||||
new GUIContent("Underwater")
|
||||
};
|
||||
|
||||
static float[,] presetsData = { { 0.925f, 0.541f, 0.0f }, { 0.98f, 0.541f, 0.0f }, { 0.922f, 0.694f, 0.075f },
|
||||
{ 0.0f, 0.427f, 1.0f }, { 0.0f, 0.365f, 1.0f }, { 0.0f, 0.71f, 1.0f },
|
||||
{ 0.918f, 0.102f, 0.102f }, { 0.956f, 0.518f, 0.09f }, { 0.976f, 0.89f, 0.11f },
|
||||
{ 0.098f, 0.788f, 0.098f }, { 0.114f, 0.796f, 0.918f }, { 0.114f, 0.209f, 0.918f },
|
||||
{ 0.608f, 0.114f, 0.918f }, { 0.89f, 0.094f, 0.89f }, { 0.675f, 0.478f, 0.2f },
|
||||
{ 1.0f, 0.0f, 0.0f }, { 0.0f, 0.133f, 0.804f }, { 0.0f, 0.553f, 0.0f },
|
||||
{ 1.0f, 0.835f, 0.0f }, { 0.0f, 0.761f, 0.694f } };
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Color = serializedObject.FindProperty("Color");
|
||||
p_Density = serializedObject.FindProperty("Density");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Color);
|
||||
EditorGUILayout.PropertyField(p_Density);
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
int selectedPreset = EditorGUILayout.Popup(GetContent("Preset"), 0, presets);
|
||||
|
||||
if (EditorGUI.EndChangeCheck() && selectedPreset > 0)
|
||||
{
|
||||
selectedPreset--;
|
||||
p_Color.colorValue = new Color(
|
||||
presetsData[selectedPreset, 0],
|
||||
presetsData[selectedPreset, 1],
|
||||
presetsData[selectedPreset, 2]
|
||||
);
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/PhotoFilterEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/PhotoFilterEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8aa05227668c2ff45a1ddf5b714fb64c
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
35
Assets/Colorful FX/Editor/Effects/PixelMatrixEditor.cs
Normal file
35
Assets/Colorful FX/Editor/Effects/PixelMatrixEditor.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(PixelMatrix))]
|
||||
public class PixelMatrixEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Size;
|
||||
SerializedProperty p_Brightness;
|
||||
SerializedProperty p_BlackBorder;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Size = serializedObject.FindProperty("Size");
|
||||
p_Brightness = serializedObject.FindProperty("Brightness");
|
||||
p_BlackBorder = serializedObject.FindProperty("BlackBorder");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Size);
|
||||
EditorGUILayout.PropertyField(p_Brightness);
|
||||
EditorGUILayout.PropertyField(p_BlackBorder);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/PixelMatrixEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/PixelMatrixEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b5ade3fe502dc404b91a45c95c4896d6
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
46
Assets/Colorful FX/Editor/Effects/PixelateEditor.cs
Normal file
46
Assets/Colorful FX/Editor/Effects/PixelateEditor.cs
Normal file
|
@ -0,0 +1,46 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Pixelate))]
|
||||
public class PixelateEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Scale;
|
||||
SerializedProperty p_Ratio;
|
||||
SerializedProperty p_AutomaticRatio;
|
||||
SerializedProperty p_Mode;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Scale = serializedObject.FindProperty("Scale");
|
||||
p_Ratio = serializedObject.FindProperty("Ratio");
|
||||
p_AutomaticRatio = serializedObject.FindProperty("AutomaticRatio");
|
||||
p_Mode = serializedObject.FindProperty("Mode");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Mode);
|
||||
EditorGUILayout.PropertyField(p_Scale);
|
||||
EditorGUILayout.PropertyField(p_AutomaticRatio);
|
||||
|
||||
if (!p_AutomaticRatio.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_Ratio);
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/PixelateEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/PixelateEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 284d28bd27c885c4fad7bdb289e4b404
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
32
Assets/Colorful FX/Editor/Effects/PosterizeEditor.cs
Normal file
32
Assets/Colorful FX/Editor/Effects/PosterizeEditor.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(Posterize))]
|
||||
public class PosterizeEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Levels;
|
||||
SerializedProperty p_Amount;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Levels = serializedObject.FindProperty("Levels");
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Levels);
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/PosterizeEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/PosterizeEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0869f3e787781f645b6a50d951749c8d
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
32
Assets/Colorful FX/Editor/Effects/RGBSplitEditor.cs
Normal file
32
Assets/Colorful FX/Editor/Effects/RGBSplitEditor.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(RGBSplit))]
|
||||
public class RGBSplitEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Amount;
|
||||
SerializedProperty p_Angle;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Amount = serializedObject.FindProperty("Amount");
|
||||
p_Angle = serializedObject.FindProperty("Angle");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Amount);
|
||||
EditorGUILayout.PropertyField(p_Angle);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/RGBSplitEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/RGBSplitEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: aa0746a6353353f4a9dbf1d9d1115ab0
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
56
Assets/Colorful FX/Editor/Effects/RadialBlurEditor.cs
Normal file
56
Assets/Colorful FX/Editor/Effects/RadialBlurEditor.cs
Normal file
|
@ -0,0 +1,56 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(RadialBlur))]
|
||||
public class RadialBlurEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_Strength;
|
||||
SerializedProperty p_Samples;
|
||||
SerializedProperty p_Center;
|
||||
SerializedProperty p_Quality;
|
||||
SerializedProperty p_Sharpness;
|
||||
SerializedProperty p_Darkness;
|
||||
SerializedProperty p_EnableVignette;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_Strength = serializedObject.FindProperty("Strength");
|
||||
p_Samples = serializedObject.FindProperty("Samples");
|
||||
p_Center = serializedObject.FindProperty("Center");
|
||||
p_Quality = serializedObject.FindProperty("Quality");
|
||||
p_Sharpness = serializedObject.FindProperty("Sharpness");
|
||||
p_Darkness = serializedObject.FindProperty("Darkness");
|
||||
p_EnableVignette = serializedObject.FindProperty("EnableVignette");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.PropertyField(p_Quality);
|
||||
|
||||
if (p_Quality.intValue == (int)RadialBlur.QualityPreset.Custom)
|
||||
EditorGUILayout.PropertyField(p_Samples);
|
||||
|
||||
EditorGUILayout.PropertyField(p_Strength);
|
||||
EditorGUILayout.PropertyField(p_Center, GetContent("Center Point"));
|
||||
EditorGUILayout.PropertyField(p_EnableVignette, GetContent("Vignette"));
|
||||
|
||||
if (p_EnableVignette.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(p_Sharpness);
|
||||
EditorGUILayout.PropertyField(p_Darkness);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
10
Assets/Colorful FX/Editor/Effects/RadialBlurEditor.cs.meta
Normal file
10
Assets/Colorful FX/Editor/Effects/RadialBlurEditor.cs.meta
Normal file
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: aafd9c0e42cf95a4789cc0560efc6726
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
114
Assets/Colorful FX/Editor/Effects/SCurveContrastEditor.cs
Normal file
114
Assets/Colorful FX/Editor/Effects/SCurveContrastEditor.cs
Normal file
|
@ -0,0 +1,114 @@
|
|||
// Colorful FX - Unity Asset
|
||||
// Copyright (c) 2015 - Thomas Hourdel
|
||||
// http://www.thomashourdel.com
|
||||
|
||||
namespace Colorful.Editors
|
||||
{
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(SCurveContrast))]
|
||||
public class SCurveContrastEditor : BaseEffectEditor
|
||||
{
|
||||
SerializedProperty p_RedSteepness;
|
||||
SerializedProperty p_RedGamma;
|
||||
SerializedProperty p_GreenSteepness;
|
||||
SerializedProperty p_GreenGamma;
|
||||
SerializedProperty p_BlueSteepness;
|
||||
SerializedProperty p_BlueGamma;
|
||||
SerializedProperty p_ShowCurves;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
p_RedSteepness = serializedObject.FindProperty("RedSteepness");
|
||||
p_RedGamma = serializedObject.FindProperty("RedGamma");
|
||||
p_GreenSteepness = serializedObject.FindProperty("GreenSteepness");
|
||||
p_GreenGamma = serializedObject.FindProperty("GreenGamma");
|
||||
p_BlueSteepness = serializedObject.FindProperty("BlueSteepness");
|
||||
p_BlueGamma = serializedObject.FindProperty("BlueGamma");
|
||||
p_ShowCurves = serializedObject.FindProperty("e_ShowCurves");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
serializedObject.Update();
|
||||
|
||||
EditorGUILayout.LabelField(GetContent("Red"), EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_RedSteepness, GetContent("Steepness"));
|
||||
EditorGUILayout.PropertyField(p_RedGamma, GetContent("Gamma"));
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.LabelField(GetContent("Green"), EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_GreenSteepness, GetContent("Steepness"));
|
||||
EditorGUILayout.PropertyField(p_GreenGamma, GetContent("Gamma"));
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.LabelField(GetContent("Blue"), EditorStyles.boldLabel);
|
||||
EditorGUI.indentLevel++;
|
||||
{
|
||||
EditorGUILayout.PropertyField(p_BlueSteepness, GetContent("Steepness"));
|
||||
EditorGUILayout.PropertyField(p_BlueGamma, GetContent("Gamma"));
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.PropertyField(p_ShowCurves, GetContent("Show Curves"));
|
||||
|
||||
if (p_ShowCurves.boolValue)
|
||||
DrawCurve();
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
void DrawCurve()
|
||||
{
|
||||
int h = 200;
|
||||
int h_1 = h - 1;
|
||||
Rect r = GUILayoutUtility.GetRect(256f, h);
|
||||
GUI.Box(r, GUIContent.none);
|
||||
|
||||
float rs = p_RedSteepness.floatValue;
|
||||
float rg = p_RedGamma.floatValue;
|
||||
float gs = p_GreenSteepness.floatValue;
|
||||
float gg = p_GreenGamma.floatValue;
|
||||
float bs = p_BlueSteepness.floatValue;
|
||||
float bg = p_BlueGamma.floatValue;
|
||||
|
||||
int w = Mathf.FloorToInt(r.width);
|
||||
Vector3[] red = new Vector3[w];
|
||||
Vector3[] green = new Vector3[w];
|
||||
Vector3[] blue = new Vector3[w];
|
||||
|
||||
for (int i = 0; i < w; i++)
|
||||
{
|
||||
float v = (float)i / (w - 1);
|
||||
red[i] = new Vector3(r.x + i, r.y + (h - curve(v, rs, rg) * h_1), 0f);
|
||||
green[i] = new Vector3(r.x + i, r.y + (h - curve(v, gs, gg) * h_1), 0f);
|
||||
blue[i] = new Vector3(r.x + i, r.y + (h - curve(v, bs, bg) * h_1), 0f);
|
||||
}
|
||||
|
||||
Handles.color = EditorGUIUtility.isProSkin ? new Color(0f, 1f, 1f, 2f) : new Color(0f, 0f, 1f, 2f);
|
||||
Handles.DrawAAPolyLine(1f, blue);
|
||||
Handles.color = EditorGUIUtility.isProSkin ? new Color(0f, 1f, 0f, 2f) : new Color(0.2f, 0.8f, 0.2f, 2f);
|
||||
Handles.DrawAAPolyLine(1f, green);
|
||||
Handles.color = new Color(1f, 0f, 0f, 2f);
|
||||
Handles.DrawAAPolyLine(1f, red);
|
||||
Handles.color = Color.white;
|
||||
}
|
||||
|
||||
float curve(float o, float steepness, float gamma)
|
||||
{
|
||||
float g = Mathf.Pow(2f, steepness) * 0.5f;
|
||||
float c = (o < 0.5f) ? Mathf.Pow(o, steepness) * g : 1f - Mathf.Pow(1f - o, steepness) * g;
|
||||
return Mathf.Clamp01(Mathf.Pow(c, gamma));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7a6954c6ece9836479f4d43d821ff8e9
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue