Skip to content
This repository was archived by the owner on Mar 8, 2018. It is now read-only.

Commit 102f057

Browse files
author
KennuX
committed
Merged private repository into github with new rendering implementation
1 parent f393de5 commit 102f057

File tree

526 files changed

+39618
-313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

526 files changed

+39618
-313
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[Oo]bj/
44
[Aa]ssets/[Pp]rivate/
55
Assets/Private.meta
6+
Assets/ZedZ_Model/
67

78
# Ignore the following file extensions
89
*.DS_Store

Assets/Editor.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor/ImageEffects.meta

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
using System;
2+
using UnityEditor;
3+
using UnityEngine;
4+
5+
namespace UnityStandardAssets.ImageEffects
6+
{
7+
[CustomEditor(typeof (Antialiasing))]
8+
public class AntialiasingEditor : Editor
9+
{
10+
private SerializedObject serObj;
11+
12+
private SerializedProperty mode;
13+
14+
private SerializedProperty showGeneratedNormals;
15+
private SerializedProperty offsetScale;
16+
private SerializedProperty blurRadius;
17+
private SerializedProperty dlaaSharp;
18+
19+
private SerializedProperty edgeThresholdMin;
20+
private SerializedProperty edgeThreshold;
21+
private SerializedProperty edgeSharpness;
22+
23+
24+
private void OnEnable()
25+
{
26+
serObj = new SerializedObject(target);
27+
28+
mode = serObj.FindProperty("mode");
29+
30+
showGeneratedNormals = serObj.FindProperty("showGeneratedNormals");
31+
offsetScale = serObj.FindProperty("offsetScale");
32+
blurRadius = serObj.FindProperty("blurRadius");
33+
dlaaSharp = serObj.FindProperty("dlaaSharp");
34+
35+
edgeThresholdMin = serObj.FindProperty("edgeThresholdMin");
36+
edgeThreshold = serObj.FindProperty("edgeThreshold");
37+
edgeSharpness = serObj.FindProperty("edgeSharpness");
38+
}
39+
40+
41+
public override void OnInspectorGUI()
42+
{
43+
serObj.Update();
44+
45+
GUILayout.Label("Luminance based fullscreen antialiasing", EditorStyles.miniBoldLabel);
46+
47+
EditorGUILayout.PropertyField(mode, new GUIContent("Technique"));
48+
49+
Material mat = (target as Antialiasing).CurrentAAMaterial();
50+
if (null == mat && (target as Antialiasing).enabled)
51+
{
52+
EditorGUILayout.HelpBox("This AA technique is currently not supported. Choose a different technique or disable the effect and use MSAA instead.", MessageType.Warning);
53+
}
54+
55+
if (mode.enumValueIndex == (int) AAMode.NFAA)
56+
{
57+
EditorGUILayout.PropertyField(offsetScale, new GUIContent("Edge Detect Ofs"));
58+
EditorGUILayout.PropertyField(blurRadius, new GUIContent("Blur Radius"));
59+
EditorGUILayout.PropertyField(showGeneratedNormals, new GUIContent("Show Normals"));
60+
}
61+
else if (mode.enumValueIndex == (int) AAMode.DLAA)
62+
{
63+
EditorGUILayout.PropertyField(dlaaSharp, new GUIContent("Sharp"));
64+
}
65+
else if (mode.enumValueIndex == (int) AAMode.FXAA3Console)
66+
{
67+
EditorGUILayout.PropertyField(edgeThresholdMin, new GUIContent("Edge Min Threshhold"));
68+
EditorGUILayout.PropertyField(edgeThreshold, new GUIContent("Edge Threshhold"));
69+
EditorGUILayout.PropertyField(edgeSharpness, new GUIContent("Edge Sharpness"));
70+
}
71+
72+
serObj.ApplyModifiedProperties();
73+
}
74+
}
75+
}

