Showing
515 changed files
with
3995 additions
and
10 deletions
.vscode/settings.json
0 → 100644
1 | +{ | ||
2 | + "files.exclude": | ||
3 | + { | ||
4 | + "**/.DS_Store":true, | ||
5 | + "**/.git":true, | ||
6 | + "**/.gitignore":true, | ||
7 | + "**/.gitmodules":true, | ||
8 | + "**/*.booproj":true, | ||
9 | + "**/*.pidb":true, | ||
10 | + "**/*.suo":true, | ||
11 | + "**/*.user":true, | ||
12 | + "**/*.userprefs":true, | ||
13 | + "**/*.unityproj":true, | ||
14 | + "**/*.dll":true, | ||
15 | + "**/*.exe":true, | ||
16 | + "**/*.pdf":true, | ||
17 | + "**/*.mid":true, | ||
18 | + "**/*.midi":true, | ||
19 | + "**/*.wav":true, | ||
20 | + "**/*.gif":true, | ||
21 | + "**/*.ico":true, | ||
22 | + "**/*.jpg":true, | ||
23 | + "**/*.jpeg":true, | ||
24 | + "**/*.png":true, | ||
25 | + "**/*.psd":true, | ||
26 | + "**/*.tga":true, | ||
27 | + "**/*.tif":true, | ||
28 | + "**/*.tiff":true, | ||
29 | + "**/*.3ds":true, | ||
30 | + "**/*.3DS":true, | ||
31 | + "**/*.fbx":true, | ||
32 | + "**/*.FBX":true, | ||
33 | + "**/*.lxo":true, | ||
34 | + "**/*.LXO":true, | ||
35 | + "**/*.ma":true, | ||
36 | + "**/*.MA":true, | ||
37 | + "**/*.obj":true, | ||
38 | + "**/*.OBJ":true, | ||
39 | + "**/*.asset":true, | ||
40 | + "**/*.cubemap":true, | ||
41 | + "**/*.flare":true, | ||
42 | + "**/*.mat":true, | ||
43 | + "**/*.meta":true, | ||
44 | + "**/*.prefab":true, | ||
45 | + "**/*.unity":true, | ||
46 | + "build/":true, | ||
47 | + "Build/":true, | ||
48 | + "Library/":true, | ||
49 | + "library/":true, | ||
50 | + "obj/":true, | ||
51 | + "Obj/":true, | ||
52 | + "ProjectSettings/":true, | ||
53 | + "temp/":true, | ||
54 | + "Temp/":true | ||
55 | + } | ||
56 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
Assets/Basic Enhance.asset
0 → 100644
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!114 &11400000 | ||
4 | +MonoBehaviour: | ||
5 | + m_ObjectHideFlags: 0 | ||
6 | + m_PrefabParentObject: {fileID: 0} | ||
7 | + m_PrefabInternal: {fileID: 0} | ||
8 | + m_GameObject: {fileID: 0} | ||
9 | + m_Enabled: 1 | ||
10 | + m_EditorHideFlags: 0 | ||
11 | + m_Script: {fileID: 11500000, guid: 8a3bdb2cd68f901469e7cc149151eb49, type: 3} | ||
12 | + m_Name: Basic Enhance | ||
13 | + m_EditorClassIdentifier: | ||
14 | + debugViews: | ||
15 | + m_Enabled: 1 | ||
16 | + m_Settings: | ||
17 | + mode: 0 | ||
18 | + depth: | ||
19 | + scale: 1 | ||
20 | + motionVectors: | ||
21 | + sourceOpacity: 1 | ||
22 | + motionImageOpacity: 0 | ||
23 | + motionImageAmplitude: 16 | ||
24 | + motionVectorsOpacity: 1 | ||
25 | + motionVectorsResolution: 24 | ||
26 | + motionVectorsAmplitude: 64 | ||
27 | + fog: | ||
28 | + m_Enabled: 1 | ||
29 | + m_Settings: | ||
30 | + excludeSkybox: 1 | ||
31 | + antialiasing: | ||
32 | + m_Enabled: 0 | ||
33 | + m_Settings: | ||
34 | + method: 0 | ||
35 | + fxaaSettings: | ||
36 | + preset: 2 | ||
37 | + taaSettings: | ||
38 | + jitterSpread: 0.75 | ||
39 | + sharpen: 0.3 | ||
40 | + stationaryBlending: 0.95 | ||
41 | + motionBlending: 0.85 | ||
42 | + ambientOcclusion: | ||
43 | + m_Enabled: 1 | ||
44 | + m_Settings: | ||
45 | + intensity: 1 | ||
46 | + radius: 0.3 | ||
47 | + sampleCount: 10 | ||
48 | + downsampling: 1 | ||
49 | + forceForwardCompatibility: 0 | ||
50 | + ambientOnly: 0 | ||
51 | + highPrecision: 0 | ||
52 | + screenSpaceReflection: | ||
53 | + m_Enabled: 0 | ||
54 | + m_Settings: | ||
55 | + reflection: | ||
56 | + blendType: 0 | ||
57 | + reflectionQuality: 2 | ||
58 | + maxDistance: 100 | ||
59 | + iterationCount: 256 | ||
60 | + stepSize: 3 | ||
61 | + widthModifier: 0.5 | ||
62 | + reflectionBlur: 1 | ||
63 | + reflectBackfaces: 0 | ||
64 | + intensity: | ||
65 | + reflectionMultiplier: 1 | ||
66 | + fadeDistance: 100 | ||
67 | + fresnelFade: 1 | ||
68 | + fresnelFadePower: 1 | ||
69 | + screenEdgeMask: | ||
70 | + intensity: 0.03 | ||
71 | + depthOfField: | ||
72 | + m_Enabled: 1 | ||
73 | + m_Settings: | ||
74 | + focusDistance: 10 | ||
75 | + aperture: 5.6 | ||
76 | + focalLength: 50 | ||
77 | + useCameraFov: 1 | ||
78 | + kernelSize: 1 | ||
79 | + motionBlur: | ||
80 | + m_Enabled: 0 | ||
81 | + m_Settings: | ||
82 | + shutterAngle: 270 | ||
83 | + sampleCount: 10 | ||
84 | + frameBlending: 0 | ||
85 | + eyeAdaptation: | ||
86 | + m_Enabled: 0 | ||
87 | + m_Settings: | ||
88 | + lowPercent: 45 | ||
89 | + highPercent: 95 | ||
90 | + minLuminance: -5 | ||
91 | + maxLuminance: 1 | ||
92 | + keyValue: 0.25 | ||
93 | + dynamicKeyValue: 1 | ||
94 | + adaptationType: 0 | ||
95 | + speedUp: 2 | ||
96 | + speedDown: 1 | ||
97 | + logMin: -8 | ||
98 | + logMax: 4 | ||
99 | + bloom: | ||
100 | + m_Enabled: 1 | ||
101 | + m_Settings: | ||
102 | + bloom: | ||
103 | + intensity: 0.5 | ||
104 | + threshold: 1.1 | ||
105 | + softKnee: 0.5 | ||
106 | + radius: 4 | ||
107 | + antiFlicker: 1 | ||
108 | + lensDirt: | ||
109 | + texture: {fileID: 0} | ||
110 | + intensity: 3 | ||
111 | + colorGrading: | ||
112 | + m_Enabled: 0 | ||
113 | + m_Settings: | ||
114 | + tonemapping: | ||
115 | + tonemapper: 2 | ||
116 | + neutralBlackIn: 0.02 | ||
117 | + neutralWhiteIn: 10 | ||
118 | + neutralBlackOut: 0 | ||
119 | + neutralWhiteOut: 10 | ||
120 | + neutralWhiteLevel: 5.3 | ||
121 | + neutralWhiteClip: 10 | ||
122 | + basic: | ||
123 | + postExposure: 0 | ||
124 | + temperature: 0 | ||
125 | + tint: 0 | ||
126 | + hueShift: 0 | ||
127 | + saturation: 1 | ||
128 | + contrast: 1 | ||
129 | + channelMixer: | ||
130 | + red: {x: 1, y: 0, z: 0} | ||
131 | + green: {x: 0, y: 1, z: 0} | ||
132 | + blue: {x: 0, y: 0, z: 1} | ||
133 | + currentEditingChannel: 0 | ||
134 | + colorWheels: | ||
135 | + mode: 1 | ||
136 | + log: | ||
137 | + slope: {r: 0, g: 0, b: 0, a: 0} | ||
138 | + power: {r: 0, g: 0, b: 0, a: 0} | ||
139 | + offset: {r: 0, g: 0, b: 0, a: 0} | ||
140 | + linear: | ||
141 | + lift: {r: 0, g: 0, b: 0, a: 0} | ||
142 | + gamma: {r: 0, g: 0, b: 0, a: 0} | ||
143 | + gain: {r: 0, g: 0, b: 0, a: 0} | ||
144 | + curves: | ||
145 | + master: | ||
146 | + curve: | ||
147 | + serializedVersion: 2 | ||
148 | + m_Curve: | ||
149 | + - serializedVersion: 2 | ||
150 | + time: 0 | ||
151 | + value: 0 | ||
152 | + inSlope: 1 | ||
153 | + outSlope: 1 | ||
154 | + tangentMode: 0 | ||
155 | + - serializedVersion: 2 | ||
156 | + time: 1 | ||
157 | + value: 1 | ||
158 | + inSlope: 1 | ||
159 | + outSlope: 1 | ||
160 | + tangentMode: 0 | ||
161 | + m_PreInfinity: 2 | ||
162 | + m_PostInfinity: 2 | ||
163 | + m_RotationOrder: 4 | ||
164 | + m_Loop: 0 | ||
165 | + m_ZeroValue: 0 | ||
166 | + m_Range: 1 | ||
167 | + red: | ||
168 | + curve: | ||
169 | + serializedVersion: 2 | ||
170 | + m_Curve: | ||
171 | + - serializedVersion: 2 | ||
172 | + time: 0 | ||
173 | + value: 0 | ||
174 | + inSlope: 1 | ||
175 | + outSlope: 1 | ||
176 | + tangentMode: 0 | ||
177 | + - serializedVersion: 2 | ||
178 | + time: 1 | ||
179 | + value: 1 | ||
180 | + inSlope: 1 | ||
181 | + outSlope: 1 | ||
182 | + tangentMode: 0 | ||
183 | + m_PreInfinity: 2 | ||
184 | + m_PostInfinity: 2 | ||
185 | + m_RotationOrder: 4 | ||
186 | + m_Loop: 0 | ||
187 | + m_ZeroValue: 0 | ||
188 | + m_Range: 1 | ||
189 | + green: | ||
190 | + curve: | ||
191 | + serializedVersion: 2 | ||
192 | + m_Curve: | ||
193 | + - serializedVersion: 2 | ||
194 | + time: 0 | ||
195 | + value: 0 | ||
196 | + inSlope: 1 | ||
197 | + outSlope: 1 | ||
198 | + tangentMode: 0 | ||
199 | + - serializedVersion: 2 | ||
200 | + time: 1 | ||
201 | + value: 1 | ||
202 | + inSlope: 1 | ||
203 | + outSlope: 1 | ||
204 | + tangentMode: 0 | ||
205 | + m_PreInfinity: 2 | ||
206 | + m_PostInfinity: 2 | ||
207 | + m_RotationOrder: 4 | ||
208 | + m_Loop: 0 | ||
209 | + m_ZeroValue: 0 | ||
210 | + m_Range: 1 | ||
211 | + blue: | ||
212 | + curve: | ||
213 | + serializedVersion: 2 | ||
214 | + m_Curve: | ||
215 | + - serializedVersion: 2 | ||
216 | + time: 0 | ||
217 | + value: 0 | ||
218 | + inSlope: 1 | ||
219 | + outSlope: 1 | ||
220 | + tangentMode: 0 | ||
221 | + - serializedVersion: 2 | ||
222 | + time: 1 | ||
223 | + value: 1 | ||
224 | + inSlope: 1 | ||
225 | + outSlope: 1 | ||
226 | + tangentMode: 0 | ||
227 | + m_PreInfinity: 2 | ||
228 | + m_PostInfinity: 2 | ||
229 | + m_RotationOrder: 4 | ||
230 | + m_Loop: 0 | ||
231 | + m_ZeroValue: 0 | ||
232 | + m_Range: 1 | ||
233 | + hueVShue: | ||
234 | + curve: | ||
235 | + serializedVersion: 2 | ||
236 | + m_Curve: [] | ||
237 | + m_PreInfinity: 2 | ||
238 | + m_PostInfinity: 2 | ||
239 | + m_RotationOrder: 4 | ||
240 | + m_Loop: 1 | ||
241 | + m_ZeroValue: 0.5 | ||
242 | + m_Range: 1 | ||
243 | + hueVSsat: | ||
244 | + curve: | ||
245 | + serializedVersion: 2 | ||
246 | + m_Curve: [] | ||
247 | + m_PreInfinity: 2 | ||
248 | + m_PostInfinity: 2 | ||
249 | + m_RotationOrder: 4 | ||
250 | + m_Loop: 1 | ||
251 | + m_ZeroValue: 0.5 | ||
252 | + m_Range: 1 | ||
253 | + satVSsat: | ||
254 | + curve: | ||
255 | + serializedVersion: 2 | ||
256 | + m_Curve: [] | ||
257 | + m_PreInfinity: 2 | ||
258 | + m_PostInfinity: 2 | ||
259 | + m_RotationOrder: 4 | ||
260 | + m_Loop: 0 | ||
261 | + m_ZeroValue: 0.5 | ||
262 | + m_Range: 1 | ||
263 | + lumVSsat: | ||
264 | + curve: | ||
265 | + serializedVersion: 2 | ||
266 | + m_Curve: [] | ||
267 | + m_PreInfinity: 2 | ||
268 | + m_PostInfinity: 2 | ||
269 | + m_RotationOrder: 4 | ||
270 | + m_Loop: 0 | ||
271 | + m_ZeroValue: 0.5 | ||
272 | + m_Range: 1 | ||
273 | + e_CurrentEditingCurve: 0 | ||
274 | + e_CurveY: 1 | ||
275 | + e_CurveR: 0 | ||
276 | + e_CurveG: 0 | ||
277 | + e_CurveB: 0 | ||
278 | + userLut: | ||
279 | + m_Enabled: 0 | ||
280 | + m_Settings: | ||
281 | + lut: {fileID: 0} | ||
282 | + contribution: 1 | ||
283 | + chromaticAberration: | ||
284 | + m_Enabled: 0 | ||
285 | + m_Settings: | ||
286 | + spectralTexture: {fileID: 0} | ||
287 | + intensity: 0.1 | ||
288 | + grain: | ||
289 | + m_Enabled: 0 | ||
290 | + m_Settings: | ||
291 | + colored: 1 | ||
292 | + intensity: 0.5 | ||
293 | + size: 1 | ||
294 | + luminanceContribution: 0.8 | ||
295 | + vignette: | ||
296 | + m_Enabled: 1 | ||
297 | + m_Settings: | ||
298 | + mode: 0 | ||
299 | + color: {r: 0, g: 0, b: 0, a: 1} | ||
300 | + center: {x: 0.5, y: 0.5} | ||
301 | + intensity: 0.45 | ||
302 | + smoothness: 0.2 | ||
303 | + roundness: 1 | ||
304 | + mask: {fileID: 0} | ||
305 | + opacity: 1 | ||
306 | + rounded: 0 | ||
307 | + dithering: | ||
308 | + m_Enabled: 0 | ||
309 | + monitors: | ||
310 | + currentMonitorID: 0 | ||
311 | + refreshOnPlay: 0 | ||
312 | + histogramMode: 3 | ||
313 | + waveformExposure: 0.12 | ||
314 | + waveformY: 0 | ||
315 | + waveformR: 1 | ||
316 | + waveformG: 1 | ||
317 | + waveformB: 1 | ||
318 | + paradeExposure: 0.12 | ||
319 | + vectorscopeExposure: 0.12 | ||
320 | + vectorscopeShowBackground: 1 |
Assets/Basic Enhance.asset.meta
0 → 100644
... | @@ -38,7 +38,7 @@ RenderSettings: | ... | @@ -38,7 +38,7 @@ RenderSettings: |
38 | m_ReflectionIntensity: 1 | 38 | m_ReflectionIntensity: 1 |
39 | m_CustomReflection: {fileID: 0} | 39 | m_CustomReflection: {fileID: 0} |
40 | m_Sun: {fileID: 0} | 40 | m_Sun: {fileID: 0} |
41 | - m_IndirectSpecularColor: {r: 0.18028653, g: 0.22571698, b: 0.30692574, a: 1} | 41 | + m_IndirectSpecularColor: {r: 0.25328526, g: 0.2169855, b: 0.23319682, a: 1} |
42 | --- !u!157 &3 | 42 | --- !u!157 &3 |
43 | LightmapSettings: | 43 | LightmapSettings: |
44 | m_ObjectHideFlags: 0 | 44 | m_ObjectHideFlags: 0 |
... | @@ -391,6 +391,7 @@ GameObject: | ... | @@ -391,6 +391,7 @@ GameObject: |
391 | - component: {fileID: 775083197} | 391 | - component: {fileID: 775083197} |
392 | - component: {fileID: 775083196} | 392 | - component: {fileID: 775083196} |
393 | - component: {fileID: 775083195} | 393 | - component: {fileID: 775083195} |
394 | + - component: {fileID: 775083199} | ||
394 | m_Layer: 0 | 395 | m_Layer: 0 |
395 | m_Name: Main Camera | 396 | m_Name: Main Camera |
396 | m_TagString: MainCamera | 397 | m_TagString: MainCamera |
... | @@ -461,6 +462,18 @@ Transform: | ... | @@ -461,6 +462,18 @@ Transform: |
461 | m_Father: {fileID: 0} | 462 | m_Father: {fileID: 0} |
462 | m_RootOrder: 2 | 463 | m_RootOrder: 2 |
463 | m_LocalEulerAnglesHint: {x: 28.569002, y: -40, z: 0} | 464 | m_LocalEulerAnglesHint: {x: 28.569002, y: -40, z: 0} |
465 | +--- !u!114 &775083199 | ||
466 | +MonoBehaviour: | ||
467 | + m_ObjectHideFlags: 0 | ||
468 | + m_PrefabParentObject: {fileID: 0} | ||
469 | + m_PrefabInternal: {fileID: 0} | ||
470 | + m_GameObject: {fileID: 775083194} | ||
471 | + m_Enabled: 1 | ||
472 | + m_EditorHideFlags: 0 | ||
473 | + m_Script: {fileID: 11500000, guid: ff26db721962cdf4a8edcdfa9a767d2a, type: 3} | ||
474 | + m_Name: | ||
475 | + m_EditorClassIdentifier: | ||
476 | + profile: {fileID: 11400000, guid: d8515d2f8d9b4482bb41b19940a27eb0, type: 2} | ||
464 | --- !u!1 &810164710 | 477 | --- !u!1 &810164710 |
465 | GameObject: | 478 | GameObject: |
466 | m_ObjectHideFlags: 0 | 479 | m_ObjectHideFlags: 0 | ... | ... |
... | @@ -7,7 +7,7 @@ Material: | ... | @@ -7,7 +7,7 @@ Material: |
7 | m_PrefabParentObject: {fileID: 0} | 7 | m_PrefabParentObject: {fileID: 0} |
8 | m_PrefabInternal: {fileID: 0} | 8 | m_PrefabInternal: {fileID: 0} |
9 | m_Name: SkyBox | 9 | m_Name: SkyBox |
10 | - m_Shader: {fileID: 106, guid: 0000000000000000f000000000000000, type: 0} | 10 | + m_Shader: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0} |
11 | m_ShaderKeywords: _SUNDISK_HIGH_QUALITY | 11 | m_ShaderKeywords: _SUNDISK_HIGH_QUALITY |
12 | m_LightmapFlags: 4 | 12 | m_LightmapFlags: 4 |
13 | m_EnableInstancingVariants: 0 | 13 | m_EnableInstancingVariants: 0 |
... | @@ -17,13 +17,13 @@ Material: | ... | @@ -17,13 +17,13 @@ Material: |
17 | disabledShaderPasses: [] | 17 | disabledShaderPasses: [] |
18 | m_SavedProperties: | 18 | m_SavedProperties: |
19 | serializedVersion: 3 | 19 | serializedVersion: 3 |
20 | - m_TexEnvs: [] | 20 | + m_TexEnvs: |
21 | + - _Tex: | ||
22 | + m_Texture: {fileID: 8900000, guid: 656a59a5ff93c46498416d97e5c16b66, type: 3} | ||
23 | + m_Scale: {x: 1, y: 1} | ||
24 | + m_Offset: {x: 0, y: 0} | ||
21 | m_Floats: | 25 | m_Floats: |
22 | - - _AtmosphereThickness: 1 | 26 | + - _Exposure: 1 |
23 | - - _Exposure: 1.3 | 27 | + - _Rotation: 0 |
24 | - - _SunDisk: 2 | ||
25 | - - _SunSize: 0.04 | ||
26 | - - _SunSizeConvergence: 5 | ||
27 | m_Colors: | 28 | m_Colors: |
28 | - - _GroundColor: {r: 0.36899996, g: 0.34899998, b: 0.34099993, a: 1} | 29 | + - _Tint: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} |
29 | - - _SkyTint: {r: 0.5, g: 0.5, b: 0.5, a: 1} | ... | ... |
Assets/PostProcessing.meta
0 → 100644
Assets/PostProcessing/Editor Resources.meta
0 → 100644
1 | +#include "UnityCG.cginc" | ||
2 | + | ||
3 | +RWStructuredBuffer<uint4> _Histogram; | ||
4 | +Texture2D<float4> _Source; | ||
5 | + | ||
6 | +CBUFFER_START (Params) | ||
7 | + uint _IsLinear; | ||
8 | + float4 _Res; | ||
9 | + uint4 _Channels; | ||
10 | +CBUFFER_END | ||
11 | + | ||
12 | +groupshared uint4 gs_histogram[256]; | ||
13 | + | ||
14 | +#define GROUP_SIZE 16 | ||
15 | + | ||
16 | +#pragma kernel KHistogramGather | ||
17 | +[numthreads(GROUP_SIZE, GROUP_SIZE,1)] | ||
18 | +void KHistogramGather(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupThreadId : SV_GroupThreadID) | ||
19 | +{ | ||
20 | + const uint localThreadId = groupThreadId.y * GROUP_SIZE + groupThreadId.x; | ||
21 | + | ||
22 | + if (localThreadId < 256) | ||
23 | + gs_histogram[localThreadId] = uint4(0, 0, 0, 0); | ||
24 | + | ||
25 | + GroupMemoryBarrierWithGroupSync(); | ||
26 | + | ||
27 | + if (dispatchThreadId.x < (uint)_Res.x && dispatchThreadId.y < (uint)_Res.y) | ||
28 | + { | ||
29 | + // We want a gamma histogram (like Photoshop & all) | ||
30 | + float3 color = saturate(_Source[dispatchThreadId].xyz); | ||
31 | + if (_IsLinear > 0) | ||
32 | + color = LinearToGammaSpace(color); | ||
33 | + | ||
34 | + // Convert color & luminance to histogram bin | ||
35 | + uint3 idx_c = (uint3)(round(color * 255.0)); | ||
36 | + uint idx_l = (uint)(round(dot(color.rgb, float3(0.2125, 0.7154, 0.0721)) * 255.0)); | ||
37 | + | ||
38 | + // Fill the group shared histogram | ||
39 | + if (_Channels.x > 0u) InterlockedAdd(gs_histogram[idx_c.x].x, 1); // Red | ||
40 | + if (_Channels.y > 0u) InterlockedAdd(gs_histogram[idx_c.y].y, 1); // Green | ||
41 | + if (_Channels.z > 0u) InterlockedAdd(gs_histogram[idx_c.z].z, 1); // Blue | ||
42 | + if (_Channels.w > 0u) InterlockedAdd(gs_histogram[idx_l].w, 1); // Luminance | ||
43 | + } | ||
44 | + | ||
45 | + GroupMemoryBarrierWithGroupSync(); | ||
46 | + | ||
47 | + // Merge | ||
48 | + if (localThreadId < 256) | ||
49 | + { | ||
50 | + uint4 h = gs_histogram[localThreadId]; | ||
51 | + if (_Channels.x > 0u && h.x > 0) InterlockedAdd(_Histogram[localThreadId].x, h.x); // Red | ||
52 | + if (_Channels.y > 0u && h.y > 0) InterlockedAdd(_Histogram[localThreadId].y, h.y); // Green | ||
53 | + if (_Channels.z > 0u && h.z > 0) InterlockedAdd(_Histogram[localThreadId].z, h.z); // Blue | ||
54 | + if (_Channels.w > 0u && h.w > 0) InterlockedAdd(_Histogram[localThreadId].w, h.w); // Luminance | ||
55 | + } | ||
56 | +} | ||
57 | + | ||
58 | +// Scaling pass | ||
59 | +groupshared uint4 gs_pyramid[256]; | ||
60 | + | ||
61 | +#pragma kernel KHistogramScale | ||
62 | +[numthreads(16,16,1)] | ||
63 | +void KHistogramScale(uint2 groupThreadId : SV_GroupThreadID) | ||
64 | +{ | ||
65 | + const uint localThreadId = groupThreadId.y * 16 + groupThreadId.x; | ||
66 | + gs_pyramid[localThreadId] = _Histogram[localThreadId]; | ||
67 | + | ||
68 | + GroupMemoryBarrierWithGroupSync(); | ||
69 | + | ||
70 | + // Parallel reduction to find the max value | ||
71 | + UNITY_UNROLL | ||
72 | + for(uint i = 256 >> 1; i > 0; i >>= 1) | ||
73 | + { | ||
74 | + if(localThreadId < i) | ||
75 | + gs_pyramid[localThreadId] = max(gs_pyramid[localThreadId], gs_pyramid[localThreadId + i]); | ||
76 | + | ||
77 | + GroupMemoryBarrierWithGroupSync(); | ||
78 | + } | ||
79 | + | ||
80 | + // Actual scaling | ||
81 | + float4 factor = _Res.y / (float4)gs_pyramid[0]; | ||
82 | + _Histogram[localThreadId] = (uint4)round(_Histogram[localThreadId] * factor); | ||
83 | +} | ||
84 | + | ||
85 | +#pragma kernel KHistogramClear | ||
86 | +[numthreads(GROUP_SIZE, GROUP_SIZE, 1)] | ||
87 | +void KHistogramClear(uint2 dispatchThreadId : SV_DispatchThreadID) | ||
88 | +{ | ||
89 | + if (dispatchThreadId.x < (uint)_Res.x && dispatchThreadId.y < (uint)_Res.y) | ||
90 | + _Histogram[dispatchThreadId.y * _Res.x + dispatchThreadId.x] = uint4(0u, 0u, 0u, 0u); | ||
91 | +} |
1 | +Shader "Hidden/Post FX/Monitors/Histogram Render" | ||
2 | +{ | ||
3 | + SubShader | ||
4 | + { | ||
5 | + ZTest Always Cull Off ZWrite Off | ||
6 | + Fog { Mode off } | ||
7 | + | ||
8 | + CGINCLUDE | ||
9 | + | ||
10 | + #pragma fragmentoption ARB_precision_hint_fastest | ||
11 | + #pragma target 5.0 | ||
12 | + #include "UnityCG.cginc" | ||
13 | + | ||
14 | + StructuredBuffer<uint4> _Histogram; | ||
15 | + float2 _Size; | ||
16 | + uint _Channel; | ||
17 | + float4 _ColorR; | ||
18 | + float4 _ColorG; | ||
19 | + float4 _ColorB; | ||
20 | + float4 _ColorL; | ||
21 | + | ||
22 | + float4 FragSingleChannel(v2f_img i) : SV_Target | ||
23 | + { | ||
24 | + const float4 COLORS[4] = { _ColorR, _ColorG, _ColorB, _ColorL }; | ||
25 | + | ||
26 | + float remapI = i.uv.x * 255.0; | ||
27 | + uint index = floor(remapI); | ||
28 | + float delta = frac(remapI); | ||
29 | + float v1 = _Histogram[index][_Channel]; | ||
30 | + float v2 = _Histogram[min(index + 1, 255)][_Channel]; | ||
31 | + float h = v1 * (1.0 - delta) + v2 * delta; | ||
32 | + uint y = (uint)round(i.uv.y * _Size.y); | ||
33 | + | ||
34 | + float4 color = float4(0.1, 0.1, 0.1, 1.0); | ||
35 | + float fill = step(y, h); | ||
36 | + color = lerp(color, COLORS[_Channel], fill); | ||
37 | + return color; | ||
38 | + } | ||
39 | + | ||
40 | + float4 FragRgbMerged(v2f_img i) : SV_Target | ||
41 | + { | ||
42 | + const float4 COLORS[3] = { _ColorR, _ColorG, _ColorB }; | ||
43 | + | ||
44 | + float4 targetColor = float4(0.1, 0.1, 0.1, 1.0); | ||
45 | + float4 emptyColor = float4(0.0, 0.0, 0.0, 1.0); | ||
46 | + | ||
47 | + float remapI = i.uv.x * 255.0; | ||
48 | + uint index = floor(remapI); | ||
49 | + float delta = frac(remapI); | ||
50 | + | ||
51 | + for (int j = 0; j < 3; j++) | ||
52 | + { | ||
53 | + float v1 = _Histogram[index][j]; | ||
54 | + float v2 = _Histogram[min(index + 1, 255)][j]; | ||
55 | + float h = v1 * (1.0 - delta) + v2 * delta; | ||
56 | + uint y = (uint)round(i.uv.y * _Size.y); | ||
57 | + float fill = step(y, h); | ||
58 | + float4 color = lerp(emptyColor, COLORS[j], fill); | ||
59 | + targetColor += color; | ||
60 | + } | ||
61 | + | ||
62 | + return saturate(targetColor); | ||
63 | + } | ||
64 | + | ||
65 | + float4 FragRgbSplitted(v2f_img i) : SV_Target | ||
66 | + { | ||
67 | + const float4 COLORS[3] = {_ColorR, _ColorG, _ColorB}; | ||
68 | + | ||
69 | + const float limitB = round(_Size.y / 3.0); | ||
70 | + const float limitG = limitB * 2; | ||
71 | + | ||
72 | + float4 color = float4(0.1, 0.1, 0.1, 1.0); | ||
73 | + uint channel; | ||
74 | + float offset; | ||
75 | + | ||
76 | + if (i.pos.y < limitB) | ||
77 | + { | ||
78 | + channel = 2; | ||
79 | + offset = 0.0; | ||
80 | + } | ||
81 | + else if (i.pos.y < limitG) | ||
82 | + { | ||
83 | + channel = 1; | ||
84 | + offset = limitB; | ||
85 | + } | ||
86 | + else | ||
87 | + { | ||
88 | + channel = 0; | ||
89 | + offset = limitG; | ||
90 | + } | ||
91 | + | ||
92 | + float remapI = i.uv.x * 255.0; | ||
93 | + uint index = floor(remapI); | ||
94 | + float delta = frac(remapI); | ||
95 | + float v1 = offset + _Histogram[index][channel] / 3.0; | ||
96 | + float v2 = offset + _Histogram[min(index + 1, 255)][channel] / 3.0; | ||
97 | + float h = v1 * (1.0 - delta) + v2 * delta; | ||
98 | + uint y = (uint)round(i.uv.y * _Size.y); | ||
99 | + | ||
100 | + float fill = step(y, h); | ||
101 | + color = lerp(color, COLORS[channel], fill); | ||
102 | + return color; | ||
103 | + } | ||
104 | + | ||
105 | + ENDCG | ||
106 | + | ||
107 | + // (0) Channel | ||
108 | + Pass | ||
109 | + { | ||
110 | + CGPROGRAM | ||
111 | + | ||
112 | + #pragma vertex vert_img | ||
113 | + #pragma fragment FragSingleChannel | ||
114 | + | ||
115 | + ENDCG | ||
116 | + } | ||
117 | + | ||
118 | + // (1) RGB merged | ||
119 | + Pass | ||
120 | + { | ||
121 | + CGPROGRAM | ||
122 | + | ||
123 | + #pragma vertex vert_img | ||
124 | + #pragma fragment FragRgbMerged | ||
125 | + | ||
126 | + ENDCG | ||
127 | + } | ||
128 | + | ||
129 | + // (2) RGB splitted | ||
130 | + Pass | ||
131 | + { | ||
132 | + CGPROGRAM | ||
133 | + | ||
134 | + #pragma vertex vert_img | ||
135 | + #pragma fragment FragRgbSplitted | ||
136 | + | ||
137 | + ENDCG | ||
138 | + } | ||
139 | + } | ||
140 | + FallBack off | ||
141 | +} |
1 | +Shader "Hidden/Post FX/Monitors/Parade Render" | ||
2 | +{ | ||
3 | + SubShader | ||
4 | + { | ||
5 | + ZTest Always Cull Off ZWrite Off | ||
6 | + Fog { Mode off } | ||
7 | + | ||
8 | + CGINCLUDE | ||
9 | + | ||
10 | + #pragma fragmentoption ARB_precision_hint_fastest | ||
11 | + #pragma target 5.0 | ||
12 | + #include "UnityCG.cginc" | ||
13 | + | ||
14 | + StructuredBuffer<uint4> _Waveform; | ||
15 | + float4 _Size; | ||
16 | + float _Exposure; | ||
17 | + | ||
18 | + float3 Tonemap(float3 x, float exposure) | ||
19 | + { | ||
20 | + const float a = 6.2; | ||
21 | + const float b = 0.5; | ||
22 | + const float c = 1.7; | ||
23 | + const float d = 0.06; | ||
24 | + x *= exposure; | ||
25 | + x = max((0.0).xxx, x - (0.004).xxx); | ||
26 | + x = (x * (a * x + b)) / (x * (a * x + c) + d); | ||
27 | + return x * x; | ||
28 | + } | ||
29 | + | ||
30 | + float4 FragParade(v2f_img i) : SV_Target | ||
31 | + { | ||
32 | + const float3 red = float3(1.8, 0.03, 0.02); | ||
33 | + const float3 green = float3(0.02, 1.3, 0.05); | ||
34 | + const float3 blue = float3(0.0, 0.45, 1.75); | ||
35 | + float3 color = float3(0.0, 0.0, 0.0); | ||
36 | + | ||
37 | + const uint limitR = _Size.x / 3; | ||
38 | + const uint limitG = limitR * 2; | ||
39 | + | ||
40 | + if (i.pos.x < (float)limitR) | ||
41 | + { | ||
42 | + uint2 uvI = i.pos.xy; | ||
43 | + color = _Waveform[uvI.y + uvI.x * _Size.y].r * red; | ||
44 | + } | ||
45 | + else if (i.pos.x < (float)limitG) | ||
46 | + { | ||
47 | + uint2 uvI = uint2(i.pos.x - limitR, i.pos.y); | ||
48 | + color = _Waveform[uvI.y + uvI.x * _Size.y].g * green; | ||
49 | + } | ||
50 | + else | ||
51 | + { | ||
52 | + uint2 uvI = uint2(i.pos.x - limitG, i.pos.y); | ||
53 | + color = _Waveform[uvI.y + uvI.x * _Size.y].b * blue; | ||
54 | + } | ||
55 | + | ||
56 | + color = Tonemap(color, _Exposure); | ||
57 | + color += (0.1).xxx; | ||
58 | + | ||
59 | + return float4(saturate(color), 1.0); | ||
60 | + } | ||
61 | + | ||
62 | + ENDCG | ||
63 | + | ||
64 | + // (0) | ||
65 | + Pass | ||
66 | + { | ||
67 | + CGPROGRAM | ||
68 | + | ||
69 | + #pragma vertex vert_img | ||
70 | + #pragma fragment FragParade | ||
71 | + | ||
72 | + ENDCG | ||
73 | + } | ||
74 | + } | ||
75 | + FallBack off | ||
76 | +} |
1 | +#include "UnityCG.cginc" | ||
2 | + | ||
3 | +RWStructuredBuffer<uint> _Vectorscope; | ||
4 | +Texture2D<float4> _Source; | ||
5 | + | ||
6 | +CBUFFER_START (Params) | ||
7 | + uint _IsLinear; | ||
8 | + float4 _Res; | ||
9 | +CBUFFER_END | ||
10 | + | ||
11 | +#define GROUP_SIZE 32 | ||
12 | + | ||
13 | +float3 RgbToYUV(float3 c) | ||
14 | +{ | ||
15 | + float Y = 0.299 * c.r + 0.587 * c.g + 0.114 * c.b; | ||
16 | + float U = -0.169 * c.r - 0.331 * c.g + 0.500 * c.b; | ||
17 | + float V = 0.500 * c.r - 0.419 * c.g - 0.081 * c.b; | ||
18 | + return float3(Y, U, V); | ||
19 | +} | ||
20 | + | ||
21 | +#pragma kernel KVectorscope | ||
22 | +[numthreads(GROUP_SIZE,GROUP_SIZE,1)] | ||
23 | +void KVectorscope(uint2 dispatchThreadId : SV_DispatchThreadID) | ||
24 | +{ | ||
25 | + if (dispatchThreadId.x < (uint)_Res.x && dispatchThreadId.y < (uint)_Res.y) | ||
26 | + { | ||
27 | + float3 color = saturate(_Source[dispatchThreadId].xyz); | ||
28 | + if (_IsLinear > 0) | ||
29 | + color = LinearToGammaSpace(color); | ||
30 | + | ||
31 | + float3 yuv = RgbToYUV(color); | ||
32 | + | ||
33 | + if (length(yuv.yz) > 0.49) | ||
34 | + yuv.yz = normalize(yuv.yz) * 0.49; | ||
35 | + | ||
36 | + yuv.yz += (0.5).xx; | ||
37 | + uint u = (uint)floor(yuv.y * _Res.x); | ||
38 | + uint v = (uint)floor(yuv.z * _Res.y); | ||
39 | + InterlockedAdd(_Vectorscope[v * _Res.x + u], 1); | ||
40 | + } | ||
41 | +} | ||
42 | + | ||
43 | +#pragma kernel KVectorscopeClear | ||
44 | +[numthreads(GROUP_SIZE,GROUP_SIZE,1)] | ||
45 | +void KVectorscopeClear(uint2 dispatchThreadId : SV_DispatchThreadID) | ||
46 | +{ | ||
47 | + if (dispatchThreadId.x < (uint)_Res.x && dispatchThreadId.y < (uint)_Res.y) | ||
48 | + _Vectorscope[dispatchThreadId.y * _Res.x + dispatchThreadId.x] = 0u; | ||
49 | +} |
1 | +Shader "Hidden/Post FX/Monitors/Vectorscope Render" | ||
2 | +{ | ||
3 | + SubShader | ||
4 | + { | ||
5 | + ZTest Always Cull Off ZWrite Off | ||
6 | + Fog { Mode off } | ||
7 | + | ||
8 | + CGINCLUDE | ||
9 | + | ||
10 | + #pragma fragmentoption ARB_precision_hint_fastest | ||
11 | + #pragma target 5.0 | ||
12 | + #include "UnityCG.cginc" | ||
13 | + | ||
14 | + StructuredBuffer<uint> _Vectorscope; | ||
15 | + float2 _Size; | ||
16 | + float _Exposure; | ||
17 | + | ||
18 | + float Tonemap(float x, float exposure) | ||
19 | + { | ||
20 | + const float a = 6.2; | ||
21 | + const float b = 0.5; | ||
22 | + const float c = 1.7; | ||
23 | + const float d = 0.06; | ||
24 | + x *= exposure; | ||
25 | + x = max(0.0, x - 0.004); | ||
26 | + x = (x * (a * x + b)) / (x * (a * x + c) + d); | ||
27 | + return x * x; | ||
28 | + } | ||
29 | + | ||
30 | + float3 YuvToRgb(float3 c) | ||
31 | + { | ||
32 | + float R = c.x + 0.000 * c.y + 1.403 * c.z; | ||
33 | + float G = c.x - 0.344 * c.y - 0.714 * c.z; | ||
34 | + float B = c.x - 1.773 * c.y + 0.000 * c.z; | ||
35 | + return float3(R, G, B); | ||
36 | + } | ||
37 | + | ||
38 | + float4 FragBackground(v2f_img i) : SV_Target | ||
39 | + { | ||
40 | + i.uv.x = 1.0 - i.uv.x; | ||
41 | + float2 uv = i.uv - (0.5).xx; | ||
42 | + float3 c = YuvToRgb(float3(0.5, uv.x, uv.y)); | ||
43 | + | ||
44 | + float dist = sqrt(dot(uv, uv)); | ||
45 | + float delta = fwidth(dist); | ||
46 | + float alphaOut = 1.0 - smoothstep(0.5 - delta, 0.5 + delta, dist); | ||
47 | + float alphaIn = smoothstep(0.495 - delta, 0.495 + delta, dist); | ||
48 | + | ||
49 | + uint2 uvI = i.pos.xy; | ||
50 | + uint v = _Vectorscope[uvI.x + uvI.y * _Size.x]; | ||
51 | + float vt = saturate(Tonemap(v, _Exposure)); | ||
52 | + | ||
53 | + float4 color = float4(lerp(c, (0.0).xxx, vt), alphaOut); | ||
54 | + color.rgb += alphaIn; | ||
55 | + return color; | ||
56 | + } | ||
57 | + | ||
58 | + float4 FragNoBackground(v2f_img i) : SV_Target | ||
59 | + { | ||
60 | + i.uv.x = 1.0 - i.uv.x; | ||
61 | + float2 uv = i.uv - (0.5).xx; | ||
62 | + | ||
63 | + float dist = sqrt(dot(uv, uv)); | ||
64 | + float delta = fwidth(dist); | ||
65 | + float alphaOut = 1.0 - smoothstep(0.5 - delta, 0.5 + delta, dist); | ||
66 | + float alphaIn = smoothstep(0.495 - delta, 0.495 + delta, dist); | ||
67 | + | ||
68 | + uint2 uvI = i.pos.xy; | ||
69 | + uint v = _Vectorscope[uvI.x + uvI.y * _Size.x]; | ||
70 | + float vt = saturate(Tonemap(v, _Exposure)); | ||
71 | + | ||
72 | + float4 color = float4((1.0).xxx, vt + alphaIn * alphaOut); | ||
73 | + return color; | ||
74 | + } | ||
75 | + | ||
76 | + ENDCG | ||
77 | + | ||
78 | + // (0) | ||
79 | + Pass | ||
80 | + { | ||
81 | + CGPROGRAM | ||
82 | + | ||
83 | + #pragma vertex vert_img | ||
84 | + #pragma fragment FragBackground | ||
85 | + | ||
86 | + ENDCG | ||
87 | + } | ||
88 | + | ||
89 | + // (1) | ||
90 | + Pass | ||
91 | + { | ||
92 | + CGPROGRAM | ||
93 | + | ||
94 | + #pragma vertex vert_img | ||
95 | + #pragma fragment FragNoBackground | ||
96 | + | ||
97 | + ENDCG | ||
98 | + } | ||
99 | + } | ||
100 | + FallBack off | ||
101 | +} |
1 | +#include "UnityCG.cginc" | ||
2 | + | ||
3 | +RWStructuredBuffer<uint4> _Waveform; | ||
4 | +Texture2D<float4> _Source; | ||
5 | + | ||
6 | +CBUFFER_START (Params) | ||
7 | + uint _IsLinear; | ||
8 | + uint4 _Channels; | ||
9 | +CBUFFER_END | ||
10 | + | ||
11 | +#define COLUMNS 384 | ||
12 | + | ||
13 | +#pragma kernel KWaveform | ||
14 | +[numthreads(1,COLUMNS,1)] | ||
15 | +void KWaveform(uint2 dispatchThreadId : SV_DispatchThreadID) | ||
16 | +{ | ||
17 | + // We want a gamma corrected colors | ||
18 | + float3 color = _Source[dispatchThreadId].rgb; | ||
19 | + if (_IsLinear > 0u) | ||
20 | + color = LinearToGammaSpace(color); | ||
21 | + | ||
22 | + color = saturate(color); | ||
23 | + | ||
24 | + // Convert color & luminance to histogram bins | ||
25 | + const float kColumnsMinusOne = COLUMNS - 1.0; | ||
26 | + uint3 idx_c = (uint3)(round(color * kColumnsMinusOne)); | ||
27 | + uint idx_l = (uint)(round(dot(color.rgb, float3(0.2126, 0.7152, 0.0722)) * kColumnsMinusOne)); | ||
28 | + | ||
29 | + // A lot of atomic operations will be skipped so there's no need to over-think this one. | ||
30 | + uint j = dispatchThreadId.x * COLUMNS; | ||
31 | + if (_Channels.x > 0u && idx_c.x > 0u) InterlockedAdd(_Waveform[j + idx_c.x].x, 1u); // Red | ||
32 | + if (_Channels.y > 0u && idx_c.y > 0u) InterlockedAdd(_Waveform[j + idx_c.y].y, 1u); // Green | ||
33 | + if (_Channels.z > 0u && idx_c.z > 0u) InterlockedAdd(_Waveform[j + idx_c.z].z, 1u); // Blue | ||
34 | + if (_Channels.w > 0u) InterlockedAdd(_Waveform[j + idx_l].w, 1u); // Luminance | ||
35 | +} | ||
36 | + | ||
37 | +#pragma kernel KWaveformClear | ||
38 | +[numthreads(1, COLUMNS, 1)] | ||
39 | +void KWaveformClear(uint2 dispatchThreadId : SV_DispatchThreadID) | ||
40 | +{ | ||
41 | + _Waveform[dispatchThreadId.x * COLUMNS + dispatchThreadId.y] = uint4(0u, 0u, 0u, 0u); | ||
42 | +} |
1 | +Shader "Hidden/Post FX/Monitors/Waveform Render" | ||
2 | +{ | ||
3 | + SubShader | ||
4 | + { | ||
5 | + ZTest Always Cull Off ZWrite Off | ||
6 | + Fog { Mode off } | ||
7 | + | ||
8 | + CGINCLUDE | ||
9 | + | ||
10 | + #pragma fragmentoption ARB_precision_hint_fastest | ||
11 | + #pragma target 5.0 | ||
12 | + #include "UnityCG.cginc" | ||
13 | + | ||
14 | + StructuredBuffer<uint4> _Waveform; | ||
15 | + float2 _Size; | ||
16 | + float4 _Channels; | ||
17 | + float _Exposure; | ||
18 | + | ||
19 | + float3 Tonemap(float3 x, float exposure) | ||
20 | + { | ||
21 | + const float a = 6.2; | ||
22 | + const float b = 0.5; | ||
23 | + const float c = 1.7; | ||
24 | + const float d = 0.06; | ||
25 | + x *= exposure; | ||
26 | + x = max((0.0).xxx, x - (0.004).xxx); | ||
27 | + x = (x * (a * x + b)) / (x * (a * x + c) + d); | ||
28 | + return x * x; | ||
29 | + } | ||
30 | + | ||
31 | + float4 FragWaveform(v2f_img i) : SV_Target | ||
32 | + { | ||
33 | + const float3 red = float3(1.4, 0.03, 0.02); | ||
34 | + const float3 green = float3(0.02, 1.1, 0.05); | ||
35 | + const float3 blue = float3(0.0, 0.25, 1.5); | ||
36 | + float3 color = float3(0.0, 0.0, 0.0); | ||
37 | + | ||
38 | + uint2 uvI = i.pos.xy; | ||
39 | + float4 w = _Waveform[uvI.y + uvI.x * _Size.y]; // Waveform data is stored in columns instead of rows | ||
40 | + | ||
41 | + color += red * w.r * _Channels.r; | ||
42 | + color += green * w.g * _Channels.g; | ||
43 | + color += blue * w.b * _Channels.b; | ||
44 | + color += w.aaa * _Channels.a * 1.5; | ||
45 | + color = Tonemap(color, _Exposure); | ||
46 | + color += (0.1).xxx; | ||
47 | + | ||
48 | + return float4(saturate(color), 1.0); | ||
49 | + } | ||
50 | + | ||
51 | + ENDCG | ||
52 | + | ||
53 | + // (0) | ||
54 | + Pass | ||
55 | + { | ||
56 | + CGPROGRAM | ||
57 | + | ||
58 | + #pragma vertex vert_img | ||
59 | + #pragma fragment FragWaveform | ||
60 | + | ||
61 | + ENDCG | ||
62 | + } | ||
63 | + } | ||
64 | + FallBack off | ||
65 | +} |
1 | +Shader "Hidden/Post FX/UI/Curve Background" | ||
2 | +{ | ||
3 | + CGINCLUDE | ||
4 | + | ||
5 | + #pragma target 3.0 | ||
6 | + #include "UnityCG.cginc" | ||
7 | + | ||
8 | + float _DisabledState; | ||
9 | + | ||
10 | + float3 HsvToRgb(float3 c) | ||
11 | + { | ||
12 | + float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); | ||
13 | + float3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www); | ||
14 | + return c.z * lerp(K.xxx, saturate(p - K.xxx), c.y); | ||
15 | + } | ||
16 | + | ||
17 | + float4 FragHue(v2f_img i) : SV_Target | ||
18 | + { | ||
19 | + float3 hsv = HsvToRgb(float3(i.uv.x, 1.0, 0.2)); | ||
20 | + float4 color = float4((0.0).xxx, 1.0); | ||
21 | + color.rgb = lerp(color.rgb, hsv, smoothstep(0.5, 1.1, 1.0 - i.uv.y)) + lerp(color.rgb, hsv, smoothstep(0.5, 1.1, i.uv.y)); | ||
22 | + color.rgb += (0.15).xxx; | ||
23 | + return float4(color.rgb, color.a * _DisabledState); | ||
24 | + } | ||
25 | + | ||
26 | + float4 FragSat(v2f_img i) : SV_Target | ||
27 | + { | ||
28 | + float4 color = float4((0.0).xxx, 1.0); | ||
29 | + float sat = i.uv.x / 2; | ||
30 | + color.rgb += lerp(color.rgb, (sat).xxx, smoothstep(0.5, 1.2, 1.0 - i.uv.y)) + lerp(color.rgb, (sat).xxx, smoothstep(0.5, 1.2, i.uv.y)); | ||
31 | + color.rgb += (0.15).xxx; | ||
32 | + return float4(color.rgb, color.a * _DisabledState); | ||
33 | + } | ||
34 | + | ||
35 | + ENDCG | ||
36 | + | ||
37 | + SubShader | ||
38 | + { | ||
39 | + Cull Off ZWrite Off ZTest Always | ||
40 | + | ||
41 | + // (0) Hue | ||
42 | + Pass | ||
43 | + { | ||
44 | + CGPROGRAM | ||
45 | + | ||
46 | + #pragma vertex vert_img | ||
47 | + #pragma fragment FragHue | ||
48 | + | ||
49 | + ENDCG | ||
50 | + } | ||
51 | + | ||
52 | + // (1) Sat/lum | ||
53 | + Pass | ||
54 | + { | ||
55 | + CGPROGRAM | ||
56 | + | ||
57 | + #pragma vertex vert_img | ||
58 | + #pragma fragment FragSat | ||
59 | + | ||
60 | + ENDCG | ||
61 | + } | ||
62 | + } | ||
63 | +} |

7.94 KB
1 | +fileFormatVersion: 2 | ||
2 | +guid: c0fa58091049bd24394fa15b0b6d4c5a | ||
3 | +timeCreated: 1468326774 | ||
4 | +licenseType: Store | ||
5 | +TextureImporter: | ||
6 | + fileIDToRecycleName: {} | ||
7 | + serializedVersion: 2 | ||
8 | + mipmaps: | ||
9 | + mipMapMode: 0 | ||
10 | + enableMipMap: 0 | ||
11 | + linearTexture: 1 | ||
12 | + correctGamma: 0 | ||
13 | + fadeOut: 0 | ||
14 | + borderMipMap: 0 | ||
15 | + mipMapFadeDistanceStart: 1 | ||
16 | + mipMapFadeDistanceEnd: 3 | ||
17 | + bumpmap: | ||
18 | + convertToNormalMap: 0 | ||
19 | + externalNormalMap: 0 | ||
20 | + heightScale: 0.25 | ||
21 | + normalMapFilter: 0 | ||
22 | + isReadable: 0 | ||
23 | + grayScaleToAlpha: 0 | ||
24 | + generateCubemap: 0 | ||
25 | + cubemapConvolution: 0 | ||
26 | + cubemapConvolutionSteps: 7 | ||
27 | + cubemapConvolutionExponent: 1.5 | ||
28 | + seamlessCubemap: 0 | ||
29 | + textureFormat: -1 | ||
30 | + maxTextureSize: 2048 | ||
31 | + textureSettings: | ||
32 | + filterMode: -1 | ||
33 | + aniso: 1 | ||
34 | + mipBias: -1 | ||
35 | + wrapMode: 1 | ||
36 | + nPOTScale: 0 | ||
37 | + lightmap: 0 | ||
38 | + rGBM: 0 | ||
39 | + compressionQuality: 50 | ||
40 | + allowsAlphaSplitting: 0 | ||
41 | + spriteMode: 0 | ||
42 | + spriteExtrude: 1 | ||
43 | + spriteMeshType: 1 | ||
44 | + alignment: 0 | ||
45 | + spritePivot: {x: 0.5, y: 0.5} | ||
46 | + spriteBorder: {x: 0, y: 0, z: 0, w: 0} | ||
47 | + spritePixelsToUnits: 100 | ||
48 | + alphaIsTransparency: 1 | ||
49 | + spriteTessellationDetail: -1 | ||
50 | + textureType: 2 | ||
51 | + buildTargetSettings: [] | ||
52 | + spriteSheet: | ||
53 | + serializedVersion: 2 | ||
54 | + sprites: [] | ||
55 | + outline: [] | ||
56 | + spritePackingTag: | ||
57 | + userData: | ||
58 | + assetBundleName: | ||
59 | + assetBundleVariant: |
1 | +Shader "Hidden/Post FX/UI/Trackball" | ||
2 | +{ | ||
3 | + CGINCLUDE | ||
4 | + | ||
5 | + #include "UnityCG.cginc" | ||
6 | + | ||
7 | + #define PI 3.14159265359 | ||
8 | + #define PI2 6.28318530718 | ||
9 | + | ||
10 | + float _Offset; | ||
11 | + float _DisabledState; | ||
12 | + float2 _Resolution; // x: size, y: size / 2 | ||
13 | + | ||
14 | + float3 HsvToRgb(float3 c) | ||
15 | + { | ||
16 | + float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); | ||
17 | + float3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www); | ||
18 | + return c.z * lerp(K.xxx, saturate(p - K.xxx), c.y); | ||
19 | + } | ||
20 | + | ||
21 | + float4 CreateWheel(v2f_img i, float crossColor, float offsetColor) | ||
22 | + { | ||
23 | + const float kHueOuterRadius = 0.45; | ||
24 | + const float kHueInnerRadius = 0.38; | ||
25 | + const float kLumOuterRadius = 0.495; | ||
26 | + const float kLumInnerRadius = 0.48; | ||
27 | + | ||
28 | + float4 color = (0.0).xxxx; | ||
29 | + float2 uvc = i.uv - (0.5).xx; | ||
30 | + float dist = sqrt(dot(uvc, uvc)); | ||
31 | + float delta = fwidth(dist); | ||
32 | + float angle = atan2(uvc.x, uvc.y); | ||
33 | + | ||
34 | + // Cross | ||
35 | + { | ||
36 | + float radius = (0.5 - kHueInnerRadius) * _Resolution.x + 1.0; | ||
37 | + float2 pixel = (_Resolution.xx - 1.0) * i.uv + 1.0; | ||
38 | + | ||
39 | + float vline = step(floor(fmod(pixel.x, _Resolution.y)), 0.0); | ||
40 | + vline *= step(radius, pixel.y) * step(pixel.y, _Resolution.x - radius); | ||
41 | + | ||
42 | + float hline = step(floor(fmod(pixel.y, _Resolution.y)), 0.0); | ||
43 | + hline *= step(radius, pixel.x) * step(pixel.x, _Resolution.x - radius); | ||
44 | + | ||
45 | + color += hline.xxxx * (1.0).xxxx; | ||
46 | + color += vline.xxxx * (1.0).xxxx; | ||
47 | + color = saturate(color); | ||
48 | + color *= half4((crossColor).xxx, 0.05); | ||
49 | + } | ||
50 | + | ||
51 | + // Hue | ||
52 | + { | ||
53 | + float alphaOut = smoothstep(kHueOuterRadius - delta, kHueOuterRadius + delta, dist); | ||
54 | + float alphaIn = smoothstep(kHueInnerRadius - delta, kHueInnerRadius + delta, dist); | ||
55 | + | ||
56 | + float hue = angle; | ||
57 | + hue = 1.0 - ((hue > 0.0) ? hue : PI2 + hue) / PI2; | ||
58 | + float4 c = float4(HsvToRgb(float3(hue, 1.0, 1.0)), 1.0); | ||
59 | + color += lerp((0.0).xxxx, c, alphaIn - alphaOut); | ||
60 | + } | ||
61 | + | ||
62 | + // Offset | ||
63 | + { | ||
64 | + float alphaOut = smoothstep(kLumOuterRadius - delta, kLumOuterRadius + delta, dist); | ||
65 | + float alphaIn = smoothstep(kLumInnerRadius - delta, kLumInnerRadius + delta / 2, dist); | ||
66 | + float4 c = float4((offsetColor).xxx, 1.0); | ||
67 | + | ||
68 | + float a = PI * _Offset; | ||
69 | + if (_Offset >= 0 && angle < a && angle > 0.0) | ||
70 | + c = float4((1.0).xxx, 0.5); | ||
71 | + else if (angle > a && angle < 0.0) | ||
72 | + c = float4((1.0).xxx, 0.5); | ||
73 | + | ||
74 | + color += lerp((0.0).xxxx, c, alphaIn - alphaOut); | ||
75 | + } | ||
76 | + | ||
77 | + return color * _DisabledState; | ||
78 | + } | ||
79 | + | ||
80 | + float4 FragTrackballDark(v2f_img i) : SV_Target | ||
81 | + { | ||
82 | + return CreateWheel(i, 1.0, 0.15); | ||
83 | + } | ||
84 | + | ||
85 | + float4 FragTrackballLight(v2f_img i) : SV_Target | ||
86 | + { | ||
87 | + return CreateWheel(i, 0.0, 0.3); | ||
88 | + } | ||
89 | + | ||
90 | + ENDCG | ||
91 | + | ||
92 | + SubShader | ||
93 | + { | ||
94 | + Cull Off ZWrite Off ZTest Always | ||
95 | + | ||
96 | + // (0) Dark skin | ||
97 | + Pass | ||
98 | + { | ||
99 | + CGPROGRAM | ||
100 | + | ||
101 | + #pragma vertex vert_img | ||
102 | + #pragma fragment FragTrackballDark | ||
103 | + | ||
104 | + ENDCG | ||
105 | + } | ||
106 | + | ||
107 | + // (1) Light skin | ||
108 | + Pass | ||
109 | + { | ||
110 | + CGPROGRAM | ||
111 | + | ||
112 | + #pragma vertex vert_img | ||
113 | + #pragma fragment FragTrackballLight | ||
114 | + | ||
115 | + ENDCG | ||
116 | + } | ||
117 | + } | ||
118 | +} |
Assets/PostProcessing/Editor.meta
0 → 100644
Assets/PostProcessing/Editor/Attributes.meta
0 → 100644
1 | +using System; | ||
2 | + | ||
3 | +namespace UnityEditor.PostProcessing | ||
4 | +{ | ||
5 | + public class PostProcessingModelEditorAttribute : Attribute | ||
6 | + { | ||
7 | + public readonly Type type; | ||
8 | + public readonly bool alwaysEnabled; | ||
9 | + | ||
10 | + public PostProcessingModelEditorAttribute(Type type, bool alwaysEnabled = false) | ||
11 | + { | ||
12 | + this.type = type; | ||
13 | + this.alwaysEnabled = alwaysEnabled; | ||
14 | + } | ||
15 | + } | ||
16 | +} |
Assets/PostProcessing/Editor/Models.meta
0 → 100644
1 | +using UnityEngine.PostProcessing; | ||
2 | + | ||
3 | +namespace UnityEditor.PostProcessing | ||
4 | +{ | ||
5 | + using Settings = AmbientOcclusionModel.Settings; | ||
6 | + | ||
7 | + [PostProcessingModelEditor(typeof(AmbientOcclusionModel))] | ||
8 | + public class AmbientOcclusionModelEditor : PostProcessingModelEditor | ||
9 | + { | ||
10 | + SerializedProperty m_Intensity; | ||
11 | + SerializedProperty m_Radius; | ||
12 | + SerializedProperty m_SampleCount; | ||
13 | + SerializedProperty m_Downsampling; | ||
14 | + SerializedProperty m_ForceForwardCompatibility; | ||
15 | + SerializedProperty m_AmbientOnly; | ||
16 | + SerializedProperty m_HighPrecision; | ||
17 | + | ||
18 | + public override void OnEnable() | ||
19 | + { | ||
20 | + m_Intensity = FindSetting((Settings x) => x.intensity); | ||
21 | + m_Radius = FindSetting((Settings x) => x.radius); | ||
22 | + m_SampleCount = FindSetting((Settings x) => x.sampleCount); | ||
23 | + m_Downsampling = FindSetting((Settings x) => x.downsampling); | ||
24 | + m_ForceForwardCompatibility = FindSetting((Settings x) => x.forceForwardCompatibility); | ||
25 | + m_AmbientOnly = FindSetting((Settings x) => x.ambientOnly); | ||
26 | + m_HighPrecision = FindSetting((Settings x) => x.highPrecision); | ||
27 | + } | ||
28 | + | ||
29 | + public override void OnInspectorGUI() | ||
30 | + { | ||
31 | + EditorGUILayout.PropertyField(m_Intensity); | ||
32 | + EditorGUILayout.PropertyField(m_Radius); | ||
33 | + EditorGUILayout.PropertyField(m_SampleCount); | ||
34 | + EditorGUILayout.PropertyField(m_Downsampling); | ||
35 | + EditorGUILayout.PropertyField(m_ForceForwardCompatibility); | ||
36 | + EditorGUILayout.PropertyField(m_HighPrecision, EditorGUIHelper.GetContent("High Precision (Forward)")); | ||
37 | + | ||
38 | + using (new EditorGUI.DisabledGroupScope(m_ForceForwardCompatibility.boolValue)) | ||
39 | + EditorGUILayout.PropertyField(m_AmbientOnly, EditorGUIHelper.GetContent("Ambient Only (Deferred + HDR)")); | ||
40 | + } | ||
41 | + } | ||
42 | +} |
1 | +using UnityEngine; | ||
2 | +using UnityEngine.PostProcessing; | ||
3 | + | ||
4 | +namespace UnityEditor.PostProcessing | ||
5 | +{ | ||
6 | + using Method = AntialiasingModel.Method; | ||
7 | + using Settings = AntialiasingModel.Settings; | ||
8 | + | ||
9 | + [PostProcessingModelEditor(typeof(AntialiasingModel))] | ||
10 | + public class AntialiasingModelEditor : PostProcessingModelEditor | ||
11 | + { | ||
12 | + SerializedProperty m_Method; | ||
13 | + | ||
14 | + SerializedProperty m_FxaaPreset; | ||
15 | + | ||
16 | + SerializedProperty m_TaaJitterSpread; | ||
17 | + SerializedProperty m_TaaSharpen; | ||
18 | + SerializedProperty m_TaaStationaryBlending; | ||
19 | + SerializedProperty m_TaaMotionBlending; | ||
20 | + | ||
21 | + static string[] s_MethodNames = | ||
22 | + { | ||
23 | + "Fast Approximate Anti-aliasing", | ||
24 | + "Temporal Anti-aliasing" | ||
25 | + }; | ||
26 | + | ||
27 | + public override void OnEnable() | ||
28 | + { | ||
29 | + m_Method = FindSetting((Settings x) => x.method); | ||
30 | + | ||
31 | + m_FxaaPreset = FindSetting((Settings x) => x.fxaaSettings.preset); | ||
32 | + | ||
33 | + m_TaaJitterSpread = FindSetting((Settings x) => x.taaSettings.jitterSpread); | ||
34 | + m_TaaSharpen = FindSetting((Settings x) => x.taaSettings.sharpen); | ||
35 | + m_TaaStationaryBlending = FindSetting((Settings x) => x.taaSettings.stationaryBlending); | ||
36 | + m_TaaMotionBlending = FindSetting((Settings x) => x.taaSettings.motionBlending); | ||
37 | + } | ||
38 | + | ||
39 | + public override void OnInspectorGUI() | ||
40 | + { | ||
41 | + m_Method.intValue = EditorGUILayout.Popup("Method", m_Method.intValue, s_MethodNames); | ||
42 | + | ||
43 | + if (m_Method.intValue == (int)Method.Fxaa) | ||
44 | + { | ||
45 | + EditorGUILayout.PropertyField(m_FxaaPreset); | ||
46 | + } | ||
47 | + else if (m_Method.intValue == (int)Method.Taa) | ||
48 | + { | ||
49 | + if (QualitySettings.antiAliasing > 1) | ||
50 | + EditorGUILayout.HelpBox("Temporal Anti-Aliasing doesn't work correctly when MSAA is enabled.", MessageType.Warning); | ||
51 | + | ||
52 | + EditorGUILayout.LabelField("Jitter", EditorStyles.boldLabel); | ||
53 | + EditorGUI.indentLevel++; | ||
54 | + EditorGUILayout.PropertyField(m_TaaJitterSpread, EditorGUIHelper.GetContent("Spread")); | ||
55 | + EditorGUI.indentLevel--; | ||
56 | + | ||
57 | + EditorGUILayout.Space(); | ||
58 | + | ||
59 | + EditorGUILayout.LabelField("Blending", EditorStyles.boldLabel); | ||
60 | + EditorGUI.indentLevel++; | ||
61 | + EditorGUILayout.PropertyField(m_TaaStationaryBlending, EditorGUIHelper.GetContent("Stationary")); | ||
62 | + EditorGUILayout.PropertyField(m_TaaMotionBlending, EditorGUIHelper.GetContent("Motion")); | ||
63 | + EditorGUI.indentLevel--; | ||
64 | + | ||
65 | + EditorGUILayout.Space(); | ||
66 | + | ||
67 | + EditorGUILayout.PropertyField(m_TaaSharpen); | ||
68 | + } | ||
69 | + } | ||
70 | + } | ||
71 | +} |
1 | +using UnityEngine; | ||
2 | +using UnityEngine.PostProcessing; | ||
3 | + | ||
4 | +namespace UnityEditor.PostProcessing | ||
5 | +{ | ||
6 | + using Settings = BloomModel.Settings; | ||
7 | + | ||
8 | + [PostProcessingModelEditor(typeof(BloomModel))] | ||
9 | + public class BloomModelEditor : PostProcessingModelEditor | ||
10 | + { | ||
11 | + struct BloomSettings | ||
12 | + { | ||
13 | + public SerializedProperty intensity; | ||
14 | + public SerializedProperty threshold; | ||
15 | + public SerializedProperty softKnee; | ||
16 | + public SerializedProperty radius; | ||
17 | + public SerializedProperty antiFlicker; | ||
18 | + } | ||
19 | + | ||
20 | + struct LensDirtSettings | ||
21 | + { | ||
22 | + public SerializedProperty texture; | ||
23 | + public SerializedProperty intensity; | ||
24 | + } | ||
25 | + | ||
26 | + BloomSettings m_Bloom; | ||
27 | + LensDirtSettings m_LensDirt; | ||
28 | + | ||
29 | + public override void OnEnable() | ||
30 | + { | ||
31 | + m_Bloom = new BloomSettings | ||
32 | + { | ||
33 | + intensity = FindSetting((Settings x) => x.bloom.intensity), | ||
34 | + threshold = FindSetting((Settings x) => x.bloom.threshold), | ||
35 | + softKnee = FindSetting((Settings x) => x.bloom.softKnee), | ||
36 | + radius = FindSetting((Settings x) => x.bloom.radius), | ||
37 | + antiFlicker = FindSetting((Settings x) => x.bloom.antiFlicker) | ||
38 | + }; | ||
39 | + | ||
40 | + m_LensDirt = new LensDirtSettings | ||
41 | + { | ||
42 | + texture = FindSetting((Settings x) => x.lensDirt.texture), | ||
43 | + intensity = FindSetting((Settings x) => x.lensDirt.intensity) | ||
44 | + }; | ||
45 | + } | ||
46 | + | ||
47 | + public override void OnInspectorGUI() | ||
48 | + { | ||
49 | + EditorGUILayout.Space(); | ||
50 | + PrepareGraph(); | ||
51 | + DrawGraph(); | ||
52 | + EditorGUILayout.Space(); | ||
53 | + | ||
54 | + EditorGUILayout.PropertyField(m_Bloom.intensity); | ||
55 | + EditorGUILayout.PropertyField(m_Bloom.threshold, EditorGUIHelper.GetContent("Threshold (Gamma)")); | ||
56 | + EditorGUILayout.PropertyField(m_Bloom.softKnee); | ||
57 | + EditorGUILayout.PropertyField(m_Bloom.radius); | ||
58 | + EditorGUILayout.PropertyField(m_Bloom.antiFlicker); | ||
59 | + | ||
60 | + EditorGUILayout.Space(); | ||
61 | + EditorGUILayout.LabelField("Dirt", EditorStyles.boldLabel); | ||
62 | + EditorGUI.indentLevel++; | ||
63 | + EditorGUILayout.PropertyField(m_LensDirt.texture); | ||
64 | + EditorGUILayout.PropertyField(m_LensDirt.intensity); | ||
65 | + EditorGUI.indentLevel--; | ||
66 | + } | ||
67 | + | ||
68 | + #region Graph | ||
69 | + | ||
70 | + float m_GraphThreshold; | ||
71 | + float m_GraphKnee; | ||
72 | + float m_GraphIntensity; | ||
73 | + | ||
74 | + // Number of vertices in curve | ||
75 | + const int k_CurveResolution = 48; | ||
76 | + | ||
77 | + // Vertex buffers | ||
78 | + Vector3[] m_RectVertices = new Vector3[4]; | ||
79 | + Vector3[] m_LineVertices = new Vector3[2]; | ||
80 | + Vector3[] m_CurveVertices = new Vector3[k_CurveResolution]; | ||
81 | + | ||
82 | + Rect m_RectGraph; | ||
83 | + float m_RangeX; | ||
84 | + float m_RangeY; | ||
85 | + | ||
86 | + float ResponseFunction(float x) | ||
87 | + { | ||
88 | + var rq = Mathf.Clamp(x - m_GraphThreshold + m_GraphKnee, 0, m_GraphKnee * 2); | ||
89 | + rq = rq * rq * 0.25f / m_GraphKnee; | ||
90 | + return Mathf.Max(rq, x - m_GraphThreshold) * m_GraphIntensity; | ||
91 | + } | ||
92 | + | ||
93 | + // Transform a point into the graph rect | ||
94 | + Vector3 PointInRect(float x, float y) | ||
95 | + { | ||
96 | + x = Mathf.Lerp(m_RectGraph.x, m_RectGraph.xMax, x / m_RangeX); | ||
97 | + y = Mathf.Lerp(m_RectGraph.yMax, m_RectGraph.y, y / m_RangeY); | ||
98 | + return new Vector3(x, y, 0); | ||
99 | + } | ||
100 | + | ||
101 | + // Draw a line in the graph rect | ||
102 | + void DrawLine(float x1, float y1, float x2, float y2, float grayscale) | ||
103 | + { | ||
104 | + m_LineVertices[0] = PointInRect(x1, y1); | ||
105 | + m_LineVertices[1] = PointInRect(x2, y2); | ||
106 | + Handles.color = Color.white * grayscale; | ||
107 | + Handles.DrawAAPolyLine(2.0f, m_LineVertices); | ||
108 | + } | ||
109 | + | ||
110 | + // Draw a rect in the graph rect | ||
111 | + void DrawRect(float x1, float y1, float x2, float y2, float fill, float line) | ||
112 | + { | ||
113 | + m_RectVertices[0] = PointInRect(x1, y1); | ||
114 | + m_RectVertices[1] = PointInRect(x2, y1); | ||
115 | + m_RectVertices[2] = PointInRect(x2, y2); | ||
116 | + m_RectVertices[3] = PointInRect(x1, y2); | ||
117 | + | ||
118 | + Handles.DrawSolidRectangleWithOutline( | ||
119 | + m_RectVertices, | ||
120 | + fill < 0 ? Color.clear : Color.white * fill, | ||
121 | + line < 0 ? Color.clear : Color.white * line | ||
122 | + ); | ||
123 | + } | ||
124 | + | ||
125 | + // Update internal state with a given bloom instance | ||
126 | + public void PrepareGraph() | ||
127 | + { | ||
128 | + var bloom = (BloomModel)target; | ||
129 | + m_RangeX = 5f; | ||
130 | + m_RangeY = 2f; | ||
131 | + | ||
132 | + m_GraphThreshold = bloom.settings.bloom.thresholdLinear; | ||
133 | + m_GraphKnee = bloom.settings.bloom.softKnee * m_GraphThreshold + 1e-5f; | ||
134 | + | ||
135 | + // Intensity is capped to prevent sampling errors | ||
136 | + m_GraphIntensity = Mathf.Min(bloom.settings.bloom.intensity, 10f); | ||
137 | + } | ||
138 | + | ||
139 | + // Draw the graph at the current position | ||
140 | + public void DrawGraph() | ||
141 | + { | ||
142 | + using (new GUILayout.HorizontalScope()) | ||
143 | + { | ||
144 | + GUILayout.Space(EditorGUI.indentLevel * 15f); | ||
145 | + m_RectGraph = GUILayoutUtility.GetRect(128, 80); | ||
146 | + } | ||
147 | + | ||
148 | + // Background | ||
149 | + DrawRect(0, 0, m_RangeX, m_RangeY, 0.1f, 0.4f); | ||
150 | + | ||
151 | + // Soft-knee range | ||
152 | + DrawRect(m_GraphThreshold - m_GraphKnee, 0, m_GraphThreshold + m_GraphKnee, m_RangeY, 0.25f, -1); | ||
153 | + | ||
154 | + // Horizontal lines | ||
155 | + for (var i = 1; i < m_RangeY; i++) | ||
156 | + DrawLine(0, i, m_RangeX, i, 0.4f); | ||
157 | + | ||
158 | + // Vertical lines | ||
159 | + for (var i = 1; i < m_RangeX; i++) | ||
160 | + DrawLine(i, 0, i, m_RangeY, 0.4f); | ||
161 | + | ||
162 | + // Label | ||
163 | + Handles.Label( | ||
164 | + PointInRect(0, m_RangeY) + Vector3.right, | ||
165 | + "Brightness Response (linear)", EditorStyles.miniLabel | ||
166 | + ); | ||
167 | + | ||
168 | + // Threshold line | ||
169 | + DrawLine(m_GraphThreshold, 0, m_GraphThreshold, m_RangeY, 0.6f); | ||
170 | + | ||
171 | + // Response curve | ||
172 | + var vcount = 0; | ||
173 | + while (vcount < k_CurveResolution) | ||
174 | + { | ||
175 | + var x = m_RangeX * vcount / (k_CurveResolution - 1); | ||
176 | + var y = ResponseFunction(x); | ||
177 | + if (y < m_RangeY) | ||
178 | + { | ||
179 | + m_CurveVertices[vcount++] = PointInRect(x, y); | ||
180 | + } | ||
181 | + else | ||
182 | + { | ||
183 | + if (vcount > 1) | ||
184 | + { | ||
185 | + // Extend the last segment to the top edge of the rect. | ||
186 | + var v1 = m_CurveVertices[vcount - 2]; | ||
187 | + var v2 = m_CurveVertices[vcount - 1]; | ||
188 | + var clip = (m_RectGraph.y - v1.y) / (v2.y - v1.y); | ||
189 | + m_CurveVertices[vcount - 1] = v1 + (v2 - v1) * clip; | ||
190 | + } | ||
191 | + break; | ||
192 | + } | ||
193 | + } | ||
194 | + | ||
195 | + if (vcount > 1) | ||
196 | + { | ||
197 | + Handles.color = Color.white * 0.9f; | ||
198 | + Handles.DrawAAPolyLine(2.0f, vcount, m_CurveVertices); | ||
199 | + } | ||
200 | + } | ||
201 | + | ||
202 | + #endregion | ||
203 | + } | ||
204 | +} |
1 | +using UnityEngine.PostProcessing; | ||
2 | + | ||
3 | +namespace UnityEditor.PostProcessing | ||
4 | +{ | ||
5 | + using Mode = BuiltinDebugViewsModel.Mode; | ||
6 | + using Settings = BuiltinDebugViewsModel.Settings; | ||
7 | + | ||
8 | + [PostProcessingModelEditor(typeof(BuiltinDebugViewsModel), alwaysEnabled: true)] | ||
9 | + public class BuiltinDebugViewsEditor : PostProcessingModelEditor | ||
10 | + { | ||
11 | + struct DepthSettings | ||
12 | + { | ||
13 | + public SerializedProperty scale; | ||
14 | + } | ||
15 | + | ||
16 | + struct MotionVectorsSettings | ||
17 | + { | ||
18 | + public SerializedProperty sourceOpacity; | ||
19 | + public SerializedProperty motionImageOpacity; | ||
20 | + public SerializedProperty motionImageAmplitude; | ||
21 | + public SerializedProperty motionVectorsOpacity; | ||
22 | + public SerializedProperty motionVectorsResolution; | ||
23 | + public SerializedProperty motionVectorsAmplitude; | ||
24 | + } | ||
25 | + | ||
26 | + SerializedProperty m_Mode; | ||
27 | + DepthSettings m_Depth; | ||
28 | + MotionVectorsSettings m_MotionVectors; | ||
29 | + | ||
30 | + public override void OnEnable() | ||
31 | + { | ||
32 | + m_Mode = FindSetting((Settings x) => x.mode); | ||
33 | + | ||
34 | + m_Depth = new DepthSettings | ||
35 | + { | ||
36 | + scale = FindSetting((Settings x) => x.depth.scale) | ||
37 | + }; | ||
38 | + | ||
39 | + m_MotionVectors = new MotionVectorsSettings | ||
40 | + { | ||
41 | + sourceOpacity = FindSetting((Settings x) => x.motionVectors.sourceOpacity), | ||
42 | + motionImageOpacity = FindSetting((Settings x) => x.motionVectors.motionImageOpacity), | ||
43 | + motionImageAmplitude = FindSetting((Settings x) => x.motionVectors.motionImageAmplitude), | ||
44 | + motionVectorsOpacity = FindSetting((Settings x) => x.motionVectors.motionVectorsOpacity), | ||
45 | + motionVectorsResolution = FindSetting((Settings x) => x.motionVectors.motionVectorsResolution), | ||
46 | + motionVectorsAmplitude = FindSetting((Settings x) => x.motionVectors.motionVectorsAmplitude), | ||
47 | + }; | ||
48 | + } | ||
49 | + | ||
50 | + public override void OnInspectorGUI() | ||
51 | + { | ||
52 | + EditorGUILayout.PropertyField(m_Mode); | ||
53 | + | ||
54 | + int mode = m_Mode.intValue; | ||
55 | + | ||
56 | + if (mode == (int)Mode.Depth) | ||
57 | + { | ||
58 | + EditorGUILayout.PropertyField(m_Depth.scale); | ||
59 | + } | ||
60 | + else if (mode == (int)Mode.MotionVectors) | ||
61 | + { | ||
62 | + EditorGUILayout.HelpBox("Switch to play mode to see motion vectors.", MessageType.Info); | ||
63 | + | ||
64 | + EditorGUILayout.LabelField("Source Image", EditorStyles.boldLabel); | ||
65 | + EditorGUI.indentLevel++; | ||
66 | + EditorGUILayout.PropertyField(m_MotionVectors.sourceOpacity, EditorGUIHelper.GetContent("Opacity")); | ||
67 | + EditorGUI.indentLevel--; | ||
68 | + | ||
69 | + EditorGUILayout.Space(); | ||
70 | + | ||
71 | + EditorGUILayout.LabelField("Motion Vectors (overlay)", EditorStyles.boldLabel); | ||
72 | + EditorGUI.indentLevel++; | ||
73 | + | ||
74 | + if (m_MotionVectors.motionImageOpacity.floatValue > 0f) | ||
75 | + EditorGUILayout.HelpBox("Please keep opacity to 0 if you're subject to motion sickness.", MessageType.Warning); | ||
76 | + | ||
77 | + EditorGUILayout.PropertyField(m_MotionVectors.motionImageOpacity, EditorGUIHelper.GetContent("Opacity")); | ||
78 | + EditorGUILayout.PropertyField(m_MotionVectors.motionImageAmplitude, EditorGUIHelper.GetContent("Amplitude")); | ||
79 | + EditorGUI.indentLevel--; | ||
80 | + | ||
81 | + EditorGUILayout.Space(); | ||
82 | + | ||
83 | + EditorGUILayout.LabelField("Motion Vectors (arrows)", EditorStyles.boldLabel); | ||
84 | + EditorGUI.indentLevel++; | ||
85 | + EditorGUILayout.PropertyField(m_MotionVectors.motionVectorsOpacity, EditorGUIHelper.GetContent("Opacity")); | ||
86 | + EditorGUILayout.PropertyField(m_MotionVectors.motionVectorsResolution, EditorGUIHelper.GetContent("Resolution")); | ||
87 | + EditorGUILayout.PropertyField(m_MotionVectors.motionVectorsAmplitude, EditorGUIHelper.GetContent("Amplitude")); | ||
88 | + EditorGUI.indentLevel--; | ||
89 | + } | ||
90 | + else | ||
91 | + { | ||
92 | + CheckActiveEffect(mode == (int)Mode.AmbientOcclusion && !profile.ambientOcclusion.enabled, "Ambient Occlusion"); | ||
93 | + CheckActiveEffect(mode == (int)Mode.FocusPlane && !profile.depthOfField.enabled, "Depth Of Field"); | ||
94 | + CheckActiveEffect(mode == (int)Mode.EyeAdaptation && !profile.eyeAdaptation.enabled, "Eye Adaptation"); | ||
95 | + CheckActiveEffect((mode == (int)Mode.LogLut || mode == (int)Mode.PreGradingLog) && !profile.colorGrading.enabled, "Color Grading"); | ||
96 | + CheckActiveEffect(mode == (int)Mode.UserLut && !profile.userLut.enabled, "User Lut"); | ||
97 | + } | ||
98 | + } | ||
99 | + | ||
100 | + void CheckActiveEffect(bool expr, string name) | ||
101 | + { | ||
102 | + if (expr) | ||
103 | + EditorGUILayout.HelpBox(string.Format("{0} isn't enabled, the debug view won't work.", name), MessageType.Warning); | ||
104 | + } | ||
105 | + } | ||
106 | +} |
This diff is collapsed. Click to expand it.
1 | +using System.Collections.Generic; | ||
2 | + | ||
3 | +namespace UnityEditor.PostProcessing | ||
4 | +{ | ||
5 | + public class DefaultPostFxModelEditor : PostProcessingModelEditor | ||
6 | + { | ||
7 | + List<SerializedProperty> m_Properties = new List<SerializedProperty>(); | ||
8 | + | ||
9 | + public override void OnEnable() | ||
10 | + { | ||
11 | + var iter = m_SettingsProperty.Copy().GetEnumerator(); | ||
12 | + while (iter.MoveNext()) | ||
13 | + m_Properties.Add(((SerializedProperty)iter.Current).Copy()); | ||
14 | + } | ||
15 | + | ||
16 | + public override void OnInspectorGUI() | ||
17 | + { | ||
18 | + foreach (var property in m_Properties) | ||
19 | + EditorGUILayout.PropertyField(property); | ||
20 | + } | ||
21 | + } | ||
22 | +} |
1 | +using UnityEngine.PostProcessing; | ||
2 | + | ||
3 | +namespace UnityEditor.PostProcessing | ||
4 | +{ | ||
5 | + using Settings = DepthOfFieldModel.Settings; | ||
6 | + | ||
7 | + [PostProcessingModelEditor(typeof(DepthOfFieldModel))] | ||
8 | + public class DepthOfFieldModelEditor : PostProcessingModelEditor | ||
9 | + { | ||
10 | + SerializedProperty m_FocusDistance; | ||
11 | + SerializedProperty m_Aperture; | ||
12 | + SerializedProperty m_FocalLength; | ||
13 | + SerializedProperty m_UseCameraFov; | ||
14 | + SerializedProperty m_KernelSize; | ||
15 | + | ||
16 | + public override void OnEnable() | ||
17 | + { | ||
18 | + m_FocusDistance = FindSetting((Settings x) => x.focusDistance); | ||
19 | + m_Aperture = FindSetting((Settings x) => x.aperture); | ||
20 | + m_FocalLength = FindSetting((Settings x) => x.focalLength); | ||
21 | + m_UseCameraFov = FindSetting((Settings x) => x.useCameraFov); | ||
22 | + m_KernelSize = FindSetting((Settings x) => x.kernelSize); | ||
23 | + } | ||
24 | + | ||
25 | + public override void OnInspectorGUI() | ||
26 | + { | ||
27 | + EditorGUILayout.PropertyField(m_FocusDistance); | ||
28 | + EditorGUILayout.PropertyField(m_Aperture, EditorGUIHelper.GetContent("Aperture (f-stop)")); | ||
29 | + | ||
30 | + EditorGUILayout.PropertyField(m_UseCameraFov, EditorGUIHelper.GetContent("Use Camera FOV")); | ||
31 | + if (!m_UseCameraFov.boolValue) | ||
32 | + EditorGUILayout.PropertyField(m_FocalLength, EditorGUIHelper.GetContent("Focal Length (mm)")); | ||
33 | + | ||
34 | + EditorGUILayout.PropertyField(m_KernelSize); | ||
35 | + } | ||
36 | + } | ||
37 | +} |
1 | +using UnityEngine.PostProcessing; | ||
2 | + | ||
3 | +namespace UnityEditor.PostProcessing | ||
4 | +{ | ||
5 | + [PostProcessingModelEditor(typeof(DitheringModel))] | ||
6 | + public class DitheringModelEditor : PostProcessingModelEditor | ||
7 | + { | ||
8 | + public override void OnInspectorGUI() | ||
9 | + { | ||
10 | + if (profile.grain.enabled && target.enabled) | ||
11 | + EditorGUILayout.HelpBox("Grain is enabled, you probably don't need dithering !", MessageType.Warning); | ||
12 | + else | ||
13 | + EditorGUILayout.HelpBox("Nothing to configure !", MessageType.Info); | ||
14 | + } | ||
15 | + } | ||
16 | +} |
1 | +using UnityEngine; | ||
2 | +using UnityEngine.PostProcessing; | ||
3 | + | ||
4 | +namespace UnityEditor.PostProcessing | ||
5 | +{ | ||
6 | + using Settings = EyeAdaptationModel.Settings; | ||
7 | + | ||
8 | + [PostProcessingModelEditor(typeof(EyeAdaptationModel))] | ||
9 | + public class EyeAdaptationModelEditor : PostProcessingModelEditor | ||
10 | + { | ||
11 | + SerializedProperty m_LowPercent; | ||
12 | + SerializedProperty m_HighPercent; | ||
13 | + SerializedProperty m_MinLuminance; | ||
14 | + SerializedProperty m_MaxLuminance; | ||
15 | + SerializedProperty m_KeyValue; | ||
16 | + SerializedProperty m_DynamicKeyValue; | ||
17 | + SerializedProperty m_AdaptationType; | ||
18 | + SerializedProperty m_SpeedUp; | ||
19 | + SerializedProperty m_SpeedDown; | ||
20 | + SerializedProperty m_LogMin; | ||
21 | + SerializedProperty m_LogMax; | ||
22 | + | ||
23 | + public override void OnEnable() | ||
24 | + { | ||
25 | + m_LowPercent = FindSetting((Settings x) => x.lowPercent); | ||
26 | + m_HighPercent = FindSetting((Settings x) => x.highPercent); | ||
27 | + m_MinLuminance = FindSetting((Settings x) => x.minLuminance); | ||
28 | + m_MaxLuminance = FindSetting((Settings x) => x.maxLuminance); | ||
29 | + m_KeyValue = FindSetting((Settings x) => x.keyValue); | ||
30 | + m_DynamicKeyValue = FindSetting((Settings x) => x.dynamicKeyValue); | ||
31 | + m_AdaptationType = FindSetting((Settings x) => x.adaptationType); | ||
32 | + m_SpeedUp = FindSetting((Settings x) => x.speedUp); | ||
33 | + m_SpeedDown = FindSetting((Settings x) => x.speedDown); | ||
34 | + m_LogMin = FindSetting((Settings x) => x.logMin); | ||
35 | + m_LogMax = FindSetting((Settings x) => x.logMax); | ||
36 | + } | ||
37 | + | ||
38 | + public override void OnInspectorGUI() | ||
39 | + { | ||
40 | + if (!GraphicsUtils.supportsDX11) | ||
41 | + EditorGUILayout.HelpBox("This effect requires support for compute shaders. Enabling it won't do anything on unsupported platforms.", MessageType.Warning); | ||
42 | + | ||
43 | + EditorGUILayout.LabelField("Luminosity range", EditorStyles.boldLabel); | ||
44 | + EditorGUI.indentLevel++; | ||
45 | + EditorGUILayout.PropertyField(m_LogMin, EditorGUIHelper.GetContent("Minimum (EV)")); | ||
46 | + EditorGUILayout.PropertyField(m_LogMax, EditorGUIHelper.GetContent("Maximum (EV)")); | ||
47 | + EditorGUI.indentLevel--; | ||
48 | + EditorGUILayout.Space(); | ||
49 | + | ||
50 | + EditorGUILayout.LabelField("Auto exposure", EditorStyles.boldLabel); | ||
51 | + EditorGUI.indentLevel++; | ||
52 | + float low = m_LowPercent.floatValue; | ||
53 | + float high = m_HighPercent.floatValue; | ||
54 | + | ||
55 | + EditorGUILayout.MinMaxSlider(EditorGUIHelper.GetContent("Histogram filtering|These values are the lower and upper percentages of the histogram that will be used to find a stable average luminance. Values outside of this range will be discarded and won't contribute to the average luminance."), ref low, ref high, 1f, 99f); | ||
56 | + | ||
57 | + m_LowPercent.floatValue = low; | ||
58 | + m_HighPercent.floatValue = high; | ||
59 | + | ||
60 | + EditorGUILayout.PropertyField(m_MinLuminance, EditorGUIHelper.GetContent("Minimum (EV)")); | ||
61 | + EditorGUILayout.PropertyField(m_MaxLuminance, EditorGUIHelper.GetContent("Maximum (EV)")); | ||
62 | + EditorGUILayout.PropertyField(m_DynamicKeyValue); | ||
63 | + | ||
64 | + if (!m_DynamicKeyValue.boolValue) | ||
65 | + EditorGUILayout.PropertyField(m_KeyValue); | ||
66 | + | ||
67 | + EditorGUI.indentLevel--; | ||
68 | + EditorGUILayout.Space(); | ||
69 | + | ||
70 | + EditorGUILayout.LabelField("Adaptation", EditorStyles.boldLabel); | ||
71 | + EditorGUI.indentLevel++; | ||
72 | + | ||
73 | + EditorGUILayout.PropertyField(m_AdaptationType, EditorGUIHelper.GetContent("Type")); | ||
74 | + | ||
75 | + if (m_AdaptationType.intValue == (int)EyeAdaptationModel.EyeAdaptationType.Progressive) | ||
76 | + { | ||
77 | + EditorGUI.indentLevel++; | ||
78 | + EditorGUILayout.PropertyField(m_SpeedUp); | ||
79 | + EditorGUILayout.PropertyField(m_SpeedDown); | ||
80 | + EditorGUI.indentLevel--; | ||
81 | + } | ||
82 | + | ||
83 | + EditorGUI.indentLevel--; | ||
84 | + } | ||
85 | + } | ||
86 | +} |
1 | +using UnityEngine.PostProcessing; | ||
2 | + | ||
3 | +namespace UnityEditor.PostProcessing | ||
4 | +{ | ||
5 | + using Settings = FogModel.Settings; | ||
6 | + | ||
7 | + [PostProcessingModelEditor(typeof(FogModel))] | ||
8 | + public class FogModelEditor : PostProcessingModelEditor | ||
9 | + { | ||
10 | + SerializedProperty m_ExcludeSkybox; | ||
11 | + | ||
12 | + public override void OnEnable() | ||
13 | + { | ||
14 | + m_ExcludeSkybox = FindSetting((Settings x) => x.excludeSkybox); | ||
15 | + } | ||
16 | + | ||
17 | + public override void OnInspectorGUI() | ||
18 | + { | ||
19 | + EditorGUILayout.HelpBox("This effect adds fog compatibility to the deferred rendering path; enabling it with the forward rendering path won't have any effect. Actual fog settings should be set in the Lighting panel.", MessageType.Info); | ||
20 | + EditorGUILayout.PropertyField(m_ExcludeSkybox); | ||
21 | + EditorGUI.indentLevel--; | ||
22 | + } | ||
23 | + } | ||
24 | +} |
1 | +using UnityEngine.PostProcessing; | ||
2 | + | ||
3 | +namespace UnityEditor.PostProcessing | ||
4 | +{ | ||
5 | + using Settings = GrainModel.Settings; | ||
6 | + | ||
7 | + [PostProcessingModelEditor(typeof(GrainModel))] | ||
8 | + public class GrainModelEditor : PostProcessingModelEditor | ||
9 | + { | ||
10 | + SerializedProperty m_Colored; | ||
11 | + SerializedProperty m_Intensity; | ||
12 | + SerializedProperty m_Size; | ||
13 | + SerializedProperty m_LuminanceContribution; | ||
14 | + | ||
15 | + public override void OnEnable() | ||
16 | + { | ||
17 | + m_Colored = FindSetting((Settings x) => x.colored); | ||
18 | + m_Intensity = FindSetting((Settings x) => x.intensity); | ||
19 | + m_Size = FindSetting((Settings x) => x.size); | ||
20 | + m_LuminanceContribution = FindSetting((Settings x) => x.luminanceContribution); | ||
21 | + } | ||
22 | + | ||
23 | + public override void OnInspectorGUI() | ||
24 | + { | ||
25 | + EditorGUILayout.PropertyField(m_Intensity); | ||
26 | + EditorGUILayout.PropertyField(m_LuminanceContribution); | ||
27 | + EditorGUILayout.PropertyField(m_Size); | ||
28 | + EditorGUILayout.PropertyField(m_Colored); | ||
29 | + } | ||
30 | + } | ||
31 | +} |
1 | +using UnityEngine; | ||
2 | +using UnityEngine.PostProcessing; | ||
3 | + | ||
4 | +namespace UnityEditor.PostProcessing | ||
5 | +{ | ||
6 | + using Settings = MotionBlurModel.Settings; | ||
7 | + | ||
8 | + [PostProcessingModelEditor(typeof(MotionBlurModel))] | ||
9 | + public class MotionBlurModelEditor : PostProcessingModelEditor | ||
10 | + { | ||
11 | + SerializedProperty m_ShutterAngle; | ||
12 | + SerializedProperty m_SampleCount; | ||
13 | + SerializedProperty m_FrameBlending; | ||
14 | + | ||
15 | + GraphDrawer m_GraphDrawer; | ||
16 | + | ||
17 | + class GraphDrawer | ||
18 | + { | ||
19 | + const float k_Height = 32f; | ||
20 | + | ||
21 | + Texture m_BlendingIcon; | ||
22 | + | ||
23 | + GUIStyle m_LowerCenterStyle; | ||
24 | + GUIStyle m_MiddleCenterStyle; | ||
25 | + | ||
26 | + Color m_ColorDark; | ||
27 | + Color m_ColorGray; | ||
28 | + | ||
29 | + Vector3[] m_RectVertices = new Vector3[4]; | ||
30 | + | ||
31 | + public GraphDrawer() | ||
32 | + { | ||
33 | + m_BlendingIcon = EditorResources.Load<Texture>("UI/MotionBlendingIcon.png"); | ||
34 | + | ||
35 | + m_LowerCenterStyle = new GUIStyle(EditorStyles.miniLabel) { alignment = TextAnchor.LowerCenter }; | ||
36 | + m_MiddleCenterStyle = new GUIStyle(EditorStyles.miniLabel) { alignment = TextAnchor.MiddleCenter }; | ||
37 | + | ||
38 | + if (EditorGUIUtility.isProSkin) | ||
39 | + { | ||
40 | + m_ColorDark = new Color(0.18f, 0.18f, 0.18f); | ||
41 | + m_ColorGray = new Color(0.43f, 0.43f, 0.43f); | ||
42 | + } | ||
43 | + else | ||
44 | + { | ||
45 | + m_ColorDark = new Color(0.64f, 0.64f, 0.64f); | ||
46 | + m_ColorGray = new Color(0.92f, 0.92f, 0.92f); | ||
47 | + } | ||
48 | + } | ||
49 | + | ||
50 | + public void DrawShutterGraph(float angle) | ||
51 | + { | ||
52 | + var center = GUILayoutUtility.GetRect(128, k_Height).center; | ||
53 | + | ||
54 | + // Parameters used to make transitions smooth. | ||
55 | + var zeroWhenOff = Mathf.Min(1f, angle * 0.1f); | ||
56 | + var zeroWhenFull = Mathf.Min(1f, (360f - angle) * 0.02f); | ||
57 | + | ||
58 | + // Shutter angle graph | ||
59 | + var discCenter = center - new Vector2(k_Height * 2.4f, 0f); | ||
60 | + // - exposure duration indicator | ||
61 | + DrawDisc(discCenter, k_Height * Mathf.Lerp(0.5f, 0.38f, zeroWhenFull), m_ColorGray); | ||
62 | + // - shutter disc | ||
63 | + DrawDisc(discCenter, k_Height * 0.16f * zeroWhenFull, m_ColorDark); | ||
64 | + // - shutter blade | ||
65 | + DrawArc(discCenter, k_Height * 0.5f, 360f - angle, m_ColorDark); | ||
66 | + // - shutter axis | ||
67 | + DrawDisc(discCenter, zeroWhenOff, m_ColorGray); | ||
68 | + | ||
69 | + // Shutter label (off/full) | ||
70 | + var labelSize = new Vector2(k_Height, k_Height); | ||
71 | + var labelOrigin = discCenter - labelSize * 0.5f; | ||
72 | + var labelRect = new Rect(labelOrigin, labelSize); | ||
73 | + | ||
74 | + if (Mathf.Approximately(angle, 0f)) | ||
75 | + GUI.Label(labelRect, "Off", m_MiddleCenterStyle); | ||
76 | + else if (Mathf.Approximately(angle, 360f)) | ||
77 | + GUI.Label(labelRect, "Full", m_MiddleCenterStyle); | ||
78 | + | ||
79 | + // Exposure time bar graph | ||
80 | + var outerBarSize = new Vector2(4.75f, 0.5f) * k_Height; | ||
81 | + var innerBarSize = outerBarSize; | ||
82 | + innerBarSize.x *= angle / 360f; | ||
83 | + | ||
84 | + var barCenter = center + new Vector2(k_Height * 0.9f, 0f); | ||
85 | + var barOrigin = barCenter - outerBarSize * 0.5f; | ||
86 | + | ||
87 | + DrawRect(barOrigin, outerBarSize, m_ColorDark); | ||
88 | + DrawRect(barOrigin, innerBarSize, m_ColorGray); | ||
89 | + | ||
90 | + var barText = "Exposure time = " + (angle / 3.6f).ToString("0") + "% of ΔT"; | ||
91 | + GUI.Label(new Rect(barOrigin, outerBarSize), barText, m_MiddleCenterStyle); | ||
92 | + } | ||
93 | + | ||
94 | + public void DrawBlendingGraph(float strength) | ||
95 | + { | ||
96 | + var center = GUILayoutUtility.GetRect(128, k_Height).center; | ||
97 | + | ||
98 | + var iconSize = new Vector2(k_Height, k_Height); | ||
99 | + var iconStride = new Vector2(k_Height * 0.9f, 0f); | ||
100 | + var iconOrigin = center - iconSize * 0.5f - iconStride * 2f; | ||
101 | + | ||
102 | + for (var i = 0; i < 5; i++) | ||
103 | + { | ||
104 | + var weight = BlendingWeight(strength, i / 60f); | ||
105 | + var rect = new Rect(iconOrigin + iconStride * i, iconSize); | ||
106 | + | ||
107 | + var color = m_ColorGray; | ||
108 | + color.a = weight; | ||
109 | + | ||
110 | + GUI.color = color; | ||
111 | + GUI.Label(rect, m_BlendingIcon); | ||
112 | + | ||
113 | + GUI.color = Color.white; | ||
114 | + GUI.Label(rect, (weight * 100).ToString("0") + "%", m_LowerCenterStyle); | ||
115 | + } | ||
116 | + // EditorGUIUtility.isProSkin | ||
117 | + } | ||
118 | + | ||
119 | + // Weight function for multi frame blending | ||
120 | + float BlendingWeight(float strength, float time) | ||
121 | + { | ||
122 | + if (strength > 0f || Mathf.Approximately(time, 0f)) | ||
123 | + return Mathf.Exp(-time * Mathf.Lerp(80f, 10f, strength)); | ||
124 | + | ||
125 | + return 0; | ||
126 | + } | ||
127 | + | ||
128 | + // Draw a solid disc in the graph rect. | ||
129 | + void DrawDisc(Vector2 center, float radius, Color fill) | ||
130 | + { | ||
131 | + Handles.color = fill; | ||
132 | + Handles.DrawSolidDisc(center, Vector3.forward, radius); | ||
133 | + } | ||
134 | + | ||
135 | + // Draw an arc in the graph rect. | ||
136 | + void DrawArc(Vector2 center, float radius, float angle, Color fill) | ||
137 | + { | ||
138 | + var start = new Vector2( | ||
139 | + -Mathf.Cos(Mathf.Deg2Rad * angle / 2f), | ||
140 | + Mathf.Sin(Mathf.Deg2Rad * angle / 2f) | ||
141 | + ); | ||
142 | + | ||
143 | + Handles.color = fill; | ||
144 | + Handles.DrawSolidArc(center, Vector3.forward, start, angle, radius); | ||
145 | + } | ||
146 | + | ||
147 | + // Draw a rectangle in the graph rect. | ||
148 | + void DrawRect(Vector2 origin, Vector2 size, Color color) | ||
149 | + { | ||
150 | + var p0 = origin; | ||
151 | + var p1 = origin + size; | ||
152 | + | ||
153 | + m_RectVertices[0] = p0; | ||
154 | + m_RectVertices[1] = new Vector2(p1.x, p0.y); | ||
155 | + m_RectVertices[2] = p1; | ||
156 | + m_RectVertices[3] = new Vector2(p0.x, p1.y); | ||
157 | + | ||
158 | + Handles.color = Color.white; | ||
159 | + Handles.DrawSolidRectangleWithOutline(m_RectVertices, color, Color.clear); | ||
160 | + } | ||
161 | + } | ||
162 | + | ||
163 | + public override void OnEnable() | ||
164 | + { | ||
165 | + m_ShutterAngle = FindSetting((Settings x) => x.shutterAngle); | ||
166 | + m_SampleCount = FindSetting((Settings x) => x.sampleCount); | ||
167 | + m_FrameBlending = FindSetting((Settings x) => x.frameBlending); | ||
168 | + } | ||
169 | + | ||
170 | + public override void OnInspectorGUI() | ||
171 | + { | ||
172 | + if (m_GraphDrawer == null) | ||
173 | + m_GraphDrawer = new GraphDrawer(); | ||
174 | + | ||
175 | + EditorGUILayout.LabelField("Shutter Speed Simulation", EditorStyles.boldLabel); | ||
176 | + EditorGUI.indentLevel++; | ||
177 | + m_GraphDrawer.DrawShutterGraph(m_ShutterAngle.floatValue); | ||
178 | + EditorGUILayout.PropertyField(m_ShutterAngle); | ||
179 | + EditorGUILayout.PropertyField(m_SampleCount); | ||
180 | + EditorGUI.indentLevel--; | ||
181 | + EditorGUILayout.Space(); | ||
182 | + | ||
183 | + EditorGUILayout.LabelField("Multiple Frame Blending", EditorStyles.boldLabel); | ||
184 | + EditorGUI.indentLevel++; | ||
185 | + | ||
186 | + float fbValue = m_FrameBlending.floatValue; | ||
187 | + m_GraphDrawer.DrawBlendingGraph(fbValue); | ||
188 | + EditorGUILayout.PropertyField(m_FrameBlending); | ||
189 | + | ||
190 | + if (fbValue > 0f) | ||
191 | + EditorGUILayout.HelpBox("Multi-Frame Blending lowers precision of the final picture for optimization purposes.", MessageType.Info); | ||
192 | + | ||
193 | + | ||
194 | + EditorGUI.indentLevel--; | ||
195 | + } | ||
196 | + } | ||
197 | +} |
1 | +using UnityEngine; | ||
2 | +using UnityEngine.PostProcessing; | ||
3 | + | ||
4 | +namespace UnityEditor.PostProcessing | ||
5 | +{ | ||
6 | + using Settings = ScreenSpaceReflectionModel.Settings; | ||
7 | + | ||
8 | + [PostProcessingModelEditor(typeof(ScreenSpaceReflectionModel))] | ||
9 | + public class ScreenSpaceReflectionModelEditor : PostProcessingModelEditor | ||
10 | + { | ||
11 | + struct IntensitySettings | ||
12 | + { | ||
13 | + public SerializedProperty reflectionMultiplier; | ||
14 | + public SerializedProperty fadeDistance; | ||
15 | + public SerializedProperty fresnelFade; | ||
16 | + public SerializedProperty fresnelFadePower; | ||
17 | + } | ||
18 | + | ||
19 | + struct ReflectionSettings | ||
20 | + { | ||
21 | + public SerializedProperty blendType; | ||
22 | + public SerializedProperty reflectionQuality; | ||
23 | + public SerializedProperty maxDistance; | ||
24 | + public SerializedProperty iterationCount; | ||
25 | + public SerializedProperty stepSize; | ||
26 | + public SerializedProperty widthModifier; | ||
27 | + public SerializedProperty reflectionBlur; | ||
28 | + public SerializedProperty reflectBackfaces; | ||
29 | + } | ||
30 | + | ||
31 | + struct ScreenEdgeMask | ||
32 | + { | ||
33 | + public SerializedProperty intensity; | ||
34 | + } | ||
35 | + | ||
36 | + IntensitySettings m_Intensity; | ||
37 | + ReflectionSettings m_Reflection; | ||
38 | + ScreenEdgeMask m_ScreenEdgeMask; | ||
39 | + | ||
40 | + public override void OnEnable() | ||
41 | + { | ||
42 | + m_Intensity = new IntensitySettings | ||
43 | + { | ||
44 | + reflectionMultiplier = FindSetting((Settings x) => x.intensity.reflectionMultiplier), | ||
45 | + fadeDistance = FindSetting((Settings x) => x.intensity.fadeDistance), | ||
46 | + fresnelFade = FindSetting((Settings x) => x.intensity.fresnelFade), | ||
47 | + fresnelFadePower = FindSetting((Settings x) => x.intensity.fresnelFadePower) | ||
48 | + }; | ||
49 | + | ||
50 | + m_Reflection = new ReflectionSettings | ||
51 | + { | ||
52 | + blendType = FindSetting((Settings x) => x.reflection.blendType), | ||
53 | + reflectionQuality = FindSetting((Settings x) => x.reflection.reflectionQuality), | ||
54 | + maxDistance = FindSetting((Settings x) => x.reflection.maxDistance), | ||
55 | + iterationCount = FindSetting((Settings x) => x.reflection.iterationCount), | ||
56 | + stepSize = FindSetting((Settings x) => x.reflection.stepSize), | ||
57 | + widthModifier = FindSetting((Settings x) => x.reflection.widthModifier), | ||
58 | + reflectionBlur = FindSetting((Settings x) => x.reflection.reflectionBlur), | ||
59 | + reflectBackfaces = FindSetting((Settings x) => x.reflection.reflectBackfaces) | ||
60 | + }; | ||
61 | + | ||
62 | + m_ScreenEdgeMask = new ScreenEdgeMask | ||
63 | + { | ||
64 | + intensity = FindSetting((Settings x) => x.screenEdgeMask.intensity) | ||
65 | + }; | ||
66 | + } | ||
67 | + | ||
68 | + public override void OnInspectorGUI() | ||
69 | + { | ||
70 | + EditorGUILayout.HelpBox("This effect only works with the deferred rendering path.", MessageType.Info); | ||
71 | + | ||
72 | + EditorGUILayout.LabelField("Reflection", EditorStyles.boldLabel); | ||
73 | + EditorGUI.indentLevel++; | ||
74 | + EditorGUILayout.PropertyField(m_Reflection.blendType); | ||
75 | + EditorGUILayout.PropertyField(m_Reflection.reflectionQuality); | ||
76 | + EditorGUILayout.PropertyField(m_Reflection.maxDistance); | ||
77 | + EditorGUILayout.PropertyField(m_Reflection.iterationCount); | ||
78 | + EditorGUILayout.PropertyField(m_Reflection.stepSize); | ||
79 | + EditorGUILayout.PropertyField(m_Reflection.widthModifier); | ||
80 | + EditorGUILayout.PropertyField(m_Reflection.reflectionBlur); | ||
81 | + EditorGUILayout.PropertyField(m_Reflection.reflectBackfaces); | ||
82 | + EditorGUI.indentLevel--; | ||
83 | + | ||
84 | + EditorGUILayout.Space(); | ||
85 | + EditorGUILayout.LabelField("Intensity", EditorStyles.boldLabel); | ||
86 | + EditorGUI.indentLevel++; | ||
87 | + EditorGUILayout.PropertyField(m_Intensity.reflectionMultiplier); | ||
88 | + EditorGUILayout.PropertyField(m_Intensity.fadeDistance); | ||
89 | + EditorGUILayout.PropertyField(m_Intensity.fresnelFade); | ||
90 | + EditorGUILayout.PropertyField(m_Intensity.fresnelFadePower); | ||
91 | + EditorGUI.indentLevel--; | ||
92 | + | ||
93 | + EditorGUILayout.Space(); | ||
94 | + EditorGUILayout.LabelField("Screen Edge Mask", EditorStyles.boldLabel); | ||
95 | + EditorGUI.indentLevel++; | ||
96 | + EditorGUILayout.PropertyField(m_ScreenEdgeMask.intensity); | ||
97 | + EditorGUI.indentLevel--; | ||
98 | + } | ||
99 | + } | ||
100 | +} |
1 | +using UnityEngine; | ||
2 | +using UnityEngine.PostProcessing; | ||
3 | + | ||
4 | +namespace UnityEditor.PostProcessing | ||
5 | +{ | ||
6 | + using Settings = UserLutModel.Settings; | ||
7 | + | ||
8 | + [PostProcessingModelEditor(typeof(UserLutModel))] | ||
9 | + public class UserLutModelEditor : PostProcessingModelEditor | ||
10 | + { | ||
11 | + SerializedProperty m_Texture; | ||
12 | + SerializedProperty m_Contribution; | ||
13 | + | ||
14 | + public override void OnEnable() | ||
15 | + { | ||
16 | + m_Texture = FindSetting((Settings x) => x.lut); | ||
17 | + m_Contribution = FindSetting((Settings x) => x.contribution); | ||
18 | + } | ||
19 | + | ||
20 | + public override void OnInspectorGUI() | ||
21 | + { | ||
22 | + var lut = (target as UserLutModel).settings.lut; | ||
23 | + | ||
24 | + // Checks import settings on the lut, offers to fix them if invalid | ||
25 | + if (lut != null) | ||
26 | + { | ||
27 | + var importer = (TextureImporter)AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(lut)); | ||
28 | + | ||
29 | + if (importer != null) // Fails when using an internal texture | ||
30 | + { | ||
31 | +#if UNITY_5_5_OR_NEWER | ||
32 | + bool valid = importer.anisoLevel == 0 | ||
33 | + && importer.mipmapEnabled == false | ||
34 | + && importer.sRGBTexture == false | ||
35 | + && (importer.textureCompression == TextureImporterCompression.Uncompressed); | ||
36 | +#else | ||
37 | + bool valid = importer.anisoLevel == 0 | ||
38 | + && importer.mipmapEnabled == false | ||
39 | + && importer.linearTexture == true | ||
40 | + && (importer.textureFormat == TextureImporterFormat.RGB24 || importer.textureFormat == TextureImporterFormat.AutomaticTruecolor); | ||
41 | +#endif | ||
42 | + | ||
43 | + if (!valid) | ||
44 | + { | ||
45 | + EditorGUILayout.HelpBox("Invalid LUT import settings.", MessageType.Warning); | ||
46 | + | ||
47 | + GUILayout.Space(-32); | ||
48 | + using (new EditorGUILayout.HorizontalScope()) | ||
49 | + { | ||
50 | + GUILayout.FlexibleSpace(); | ||
51 | + if (GUILayout.Button("Fix", GUILayout.Width(60))) | ||
52 | + { | ||
53 | + SetLUTImportSettings(importer); | ||
54 | + AssetDatabase.Refresh(); | ||
55 | + } | ||
56 | + GUILayout.Space(8); | ||
57 | + } | ||
58 | + GUILayout.Space(11); | ||
59 | + } | ||
60 | + } | ||
61 | + else | ||
62 | + { | ||
63 | + m_Texture.objectReferenceValue = null; | ||
64 | + } | ||
65 | + } | ||
66 | + | ||
67 | + EditorGUILayout.PropertyField(m_Texture); | ||
68 | + EditorGUILayout.PropertyField(m_Contribution); | ||
69 | + } | ||
70 | + | ||
71 | + void SetLUTImportSettings(TextureImporter importer) | ||
72 | + { | ||
73 | +#if UNITY_5_5_OR_NEWER | ||
74 | + importer.textureType = TextureImporterType.Default; | ||
75 | + importer.sRGBTexture = false; | ||
76 | + importer.textureCompression = TextureImporterCompression.Uncompressed; | ||
77 | +#else | ||
78 | + importer.textureType = TextureImporterType.Advanced; | ||
79 | + importer.linearTexture = true; | ||
80 | + importer.textureFormat = TextureImporterFormat.RGB24; | ||
81 | +#endif | ||
82 | + importer.anisoLevel = 0; | ||
83 | + importer.mipmapEnabled = false; | ||
84 | + importer.SaveAndReimport(); | ||
85 | + } | ||
86 | + } | ||
87 | +} |
1 | +using UnityEngine; | ||
2 | +using UnityEngine.PostProcessing; | ||
3 | + | ||
4 | +namespace UnityEditor.PostProcessing | ||
5 | +{ | ||
6 | + using VignetteMode = VignetteModel.Mode; | ||
7 | + using Settings = VignetteModel.Settings; | ||
8 | + | ||
9 | + [PostProcessingModelEditor(typeof(VignetteModel))] | ||
10 | + public class VignetteModelEditor : PostProcessingModelEditor | ||
11 | + { | ||
12 | + SerializedProperty m_Mode; | ||
13 | + SerializedProperty m_Color; | ||
14 | + SerializedProperty m_Center; | ||
15 | + SerializedProperty m_Intensity; | ||
16 | + SerializedProperty m_Smoothness; | ||
17 | + SerializedProperty m_Roundness; | ||
18 | + SerializedProperty m_Mask; | ||
19 | + SerializedProperty m_Opacity; | ||
20 | + SerializedProperty m_Rounded; | ||
21 | + | ||
22 | + public override void OnEnable() | ||
23 | + { | ||
24 | + m_Mode = FindSetting((Settings x) => x.mode); | ||
25 | + m_Color = FindSetting((Settings x) => x.color); | ||
26 | + m_Center = FindSetting((Settings x) => x.center); | ||
27 | + m_Intensity = FindSetting((Settings x) => x.intensity); | ||
28 | + m_Smoothness = FindSetting((Settings x) => x.smoothness); | ||
29 | + m_Roundness = FindSetting((Settings x) => x.roundness); | ||
30 | + m_Mask = FindSetting((Settings x) => x.mask); | ||
31 | + m_Opacity = FindSetting((Settings x) => x.opacity); | ||
32 | + m_Rounded = FindSetting((Settings x) => x.rounded); | ||
33 | + } | ||
34 | + | ||
35 | + public override void OnInspectorGUI() | ||
36 | + { | ||
37 | + EditorGUILayout.PropertyField(m_Mode); | ||
38 | + EditorGUILayout.PropertyField(m_Color); | ||
39 | + | ||
40 | + if (m_Mode.intValue < (int)VignetteMode.Masked) | ||
41 | + { | ||
42 | + EditorGUILayout.PropertyField(m_Center); | ||
43 | + EditorGUILayout.PropertyField(m_Intensity); | ||
44 | + EditorGUILayout.PropertyField(m_Smoothness); | ||
45 | + EditorGUILayout.PropertyField(m_Roundness); | ||
46 | + EditorGUILayout.PropertyField(m_Rounded); | ||
47 | + } | ||
48 | + else | ||
49 | + { | ||
50 | + var mask = (target as VignetteModel).settings.mask; | ||
51 | + | ||
52 | + // Checks import settings on the mask, offers to fix them if invalid | ||
53 | + if (mask != null) | ||
54 | + { | ||
55 | + var importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(mask)) as TextureImporter; | ||
56 | + | ||
57 | + if (importer != null) // Fails when using an internal texture | ||
58 | + { | ||
59 | +#if UNITY_5_5_OR_NEWER | ||
60 | + bool valid = importer.anisoLevel == 0 | ||
61 | + && importer.mipmapEnabled == false | ||
62 | + //&& importer.alphaUsage == TextureImporterAlphaUsage.FromGrayScale | ||
63 | + && importer.alphaSource == TextureImporterAlphaSource.FromGrayScale | ||
64 | + && importer.textureCompression == TextureImporterCompression.Uncompressed | ||
65 | + && importer.wrapMode == TextureWrapMode.Clamp; | ||
66 | +#else | ||
67 | + bool valid = importer.anisoLevel == 0 | ||
68 | + && importer.mipmapEnabled == false | ||
69 | + && importer.grayscaleToAlpha == true | ||
70 | + && importer.textureFormat == TextureImporterFormat.Alpha8 | ||
71 | + && importer.wrapMode == TextureWrapMode.Clamp; | ||
72 | +#endif | ||
73 | + | ||
74 | + if (!valid) | ||
75 | + { | ||
76 | + EditorGUILayout.HelpBox("Invalid mask import settings.", MessageType.Warning); | ||
77 | + | ||
78 | + GUILayout.Space(-32); | ||
79 | + using (new EditorGUILayout.HorizontalScope()) | ||
80 | + { | ||
81 | + GUILayout.FlexibleSpace(); | ||
82 | + if (GUILayout.Button("Fix", GUILayout.Width(60))) | ||
83 | + { | ||
84 | + SetMaskImportSettings(importer); | ||
85 | + AssetDatabase.Refresh(); | ||
86 | + } | ||
87 | + GUILayout.Space(8); | ||
88 | + } | ||
89 | + GUILayout.Space(11); | ||
90 | + } | ||
91 | + } | ||
92 | + } | ||
93 | + | ||
94 | + EditorGUILayout.PropertyField(m_Mask); | ||
95 | + EditorGUILayout.PropertyField(m_Opacity); | ||
96 | + } | ||
97 | + } | ||
98 | + | ||
99 | + void SetMaskImportSettings(TextureImporter importer) | ||
100 | + { | ||
101 | +#if UNITY_5_5_OR_NEWER | ||
102 | + importer.textureType = TextureImporterType.SingleChannel; | ||
103 | + //importer.alphaUsage = TextureImporterAlphaUsage.FromGrayScale; | ||
104 | + importer.alphaSource = TextureImporterAlphaSource.FromGrayScale; | ||
105 | + importer.textureCompression = TextureImporterCompression.Uncompressed; | ||
106 | +#else | ||
107 | + importer.textureType = TextureImporterType.Advanced; | ||
108 | + importer.grayscaleToAlpha = true; | ||
109 | + importer.textureFormat = TextureImporterFormat.Alpha8; | ||
110 | +#endif | ||
111 | + | ||
112 | + importer.anisoLevel = 0; | ||
113 | + importer.mipmapEnabled = false; | ||
114 | + importer.wrapMode = TextureWrapMode.Clamp; | ||
115 | + importer.SaveAndReimport(); | ||
116 | + } | ||
117 | + } | ||
118 | +} |
Assets/PostProcessing/Editor/Monitors.meta
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 | +using System; | ||
2 | +using System.Linq.Expressions; | ||
3 | +using UnityEngine.PostProcessing; | ||
4 | + | ||
5 | +namespace UnityEditor.PostProcessing | ||
6 | +{ | ||
7 | + [CustomEditor(typeof(PostProcessingBehaviour))] | ||
8 | + public class PostProcessingBehaviourEditor : Editor | ||
9 | + { | ||
10 | + SerializedProperty m_Profile; | ||
11 | + | ||
12 | + public void OnEnable() | ||
13 | + { | ||
14 | + m_Profile = FindSetting((PostProcessingBehaviour x) => x.profile); | ||
15 | + } | ||
16 | + | ||
17 | + public override void OnInspectorGUI() | ||
18 | + { | ||
19 | + serializedObject.Update(); | ||
20 | + | ||
21 | + EditorGUILayout.PropertyField(m_Profile); | ||
22 | + | ||
23 | + serializedObject.ApplyModifiedProperties(); | ||
24 | + } | ||
25 | + | ||
26 | + SerializedProperty FindSetting<T, TValue>(Expression<Func<T, TValue>> expr) | ||
27 | + { | ||
28 | + return serializedObject.FindProperty(ReflectionUtils.GetFieldPath(expr)); | ||
29 | + } | ||
30 | + } | ||
31 | +} |
1 | +using UnityEngine; | ||
2 | +using UnityEngine.PostProcessing; | ||
3 | +using UnityEditor.ProjectWindowCallback; | ||
4 | +using System.IO; | ||
5 | + | ||
6 | +namespace UnityEditor.PostProcessing | ||
7 | +{ | ||
8 | + public class PostProcessingFactory | ||
9 | + { | ||
10 | + [MenuItem("Assets/Create/Post-Processing Profile", priority = 201)] | ||
11 | + static void MenuCreatePostProcessingProfile() | ||
12 | + { | ||
13 | + var icon = EditorGUIUtility.FindTexture("ScriptableObject Icon"); | ||
14 | + ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance<DoCreatePostProcessingProfile>(), "New Post-Processing Profile.asset", icon, null); | ||
15 | + } | ||
16 | + | ||
17 | + internal static PostProcessingProfile CreatePostProcessingProfileAtPath(string path) | ||
18 | + { | ||
19 | + var profile = ScriptableObject.CreateInstance<PostProcessingProfile>(); | ||
20 | + profile.name = Path.GetFileName(path); | ||
21 | + profile.fog.enabled = true; | ||
22 | + AssetDatabase.CreateAsset(profile, path); | ||
23 | + return profile; | ||
24 | + } | ||
25 | + } | ||
26 | + | ||
27 | + class DoCreatePostProcessingProfile : EndNameEditAction | ||
28 | + { | ||
29 | + public override void Action(int instanceId, string pathName, string resourceFile) | ||
30 | + { | ||
31 | + PostProcessingProfile profile = PostProcessingFactory.CreatePostProcessingProfileAtPath(pathName); | ||
32 | + ProjectWindowUtil.ShowCreatedAsset(profile); | ||
33 | + } | ||
34 | + } | ||
35 | +} |
1 | +using UnityEngine; | ||
2 | +using UnityEngine.PostProcessing; | ||
3 | +using System; | ||
4 | +using System.Collections.Generic; | ||
5 | +using System.Linq; | ||
6 | +using System.Reflection; | ||
7 | + | ||
8 | +namespace UnityEditor.PostProcessing | ||
9 | +{ | ||
10 | + //[CanEditMultipleObjects] | ||
11 | + [CustomEditor(typeof(PostProcessingProfile))] | ||
12 | + public class PostProcessingInspector : Editor | ||
13 | + { | ||
14 | + static GUIContent s_PreviewTitle = new GUIContent("Monitors"); | ||
15 | + | ||
16 | + PostProcessingProfile m_ConcreteTarget | ||
17 | + { | ||
18 | + get { return target as PostProcessingProfile; } | ||
19 | + } | ||
20 | + | ||
21 | + int m_CurrentMonitorID | ||
22 | + { | ||
23 | + get { return m_ConcreteTarget.monitors.currentMonitorID; } | ||
24 | + set { m_ConcreteTarget.monitors.currentMonitorID = value; } | ||
25 | + } | ||
26 | + | ||
27 | + List<PostProcessingMonitor> m_Monitors; | ||
28 | + GUIContent[] m_MonitorNames; | ||
29 | + Dictionary<PostProcessingModelEditor, PostProcessingModel> m_CustomEditors = new Dictionary<PostProcessingModelEditor, PostProcessingModel>(); | ||
30 | + | ||
31 | + public bool IsInteractivePreviewOpened { get; private set; } | ||
32 | + | ||
33 | + void OnEnable() | ||
34 | + { | ||
35 | + if (target == null) | ||
36 | + return; | ||
37 | + | ||
38 | + // Aggregate custom post-fx editors | ||
39 | + var assembly = Assembly.GetAssembly(typeof(PostProcessingInspector)); | ||
40 | + | ||
41 | + var editorTypes = assembly.GetTypes() | ||
42 | + .Where(x => x.IsDefined(typeof(PostProcessingModelEditorAttribute), false)); | ||
43 | + | ||
44 | + var customEditors = new Dictionary<Type, PostProcessingModelEditor>(); | ||
45 | + foreach (var editor in editorTypes) | ||
46 | + { | ||
47 | + var attr = (PostProcessingModelEditorAttribute)editor.GetCustomAttributes(typeof(PostProcessingModelEditorAttribute), false)[0]; | ||
48 | + var effectType = attr.type; | ||
49 | + var alwaysEnabled = attr.alwaysEnabled; | ||
50 | + | ||
51 | + var editorInst = (PostProcessingModelEditor)Activator.CreateInstance(editor); | ||
52 | + editorInst.alwaysEnabled = alwaysEnabled; | ||
53 | + editorInst.profile = target as PostProcessingProfile; | ||
54 | + editorInst.inspector = this; | ||
55 | + customEditors.Add(effectType, editorInst); | ||
56 | + } | ||
57 | + | ||
58 | + // ... and corresponding models | ||
59 | + var baseType = target.GetType(); | ||
60 | + var property = serializedObject.GetIterator(); | ||
61 | + | ||
62 | + while (property.Next(true)) | ||
63 | + { | ||
64 | + if (!property.hasChildren) | ||
65 | + continue; | ||
66 | + | ||
67 | + var type = baseType; | ||
68 | + var srcObject = ReflectionUtils.GetFieldValueFromPath(serializedObject.targetObject, ref type, property.propertyPath); | ||
69 | + | ||
70 | + if (srcObject == null) | ||
71 | + continue; | ||
72 | + | ||
73 | + PostProcessingModelEditor editor; | ||
74 | + if (customEditors.TryGetValue(type, out editor)) | ||
75 | + { | ||
76 | + var effect = (PostProcessingModel)srcObject; | ||
77 | + | ||
78 | + if (editor.alwaysEnabled) | ||
79 | + effect.enabled = editor.alwaysEnabled; | ||
80 | + | ||
81 | + m_CustomEditors.Add(editor, effect); | ||
82 | + editor.target = effect; | ||
83 | + editor.serializedProperty = property.Copy(); | ||
84 | + editor.OnPreEnable(); | ||
85 | + } | ||
86 | + } | ||
87 | + | ||
88 | + // Prepare monitors | ||
89 | + m_Monitors = new List<PostProcessingMonitor>(); | ||
90 | + | ||
91 | + var monitors = new List<PostProcessingMonitor> | ||
92 | + { | ||
93 | + new HistogramMonitor(), | ||
94 | + new WaveformMonitor(), | ||
95 | + new ParadeMonitor(), | ||
96 | + new VectorscopeMonitor() | ||
97 | + }; | ||
98 | + | ||
99 | + var monitorNames = new List<GUIContent>(); | ||
100 | + | ||
101 | + foreach (var monitor in monitors) | ||
102 | + { | ||
103 | + if (monitor.IsSupported()) | ||
104 | + { | ||
105 | + monitor.Init(m_ConcreteTarget.monitors, this); | ||
106 | + m_Monitors.Add(monitor); | ||
107 | + monitorNames.Add(monitor.GetMonitorTitle()); | ||
108 | + } | ||
109 | + } | ||
110 | + | ||
111 | + m_MonitorNames = monitorNames.ToArray(); | ||
112 | + | ||
113 | + if (m_Monitors.Count > 0) | ||
114 | + m_ConcreteTarget.monitors.onFrameEndEditorOnly = OnFrameEnd; | ||
115 | + } | ||
116 | + | ||
117 | + void OnDisable() | ||
118 | + { | ||
119 | + if (m_CustomEditors != null) | ||
120 | + { | ||
121 | + foreach (var editor in m_CustomEditors.Keys) | ||
122 | + editor.OnDisable(); | ||
123 | + | ||
124 | + m_CustomEditors.Clear(); | ||
125 | + } | ||
126 | + | ||
127 | + if (m_Monitors != null) | ||
128 | + { | ||
129 | + foreach (var monitor in m_Monitors) | ||
130 | + monitor.Dispose(); | ||
131 | + | ||
132 | + m_Monitors.Clear(); | ||
133 | + } | ||
134 | + | ||
135 | + if (m_ConcreteTarget != null) | ||
136 | + m_ConcreteTarget.monitors.onFrameEndEditorOnly = null; | ||
137 | + } | ||
138 | + | ||
139 | + void OnFrameEnd(RenderTexture source) | ||
140 | + { | ||
141 | + if (!IsInteractivePreviewOpened) | ||
142 | + return; | ||
143 | + | ||
144 | + if (m_CurrentMonitorID < m_Monitors.Count) | ||
145 | + m_Monitors[m_CurrentMonitorID].OnFrameData(source); | ||
146 | + | ||
147 | + IsInteractivePreviewOpened = false; | ||
148 | + } | ||
149 | + | ||
150 | + public override void OnInspectorGUI() | ||
151 | + { | ||
152 | + serializedObject.Update(); | ||
153 | + | ||
154 | + // Handles undo/redo events first (before they get used by the editors' widgets) | ||
155 | + var e = Event.current; | ||
156 | + if (e.type == EventType.ValidateCommand && e.commandName == "UndoRedoPerformed") | ||
157 | + { | ||
158 | + foreach (var editor in m_CustomEditors) | ||
159 | + editor.Value.OnValidate(); | ||
160 | + } | ||
161 | + | ||
162 | + if (!m_ConcreteTarget.debugViews.IsModeActive(BuiltinDebugViewsModel.Mode.None)) | ||
163 | + EditorGUILayout.HelpBox("A debug view is currently enabled. Changes done to an effect might not be visible.", MessageType.Info); | ||
164 | + | ||
165 | + foreach (var editor in m_CustomEditors) | ||
166 | + { | ||
167 | + EditorGUI.BeginChangeCheck(); | ||
168 | + | ||
169 | + editor.Key.OnGUI(); | ||
170 | + | ||
171 | + if (EditorGUI.EndChangeCheck()) | ||
172 | + editor.Value.OnValidate(); | ||
173 | + } | ||
174 | + | ||
175 | + serializedObject.ApplyModifiedProperties(); | ||
176 | + } | ||
177 | + | ||
178 | + public override GUIContent GetPreviewTitle() | ||
179 | + { | ||
180 | + return s_PreviewTitle; | ||
181 | + } | ||
182 | + | ||
183 | + public override bool HasPreviewGUI() | ||
184 | + { | ||
185 | + return GraphicsUtils.supportsDX11 && m_Monitors.Count > 0; | ||
186 | + } | ||
187 | + | ||
188 | + public override void OnPreviewSettings() | ||
189 | + { | ||
190 | + using (new EditorGUILayout.HorizontalScope()) | ||
191 | + { | ||
192 | + if (m_CurrentMonitorID < m_Monitors.Count) | ||
193 | + m_Monitors[m_CurrentMonitorID].OnMonitorSettings(); | ||
194 | + | ||
195 | + GUILayout.Space(5); | ||
196 | + m_CurrentMonitorID = EditorGUILayout.Popup(m_CurrentMonitorID, m_MonitorNames, FxStyles.preDropdown, GUILayout.MaxWidth(100f)); | ||
197 | + } | ||
198 | + } | ||
199 | + | ||
200 | + public override void OnInteractivePreviewGUI(Rect r, GUIStyle background) | ||
201 | + { | ||
202 | + IsInteractivePreviewOpened = true; | ||
203 | + | ||
204 | + if (m_CurrentMonitorID < m_Monitors.Count) | ||
205 | + m_Monitors[m_CurrentMonitorID].OnMonitorGUI(r); | ||
206 | + } | ||
207 | + } | ||
208 | +} |
1 | +using UnityEngine; | ||
2 | +using UnityEngine.PostProcessing; | ||
3 | +using System; | ||
4 | +using System.Linq.Expressions; | ||
5 | + | ||
6 | +namespace UnityEditor.PostProcessing | ||
7 | +{ | ||
8 | + public class PostProcessingModelEditor | ||
9 | + { | ||
10 | + public PostProcessingModel target { get; internal set; } | ||
11 | + public SerializedProperty serializedProperty { get; internal set; } | ||
12 | + | ||
13 | + protected SerializedProperty m_SettingsProperty; | ||
14 | + protected SerializedProperty m_EnabledProperty; | ||
15 | + | ||
16 | + internal bool alwaysEnabled = false; | ||
17 | + internal PostProcessingProfile profile; | ||
18 | + internal PostProcessingInspector inspector; | ||
19 | + | ||
20 | + internal void OnPreEnable() | ||
21 | + { | ||
22 | + m_SettingsProperty = serializedProperty.FindPropertyRelative("m_Settings"); | ||
23 | + m_EnabledProperty = serializedProperty.FindPropertyRelative("m_Enabled"); | ||
24 | + | ||
25 | + OnEnable(); | ||
26 | + } | ||
27 | + | ||
28 | + public virtual void OnEnable() | ||
29 | + {} | ||
30 | + | ||
31 | + public virtual void OnDisable() | ||
32 | + {} | ||
33 | + | ||
34 | + internal void OnGUI() | ||
35 | + { | ||
36 | + GUILayout.Space(5); | ||
37 | + | ||
38 | + var display = alwaysEnabled | ||
39 | + ? EditorGUIHelper.Header(serializedProperty.displayName, m_SettingsProperty, Reset) | ||
40 | + : EditorGUIHelper.Header(serializedProperty.displayName, m_SettingsProperty, m_EnabledProperty, Reset); | ||
41 | + | ||
42 | + if (display) | ||
43 | + { | ||
44 | + EditorGUI.indentLevel++; | ||
45 | + using (new EditorGUI.DisabledGroupScope(!m_EnabledProperty.boolValue)) | ||
46 | + { | ||
47 | + OnInspectorGUI(); | ||
48 | + } | ||
49 | + EditorGUI.indentLevel--; | ||
50 | + } | ||
51 | + } | ||
52 | + | ||
53 | + void Reset() | ||
54 | + { | ||
55 | + var obj = serializedProperty.serializedObject; | ||
56 | + Undo.RecordObject(obj.targetObject, "Reset"); | ||
57 | + target.Reset(); | ||
58 | + EditorUtility.SetDirty(obj.targetObject); | ||
59 | + } | ||
60 | + | ||
61 | + public virtual void OnInspectorGUI() | ||
62 | + {} | ||
63 | + | ||
64 | + public void Repaint() | ||
65 | + { | ||
66 | + inspector.Repaint(); | ||
67 | + } | ||
68 | + | ||
69 | + protected SerializedProperty FindSetting<T, TValue>(Expression<Func<T, TValue>> expr) | ||
70 | + { | ||
71 | + return m_SettingsProperty.FindPropertyRelative(ReflectionUtils.GetFieldPath(expr)); | ||
72 | + } | ||
73 | + | ||
74 | + protected SerializedProperty FindSetting<T, TValue>(SerializedProperty prop, Expression<Func<T, TValue>> expr) | ||
75 | + { | ||
76 | + return prop.FindPropertyRelative(ReflectionUtils.GetFieldPath(expr)); | ||
77 | + } | ||
78 | + } | ||
79 | +} |
1 | +using System; | ||
2 | +using UnityEngine; | ||
3 | + | ||
4 | +namespace UnityEditor.PostProcessing | ||
5 | +{ | ||
6 | + using MonitorSettings = UnityEngine.PostProcessing.PostProcessingProfile.MonitorSettings; | ||
7 | + | ||
8 | + public abstract class PostProcessingMonitor : IDisposable | ||
9 | + { | ||
10 | + protected MonitorSettings m_MonitorSettings; | ||
11 | + protected PostProcessingInspector m_BaseEditor; | ||
12 | + | ||
13 | + public void Init(MonitorSettings monitorSettings, PostProcessingInspector baseEditor) | ||
14 | + { | ||
15 | + m_MonitorSettings = monitorSettings; | ||
16 | + m_BaseEditor = baseEditor; | ||
17 | + } | ||
18 | + | ||
19 | + public abstract bool IsSupported(); | ||
20 | + | ||
21 | + public abstract GUIContent GetMonitorTitle(); | ||
22 | + | ||
23 | + public virtual void OnMonitorSettings() | ||
24 | + {} | ||
25 | + | ||
26 | + public abstract void OnMonitorGUI(Rect r); | ||
27 | + | ||
28 | + public virtual void OnFrameData(RenderTexture source) | ||
29 | + {} | ||
30 | + | ||
31 | + public virtual void Dispose() | ||
32 | + {} | ||
33 | + } | ||
34 | +} |
1 | +using UnityEngine; | ||
2 | +using UnityEngine.PostProcessing; | ||
3 | + | ||
4 | +namespace UnityEditor.PostProcessing | ||
5 | +{ | ||
6 | + [CustomPropertyDrawer(typeof(GetSetAttribute))] | ||
7 | + sealed class GetSetDrawer : PropertyDrawer | ||
8 | + { | ||
9 | + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) | ||
10 | + { | ||
11 | + var attribute = (GetSetAttribute)base.attribute; | ||
12 | + | ||
13 | + EditorGUI.BeginChangeCheck(); | ||
14 | + EditorGUI.PropertyField(position, property, label); | ||
15 | + | ||
16 | + if (EditorGUI.EndChangeCheck()) | ||
17 | + { | ||
18 | + attribute.dirty = true; | ||
19 | + } | ||
20 | + else if (attribute.dirty) | ||
21 | + { | ||
22 | + var parent = ReflectionUtils.GetParentObject(property.propertyPath, property.serializedObject.targetObject); | ||
23 | + | ||
24 | + var type = parent.GetType(); | ||
25 | + var info = type.GetProperty(attribute.name); | ||
26 | + | ||
27 | + if (info == null) | ||
28 | + Debug.LogError("Invalid property name \"" + attribute.name + "\""); | ||
29 | + else | ||
30 | + info.SetValue(parent, fieldInfo.GetValue(parent), null); | ||
31 | + | ||
32 | + attribute.dirty = false; | ||
33 | + } | ||
34 | + } | ||
35 | + } | ||
36 | +} |
1 | +using UnityEngine; | ||
2 | +using UnityEngine.PostProcessing; | ||
3 | + | ||
4 | +namespace UnityEditor.PostProcessing | ||
5 | +{ | ||
6 | + [CustomPropertyDrawer(typeof(MinAttribute))] | ||
7 | + sealed class MinDrawer : PropertyDrawer | ||
8 | + { | ||
9 | + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) | ||
10 | + { | ||
11 | + MinAttribute attribute = (MinAttribute)base.attribute; | ||
12 | + | ||
13 | + if (property.propertyType == SerializedPropertyType.Integer) | ||
14 | + { | ||
15 | + int v = EditorGUI.IntField(position, label, property.intValue); | ||
16 | + property.intValue = (int)Mathf.Max(v, attribute.min); | ||
17 | + } | ||
18 | + else if (property.propertyType == SerializedPropertyType.Float) | ||
19 | + { | ||
20 | + float v = EditorGUI.FloatField(position, label, property.floatValue); | ||
21 | + property.floatValue = Mathf.Max(v, attribute.min); | ||
22 | + } | ||
23 | + else | ||
24 | + { | ||
25 | + EditorGUI.LabelField(position, label.text, "Use Min with float or int."); | ||
26 | + } | ||
27 | + } | ||
28 | + } | ||
29 | +} |
1 | +using System.Collections.Generic; | ||
2 | +using System.Reflection; | ||
3 | +using UnityEngine; | ||
4 | +using UnityEngine.PostProcessing; | ||
5 | + | ||
6 | +namespace UnityEditor.PostProcessing | ||
7 | +{ | ||
8 | + [CustomPropertyDrawer(typeof(TrackballGroupAttribute))] | ||
9 | + sealed class TrackballGroupDrawer : PropertyDrawer | ||
10 | + { | ||
11 | + static Material s_Material; | ||
12 | + | ||
13 | + const int k_MinWheelSize = 80; | ||
14 | + const int k_MaxWheelSize = 256; | ||
15 | + | ||
16 | + bool m_ResetState; | ||
17 | + | ||
18 | + // Cached trackball computation methods (for speed reasons) | ||
19 | + static Dictionary<string, MethodInfo> m_TrackballMethods = new Dictionary<string, MethodInfo>(); | ||
20 | + | ||
21 | + internal static int m_Size | ||
22 | + { | ||
23 | + get | ||
24 | + { | ||
25 | + int size = Mathf.FloorToInt(EditorGUIUtility.currentViewWidth / 3f) - 18; | ||
26 | + size = Mathf.Clamp(size, k_MinWheelSize, k_MaxWheelSize); | ||
27 | + return size; | ||
28 | + } | ||
29 | + } | ||
30 | + | ||
31 | + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) | ||
32 | + { | ||
33 | + if (s_Material == null) | ||
34 | + s_Material = new Material(Shader.Find("Hidden/Post FX/UI/Trackball")) { hideFlags = HideFlags.HideAndDontSave }; | ||
35 | + | ||
36 | + position = new Rect(position.x, position.y, position.width / 3f, position.height); | ||
37 | + int size = m_Size; | ||
38 | + position.x += 5f; | ||
39 | + | ||
40 | + var enumerator = property.GetEnumerator(); | ||
41 | + while (enumerator.MoveNext()) | ||
42 | + { | ||
43 | + var prop = enumerator.Current as SerializedProperty; | ||
44 | + if (prop == null || prop.propertyType != SerializedPropertyType.Color) | ||
45 | + continue; | ||
46 | + | ||
47 | + OnWheelGUI(position, size, prop.Copy()); | ||
48 | + position.x += position.width; | ||
49 | + } | ||
50 | + } | ||
51 | + | ||
52 | + void OnWheelGUI(Rect position, int size, SerializedProperty property) | ||
53 | + { | ||
54 | + if (Event.current.type == EventType.Layout) | ||
55 | + return; | ||
56 | + | ||
57 | + var value = property.colorValue; | ||
58 | + float offset = value.a; | ||
59 | + | ||
60 | + var wheelDrawArea = position; | ||
61 | + wheelDrawArea.height = size; | ||
62 | + | ||
63 | + if (wheelDrawArea.width > wheelDrawArea.height) | ||
64 | + { | ||
65 | + wheelDrawArea.x += (wheelDrawArea.width - wheelDrawArea.height) / 2.0f; | ||
66 | + wheelDrawArea.width = position.height; | ||
67 | + } | ||
68 | + | ||
69 | + wheelDrawArea.width = wheelDrawArea.height; | ||
70 | + | ||
71 | + float hsize = size / 2f; | ||
72 | + float radius = 0.38f * size; | ||
73 | + Vector3 hsv; | ||
74 | + Color.RGBToHSV(value, out hsv.x, out hsv.y, out hsv.z); | ||
75 | + | ||
76 | + if (Event.current.type == EventType.Repaint) | ||
77 | + { | ||
78 | + float scale = EditorGUIUtility.pixelsPerPoint; | ||
79 | + | ||
80 | + // Wheel texture | ||
81 | + var oldRT = RenderTexture.active; | ||
82 | + var rt = RenderTexture.GetTemporary((int)(size * scale), (int)(size * scale), 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear); | ||
83 | + s_Material.SetFloat("_Offset", offset); | ||
84 | + s_Material.SetFloat("_DisabledState", GUI.enabled ? 1f : 0.5f); | ||
85 | + s_Material.SetVector("_Resolution", new Vector2(size * scale, size * scale / 2f)); | ||
86 | + Graphics.Blit(null, rt, s_Material, EditorGUIUtility.isProSkin ? 0 : 1); | ||
87 | + RenderTexture.active = oldRT; | ||
88 | + | ||
89 | + GUI.DrawTexture(wheelDrawArea, rt); | ||
90 | + RenderTexture.ReleaseTemporary(rt); | ||
91 | + | ||
92 | + // Thumb | ||
93 | + var thumbPos = Vector2.zero; | ||
94 | + float theta = hsv.x * (Mathf.PI * 2f); | ||
95 | + float len = hsv.y * radius; | ||
96 | + thumbPos.x = Mathf.Cos(theta + (Mathf.PI / 2f)); | ||
97 | + thumbPos.y = Mathf.Sin(theta - (Mathf.PI / 2f)); | ||
98 | + thumbPos *= len; | ||
99 | + var thumbSize = FxStyles.wheelThumbSize; | ||
100 | + var thumbSizeH = thumbSize / 2f; | ||
101 | + FxStyles.wheelThumb.Draw(new Rect(wheelDrawArea.x + hsize + thumbPos.x - thumbSizeH.x, wheelDrawArea.y + hsize + thumbPos.y - thumbSizeH.y, thumbSize.x, thumbSize.y), false, false, false, false); | ||
102 | + } | ||
103 | + | ||
104 | + var bounds = wheelDrawArea; | ||
105 | + bounds.x += hsize - radius; | ||
106 | + bounds.y += hsize - radius; | ||
107 | + bounds.width = bounds.height = radius * 2f; | ||
108 | + hsv = GetInput(bounds, hsv, radius); | ||
109 | + value = Color.HSVToRGB(hsv.x, hsv.y, 1f); | ||
110 | + value.a = offset; | ||
111 | + | ||
112 | + // Luminosity booster | ||
113 | + position = wheelDrawArea; | ||
114 | + float oldX = position.x; | ||
115 | + float oldW = position.width; | ||
116 | + position.y += position.height + 4f; | ||
117 | + position.x += (position.width - (position.width * 0.75f)) / 2f; | ||
118 | + position.width = position.width * 0.75f; | ||
119 | + position.height = EditorGUIUtility.singleLineHeight; | ||
120 | + value.a = GUI.HorizontalSlider(position, value.a, -1f, 1f); | ||
121 | + | ||
122 | + // Advanced controls | ||
123 | + var data = Vector3.zero; | ||
124 | + | ||
125 | + if (TryGetDisplayValue(value, property, out data)) | ||
126 | + { | ||
127 | + position.x = oldX; | ||
128 | + position.y += position.height; | ||
129 | + position.width = oldW / 3f; | ||
130 | + | ||
131 | + using (new EditorGUI.DisabledGroupScope(true)) | ||
132 | + { | ||
133 | + GUI.Label(position, data.x.ToString("F2"), EditorStyles.centeredGreyMiniLabel); | ||
134 | + position.x += position.width; | ||
135 | + GUI.Label(position, data.y.ToString("F2"), EditorStyles.centeredGreyMiniLabel); | ||
136 | + position.x += position.width; | ||
137 | + GUI.Label(position, data.z.ToString("F2"), EditorStyles.centeredGreyMiniLabel); | ||
138 | + position.x += position.width; | ||
139 | + } | ||
140 | + } | ||
141 | + | ||
142 | + // Title | ||
143 | + position.x = oldX; | ||
144 | + position.y += position.height; | ||
145 | + position.width = oldW; | ||
146 | + GUI.Label(position, property.displayName, EditorStyles.centeredGreyMiniLabel); | ||
147 | + | ||
148 | + if (m_ResetState) | ||
149 | + { | ||
150 | + value = Color.clear; | ||
151 | + m_ResetState = false; | ||
152 | + } | ||
153 | + | ||
154 | + property.colorValue = value; | ||
155 | + } | ||
156 | + | ||
157 | + bool TryGetDisplayValue(Color color, SerializedProperty property, out Vector3 output) | ||
158 | + { | ||
159 | + output = Vector3.zero; | ||
160 | + MethodInfo method; | ||
161 | + | ||
162 | + if (!m_TrackballMethods.TryGetValue(property.name, out method)) | ||
163 | + { | ||
164 | + var field = ReflectionUtils.GetFieldInfoFromPath(property.serializedObject.targetObject, property.propertyPath); | ||
165 | + | ||
166 | + if (!field.IsDefined(typeof(TrackballAttribute), false)) | ||
167 | + return false; | ||
168 | + | ||
169 | + var attr = (TrackballAttribute)field.GetCustomAttributes(typeof(TrackballAttribute), false)[0]; | ||
170 | + const BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static; | ||
171 | + method = typeof(ColorGradingComponent).GetMethod(attr.method, flags); | ||
172 | + m_TrackballMethods.Add(property.name, method); | ||
173 | + } | ||
174 | + | ||
175 | + if (method == null) | ||
176 | + return false; | ||
177 | + | ||
178 | + output = (Vector3)method.Invoke(property.serializedObject.targetObject, new object[] { color }); | ||
179 | + return true; | ||
180 | + } | ||
181 | + | ||
182 | + static readonly int k_ThumbHash = "colorWheelThumb".GetHashCode(); | ||
183 | + | ||
184 | + Vector3 GetInput(Rect bounds, Vector3 hsv, float radius) | ||
185 | + { | ||
186 | + var e = Event.current; | ||
187 | + var id = GUIUtility.GetControlID(k_ThumbHash, FocusType.Passive, bounds); | ||
188 | + | ||
189 | + var mousePos = e.mousePosition; | ||
190 | + var relativePos = mousePos - new Vector2(bounds.x, bounds.y); | ||
191 | + | ||
192 | + if (e.type == EventType.MouseDown && GUIUtility.hotControl == 0 && bounds.Contains(mousePos)) | ||
193 | + { | ||
194 | + if (e.button == 0) | ||
195 | + { | ||
196 | + var center = new Vector2(bounds.x + radius, bounds.y + radius); | ||
197 | + float dist = Vector2.Distance(center, mousePos); | ||
198 | + | ||
199 | + if (dist <= radius) | ||
200 | + { | ||
201 | + e.Use(); | ||
202 | + GetWheelHueSaturation(relativePos.x, relativePos.y, radius, out hsv.x, out hsv.y); | ||
203 | + GUIUtility.hotControl = id; | ||
204 | + GUI.changed = true; | ||
205 | + } | ||
206 | + } | ||
207 | + else if (e.button == 1) | ||
208 | + { | ||
209 | + e.Use(); | ||
210 | + GUI.changed = true; | ||
211 | + m_ResetState = true; | ||
212 | + } | ||
213 | + } | ||
214 | + else if (e.type == EventType.MouseDrag && e.button == 0 && GUIUtility.hotControl == id) | ||
215 | + { | ||
216 | + e.Use(); | ||
217 | + GUI.changed = true; | ||
218 | + GetWheelHueSaturation(relativePos.x, relativePos.y, radius, out hsv.x, out hsv.y); | ||
219 | + } | ||
220 | + else if (e.rawType == EventType.MouseUp && e.button == 0 && GUIUtility.hotControl == id) | ||
221 | + { | ||
222 | + e.Use(); | ||
223 | + GUIUtility.hotControl = 0; | ||
224 | + } | ||
225 | + | ||
226 | + return hsv; | ||
227 | + } | ||
228 | + | ||
229 | + void GetWheelHueSaturation(float x, float y, float radius, out float hue, out float saturation) | ||
230 | + { | ||
231 | + float dx = (x - radius) / radius; | ||
232 | + float dy = (y - radius) / radius; | ||
233 | + float d = Mathf.Sqrt(dx * dx + dy * dy); | ||
234 | + hue = Mathf.Atan2(dx, -dy); | ||
235 | + hue = 1f - ((hue > 0) ? hue : (Mathf.PI * 2f) + hue) / (Mathf.PI * 2f); | ||
236 | + saturation = Mathf.Clamp01(d); | ||
237 | + } | ||
238 | + | ||
239 | + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) | ||
240 | + { | ||
241 | + return m_Size + 4f * 2f + EditorGUIUtility.singleLineHeight * 3f; | ||
242 | + } | ||
243 | + } | ||
244 | +} |
Assets/PostProcessing/Editor/Utils.meta
0 → 100644
This diff is collapsed. Click to expand it.
1 | +using System; | ||
2 | +using UnityEngine; | ||
3 | +using System.Collections.Generic; | ||
4 | +using System.Globalization; | ||
5 | +using System.Reflection; | ||
6 | +using UnityEngine.PostProcessing; | ||
7 | + | ||
8 | +namespace UnityEditor.PostProcessing | ||
9 | +{ | ||
10 | + public static class EditorGUIHelper | ||
11 | + { | ||
12 | + static EditorGUIHelper() | ||
13 | + { | ||
14 | + s_GUIContentCache = new Dictionary<string, GUIContent>(); | ||
15 | + } | ||
16 | + | ||
17 | + #region GUIContent caching | ||
18 | + | ||
19 | + static Dictionary<string, GUIContent> s_GUIContentCache; | ||
20 | + | ||
21 | + public static GUIContent GetContent(string textAndTooltip) | ||
22 | + { | ||
23 | + if (string.IsNullOrEmpty(textAndTooltip)) | ||
24 | + return GUIContent.none; | ||
25 | + | ||
26 | + GUIContent content; | ||
27 | + | ||
28 | + if (!s_GUIContentCache.TryGetValue(textAndTooltip, out content)) | ||
29 | + { | ||
30 | + var s = textAndTooltip.Split('|'); | ||
31 | + content = new GUIContent(s[0]); | ||
32 | + | ||
33 | + if (s.Length > 1 && !string.IsNullOrEmpty(s[1])) | ||
34 | + content.tooltip = s[1]; | ||
35 | + | ||
36 | + s_GUIContentCache.Add(textAndTooltip, content); | ||
37 | + } | ||
38 | + | ||
39 | + return content; | ||
40 | + } | ||
41 | + | ||
42 | + #endregion | ||
43 | + | ||
44 | + public static bool Header(string title, SerializedProperty group, Action resetAction) | ||
45 | + { | ||
46 | + var rect = GUILayoutUtility.GetRect(16f, 22f, FxStyles.header); | ||
47 | + GUI.Box(rect, title, FxStyles.header); | ||
48 | + | ||
49 | + var display = group == null || group.isExpanded; | ||
50 | + | ||
51 | + var foldoutRect = new Rect(rect.x + 4f, rect.y + 2f, 13f, 13f); | ||
52 | + var e = Event.current; | ||
53 | + | ||
54 | + var popupRect = new Rect(rect.x + rect.width - FxStyles.paneOptionsIcon.width - 5f, rect.y + FxStyles.paneOptionsIcon.height / 2f + 1f, FxStyles.paneOptionsIcon.width, FxStyles.paneOptionsIcon.height); | ||
55 | + GUI.DrawTexture(popupRect, FxStyles.paneOptionsIcon); | ||
56 | + | ||
57 | + if (e.type == EventType.Repaint) | ||
58 | + FxStyles.headerFoldout.Draw(foldoutRect, false, false, display, false); | ||
59 | + | ||
60 | + if (e.type == EventType.MouseDown) | ||
61 | + { | ||
62 | + if (popupRect.Contains(e.mousePosition)) | ||
63 | + { | ||
64 | + var popup = new GenericMenu(); | ||
65 | + popup.AddItem(GetContent("Reset"), false, () => resetAction()); | ||
66 | + popup.AddSeparator(string.Empty); | ||
67 | + popup.AddItem(GetContent("Copy Settings"), false, () => CopySettings(group)); | ||
68 | + | ||
69 | + if (CanPaste(group)) | ||
70 | + popup.AddItem(GetContent("Paste Settings"), false, () => PasteSettings(group)); | ||
71 | + else | ||
72 | + popup.AddDisabledItem(GetContent("Paste Settings")); | ||
73 | + | ||
74 | + popup.ShowAsContext(); | ||
75 | + } | ||
76 | + else if (rect.Contains(e.mousePosition) && group != null) | ||
77 | + { | ||
78 | + display = !display; | ||
79 | + | ||
80 | + if (group != null) | ||
81 | + group.isExpanded = !group.isExpanded; | ||
82 | + | ||
83 | + e.Use(); | ||
84 | + } | ||
85 | + } | ||
86 | + | ||
87 | + return display; | ||
88 | + } | ||
89 | + | ||
90 | + public static bool Header(string title, SerializedProperty group, SerializedProperty enabledField, Action resetAction) | ||
91 | + { | ||
92 | + var field = ReflectionUtils.GetFieldInfoFromPath(enabledField.serializedObject.targetObject, enabledField.propertyPath); | ||
93 | + object parent = null; | ||
94 | + PropertyInfo prop = null; | ||
95 | + | ||
96 | + if (field != null && field.IsDefined(typeof(GetSetAttribute), false)) | ||
97 | + { | ||
98 | + var attr = (GetSetAttribute)field.GetCustomAttributes(typeof(GetSetAttribute), false)[0]; | ||
99 | + parent = ReflectionUtils.GetParentObject(enabledField.propertyPath, enabledField.serializedObject.targetObject); | ||
100 | + prop = parent.GetType().GetProperty(attr.name); | ||
101 | + } | ||
102 | + | ||
103 | + var display = group == null || group.isExpanded; | ||
104 | + var enabled = enabledField.boolValue; | ||
105 | + | ||
106 | + var rect = GUILayoutUtility.GetRect(16f, 22f, FxStyles.header); | ||
107 | + GUI.Box(rect, title, FxStyles.header); | ||
108 | + | ||
109 | + var toggleRect = new Rect(rect.x + 4f, rect.y + 4f, 13f, 13f); | ||
110 | + var e = Event.current; | ||
111 | + | ||
112 | + var popupRect = new Rect(rect.x + rect.width - FxStyles.paneOptionsIcon.width - 5f, rect.y + FxStyles.paneOptionsIcon.height / 2f + 1f, FxStyles.paneOptionsIcon.width, FxStyles.paneOptionsIcon.height); | ||
113 | + GUI.DrawTexture(popupRect, FxStyles.paneOptionsIcon); | ||
114 | + | ||
115 | + if (e.type == EventType.Repaint) | ||
116 | + FxStyles.headerCheckbox.Draw(toggleRect, false, false, enabled, false); | ||
117 | + | ||
118 | + if (e.type == EventType.MouseDown) | ||
119 | + { | ||
120 | + const float kOffset = 2f; | ||
121 | + toggleRect.x -= kOffset; | ||
122 | + toggleRect.y -= kOffset; | ||
123 | + toggleRect.width += kOffset * 2f; | ||
124 | + toggleRect.height += kOffset * 2f; | ||
125 | + | ||
126 | + if (toggleRect.Contains(e.mousePosition)) | ||
127 | + { | ||
128 | + enabledField.boolValue = !enabledField.boolValue; | ||
129 | + | ||
130 | + if (prop != null) | ||
131 | + prop.SetValue(parent, enabledField.boolValue, null); | ||
132 | + | ||
133 | + e.Use(); | ||
134 | + } | ||
135 | + else if (popupRect.Contains(e.mousePosition)) | ||
136 | + { | ||
137 | + var popup = new GenericMenu(); | ||
138 | + popup.AddItem(GetContent("Reset"), false, () => resetAction()); | ||
139 | + popup.AddSeparator(string.Empty); | ||
140 | + popup.AddItem(GetContent("Copy Settings"), false, () => CopySettings(group)); | ||
141 | + | ||
142 | + if (CanPaste(group)) | ||
143 | + popup.AddItem(GetContent("Paste Settings"), false, () => PasteSettings(group)); | ||
144 | + else | ||
145 | + popup.AddDisabledItem(GetContent("Paste Settings")); | ||
146 | + | ||
147 | + popup.ShowAsContext(); | ||
148 | + } | ||
149 | + else if (rect.Contains(e.mousePosition) && group != null) | ||
150 | + { | ||
151 | + display = !display; | ||
152 | + group.isExpanded = !group.isExpanded; | ||
153 | + e.Use(); | ||
154 | + } | ||
155 | + } | ||
156 | + | ||
157 | + return display; | ||
158 | + } | ||
159 | + | ||
160 | + static void CopySettings(SerializedProperty settings) | ||
161 | + { | ||
162 | + var t = typeof(PostProcessingProfile); | ||
163 | + var settingsStruct = ReflectionUtils.GetFieldValueFromPath(settings.serializedObject.targetObject, ref t, settings.propertyPath); | ||
164 | + var serializedString = t.ToString() + '|' + JsonUtility.ToJson(settingsStruct); | ||
165 | + EditorGUIUtility.systemCopyBuffer = serializedString; | ||
166 | + } | ||
167 | + | ||
168 | + static bool CanPaste(SerializedProperty settings) | ||
169 | + { | ||
170 | + var data = EditorGUIUtility.systemCopyBuffer; | ||
171 | + | ||
172 | + if (string.IsNullOrEmpty(data)) | ||
173 | + return false; | ||
174 | + | ||
175 | + var parts = data.Split('|'); | ||
176 | + | ||
177 | + if (string.IsNullOrEmpty(parts[0])) | ||
178 | + return false; | ||
179 | + | ||
180 | + var field = ReflectionUtils.GetFieldInfoFromPath(settings.serializedObject.targetObject, settings.propertyPath); | ||
181 | + return parts[0] == field.FieldType.ToString(); | ||
182 | + } | ||
183 | + | ||
184 | + static void PasteSettings(SerializedProperty settings) | ||
185 | + { | ||
186 | + Undo.RecordObject(settings.serializedObject.targetObject, "Paste effect settings"); | ||
187 | + var field = ReflectionUtils.GetFieldInfoFromPath(settings.serializedObject.targetObject, settings.propertyPath); | ||
188 | + var json = EditorGUIUtility.systemCopyBuffer.Substring(field.FieldType.ToString().Length + 1); | ||
189 | + var obj = JsonUtility.FromJson(json, field.FieldType); | ||
190 | + var parent = ReflectionUtils.GetParentObject(settings.propertyPath, settings.serializedObject.targetObject); | ||
191 | + field.SetValue(parent, obj, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, CultureInfo.CurrentCulture); | ||
192 | + } | ||
193 | + } | ||
194 | +} |
1 | +using UnityEngine; | ||
2 | + | ||
3 | +namespace UnityEditor.PostProcessing | ||
4 | +{ | ||
5 | + using UnityObject = Object; | ||
6 | + | ||
7 | + static class EditorResources | ||
8 | + { | ||
9 | + static string m_EditorResourcesPath = string.Empty; | ||
10 | + | ||
11 | + internal static string editorResourcesPath | ||
12 | + { | ||
13 | + get | ||
14 | + { | ||
15 | + if (string.IsNullOrEmpty(m_EditorResourcesPath)) | ||
16 | + { | ||
17 | + string path; | ||
18 | + | ||
19 | + if (SearchForEditorResourcesPath(out path)) | ||
20 | + m_EditorResourcesPath = path; | ||
21 | + else | ||
22 | + Debug.LogError("Unable to locate editor resources. Make sure the PostProcessing package has been installed correctly."); | ||
23 | + } | ||
24 | + | ||
25 | + return m_EditorResourcesPath; | ||
26 | + } | ||
27 | + } | ||
28 | + | ||
29 | + internal static T Load<T>(string name) | ||
30 | + where T : UnityObject | ||
31 | + { | ||
32 | + return AssetDatabase.LoadAssetAtPath<T>(editorResourcesPath + name); | ||
33 | + } | ||
34 | + | ||
35 | + static bool SearchForEditorResourcesPath(out string path) | ||
36 | + { | ||
37 | + path = string.Empty; | ||
38 | + | ||
39 | + string searchStr = "/PostProcessing/Editor Resources/"; | ||
40 | + string str = null; | ||
41 | + | ||
42 | + foreach (var assetPath in AssetDatabase.GetAllAssetPaths()) | ||
43 | + { | ||
44 | + if (assetPath.Contains(searchStr)) | ||
45 | + { | ||
46 | + str = assetPath; | ||
47 | + break; | ||
48 | + } | ||
49 | + } | ||
50 | + | ||
51 | + if (str == null) | ||
52 | + return false; | ||
53 | + | ||
54 | + path = str.Substring(0, str.LastIndexOf(searchStr) + searchStr.Length); | ||
55 | + return true; | ||
56 | + } | ||
57 | + } | ||
58 | +} |
1 | +using UnityEngine; | ||
2 | + | ||
3 | +namespace UnityEditor.PostProcessing | ||
4 | +{ | ||
5 | + public static class FxStyles | ||
6 | + { | ||
7 | + public static GUIStyle tickStyleRight; | ||
8 | + public static GUIStyle tickStyleLeft; | ||
9 | + public static GUIStyle tickStyleCenter; | ||
10 | + | ||
11 | + public static GUIStyle preSlider; | ||
12 | + public static GUIStyle preSliderThumb; | ||
13 | + public static GUIStyle preButton; | ||
14 | + public static GUIStyle preDropdown; | ||
15 | + | ||
16 | + public static GUIStyle preLabel; | ||
17 | + public static GUIStyle hueCenterCursor; | ||
18 | + public static GUIStyle hueRangeCursor; | ||
19 | + | ||
20 | + public static GUIStyle centeredBoldLabel; | ||
21 | + public static GUIStyle wheelThumb; | ||
22 | + public static Vector2 wheelThumbSize; | ||
23 | + | ||
24 | + public static GUIStyle header; | ||
25 | + public static GUIStyle headerCheckbox; | ||
26 | + public static GUIStyle headerFoldout; | ||
27 | + | ||
28 | + public static Texture2D playIcon; | ||
29 | + public static Texture2D checkerIcon; | ||
30 | + public static Texture2D paneOptionsIcon; | ||
31 | + | ||
32 | + public static GUIStyle centeredMiniLabel; | ||
33 | + | ||
34 | + static FxStyles() | ||
35 | + { | ||
36 | + tickStyleRight = new GUIStyle("Label") | ||
37 | + { | ||
38 | + alignment = TextAnchor.MiddleRight, | ||
39 | + fontSize = 9 | ||
40 | + }; | ||
41 | + | ||
42 | + tickStyleLeft = new GUIStyle("Label") | ||
43 | + { | ||
44 | + alignment = TextAnchor.MiddleLeft, | ||
45 | + fontSize = 9 | ||
46 | + }; | ||
47 | + | ||
48 | + tickStyleCenter = new GUIStyle("Label") | ||
49 | + { | ||
50 | + alignment = TextAnchor.MiddleCenter, | ||
51 | + fontSize = 9 | ||
52 | + }; | ||
53 | + | ||
54 | + preSlider = new GUIStyle("PreSlider"); | ||
55 | + preSliderThumb = new GUIStyle("PreSliderThumb"); | ||
56 | + preButton = new GUIStyle("PreButton"); | ||
57 | + preDropdown = new GUIStyle("preDropdown"); | ||
58 | + | ||
59 | + preLabel = new GUIStyle("ShurikenLabel"); | ||
60 | + | ||
61 | + hueCenterCursor = new GUIStyle("ColorPicker2DThumb") | ||
62 | + { | ||
63 | + normal = { background = (Texture2D)EditorGUIUtility.LoadRequired("Builtin Skins/DarkSkin/Images/ShurikenPlus.png") }, | ||
64 | + fixedWidth = 6, | ||
65 | + fixedHeight = 6 | ||
66 | + }; | ||
67 | + | ||
68 | + hueRangeCursor = new GUIStyle(hueCenterCursor) | ||
69 | + { | ||
70 | + normal = { background = (Texture2D)EditorGUIUtility.LoadRequired("Builtin Skins/DarkSkin/Images/CircularToggle_ON.png") } | ||
71 | + }; | ||
72 | + | ||
73 | + wheelThumb = new GUIStyle("ColorPicker2DThumb"); | ||
74 | + | ||
75 | + centeredBoldLabel = new GUIStyle(GUI.skin.GetStyle("Label")) | ||
76 | + { | ||
77 | + alignment = TextAnchor.UpperCenter, | ||
78 | + fontStyle = FontStyle.Bold | ||
79 | + }; | ||
80 | + | ||
81 | + centeredMiniLabel = new GUIStyle(EditorStyles.centeredGreyMiniLabel) | ||
82 | + { | ||
83 | + alignment = TextAnchor.UpperCenter | ||
84 | + }; | ||
85 | + | ||
86 | + wheelThumbSize = new Vector2( | ||
87 | + !Mathf.Approximately(wheelThumb.fixedWidth, 0f) ? wheelThumb.fixedWidth : wheelThumb.padding.horizontal, | ||
88 | + !Mathf.Approximately(wheelThumb.fixedHeight, 0f) ? wheelThumb.fixedHeight : wheelThumb.padding.vertical | ||
89 | + ); | ||
90 | + | ||
91 | + header = new GUIStyle("ShurikenModuleTitle") | ||
92 | + { | ||
93 | + font = (new GUIStyle("Label")).font, | ||
94 | + border = new RectOffset(15, 7, 4, 4), | ||
95 | + fixedHeight = 22, | ||
96 | + contentOffset = new Vector2(20f, -2f) | ||
97 | + }; | ||
98 | + | ||
99 | + headerCheckbox = new GUIStyle("ShurikenCheckMark"); | ||
100 | + headerFoldout = new GUIStyle("Foldout"); | ||
101 | + | ||
102 | + playIcon = (Texture2D)EditorGUIUtility.LoadRequired("Builtin Skins/DarkSkin/Images/IN foldout act.png"); | ||
103 | + checkerIcon = (Texture2D)EditorGUIUtility.LoadRequired("Icons/CheckerFloor.png"); | ||
104 | + | ||
105 | + if (EditorGUIUtility.isProSkin) | ||
106 | + paneOptionsIcon = (Texture2D)EditorGUIUtility.LoadRequired("Builtin Skins/DarkSkin/Images/pane options.png"); | ||
107 | + else | ||
108 | + paneOptionsIcon = (Texture2D)EditorGUIUtility.LoadRequired("Builtin Skins/LightSkin/Images/pane options.png"); | ||
109 | + } | ||
110 | + } | ||
111 | +} |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Resources.meta
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.97 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.97 KB
This diff is collapsed. Click to expand it.