Assets/Editor/ImageEffects/AntialiasingEditor.cs.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
using System;
2+
using UnityEditor;
3+
using UnityEngine;
4+
5+
namespace UnityStandardAssets.ImageEffects
6+
{
7+
[CustomEditor (typeof(BloomAndFlares))]
8+
class BloomAndFlaresEditor : Editor
9+
{
10+
SerializedProperty tweakMode;
11+
SerializedProperty screenBlendMode;
12+
13+
SerializedObject serObj;
14+
15+
SerializedProperty hdr;
16+
SerializedProperty sepBlurSpread;
17+
SerializedProperty useSrcAlphaAsMask;
18+
19+
SerializedProperty bloomIntensity;
20+
SerializedProperty bloomthreshold;
21+
SerializedProperty bloomBlurIterations;
22+
23+
SerializedProperty lensflares;
24+
25+
SerializedProperty hollywoodFlareBlurIterations;
26+
27+
SerializedProperty lensflareMode;
28+
SerializedProperty hollyStretchWidth;
29+
SerializedProperty lensflareIntensity;
30+
SerializedProperty lensflarethreshold;
31+
SerializedProperty flareColorA;
32+
SerializedProperty flareColorB;
33+
SerializedProperty flareColorC;
34+
SerializedProperty flareColorD;
35+
36+
SerializedProperty lensFlareVignetteMask;
37+
38+
void OnEnable () {
39+
serObj = new SerializedObject (target);
40+
41+
screenBlendMode = serObj.FindProperty("screenBlendMode");
42+
hdr = serObj.FindProperty("hdr");
43+
44+
sepBlurSpread = serObj.FindProperty("sepBlurSpread");
45+
useSrcAlphaAsMask = serObj.FindProperty("useSrcAlphaAsMask");
46+
47+
bloomIntensity = serObj.FindProperty("bloomIntensity");
48+
bloomthreshold = serObj.FindProperty("bloomThreshold");
49+
bloomBlurIterations = serObj.FindProperty("bloomBlurIterations");
50+
51+
lensflares = serObj.FindProperty("lensflares");
52+
53+
lensflareMode = serObj.FindProperty("lensflareMode");
54+
hollywoodFlareBlurIterations = serObj.FindProperty("hollywoodFlareBlurIterations");
55+
hollyStretchWidth = serObj.FindProperty("hollyStretchWidth");
56+
lensflareIntensity = serObj.FindProperty("lensflareIntensity");
57+
lensflarethreshold = serObj.FindProperty("lensflareThreshold");
58+
flareColorA = serObj.FindProperty("flareColorA");
59+
flareColorB = serObj.FindProperty("flareColorB");
60+
flareColorC = serObj.FindProperty("flareColorC");
61+
flareColorD = serObj.FindProperty("flareColorD");
62+
lensFlareVignetteMask = serObj.FindProperty("lensFlareVignetteMask");
63+
64+
tweakMode = serObj.FindProperty("tweakMode");
65+
}
66+
67+
68+
public override void OnInspectorGUI () {
69+
serObj.Update();
70+
71+
GUILayout.Label("HDR " + (hdr.enumValueIndex == 0 ? "auto detected, " : (hdr.enumValueIndex == 1 ? "forced on, " : "disabled, ")) + (useSrcAlphaAsMask.floatValue < 0.1f ? " ignoring alpha channel glow information" : " using alpha channel glow information"), EditorStyles.miniBoldLabel);
72+
73+
EditorGUILayout.PropertyField (tweakMode, new GUIContent("Tweak mode"));
74+
EditorGUILayout.PropertyField (screenBlendMode, new GUIContent("Blend mode"));
75+
EditorGUILayout.PropertyField (hdr, new GUIContent("HDR"));
76+
77+
// display info text when screen blend mode cannot be used
78+
Camera cam = (target as BloomAndFlares).GetComponent<Camera>();
79+
if (cam != null) {
80+
if (screenBlendMode.enumValueIndex==0 && ((cam.hdr && hdr.enumValueIndex==0) || (hdr.enumValueIndex==1))) {
81+
EditorGUILayout.HelpBox("Screen blend is not supported in HDR. Using 'Add' instead.", MessageType.Info);
82+
}
83+
}
84+
85+
if (1 == tweakMode.intValue)
86+
EditorGUILayout.PropertyField (lensflares, new GUIContent("Cast lens flares"));
87+
88+
EditorGUILayout.Separator ();
89+
90+
EditorGUILayout.PropertyField (bloomIntensity, new GUIContent("Intensity"));
91+
bloomthreshold.floatValue = EditorGUILayout.Slider ("threshold", bloomthreshold.floatValue, -0.05f, 4.0f);
92+
bloomBlurIterations.intValue = EditorGUILayout.IntSlider ("Blur iterations", bloomBlurIterations.intValue, 1, 4);
93+
sepBlurSpread.floatValue = EditorGUILayout.Slider ("Blur spread", sepBlurSpread.floatValue, 0.1f, 10.0f);
94+
95+
if (1 == tweakMode.intValue)
96+
useSrcAlphaAsMask.floatValue = EditorGUILayout.Slider (new GUIContent("Use alpha mask", "Make alpha channel define glowiness"), useSrcAlphaAsMask.floatValue, 0.0f, 1.0f);
97+
else
98+
useSrcAlphaAsMask.floatValue = 0.0f;
99+
100+
if (1 == tweakMode.intValue) {
101+
EditorGUILayout.Separator ();
102+
103+
if (lensflares.boolValue) {
104+
105+
// further lens flare tweakings
106+
if (0 != tweakMode.intValue)
107+
EditorGUILayout.PropertyField (lensflareMode, new GUIContent("Lens flare mode"));
108+
else
109+
lensflareMode.enumValueIndex = 0;
110+
111+
EditorGUILayout.PropertyField(lensFlareVignetteMask, new GUIContent("Lens flare mask", "This mask is needed to prevent lens flare artifacts"));
112+
113+
EditorGUILayout.PropertyField (lensflareIntensity, new GUIContent("Local intensity"));
114+
lensflarethreshold.floatValue = EditorGUILayout.Slider ("Local threshold", lensflarethreshold.floatValue, 0.0f, 1.0f);
115+
116+
if (lensflareMode.intValue == 0) {
117+
// ghosting
118+
EditorGUILayout.BeginHorizontal ();
119+
EditorGUILayout.PropertyField (flareColorA, new GUIContent("1st Color"));
120+
EditorGUILayout.PropertyField (flareColorB, new GUIContent("2nd Color"));
121+
EditorGUILayout.EndHorizontal ();
122+
123+
EditorGUILayout.BeginHorizontal ();
124+
EditorGUILayout.PropertyField (flareColorC, new GUIContent("3rd Color"));
125+
EditorGUILayout.PropertyField (flareColorD, new GUIContent("4th Color"));
126+
EditorGUILayout.EndHorizontal ();
127+
}
128+
else if (lensflareMode.intValue == 1) {
129+
// hollywood
130+
EditorGUILayout.PropertyField (hollyStretchWidth, new GUIContent("Stretch width"));
131+
hollywoodFlareBlurIterations.intValue = EditorGUILayout.IntSlider ("Blur iterations", hollywoodFlareBlurIterations.intValue, 1, 4);
132+
133+
EditorGUILayout.PropertyField (flareColorA, new GUIContent("Tint Color"));
134+
}
135+
else if (lensflareMode.intValue == 2) {
136+
// both
137+
EditorGUILayout.PropertyField (hollyStretchWidth, new GUIContent("Stretch width"));
138+
hollywoodFlareBlurIterations.intValue = EditorGUILayout.IntSlider ("Blur iterations", hollywoodFlareBlurIterations.intValue, 1, 4);
139+
140+
EditorGUILayout.BeginHorizontal ();
141+
EditorGUILayout.PropertyField (flareColorA, new GUIContent("1st Color"));
142+
EditorGUILayout.PropertyField (flareColorB, new GUIContent("2nd Color"));
143+
EditorGUILayout.EndHorizontal ();
144+
145+
EditorGUILayout.BeginHorizontal ();
146+
EditorGUILayout.PropertyField (flareColorC, new GUIContent("3rd Color"));
147+
EditorGUILayout.PropertyField (flareColorD, new GUIContent("4th Color"));
148+
EditorGUILayout.EndHorizontal ();
149+
}
150+
}
151+
} else
152+
lensflares.boolValue = false; // disable lens flares in simple tweak mode
153+
154+
serObj.ApplyModifiedProperties();
155+
}
156+
}
157+
}

Assets/Editor/ImageEffects/BloomAndFlaresEditor.cs.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)