6.96 KB
This diff is collapsed. Click to expand it.

6.98 KB
This diff is collapsed. Click to expand it.

6.96 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.93 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.96 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.93 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.96 KB
This diff is collapsed. Click to expand it.

6.93 KB
This diff is collapsed. Click to expand it.

6.96 KB
This diff is collapsed. Click to expand it.

6.96 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.96 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.96 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.93 KB
This diff is collapsed. Click to expand it.

6.96 KB
This diff is collapsed. Click to expand it.

6.96 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.96 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.93 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.94 KB
This diff is collapsed. Click to expand it.

6.95 KB
This diff is collapsed. Click to expand it.

6.96 KB
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Resources/Shaders.meta
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Runtime.meta
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Runtime/Models.meta
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Runtime/Utils.meta
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Textures.meta
0 → 100644
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Textures/LUTs.meta
0 → 100644
This diff is collapsed. Click to expand it.

982 Bytes
This diff is collapsed. Click to expand it.

1.14 KB
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.

4.8 MB
This diff is collapsed. Click to expand it.

8.13 MB
This diff is collapsed. Click to expand it.
This file is too large to display.
This diff is collapsed. Click to expand it.

4.99 MB
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Utilities.meta
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Utilities/CustomMotionTexture/CustomMotionVectorDebugProfile.asset.meta
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Utilities/CustomMotionTexture/Materials/DebugMotionVectors.mat.meta
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Utilities/CustomMotionTexture/Materials/WheelMotionVectors.mat.meta
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Utilities/CustomMotionTexture/Shaders/CustomMotionVectorTexture.shader
0 → 100644
This diff is collapsed. Click to expand it.
Assets/PostProcessing/Utilities/CustomMotionTexture/Shaders/CustomMotionVectorTexture.shader.meta
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.

167 KB
This diff is collapsed. Click to expand it.

12.1 KB
This diff is collapsed. Click to expand it.

380 KB
This diff is collapsed. Click to expand it.
Assets/Standard Assets.meta
0 → 100644
This diff is collapsed. Click to expand it.
Assets/Standard Assets/Environment.meta
0 → 100755
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/MudRockyAlbedoSpecular.bmp
0 → 100755
No preview for this file type
Assets/Standard Assets/Environment/TerrainAssets/SurfaceTextures/MudRockyAlbedoSpecular.bmp.meta
0 → 100755
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/Standard Assets/ParticleSystems.meta
0 → 100755
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.

11.1 KB
This diff is collapsed. Click to expand it.

47.9 KB
This diff is collapsed. Click to expand it.

38.2 KB
This diff is collapsed. Click to expand it.

81.5 KB
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.

295 KB
This diff is collapsed. Click to expand it.

1.49 KB
This diff is collapsed. Click to expand it.

871 Bytes
This diff is collapsed. Click to expand it.

35.3 KB
This diff is collapsed. Click to expand it.

68.1 KB
This diff is collapsed. Click to expand it.
Assets/Textures/noise2.png
0 → 100644

71.5 KB
Assets/Textures/noise2.png.meta
0 → 100644
This diff is collapsed. Click to expand it.
Assets/Textures/sunset.hdr
0 → 100755
This file is too large to display.
Assets/Textures/sunset.hdr.meta
0 → 100755
This diff is collapsed. Click to expand it.
Assets/Water.meta
0 → 100644
This diff is collapsed. Click to expand it.
Assets/Water/Complete.meta
0 → 100644
This diff is collapsed. Click to expand it.
Assets/Water/Complete/Water Complete.mat
0 → 100644
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/Water/Complete/Water Complete.meta
0 → 100644
This diff is collapsed. Click to expand it.
Assets/Water/Complete/Water Complete.shader
0 → 100755
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Assets/Water/Complete/Water Complete.unity
0 → 100644
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
This diff is collapsed. Click to expand it.
Assets/Water/Water Terrain.asset
0 → 100644
No preview for this file type
Assets/Water/Water Terrain.asset.meta
0 → 100755
This diff is collapsed. Click to expand it.
Assets/Water/Water.mat
0 → 100644
This diff is collapsed. Click to expand it.
Assets/Water/Water.mat.meta
0 → 100755
This diff is collapsed. Click to expand it.
Assets/Water/Water.meta
0 → 100644
This diff is collapsed. Click to expand it.
Assets/Water/Water.shader
0 → 100644
This diff is collapsed. Click to expand it.
Assets/Water/Water.shader.meta
0 → 100644
This diff is collapsed. Click to expand it.
Assets/Water/Water.unity
0 → 100644
This diff could not be displayed because it is too large.
Assets/Water/Water.unity.meta
0 → 100755
This diff is collapsed. Click to expand it.
Assets/Water/Water/LightingData.asset
0 → 100644
No preview for this file type
Assets/Water/Water/LightingData.asset.meta
0 → 100644
This diff is collapsed. Click to expand it.
Assets/Water/Water/ReflectionProbe-0.exr
0 → 100644
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment