I_Jemin

Preparing Water

Showing 515 changed files with 31970 additions and 25 deletions
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
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
1 +fileFormatVersion: 2
2 +guid: d8515d2f8d9b4482bb41b19940a27eb0
3 +timeCreated: 1516852975
4 +licenseType: Pro
5 +NativeFormatImporter:
6 + externalObjects: {}
7 + mainObjectFileID: 11400000
8 + userData:
9 + assetBundleName:
10 + assetBundleVariant:
...@@ -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}
......
1 +fileFormatVersion: 2
2 +guid: 5dbfb25c145da4ee3b85fc2e8c46da04
3 +folderAsset: yes
4 +timeCreated: 1516852825
5 +licenseType: Pro
6 +DefaultImporter:
7 + externalObjects: {}
8 + userData:
9 + assetBundleName:
10 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 83715878d3a8db441aa5636641db69a3
3 +folderAsset: yes
4 +timeCreated: 1476176392
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: e7358848dd8737c459f4636f1c075835
3 +folderAsset: yes
4 +timeCreated: 1460361782
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 51b7e4b4448c98f4a849081110fd6212
3 +timeCreated: 1459956391
4 +licenseType: Store
5 +ComputeShaderImporter:
6 + currentAPIMask: 4
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 965efa32cf2345647a1c987546e08f86
3 +timeCreated: 1459956391
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 5ae1bfc1dd20ac04e8b74aa0f2f12eea
3 +timeCreated: 1459956391
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 45de9ff58691e934c9810dc23de2ba50
3 +timeCreated: 1459956391
4 +licenseType: Store
5 +ComputeShaderImporter:
6 + currentAPIMask: 4
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 1c4298cd35ef7834e892898e49d61ecd
3 +timeCreated: 1461756159
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 9d9b886f7a8fe7b4baf56624c42e3420
3 +timeCreated: 1459956392
4 +licenseType: Store
5 +ComputeShaderImporter:
6 + currentAPIMask: 4
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 8b3e43c50424ab2428a9c172843bc66d
3 +timeCreated: 1459956391
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: df37d60cc69b7b04d9705a74938179e7
3 +folderAsset: yes
4 +timeCreated: 1460627771
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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 +}
1 +fileFormatVersion: 2
2 +guid: b1b2bfb2897659e45983f0c3e7dda2c8
3 +timeCreated: 1460970196
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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 +}
1 +fileFormatVersion: 2
2 +guid: 4bf49309c7ab9eb42a86774d2c09b4fa
3 +timeCreated: 1460627788
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: e0e418747b892364db5c5f4451e67ede
3 +folderAsset: yes
4 +timeCreated: 1466586258
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: cc5c690f549b4704eb992a9be781554d
3 +folderAsset: yes
4 +timeCreated: 1466769698
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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 +}
1 +fileFormatVersion: 2
2 +guid: c21938aa988055347a2271f03a3e731e
3 +timeCreated: 1466769734
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: d5341d31985da604db4b100f174142ad
3 +folderAsset: yes
4 +timeCreated: 1466769808
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 9fcb710e23a5a0546a3b8b0ca28c1720
3 +timeCreated: 1467190133
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 2451939fe695c1a408ba688219837667
3 +timeCreated: 1467190133
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: a95f3f10e7e437c49ade656f531b30d2
3 +timeCreated: 1467190133
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +}
1 +fileFormatVersion: 2
2 +guid: 760ffebbef2ed644c87940a699eb7fe6
3 +timeCreated: 1468237035
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using UnityEngine.PostProcessing;
2 +
3 +namespace UnityEditor.PostProcessing
4 +{
5 + [PostProcessingModelEditor(typeof(ChromaticAberrationModel))]
6 + public class ChromaticaAberrationModelEditor : DefaultPostFxModelEditor
7 + {
8 + }
9 +}
1 +fileFormatVersion: 2
2 +guid: 8a713f71a0169794a915a081f6242f60
3 +timeCreated: 1467190133
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using UnityEngine;
2 +using UnityEngine.PostProcessing;
3 +using System;
4 +using System.Collections.Generic;
5 +using System.Linq.Expressions;
6 +
7 +namespace UnityEditor.PostProcessing
8 +{
9 + using Settings = ColorGradingModel.Settings;
10 + using Tonemapper = ColorGradingModel.Tonemapper;
11 + using ColorWheelMode = ColorGradingModel.ColorWheelMode;
12 +
13 + [PostProcessingModelEditor(typeof(ColorGradingModel))]
14 + public class ColorGradingModelEditor : PostProcessingModelEditor
15 + {
16 + static GUIContent[] s_Tonemappers =
17 + {
18 + new GUIContent("None"),
19 + new GUIContent("Filmic (ACES)"),
20 + new GUIContent("Neutral")
21 + };
22 +
23 + struct TonemappingSettings
24 + {
25 + public SerializedProperty tonemapper;
26 + public SerializedProperty neutralBlackIn;
27 + public SerializedProperty neutralWhiteIn;
28 + public SerializedProperty neutralBlackOut;
29 + public SerializedProperty neutralWhiteOut;
30 + public SerializedProperty neutralWhiteLevel;
31 + public SerializedProperty neutralWhiteClip;
32 + }
33 +
34 + struct BasicSettings
35 + {
36 + public SerializedProperty exposure;
37 + public SerializedProperty temperature;
38 + public SerializedProperty tint;
39 + public SerializedProperty hueShift;
40 + public SerializedProperty saturation;
41 + public SerializedProperty contrast;
42 + }
43 +
44 + struct ChannelMixerSettings
45 + {
46 + public SerializedProperty[] channels;
47 + public SerializedProperty currentEditingChannel;
48 + }
49 +
50 + struct ColorWheelsSettings
51 + {
52 + public SerializedProperty mode;
53 + public SerializedProperty log;
54 + public SerializedProperty linear;
55 + }
56 +
57 + static GUIContent[] s_Curves =
58 + {
59 + new GUIContent("YRGB"),
60 + new GUIContent("Hue VS Hue"),
61 + new GUIContent("Hue VS Sat"),
62 + new GUIContent("Sat VS Sat"),
63 + new GUIContent("Lum VS Sat")
64 + };
65 +
66 + struct CurvesSettings
67 + {
68 + public SerializedProperty master;
69 + public SerializedProperty red;
70 + public SerializedProperty green;
71 + public SerializedProperty blue;
72 +
73 + public SerializedProperty hueVShue;
74 + public SerializedProperty hueVSsat;
75 + public SerializedProperty satVSsat;
76 + public SerializedProperty lumVSsat;
77 +
78 + public SerializedProperty currentEditingCurve;
79 + public SerializedProperty curveY;
80 + public SerializedProperty curveR;
81 + public SerializedProperty curveG;
82 + public SerializedProperty curveB;
83 + }
84 +
85 + TonemappingSettings m_Tonemapping;
86 + BasicSettings m_Basic;
87 + ChannelMixerSettings m_ChannelMixer;
88 + ColorWheelsSettings m_ColorWheels;
89 + CurvesSettings m_Curves;
90 +
91 + CurveEditor m_CurveEditor;
92 + Dictionary<SerializedProperty, Color> m_CurveDict;
93 +
94 + // Neutral tonemapping curve helper
95 + const int k_CurveResolution = 24;
96 + const float k_NeutralRangeX = 2f;
97 + const float k_NeutralRangeY = 1f;
98 + Vector3[] m_RectVertices = new Vector3[4];
99 + Vector3[] m_LineVertices = new Vector3[2];
100 + Vector3[] m_CurveVertices = new Vector3[k_CurveResolution];
101 + Rect m_NeutralCurveRect;
102 +
103 + public override void OnEnable()
104 + {
105 + // Tonemapping settings
106 + m_Tonemapping = new TonemappingSettings
107 + {
108 + tonemapper = FindSetting((Settings x) => x.tonemapping.tonemapper),
109 + neutralBlackIn = FindSetting((Settings x) => x.tonemapping.neutralBlackIn),
110 + neutralWhiteIn = FindSetting((Settings x) => x.tonemapping.neutralWhiteIn),
111 + neutralBlackOut = FindSetting((Settings x) => x.tonemapping.neutralBlackOut),
112 + neutralWhiteOut = FindSetting((Settings x) => x.tonemapping.neutralWhiteOut),
113 + neutralWhiteLevel = FindSetting((Settings x) => x.tonemapping.neutralWhiteLevel),
114 + neutralWhiteClip = FindSetting((Settings x) => x.tonemapping.neutralWhiteClip)
115 + };
116 +
117 + // Basic settings
118 + m_Basic = new BasicSettings
119 + {
120 + exposure = FindSetting((Settings x) => x.basic.postExposure),
121 + temperature = FindSetting((Settings x) => x.basic.temperature),
122 + tint = FindSetting((Settings x) => x.basic.tint),
123 + hueShift = FindSetting((Settings x) => x.basic.hueShift),
124 + saturation = FindSetting((Settings x) => x.basic.saturation),
125 + contrast = FindSetting((Settings x) => x.basic.contrast)
126 + };
127 +
128 + // Channel mixer
129 + m_ChannelMixer = new ChannelMixerSettings
130 + {
131 + channels = new[]
132 + {
133 + FindSetting((Settings x) => x.channelMixer.red),
134 + FindSetting((Settings x) => x.channelMixer.green),
135 + FindSetting((Settings x) => x.channelMixer.blue)
136 + },
137 + currentEditingChannel = FindSetting((Settings x) => x.channelMixer.currentEditingChannel)
138 + };
139 +
140 + // Color wheels
141 + m_ColorWheels = new ColorWheelsSettings
142 + {
143 + mode = FindSetting((Settings x) => x.colorWheels.mode),
144 + log = FindSetting((Settings x) => x.colorWheels.log),
145 + linear = FindSetting((Settings x) => x.colorWheels.linear)
146 + };
147 +
148 + // Curves
149 + m_Curves = new CurvesSettings
150 + {
151 + master = FindSetting((Settings x) => x.curves.master.curve),
152 + red = FindSetting((Settings x) => x.curves.red.curve),
153 + green = FindSetting((Settings x) => x.curves.green.curve),
154 + blue = FindSetting((Settings x) => x.curves.blue.curve),
155 +
156 + hueVShue = FindSetting((Settings x) => x.curves.hueVShue.curve),
157 + hueVSsat = FindSetting((Settings x) => x.curves.hueVSsat.curve),
158 + satVSsat = FindSetting((Settings x) => x.curves.satVSsat.curve),
159 + lumVSsat = FindSetting((Settings x) => x.curves.lumVSsat.curve),
160 +
161 + currentEditingCurve = FindSetting((Settings x) => x.curves.e_CurrentEditingCurve),
162 + curveY = FindSetting((Settings x) => x.curves.e_CurveY),
163 + curveR = FindSetting((Settings x) => x.curves.e_CurveR),
164 + curveG = FindSetting((Settings x) => x.curves.e_CurveG),
165 + curveB = FindSetting((Settings x) => x.curves.e_CurveB)
166 + };
167 +
168 + // Prepare the curve editor and extract curve display settings
169 + m_CurveDict = new Dictionary<SerializedProperty, Color>();
170 +
171 + var settings = CurveEditor.Settings.defaultSettings;
172 +
173 + m_CurveEditor = new CurveEditor(settings);
174 + AddCurve(m_Curves.master, new Color(1f, 1f, 1f), 2, false);
175 + AddCurve(m_Curves.red, new Color(1f, 0f, 0f), 2, false);
176 + AddCurve(m_Curves.green, new Color(0f, 1f, 0f), 2, false);
177 + AddCurve(m_Curves.blue, new Color(0f, 0.5f, 1f), 2, false);
178 + AddCurve(m_Curves.hueVShue, new Color(1f, 1f, 1f), 0, true);
179 + AddCurve(m_Curves.hueVSsat, new Color(1f, 1f, 1f), 0, true);
180 + AddCurve(m_Curves.satVSsat, new Color(1f, 1f, 1f), 0, false);
181 + AddCurve(m_Curves.lumVSsat, new Color(1f, 1f, 1f), 0, false);
182 + }
183 +
184 + void AddCurve(SerializedProperty prop, Color color, uint minPointCount, bool loop)
185 + {
186 + var state = CurveEditor.CurveState.defaultState;
187 + state.color = color;
188 + state.visible = false;
189 + state.minPointCount = minPointCount;
190 + state.onlyShowHandlesOnSelection = true;
191 + state.zeroKeyConstantValue = 0.5f;
192 + state.loopInBounds = loop;
193 + m_CurveEditor.Add(prop, state);
194 + m_CurveDict.Add(prop, color);
195 + }
196 +
197 + public override void OnDisable()
198 + {
199 + m_CurveEditor.RemoveAll();
200 + }
201 +
202 + public override void OnInspectorGUI()
203 + {
204 + DoGUIFor("Tonemapping", DoTonemappingGUI);
205 + EditorGUILayout.Space();
206 + DoGUIFor("Basic", DoBasicGUI);
207 + EditorGUILayout.Space();
208 + DoGUIFor("Channel Mixer", DoChannelMixerGUI);
209 + EditorGUILayout.Space();
210 + DoGUIFor("Trackballs", DoColorWheelsGUI);
211 + EditorGUILayout.Space();
212 + DoGUIFor("Grading Curves", DoCurvesGUI);
213 + }
214 +
215 + void DoGUIFor(string title, Action func)
216 + {
217 + EditorGUILayout.LabelField(title, EditorStyles.boldLabel);
218 + EditorGUI.indentLevel++;
219 + func();
220 + EditorGUI.indentLevel--;
221 + }
222 +
223 + void DoTonemappingGUI()
224 + {
225 + int tid = EditorGUILayout.Popup(EditorGUIHelper.GetContent("Tonemapper"), m_Tonemapping.tonemapper.intValue, s_Tonemappers);
226 +
227 + if (tid == (int)Tonemapper.Neutral)
228 + {
229 + DrawNeutralTonemappingCurve();
230 +
231 + EditorGUILayout.PropertyField(m_Tonemapping.neutralBlackIn, EditorGUIHelper.GetContent("Black In"));
232 + EditorGUILayout.PropertyField(m_Tonemapping.neutralWhiteIn, EditorGUIHelper.GetContent("White In"));
233 + EditorGUILayout.PropertyField(m_Tonemapping.neutralBlackOut, EditorGUIHelper.GetContent("Black Out"));
234 + EditorGUILayout.PropertyField(m_Tonemapping.neutralWhiteOut, EditorGUIHelper.GetContent("White Out"));
235 + EditorGUILayout.PropertyField(m_Tonemapping.neutralWhiteLevel, EditorGUIHelper.GetContent("White Level"));
236 + EditorGUILayout.PropertyField(m_Tonemapping.neutralWhiteClip, EditorGUIHelper.GetContent("White Clip"));
237 + }
238 +
239 + m_Tonemapping.tonemapper.intValue = tid;
240 + }
241 +
242 + void DrawNeutralTonemappingCurve()
243 + {
244 + using (new GUILayout.HorizontalScope())
245 + {
246 + GUILayout.Space(EditorGUI.indentLevel * 15f);
247 + m_NeutralCurveRect = GUILayoutUtility.GetRect(128, 80);
248 + }
249 +
250 + // Background
251 + m_RectVertices[0] = PointInRect( 0f, 0f);
252 + m_RectVertices[1] = PointInRect(k_NeutralRangeX, 0f);
253 + m_RectVertices[2] = PointInRect(k_NeutralRangeX, k_NeutralRangeY);
254 + m_RectVertices[3] = PointInRect( 0f, k_NeutralRangeY);
255 +
256 + Handles.DrawSolidRectangleWithOutline(
257 + m_RectVertices,
258 + Color.white * 0.1f,
259 + Color.white * 0.4f
260 + );
261 +
262 + // Horizontal lines
263 + for (var i = 1; i < k_NeutralRangeY; i++)
264 + DrawLine(0, i, k_NeutralRangeX, i, 0.4f);
265 +
266 + // Vertical lines
267 + for (var i = 1; i < k_NeutralRangeX; i++)
268 + DrawLine(i, 0, i, k_NeutralRangeY, 0.4f);
269 +
270 + // Label
271 + Handles.Label(
272 + PointInRect(0, k_NeutralRangeY) + Vector3.right,
273 + "Neutral Tonemapper", EditorStyles.miniLabel
274 + );
275 +
276 + // Precompute some values
277 + var tonemap = ((ColorGradingModel)target).settings.tonemapping;
278 +
279 + const float scaleFactor = 20f;
280 + const float scaleFactorHalf = scaleFactor * 0.5f;
281 +
282 + float inBlack = tonemap.neutralBlackIn * scaleFactor + 1f;
283 + float outBlack = tonemap.neutralBlackOut * scaleFactorHalf + 1f;
284 + float inWhite = tonemap.neutralWhiteIn / scaleFactor;
285 + float outWhite = 1f - tonemap.neutralWhiteOut / scaleFactor;
286 + float blackRatio = inBlack / outBlack;
287 + float whiteRatio = inWhite / outWhite;
288 +
289 + const float a = 0.2f;
290 + float b = Mathf.Max(0f, Mathf.LerpUnclamped(0.57f, 0.37f, blackRatio));
291 + float c = Mathf.LerpUnclamped(0.01f, 0.24f, whiteRatio);
292 + float d = Mathf.Max(0f, Mathf.LerpUnclamped(0.02f, 0.20f, blackRatio));
293 + const float e = 0.02f;
294 + const float f = 0.30f;
295 + float whiteLevel = tonemap.neutralWhiteLevel;
296 + float whiteClip = tonemap.neutralWhiteClip / scaleFactorHalf;
297 +
298 + // Tonemapping curve
299 + var vcount = 0;
300 + while (vcount < k_CurveResolution)
301 + {
302 + float x = k_NeutralRangeX * vcount / (k_CurveResolution - 1);
303 + float y = NeutralTonemap(x, a, b, c, d, e, f, whiteLevel, whiteClip);
304 +
305 + if (y < k_NeutralRangeY)
306 + {
307 + m_CurveVertices[vcount++] = PointInRect(x, y);
308 + }
309 + else
310 + {
311 + if (vcount > 1)
312 + {
313 + // Extend the last segment to the top edge of the rect.
314 + var v1 = m_CurveVertices[vcount - 2];
315 + var v2 = m_CurveVertices[vcount - 1];
316 + var clip = (m_NeutralCurveRect.y - v1.y) / (v2.y - v1.y);
317 + m_CurveVertices[vcount - 1] = v1 + (v2 - v1) * clip;
318 + }
319 + break;
320 + }
321 + }
322 +
323 + if (vcount > 1)
324 + {
325 + Handles.color = Color.white * 0.9f;
326 + Handles.DrawAAPolyLine(2.0f, vcount, m_CurveVertices);
327 + }
328 + }
329 +
330 + void DrawLine(float x1, float y1, float x2, float y2, float grayscale)
331 + {
332 + m_LineVertices[0] = PointInRect(x1, y1);
333 + m_LineVertices[1] = PointInRect(x2, y2);
334 + Handles.color = Color.white * grayscale;
335 + Handles.DrawAAPolyLine(2f, m_LineVertices);
336 + }
337 +
338 + Vector3 PointInRect(float x, float y)
339 + {
340 + x = Mathf.Lerp(m_NeutralCurveRect.x, m_NeutralCurveRect.xMax, x / k_NeutralRangeX);
341 + y = Mathf.Lerp(m_NeutralCurveRect.yMax, m_NeutralCurveRect.y, y / k_NeutralRangeY);
342 + return new Vector3(x, y, 0);
343 + }
344 +
345 + float NeutralCurve(float x, float a, float b, float c, float d, float e, float f)
346 + {
347 + return ((x * (a * x + c * b) + d * e) / (x * (a * x + b) + d * f)) - e / f;
348 + }
349 +
350 + float NeutralTonemap(float x, float a, float b, float c, float d, float e, float f, float whiteLevel, float whiteClip)
351 + {
352 + x = Mathf.Max(0f, x);
353 +
354 + // Tonemap
355 + float whiteScale = 1f / NeutralCurve(whiteLevel, a, b, c, d, e, f);
356 + x = NeutralCurve(x * whiteScale, a, b, c, d, e, f);
357 + x *= whiteScale;
358 +
359 + // Post-curve white point adjustment
360 + x /= whiteClip;
361 +
362 + return x;
363 + }
364 +
365 + void DoBasicGUI()
366 + {
367 + EditorGUILayout.PropertyField(m_Basic.exposure, EditorGUIHelper.GetContent("Post Exposure (EV)"));
368 + EditorGUILayout.PropertyField(m_Basic.temperature);
369 + EditorGUILayout.PropertyField(m_Basic.tint);
370 + EditorGUILayout.PropertyField(m_Basic.hueShift);
371 + EditorGUILayout.PropertyField(m_Basic.saturation);
372 + EditorGUILayout.PropertyField(m_Basic.contrast);
373 + }
374 +
375 + void DoChannelMixerGUI()
376 + {
377 + int currentChannel = m_ChannelMixer.currentEditingChannel.intValue;
378 +
379 + EditorGUI.BeginChangeCheck();
380 + {
381 + using (new EditorGUILayout.HorizontalScope())
382 + {
383 + EditorGUILayout.PrefixLabel("Channel");
384 + if (GUILayout.Toggle(currentChannel == 0, EditorGUIHelper.GetContent("Red|Red output channel."), EditorStyles.miniButtonLeft)) currentChannel = 0;
385 + if (GUILayout.Toggle(currentChannel == 1, EditorGUIHelper.GetContent("Green|Green output channel."), EditorStyles.miniButtonMid)) currentChannel = 1;
386 + if (GUILayout.Toggle(currentChannel == 2, EditorGUIHelper.GetContent("Blue|Blue output channel."), EditorStyles.miniButtonRight)) currentChannel = 2;
387 + }
388 + }
389 + if (EditorGUI.EndChangeCheck())
390 + {
391 + GUI.FocusControl(null);
392 + }
393 +
394 + var serializedChannel = m_ChannelMixer.channels[currentChannel];
395 + m_ChannelMixer.currentEditingChannel.intValue = currentChannel;
396 +
397 + var v = serializedChannel.vector3Value;
398 + v.x = EditorGUILayout.Slider(EditorGUIHelper.GetContent("Red|Modify influence of the red channel within the overall mix."), v.x, -2f, 2f);
399 + v.y = EditorGUILayout.Slider(EditorGUIHelper.GetContent("Green|Modify influence of the green channel within the overall mix."), v.y, -2f, 2f);
400 + v.z = EditorGUILayout.Slider(EditorGUIHelper.GetContent("Blue|Modify influence of the blue channel within the overall mix."), v.z, -2f, 2f);
401 + serializedChannel.vector3Value = v;
402 + }
403 +
404 + void DoColorWheelsGUI()
405 + {
406 + int wheelMode = m_ColorWheels.mode.intValue;
407 +
408 + using (new EditorGUILayout.HorizontalScope())
409 + {
410 + GUILayout.Space(15);
411 + if (GUILayout.Toggle(wheelMode == (int)ColorWheelMode.Linear, "Linear", EditorStyles.miniButtonLeft)) wheelMode = (int)ColorWheelMode.Linear;
412 + if (GUILayout.Toggle(wheelMode == (int)ColorWheelMode.Log, "Log", EditorStyles.miniButtonRight)) wheelMode = (int)ColorWheelMode.Log;
413 + }
414 +
415 + m_ColorWheels.mode.intValue = wheelMode;
416 + EditorGUILayout.Space();
417 +
418 + if (wheelMode == (int)ColorWheelMode.Linear)
419 + {
420 + EditorGUILayout.PropertyField(m_ColorWheels.linear);
421 + WheelSetTitle(GUILayoutUtility.GetLastRect(), "Linear Controls");
422 + }
423 + else if (wheelMode == (int)ColorWheelMode.Log)
424 + {
425 + EditorGUILayout.PropertyField(m_ColorWheels.log);
426 + WheelSetTitle(GUILayoutUtility.GetLastRect(), "Log Controls");
427 + }
428 + }
429 +
430 + static void WheelSetTitle(Rect position, string label)
431 + {
432 + var matrix = GUI.matrix;
433 + var rect = new Rect(position.x - 10f, position.y, TrackballGroupDrawer.m_Size, TrackballGroupDrawer.m_Size);
434 + GUIUtility.RotateAroundPivot(-90f, rect.center);
435 + GUI.Label(rect, label, FxStyles.centeredMiniLabel);
436 + GUI.matrix = matrix;
437 + }
438 +
439 + void ResetVisibleCurves()
440 + {
441 + foreach (var curve in m_CurveDict)
442 + {
443 + var state = m_CurveEditor.GetCurveState(curve.Key);
444 + state.visible = false;
445 + m_CurveEditor.SetCurveState(curve.Key, state);
446 + }
447 + }
448 +
449 + void SetCurveVisible(SerializedProperty prop)
450 + {
451 + var state = m_CurveEditor.GetCurveState(prop);
452 + state.visible = true;
453 + m_CurveEditor.SetCurveState(prop, state);
454 + }
455 +
456 + bool SpecialToggle(bool value, string name, out bool rightClicked)
457 + {
458 + var rect = GUILayoutUtility.GetRect(EditorGUIHelper.GetContent(name), EditorStyles.toolbarButton);
459 +
460 + var e = Event.current;
461 + rightClicked = (e.type == EventType.MouseUp && rect.Contains(e.mousePosition) && e.button == 1);
462 +
463 + return GUI.Toggle(rect, value, name, EditorStyles.toolbarButton);
464 + }
465 +
466 + static Material s_MaterialSpline;
467 +
468 + void DoCurvesGUI()
469 + {
470 + EditorGUILayout.Space();
471 + EditorGUI.indentLevel -= 2;
472 + ResetVisibleCurves();
473 +
474 + using (new EditorGUI.DisabledGroupScope(serializedProperty.serializedObject.isEditingMultipleObjects))
475 + {
476 + int curveEditingId = 0;
477 +
478 + // Top toolbar
479 + using (new GUILayout.HorizontalScope(EditorStyles.toolbar))
480 + {
481 + curveEditingId = EditorGUILayout.Popup(m_Curves.currentEditingCurve.intValue, s_Curves, EditorStyles.toolbarPopup, GUILayout.MaxWidth(150f));
482 + bool y = false, r = false, g = false, b = false;
483 +
484 + if (curveEditingId == 0)
485 + {
486 + EditorGUILayout.Space();
487 +
488 + bool rightClickedY, rightClickedR, rightClickedG, rightClickedB;
489 +
490 + y = SpecialToggle(m_Curves.curveY.boolValue, "Y", out rightClickedY);
491 + r = SpecialToggle(m_Curves.curveR.boolValue, "R", out rightClickedR);
492 + g = SpecialToggle(m_Curves.curveG.boolValue, "G", out rightClickedG);
493 + b = SpecialToggle(m_Curves.curveB.boolValue, "B", out rightClickedB);
494 +
495 + if (!y && !r && !g && !b)
496 + {
497 + r = g = b = false;
498 + y = true;
499 + }
500 +
501 + if (rightClickedY || rightClickedR || rightClickedG || rightClickedB)
502 + {
503 + y = rightClickedY;
504 + r = rightClickedR;
505 + g = rightClickedG;
506 + b = rightClickedB;
507 + }
508 +
509 + if (y) SetCurveVisible(m_Curves.master);
510 + if (r) SetCurveVisible(m_Curves.red);
511 + if (g) SetCurveVisible(m_Curves.green);
512 + if (b) SetCurveVisible(m_Curves.blue);
513 +
514 + m_Curves.curveY.boolValue = y;
515 + m_Curves.curveR.boolValue = r;
516 + m_Curves.curveG.boolValue = g;
517 + m_Curves.curveB.boolValue = b;
518 + }
519 + else
520 + {
521 + switch (curveEditingId)
522 + {
523 + case 1: SetCurveVisible(m_Curves.hueVShue);
524 + break;
525 + case 2: SetCurveVisible(m_Curves.hueVSsat);
526 + break;
527 + case 3: SetCurveVisible(m_Curves.satVSsat);
528 + break;
529 + case 4: SetCurveVisible(m_Curves.lumVSsat);
530 + break;
531 + }
532 + }
533 +
534 + GUILayout.FlexibleSpace();
535 +
536 + if (GUILayout.Button("Reset", EditorStyles.toolbarButton))
537 + {
538 + switch (curveEditingId)
539 + {
540 + case 0:
541 + if (y) m_Curves.master.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f);
542 + if (r) m_Curves.red.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f);
543 + if (g) m_Curves.green.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f);
544 + if (b) m_Curves.blue.animationCurveValue = AnimationCurve.Linear(0f, 0f, 1f, 1f);
545 + break;
546 + case 1: m_Curves.hueVShue.animationCurveValue = new AnimationCurve();
547 + break;
548 + case 2: m_Curves.hueVSsat.animationCurveValue = new AnimationCurve();
549 + break;
550 + case 3: m_Curves.satVSsat.animationCurveValue = new AnimationCurve();
551 + break;
552 + case 4: m_Curves.lumVSsat.animationCurveValue = new AnimationCurve();
553 + break;
554 + }
555 + }
556 +
557 + m_Curves.currentEditingCurve.intValue = curveEditingId;
558 + }
559 +
560 + // Curve area
561 + var settings = m_CurveEditor.settings;
562 + var rect = GUILayoutUtility.GetAspectRect(2f);
563 + var innerRect = settings.padding.Remove(rect);
564 +
565 + if (Event.current.type == EventType.Repaint)
566 + {
567 + // Background
568 + EditorGUI.DrawRect(rect, new Color(0.15f, 0.15f, 0.15f, 1f));
569 +
570 + if (s_MaterialSpline == null)
571 + s_MaterialSpline = new Material(Shader.Find("Hidden/Post FX/UI/Curve Background")) { hideFlags = HideFlags.HideAndDontSave };
572 +
573 + if (curveEditingId == 1 || curveEditingId == 2)
574 + DrawBackgroundTexture(innerRect, 0);
575 + else if (curveEditingId == 3 || curveEditingId == 4)
576 + DrawBackgroundTexture(innerRect, 1);
577 +
578 + // Bounds
579 + Handles.color = Color.white;
580 + Handles.DrawSolidRectangleWithOutline(innerRect, Color.clear, new Color(0.8f, 0.8f, 0.8f, 0.5f));
581 +
582 + // Grid setup
583 + Handles.color = new Color(1f, 1f, 1f, 0.05f);
584 + int hLines = (int)Mathf.Sqrt(innerRect.width);
585 + int vLines = (int)(hLines / (innerRect.width / innerRect.height));
586 +
587 + // Vertical grid
588 + int gridOffset = Mathf.FloorToInt(innerRect.width / hLines);
589 + int gridPadding = ((int)(innerRect.width) % hLines) / 2;
590 +
591 + for (int i = 1; i < hLines; i++)
592 + {
593 + var offset = i * Vector2.right * gridOffset;
594 + offset.x += gridPadding;
595 + Handles.DrawLine(innerRect.position + offset, new Vector2(innerRect.x, innerRect.yMax - 1) + offset);
596 + }
597 +
598 + // Horizontal grid
599 + gridOffset = Mathf.FloorToInt(innerRect.height / vLines);
600 + gridPadding = ((int)(innerRect.height) % vLines) / 2;
601 +
602 + for (int i = 1; i < vLines; i++)
603 + {
604 + var offset = i * Vector2.up * gridOffset;
605 + offset.y += gridPadding;
606 + Handles.DrawLine(innerRect.position + offset, new Vector2(innerRect.xMax - 1, innerRect.y) + offset);
607 + }
608 + }
609 +
610 + // Curve editor
611 + if (m_CurveEditor.OnGUI(rect))
612 + {
613 + Repaint();
614 + GUI.changed = true;
615 + }
616 +
617 + if (Event.current.type == EventType.Repaint)
618 + {
619 + // Borders
620 + Handles.color = Color.black;
621 + Handles.DrawLine(new Vector2(rect.x, rect.y - 18f), new Vector2(rect.xMax, rect.y - 18f));
622 + Handles.DrawLine(new Vector2(rect.x, rect.y - 19f), new Vector2(rect.x, rect.yMax));
623 + Handles.DrawLine(new Vector2(rect.x, rect.yMax), new Vector2(rect.xMax, rect.yMax));
624 + Handles.DrawLine(new Vector2(rect.xMax, rect.yMax), new Vector2(rect.xMax, rect.y - 18f));
625 +
626 + // Selection info
627 + var selection = m_CurveEditor.GetSelection();
628 +
629 + if (selection.curve != null && selection.keyframeIndex > -1)
630 + {
631 + var key = selection.keyframe.Value;
632 + var infoRect = innerRect;
633 + infoRect.x += 5f;
634 + infoRect.width = 100f;
635 + infoRect.height = 30f;
636 + GUI.Label(infoRect, string.Format("{0}\n{1}", key.time.ToString("F3"), key.value.ToString("F3")), FxStyles.preLabel);
637 + }
638 + }
639 + }
640 +
641 + /*
642 + EditorGUILayout.HelpBox(
643 + @"Curve editor cheat sheet:
644 +- [Del] or [Backspace] to remove a key
645 +- [Ctrl] to break a tangent handle
646 +- [Shift] to align tangent handles
647 +- [Double click] to create a key on the curve(s) at mouse position
648 +- [Alt] + [Double click] to create a key on the curve(s) at a given time",
649 + MessageType.Info);
650 + */
651 +
652 + EditorGUILayout.Space();
653 + EditorGUI.indentLevel += 2;
654 + }
655 +
656 + void DrawBackgroundTexture(Rect rect, int pass)
657 + {
658 + float scale = EditorGUIUtility.pixelsPerPoint;
659 +
660 + var oldRt = RenderTexture.active;
661 + var rt = RenderTexture.GetTemporary(Mathf.CeilToInt(rect.width * scale), Mathf.CeilToInt(rect.height * scale), 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
662 + s_MaterialSpline.SetFloat("_DisabledState", GUI.enabled ? 1f : 0.5f);
663 + s_MaterialSpline.SetFloat("_PixelScaling", EditorGUIUtility.pixelsPerPoint);
664 +
665 + Graphics.Blit(null, rt, s_MaterialSpline, pass);
666 + RenderTexture.active = oldRt;
667 +
668 + GUI.DrawTexture(rect, rt);
669 + RenderTexture.ReleaseTemporary(rt);
670 + }
671 + }
672 +}
1 +fileFormatVersion: 2
2 +guid: c3e3bce1d5c900d4fa7aa0f2b21814cf
3 +timeCreated: 1467190133
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: c15016a7fef58974f91a6a4d6b132d94
3 +timeCreated: 1467190133
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: dc2f388440e9f8b4f8fc7bb43c01cc7d
3 +timeCreated: 1467190133
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 87377c86d84f49a4e912d37d28353e7f
3 +timeCreated: 1485179854
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 489b5c785ba0f614d90c322fa0827216
3 +timeCreated: 1467190133
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 44a64b44ec891d24b96ed84d958c3d4f
3 +timeCreated: 1487335049
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 8330694e2c90c284f81153ac83b3cb4a
3 +timeCreated: 1467190133
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 870806eda355b5144879155e2ba37eb6
3 +timeCreated: 1468325681
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 57bbe1f20eec7bb4d9bc90fc65ef381b
3 +timeCreated: 1467190133
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: b235eb1c486b38c4fa06470234bbfd32
3 +timeCreated: 1466769818
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +}
1 +fileFormatVersion: 2
2 +guid: 745ad42620dabf04b94761acc86189ba
3 +timeCreated: 1467190133
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: e31078d57ac582944ad5e1e76a84f36a
3 +folderAsset: yes
4 +timeCreated: 1467188891
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +using UnityEditorInternal;
2 +using UnityEngine;
3 +using UnityEngine.PostProcessing;
4 +
5 +namespace UnityEditor.PostProcessing
6 +{
7 + using HistogramMode = PostProcessingProfile.MonitorSettings.HistogramMode;
8 +
9 + public class HistogramMonitor : PostProcessingMonitor
10 + {
11 + static GUIContent s_MonitorTitle = new GUIContent("Histogram");
12 +
13 + ComputeShader m_ComputeShader;
14 + ComputeBuffer m_Buffer;
15 + Material m_Material;
16 + RenderTexture m_HistogramTexture;
17 + Rect m_MonitorAreaRect;
18 +
19 + public HistogramMonitor()
20 + {
21 + m_ComputeShader = EditorResources.Load<ComputeShader>("Monitors/HistogramCompute.compute");
22 + }
23 +
24 + public override void Dispose()
25 + {
26 + GraphicsUtils.Destroy(m_Material);
27 + GraphicsUtils.Destroy(m_HistogramTexture);
28 +
29 + if (m_Buffer != null)
30 + m_Buffer.Release();
31 +
32 + m_Material = null;
33 + m_HistogramTexture = null;
34 + m_Buffer = null;
35 + }
36 +
37 + public override bool IsSupported()
38 + {
39 + return m_ComputeShader != null && GraphicsUtils.supportsDX11;
40 + }
41 +
42 + public override GUIContent GetMonitorTitle()
43 + {
44 + return s_MonitorTitle;
45 + }
46 +
47 + public override void OnMonitorSettings()
48 + {
49 + EditorGUI.BeginChangeCheck();
50 +
51 + bool refreshOnPlay = m_MonitorSettings.refreshOnPlay;
52 + var mode = m_MonitorSettings.histogramMode;
53 +
54 + refreshOnPlay = GUILayout.Toggle(refreshOnPlay, new GUIContent(FxStyles.playIcon, "Keep refreshing the histogram in play mode; this may impact performances."), FxStyles.preButton);
55 + mode = (HistogramMode)EditorGUILayout.EnumPopup(mode, FxStyles.preDropdown, GUILayout.MaxWidth(100f));
56 +
57 + if (EditorGUI.EndChangeCheck())
58 + {
59 + Undo.RecordObject(m_BaseEditor.serializedObject.targetObject, "Histogram Settings Changed");
60 + m_MonitorSettings.refreshOnPlay = refreshOnPlay;
61 + m_MonitorSettings.histogramMode = mode;
62 + InternalEditorUtility.RepaintAllViews();
63 + }
64 + }
65 +
66 + public override void OnMonitorGUI(Rect r)
67 + {
68 + if (Event.current.type == EventType.Repaint)
69 + {
70 + // If m_MonitorAreaRect isn't set the preview was just opened so refresh the render to get the histogram data
71 + if (Mathf.Approximately(m_MonitorAreaRect.width, 0) && Mathf.Approximately(m_MonitorAreaRect.height, 0))
72 + InternalEditorUtility.RepaintAllViews();
73 +
74 + // Sizing
75 + float width = m_HistogramTexture != null
76 + ? Mathf.Min(m_HistogramTexture.width, r.width - 65f)
77 + : r.width;
78 + float height = m_HistogramTexture != null
79 + ? Mathf.Min(m_HistogramTexture.height, r.height - 45f)
80 + : r.height;
81 +
82 + m_MonitorAreaRect = new Rect(
83 + Mathf.Floor(r.x + r.width / 2f - width / 2f),
84 + Mathf.Floor(r.y + r.height / 2f - height / 2f - 5f),
85 + width, height
86 + );
87 +
88 + if (m_HistogramTexture != null)
89 + {
90 + Graphics.DrawTexture(m_MonitorAreaRect, m_HistogramTexture);
91 +
92 + var color = Color.white;
93 + const float kTickSize = 5f;
94 +
95 + // Rect, lines & ticks points
96 + if (m_MonitorSettings.histogramMode == HistogramMode.RGBSplit)
97 + {
98 + // A B C D E
99 + // N F
100 + // M G
101 + // L K J I H
102 +
103 + var A = new Vector3(m_MonitorAreaRect.x - 1f, m_MonitorAreaRect.y - 1f);
104 + var E = new Vector3(A.x + m_MonitorAreaRect.width + 2f, m_MonitorAreaRect.y - 1f);
105 + var H = new Vector3(E.x, E.y + m_MonitorAreaRect.height + 2f);
106 + var L = new Vector3(A.x, H.y);
107 +
108 + var N = new Vector3(A.x, A.y + (L.y - A.y) / 3f);
109 + var M = new Vector3(A.x, A.y + (L.y - A.y) * 2f / 3f);
110 + var F = new Vector3(E.x, E.y + (H.y - E.y) / 3f);
111 + var G = new Vector3(E.x, E.y + (H.y - E.y) * 2f / 3f);
112 +
113 + var C = new Vector3(A.x + (E.x - A.x) / 2f, A.y);
114 + var J = new Vector3(L.x + (H.x - L.x) / 2f, L.y);
115 +
116 + var B = new Vector3(A.x + (C.x - A.x) / 2f, A.y);
117 + var D = new Vector3(C.x + (E.x - C.x) / 2f, C.y);
118 + var I = new Vector3(J.x + (H.x - J.x) / 2f, J.y);
119 + var K = new Vector3(L.x + (J.x - L.x) / 2f, L.y);
120 +
121 + // Borders
122 + Handles.color = color;
123 + Handles.DrawLine(A, E);
124 + Handles.DrawLine(E, H);
125 + Handles.DrawLine(H, L);
126 + Handles.DrawLine(L, new Vector3(A.x, A.y - 1f));
127 +
128 + // Vertical ticks
129 + Handles.DrawLine(A, new Vector3(A.x - kTickSize, A.y));
130 + Handles.DrawLine(N, new Vector3(N.x - kTickSize, N.y));
131 + Handles.DrawLine(M, new Vector3(M.x - kTickSize, M.y));
132 + Handles.DrawLine(L, new Vector3(L.x - kTickSize, L.y));
133 +
134 + Handles.DrawLine(E, new Vector3(E.x + kTickSize, E.y));
135 + Handles.DrawLine(F, new Vector3(F.x + kTickSize, F.y));
136 + Handles.DrawLine(G, new Vector3(G.x + kTickSize, G.y));
137 + Handles.DrawLine(H, new Vector3(H.x + kTickSize, H.y));
138 +
139 + // Horizontal ticks
140 + Handles.DrawLine(A, new Vector3(A.x, A.y - kTickSize));
141 + Handles.DrawLine(B, new Vector3(B.x, B.y - kTickSize));
142 + Handles.DrawLine(C, new Vector3(C.x, C.y - kTickSize));
143 + Handles.DrawLine(D, new Vector3(D.x, D.y - kTickSize));
144 + Handles.DrawLine(E, new Vector3(E.x, E.y - kTickSize));
145 +
146 + Handles.DrawLine(L, new Vector3(L.x, L.y + kTickSize));
147 + Handles.DrawLine(K, new Vector3(K.x, K.y + kTickSize));
148 + Handles.DrawLine(J, new Vector3(J.x, J.y + kTickSize));
149 + Handles.DrawLine(I, new Vector3(I.x, I.y + kTickSize));
150 + Handles.DrawLine(H, new Vector3(H.x, H.y + kTickSize));
151 +
152 + // Separators
153 + Handles.DrawLine(N, F);
154 + Handles.DrawLine(M, G);
155 +
156 + // Labels
157 + GUI.color = color;
158 + GUI.Label(new Rect(L.x - 15f, L.y + kTickSize - 4f, 30f, 30f), "0.0", FxStyles.tickStyleCenter);
159 + GUI.Label(new Rect(J.x - 15f, J.y + kTickSize - 4f, 30f, 30f), "0.5", FxStyles.tickStyleCenter);
160 + GUI.Label(new Rect(H.x - 15f, H.y + kTickSize - 4f, 30f, 30f), "1.0", FxStyles.tickStyleCenter);
161 + }
162 + else
163 + {
164 + // A B C D E
165 + // P F
166 + // O G
167 + // N H
168 + // M L K J I
169 +
170 + var A = new Vector3(m_MonitorAreaRect.x, m_MonitorAreaRect.y);
171 + var E = new Vector3(A.x + m_MonitorAreaRect.width + 1f, m_MonitorAreaRect.y);
172 + var I = new Vector3(E.x, E.y + m_MonitorAreaRect.height + 1f);
173 + var M = new Vector3(A.x, I.y);
174 +
175 + var C = new Vector3(A.x + (E.x - A.x) / 2f, A.y);
176 + var G = new Vector3(E.x, E.y + (I.y - E.y) / 2f);
177 + var K = new Vector3(M.x + (I.x - M.x) / 2f, M.y);
178 + var O = new Vector3(A.x, A.y + (M.y - A.y) / 2f);
179 +
180 + var P = new Vector3(A.x, A.y + (O.y - A.y) / 2f);
181 + var F = new Vector3(E.x, E.y + (G.y - E.y) / 2f);
182 + var N = new Vector3(A.x, O.y + (M.y - O.y) / 2f);
183 + var H = new Vector3(E.x, G.y + (I.y - G.y) / 2f);
184 +
185 + var B = new Vector3(A.x + (C.x - A.x) / 2f, A.y);
186 + var L = new Vector3(M.x + (K.x - M.x) / 2f, M.y);
187 + var D = new Vector3(C.x + (E.x - C.x) / 2f, A.y);
188 + var J = new Vector3(K.x + (I.x - K.x) / 2f, M.y);
189 +
190 + // Borders
191 + Handles.color = color;
192 + Handles.DrawLine(A, E);
193 + Handles.DrawLine(E, I);
194 + Handles.DrawLine(I, M);
195 + Handles.DrawLine(M, new Vector3(A.x, A.y - 1f));
196 +
197 + // Vertical ticks
198 + Handles.DrawLine(A, new Vector3(A.x - kTickSize, A.y));
199 + Handles.DrawLine(P, new Vector3(P.x - kTickSize, P.y));
200 + Handles.DrawLine(O, new Vector3(O.x - kTickSize, O.y));
201 + Handles.DrawLine(N, new Vector3(N.x - kTickSize, N.y));
202 + Handles.DrawLine(M, new Vector3(M.x - kTickSize, M.y));
203 +
204 + Handles.DrawLine(E, new Vector3(E.x + kTickSize, E.y));
205 + Handles.DrawLine(F, new Vector3(F.x + kTickSize, F.y));
206 + Handles.DrawLine(G, new Vector3(G.x + kTickSize, G.y));
207 + Handles.DrawLine(H, new Vector3(H.x + kTickSize, H.y));
208 + Handles.DrawLine(I, new Vector3(I.x + kTickSize, I.y));
209 +
210 + // Horizontal ticks
211 + Handles.DrawLine(A, new Vector3(A.x, A.y - kTickSize));
212 + Handles.DrawLine(B, new Vector3(B.x, B.y - kTickSize));
213 + Handles.DrawLine(C, new Vector3(C.x, C.y - kTickSize));
214 + Handles.DrawLine(D, new Vector3(D.x, D.y - kTickSize));
215 + Handles.DrawLine(E, new Vector3(E.x, E.y - kTickSize));
216 +
217 + Handles.DrawLine(M, new Vector3(M.x, M.y + kTickSize));
218 + Handles.DrawLine(L, new Vector3(L.x, L.y + kTickSize));
219 + Handles.DrawLine(K, new Vector3(K.x, K.y + kTickSize));
220 + Handles.DrawLine(J, new Vector3(J.x, J.y + kTickSize));
221 + Handles.DrawLine(I, new Vector3(I.x, I.y + kTickSize));
222 +
223 + // Labels
224 + GUI.color = color;
225 + GUI.Label(new Rect(A.x - kTickSize - 34f, A.y - 15f, 30f, 30f), "1.0", FxStyles.tickStyleRight);
226 + GUI.Label(new Rect(O.x - kTickSize - 34f, O.y - 15f, 30f, 30f), "0.5", FxStyles.tickStyleRight);
227 + GUI.Label(new Rect(M.x - kTickSize - 34f, M.y - 15f, 30f, 30f), "0.0", FxStyles.tickStyleRight);
228 +
229 + GUI.Label(new Rect(E.x + kTickSize + 4f, E.y - 15f, 30f, 30f), "1.0", FxStyles.tickStyleLeft);
230 + GUI.Label(new Rect(G.x + kTickSize + 4f, G.y - 15f, 30f, 30f), "0.5", FxStyles.tickStyleLeft);
231 + GUI.Label(new Rect(I.x + kTickSize + 4f, I.y - 15f, 30f, 30f), "0.0", FxStyles.tickStyleLeft);
232 +
233 + GUI.Label(new Rect(M.x - 15f, M.y + kTickSize - 4f, 30f, 30f), "0.0", FxStyles.tickStyleCenter);
234 + GUI.Label(new Rect(K.x - 15f, K.y + kTickSize - 4f, 30f, 30f), "0.5", FxStyles.tickStyleCenter);
235 + GUI.Label(new Rect(I.x - 15f, I.y + kTickSize - 4f, 30f, 30f), "1.0", FxStyles.tickStyleCenter);
236 + }
237 + }
238 + }
239 + }
240 +
241 + public override void OnFrameData(RenderTexture source)
242 + {
243 + if (Application.isPlaying && !m_MonitorSettings.refreshOnPlay)
244 + return;
245 +
246 + if (Mathf.Approximately(m_MonitorAreaRect.width, 0) || Mathf.Approximately(m_MonitorAreaRect.height, 0))
247 + return;
248 +
249 + float ratio = (float)source.width / (float)source.height;
250 + int h = 512;
251 + int w = Mathf.FloorToInt(h * ratio);
252 +
253 + var rt = RenderTexture.GetTemporary(w, h, 0, source.format);
254 + Graphics.Blit(source, rt);
255 + ComputeHistogram(rt);
256 + m_BaseEditor.Repaint();
257 + RenderTexture.ReleaseTemporary(rt);
258 + }
259 +
260 + void CreateBuffer(int width, int height)
261 + {
262 + m_Buffer = new ComputeBuffer(width * height, sizeof(uint) << 2);
263 + }
264 +
265 + void ComputeHistogram(RenderTexture source)
266 + {
267 + if (m_Buffer == null)
268 + {
269 + CreateBuffer(256, 1);
270 + }
271 + else if (m_Buffer.count != 256)
272 + {
273 + m_Buffer.Release();
274 + CreateBuffer(256, 1);
275 + }
276 +
277 + if (m_Material == null)
278 + {
279 + m_Material = new Material(Shader.Find("Hidden/Post FX/Monitors/Histogram Render")) { hideFlags = HideFlags.DontSave };
280 + }
281 +
282 + var channels = Vector4.zero;
283 + switch (m_MonitorSettings.histogramMode)
284 + {
285 + case HistogramMode.Red: channels.x = 1f; break;
286 + case HistogramMode.Green: channels.y = 1f; break;
287 + case HistogramMode.Blue: channels.z = 1f; break;
288 + case HistogramMode.Luminance: channels.w = 1f; break;
289 + default: channels = new Vector4(1f, 1f, 1f, 0f); break;
290 + }
291 +
292 + var cs = m_ComputeShader;
293 +
294 + int kernel = cs.FindKernel("KHistogramClear");
295 + cs.SetBuffer(kernel, "_Histogram", m_Buffer);
296 + cs.Dispatch(kernel, 1, 1, 1);
297 +
298 + kernel = cs.FindKernel("KHistogramGather");
299 + cs.SetBuffer(kernel, "_Histogram", m_Buffer);
300 + cs.SetTexture(kernel, "_Source", source);
301 + cs.SetInt("_IsLinear", GraphicsUtils.isLinearColorSpace ? 1 : 0);
302 + cs.SetVector("_Res", new Vector4(source.width, source.height, 0f, 0f));
303 + cs.SetVector("_Channels", channels);
304 + cs.Dispatch(kernel, Mathf.CeilToInt(source.width / 16f), Mathf.CeilToInt(source.height / 16f), 1);
305 +
306 + kernel = cs.FindKernel("KHistogramScale");
307 + cs.SetBuffer(kernel, "_Histogram", m_Buffer);
308 + cs.Dispatch(kernel, 1, 1, 1);
309 +
310 + if (m_HistogramTexture == null || m_HistogramTexture.width != source.width || m_HistogramTexture.height != source.height)
311 + {
312 + GraphicsUtils.Destroy(m_HistogramTexture);
313 + m_HistogramTexture = new RenderTexture(source.width, source.height, 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear)
314 + {
315 + hideFlags = HideFlags.DontSave,
316 + wrapMode = TextureWrapMode.Clamp,
317 + filterMode = FilterMode.Bilinear
318 + };
319 + }
320 +
321 + m_Material.SetBuffer("_Histogram", m_Buffer);
322 + m_Material.SetVector("_Size", new Vector2(m_HistogramTexture.width, m_HistogramTexture.height));
323 + m_Material.SetColor("_ColorR", new Color(1f, 0f, 0f, 1f));
324 + m_Material.SetColor("_ColorG", new Color(0f, 1f, 0f, 1f));
325 + m_Material.SetColor("_ColorB", new Color(0f, 0f, 1f, 1f));
326 + m_Material.SetColor("_ColorL", new Color(1f, 1f, 1f, 1f));
327 + m_Material.SetInt("_Channel", (int)m_MonitorSettings.histogramMode);
328 +
329 + int pass = 0;
330 + if (m_MonitorSettings.histogramMode == HistogramMode.RGBMerged)
331 + pass = 1;
332 + else if (m_MonitorSettings.histogramMode == HistogramMode.RGBSplit)
333 + pass = 2;
334 +
335 + Graphics.Blit(null, m_HistogramTexture, m_Material, pass);
336 + }
337 + }
338 +}
1 +fileFormatVersion: 2
2 +guid: 4581c45ac4aa2264187087659a4cc252
3 +timeCreated: 1460031632
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using UnityEditorInternal;
2 +using UnityEngine;
3 +using UnityEngine.PostProcessing;
4 +
5 +namespace UnityEditor.PostProcessing
6 +{
7 + public class ParadeMonitor : PostProcessingMonitor
8 + {
9 + static GUIContent s_MonitorTitle = new GUIContent("Parade");
10 +
11 + ComputeShader m_ComputeShader;
12 + ComputeBuffer m_Buffer;
13 + Material m_Material;
14 + RenderTexture m_WaveformTexture;
15 + Rect m_MonitorAreaRect;
16 +
17 + public ParadeMonitor()
18 + {
19 + m_ComputeShader = EditorResources.Load<ComputeShader>("Monitors/WaveformCompute.compute");
20 + }
21 +
22 + public override void Dispose()
23 + {
24 + GraphicsUtils.Destroy(m_Material);
25 + GraphicsUtils.Destroy(m_WaveformTexture);
26 +
27 + if (m_Buffer != null)
28 + m_Buffer.Release();
29 +
30 + m_Material = null;
31 + m_WaveformTexture = null;
32 + m_Buffer = null;
33 + }
34 +
35 + public override bool IsSupported()
36 + {
37 + return m_ComputeShader != null && GraphicsUtils.supportsDX11;
38 + }
39 +
40 + public override GUIContent GetMonitorTitle()
41 + {
42 + return s_MonitorTitle;
43 + }
44 +
45 + public override void OnMonitorSettings()
46 + {
47 + EditorGUI.BeginChangeCheck();
48 +
49 + bool refreshOnPlay = m_MonitorSettings.refreshOnPlay;
50 + float exposure = m_MonitorSettings.paradeExposure;
51 +
52 + refreshOnPlay = GUILayout.Toggle(refreshOnPlay, new GUIContent(FxStyles.playIcon, "Keep refreshing the parade in play mode; this may impact performances."), FxStyles.preButton);
53 + exposure = GUILayout.HorizontalSlider(exposure, 0.05f, 0.3f, FxStyles.preSlider, FxStyles.preSliderThumb, GUILayout.Width(40f));
54 +
55 + if (EditorGUI.EndChangeCheck())
56 + {
57 + Undo.RecordObject(m_BaseEditor.serializedObject.targetObject, "Parade Settings Changed");
58 + m_MonitorSettings.refreshOnPlay = refreshOnPlay;
59 + m_MonitorSettings.paradeExposure = exposure;
60 + InternalEditorUtility.RepaintAllViews();
61 + }
62 + }
63 +
64 + public override void OnMonitorGUI(Rect r)
65 + {
66 + if (Event.current.type == EventType.Repaint)
67 + {
68 + // If m_MonitorAreaRect isn't set the preview was just opened so refresh the render to get the waveform data
69 + if (Mathf.Approximately(m_MonitorAreaRect.width, 0) && Mathf.Approximately(m_MonitorAreaRect.height, 0))
70 + InternalEditorUtility.RepaintAllViews();
71 +
72 + // Sizing
73 + float width = m_WaveformTexture != null
74 + ? Mathf.Min(m_WaveformTexture.width, r.width - 65f)
75 + : r.width;
76 + float height = m_WaveformTexture != null
77 + ? Mathf.Min(m_WaveformTexture.height, r.height - 45f)
78 + : r.height;
79 +
80 + m_MonitorAreaRect = new Rect(
81 + Mathf.Floor(r.x + r.width / 2f - width / 2f),
82 + Mathf.Floor(r.y + r.height / 2f - height / 2f - 5f),
83 + width, height
84 + );
85 +
86 + if (m_WaveformTexture != null)
87 + {
88 + m_Material.SetFloat("_Exposure", m_MonitorSettings.paradeExposure);
89 +
90 + var oldActive = RenderTexture.active;
91 + Graphics.Blit(null, m_WaveformTexture, m_Material, 0);
92 + RenderTexture.active = oldActive;
93 +
94 + Graphics.DrawTexture(m_MonitorAreaRect, m_WaveformTexture);
95 +
96 + var color = Color.white;
97 + const float kTickSize = 5f;
98 +
99 + // Rect, lines & ticks points
100 + // A O B P C Q D
101 + // N E
102 + // M F
103 + // L G
104 + // K T J S I R H
105 +
106 + var A = new Vector3(m_MonitorAreaRect.x, m_MonitorAreaRect.y);
107 + var D = new Vector3(A.x + m_MonitorAreaRect.width + 1f, m_MonitorAreaRect.y);
108 + var H = new Vector3(D.x, D.y + m_MonitorAreaRect.height + 1f);
109 + var K = new Vector3(A.x, H.y);
110 +
111 + var F = new Vector3(D.x, D.y + (H.y - D.y) / 2f);
112 + var M = new Vector3(A.x, A.y + (K.y - A.y) / 2f);
113 +
114 + var B = new Vector3(A.x + (D.x - A.x) / 3f, A.y);
115 + var C = new Vector3(A.x + (D.x - A.x) * 2f / 3f, A.y);
116 + var I = new Vector3(K.x + (H.x - K.x) * 2f / 3f, K.y);
117 + var J = new Vector3(K.x + (H.x - K.x) / 3f, K.y);
118 +
119 + var N = new Vector3(A.x, A.y + (M.y - A.y) / 2f);
120 + var L = new Vector3(A.x, M.y + (K.y - M.y) / 2f);
121 + var E = new Vector3(D.x, D.y + (F.y - D.y) / 2f);
122 + var G = new Vector3(D.x, F.y + (H.y - F.y) / 2f);
123 +
124 + var O = new Vector3(A.x + (B.x - A.x) / 2f, A.y);
125 + var P = new Vector3(B.x + (C.x - B.x) / 2f, B.y);
126 + var Q = new Vector3(C.x + (D.x - C.x) / 2f, C.y);
127 +
128 + var R = new Vector3(I.x + (H.x - I.x) / 2f, I.y);
129 + var S = new Vector3(J.x + (I.x - J.x) / 2f, J.y);
130 + var T = new Vector3(K.x + (J.x - K.x) / 2f, K.y);
131 +
132 + // Borders
133 + Handles.color = color;
134 + Handles.DrawLine(A, D);
135 + Handles.DrawLine(D, H);
136 + Handles.DrawLine(H, K);
137 + Handles.DrawLine(K, new Vector3(A.x, A.y - 1f));
138 +
139 + Handles.DrawLine(B, J);
140 + Handles.DrawLine(C, I);
141 +
142 + // Vertical ticks
143 + Handles.DrawLine(A, new Vector3(A.x - kTickSize, A.y));
144 + Handles.DrawLine(N, new Vector3(N.x - kTickSize, N.y));
145 + Handles.DrawLine(M, new Vector3(M.x - kTickSize, M.y));
146 + Handles.DrawLine(L, new Vector3(L.x - kTickSize, L.y));
147 + Handles.DrawLine(K, new Vector3(K.x - kTickSize, K.y));
148 +
149 + Handles.DrawLine(D, new Vector3(D.x + kTickSize, D.y));
150 + Handles.DrawLine(E, new Vector3(E.x + kTickSize, E.y));
151 + Handles.DrawLine(F, new Vector3(F.x + kTickSize, F.y));
152 + Handles.DrawLine(G, new Vector3(G.x + kTickSize, G.y));
153 + Handles.DrawLine(H, new Vector3(H.x + kTickSize, H.y));
154 +
155 + // Horizontal ticks
156 + Handles.DrawLine(A, new Vector3(A.x, A.y - kTickSize));
157 + Handles.DrawLine(B, new Vector3(B.x, B.y - kTickSize));
158 + Handles.DrawLine(C, new Vector3(C.x, C.y - kTickSize));
159 + Handles.DrawLine(D, new Vector3(D.x, D.y - kTickSize));
160 + Handles.DrawLine(O, new Vector3(O.x, O.y - kTickSize));
161 + Handles.DrawLine(P, new Vector3(P.x, P.y - kTickSize));
162 + Handles.DrawLine(Q, new Vector3(Q.x, Q.y - kTickSize));
163 +
164 + Handles.DrawLine(H, new Vector3(H.x, H.y + kTickSize));
165 + Handles.DrawLine(I, new Vector3(I.x, I.y + kTickSize));
166 + Handles.DrawLine(J, new Vector3(J.x, J.y + kTickSize));
167 + Handles.DrawLine(K, new Vector3(K.x, K.y + kTickSize));
168 + Handles.DrawLine(R, new Vector3(R.x, R.y + kTickSize));
169 + Handles.DrawLine(S, new Vector3(S.x, S.y + kTickSize));
170 + Handles.DrawLine(T, new Vector3(T.x, T.y + kTickSize));
171 +
172 + // Labels
173 + GUI.color = color;
174 + GUI.Label(new Rect(A.x - kTickSize - 34f, A.y - 15f, 30f, 30f), "1.0", FxStyles.tickStyleRight);
175 + GUI.Label(new Rect(M.x - kTickSize - 34f, M.y - 15f, 30f, 30f), "0.5", FxStyles.tickStyleRight);
176 + GUI.Label(new Rect(K.x - kTickSize - 34f, K.y - 15f, 30f, 30f), "0.0", FxStyles.tickStyleRight);
177 +
178 + GUI.Label(new Rect(D.x + kTickSize + 4f, D.y - 15f, 30f, 30f), "1.0", FxStyles.tickStyleLeft);
179 + GUI.Label(new Rect(F.x + kTickSize + 4f, F.y - 15f, 30f, 30f), "0.5", FxStyles.tickStyleLeft);
180 + GUI.Label(new Rect(H.x + kTickSize + 4f, H.y - 15f, 30f, 30f), "0.0", FxStyles.tickStyleLeft);
181 + }
182 + }
183 + }
184 +
185 + public override void OnFrameData(RenderTexture source)
186 + {
187 + if (Application.isPlaying && !m_MonitorSettings.refreshOnPlay)
188 + return;
189 +
190 + if (Mathf.Approximately(m_MonitorAreaRect.width, 0) || Mathf.Approximately(m_MonitorAreaRect.height, 0))
191 + return;
192 +
193 + float ratio = ((float)source.width / (float)source.height) / 3f;
194 + int h = 384;
195 + int w = Mathf.FloorToInt(h * ratio);
196 +
197 + var rt = RenderTexture.GetTemporary(w, h, 0, source.format);
198 + Graphics.Blit(source, rt);
199 + ComputeWaveform(rt);
200 + m_BaseEditor.Repaint();
201 + RenderTexture.ReleaseTemporary(rt);
202 + }
203 +
204 + void CreateBuffer(int width, int height)
205 + {
206 + m_Buffer = new ComputeBuffer(width * height, sizeof(uint) << 2);
207 + }
208 +
209 + void ComputeWaveform(RenderTexture source)
210 + {
211 + if (m_Buffer == null)
212 + {
213 + CreateBuffer(source.width, source.height);
214 + }
215 + else if (m_Buffer.count != (source.width * source.height))
216 + {
217 + m_Buffer.Release();
218 + CreateBuffer(source.width, source.height);
219 + }
220 +
221 + var channels = m_MonitorSettings.waveformY
222 + ? new Vector4(0f, 0f, 0f, 1f)
223 + : new Vector4(m_MonitorSettings.waveformR ? 1f : 0f, m_MonitorSettings.waveformG ? 1f : 0f, m_MonitorSettings.waveformB ? 1f : 0f, 0f);
224 +
225 + var cs = m_ComputeShader;
226 +
227 + int kernel = cs.FindKernel("KWaveformClear");
228 + cs.SetBuffer(kernel, "_Waveform", m_Buffer);
229 + cs.Dispatch(kernel, source.width, 1, 1);
230 +
231 + kernel = cs.FindKernel("KWaveform");
232 + cs.SetBuffer(kernel, "_Waveform", m_Buffer);
233 + cs.SetTexture(kernel, "_Source", source);
234 + cs.SetInt("_IsLinear", GraphicsUtils.isLinearColorSpace ? 1 : 0);
235 + cs.SetVector("_Channels", channels);
236 + cs.Dispatch(kernel, source.width, 1, 1);
237 +
238 + if (m_WaveformTexture == null || m_WaveformTexture.width != (source.width * 3) || m_WaveformTexture.height != source.height)
239 + {
240 + GraphicsUtils.Destroy(m_WaveformTexture);
241 + m_WaveformTexture = new RenderTexture(source.width * 3, source.height, 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear)
242 + {
243 + hideFlags = HideFlags.DontSave,
244 + wrapMode = TextureWrapMode.Clamp,
245 + filterMode = FilterMode.Bilinear
246 + };
247 + }
248 +
249 + if (m_Material == null)
250 + m_Material = new Material(Shader.Find("Hidden/Post FX/Monitors/Parade Render")) { hideFlags = HideFlags.DontSave };
251 +
252 + m_Material.SetBuffer("_Waveform", m_Buffer);
253 + m_Material.SetVector("_Size", new Vector2(m_WaveformTexture.width, m_WaveformTexture.height));
254 + m_Material.SetVector("_Channels", channels);
255 + }
256 + }
257 +}
1 +fileFormatVersion: 2
2 +guid: b1f878f3742072e40a280683573bd0ee
3 +timeCreated: 1460031643
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using UnityEditorInternal;
2 +using UnityEngine;
3 +using UnityEngine.PostProcessing;
4 +
5 +namespace UnityEditor.PostProcessing
6 +{
7 + public class VectorscopeMonitor : PostProcessingMonitor
8 + {
9 + static GUIContent s_MonitorTitle = new GUIContent("Vectorscope");
10 +
11 + ComputeShader m_ComputeShader;
12 + ComputeBuffer m_Buffer;
13 + Material m_Material;
14 + RenderTexture m_VectorscopeTexture;
15 + Rect m_MonitorAreaRect;
16 +
17 + public VectorscopeMonitor()
18 + {
19 + m_ComputeShader = EditorResources.Load<ComputeShader>("Monitors/VectorscopeCompute.compute");
20 + }
21 +
22 + public override void Dispose()
23 + {
24 + GraphicsUtils.Destroy(m_Material);
25 + GraphicsUtils.Destroy(m_VectorscopeTexture);
26 +
27 + if (m_Buffer != null)
28 + m_Buffer.Release();
29 +
30 + m_Material = null;
31 + m_VectorscopeTexture = null;
32 + m_Buffer = null;
33 + }
34 +
35 + public override bool IsSupported()
36 + {
37 + return m_ComputeShader != null && GraphicsUtils.supportsDX11;
38 + }
39 +
40 + public override GUIContent GetMonitorTitle()
41 + {
42 + return s_MonitorTitle;
43 + }
44 +
45 + public override void OnMonitorSettings()
46 + {
47 + EditorGUI.BeginChangeCheck();
48 +
49 + bool refreshOnPlay = m_MonitorSettings.refreshOnPlay;
50 + float exposure = m_MonitorSettings.vectorscopeExposure;
51 + bool showBackground = m_MonitorSettings.vectorscopeShowBackground;
52 +
53 + refreshOnPlay = GUILayout.Toggle(refreshOnPlay, new GUIContent(FxStyles.playIcon, "Keep refreshing the vectorscope in play mode; this may impact performances."), FxStyles.preButton);
54 + exposure = GUILayout.HorizontalSlider(exposure, 0.05f, 0.3f, FxStyles.preSlider, FxStyles.preSliderThumb, GUILayout.Width(40f));
55 + showBackground = GUILayout.Toggle(showBackground, new GUIContent(FxStyles.checkerIcon, "Show an YUV background in the vectorscope."), FxStyles.preButton);
56 +
57 + if (EditorGUI.EndChangeCheck())
58 + {
59 + Undo.RecordObject(m_BaseEditor.serializedObject.targetObject, "Vectorscope Settings Changed");
60 + m_MonitorSettings.refreshOnPlay = refreshOnPlay;
61 + m_MonitorSettings.vectorscopeExposure = exposure;
62 + m_MonitorSettings.vectorscopeShowBackground = showBackground;
63 + InternalEditorUtility.RepaintAllViews();
64 + }
65 + }
66 +
67 + public override void OnMonitorGUI(Rect r)
68 + {
69 + if (Event.current.type == EventType.Repaint)
70 + {
71 + // If m_MonitorAreaRect isn't set the preview was just opened so refresh the render to get the vectoscope data
72 + if (Mathf.Approximately(m_MonitorAreaRect.width, 0) && Mathf.Approximately(m_MonitorAreaRect.height, 0))
73 + InternalEditorUtility.RepaintAllViews();
74 +
75 + // Sizing
76 + float size = 0f;
77 +
78 + if (r.width < r.height)
79 + {
80 + size = m_VectorscopeTexture != null
81 + ? Mathf.Min(m_VectorscopeTexture.width, r.width - 35f)
82 + : r.width;
83 + }
84 + else
85 + {
86 + size = m_VectorscopeTexture != null
87 + ? Mathf.Min(m_VectorscopeTexture.height, r.height - 25f)
88 + : r.height;
89 + }
90 +
91 + m_MonitorAreaRect = new Rect(
92 + Mathf.Floor(r.x + r.width / 2f - size / 2f),
93 + Mathf.Floor(r.y + r.height / 2f - size / 2f - 5f),
94 + size, size
95 + );
96 +
97 + if (m_VectorscopeTexture != null)
98 + {
99 + m_Material.SetFloat("_Exposure", m_MonitorSettings.vectorscopeExposure);
100 +
101 + var oldActive = RenderTexture.active;
102 + Graphics.Blit(null, m_VectorscopeTexture, m_Material, m_MonitorSettings.vectorscopeShowBackground ? 0 : 1);
103 + RenderTexture.active = oldActive;
104 +
105 + Graphics.DrawTexture(m_MonitorAreaRect, m_VectorscopeTexture);
106 +
107 + var color = Color.white;
108 + const float kTickSize = 10f;
109 + const int kTickCount = 24;
110 +
111 + float radius = m_MonitorAreaRect.width / 2f;
112 + float midX = m_MonitorAreaRect.x + radius;
113 + float midY = m_MonitorAreaRect.y + radius;
114 + var center = new Vector2(midX, midY);
115 +
116 + // Cross
117 + color.a *= 0.5f;
118 + Handles.color = color;
119 + Handles.DrawLine(new Vector2(midX, m_MonitorAreaRect.y), new Vector2(midX, m_MonitorAreaRect.y + m_MonitorAreaRect.height));
120 + Handles.DrawLine(new Vector2(m_MonitorAreaRect.x, midY), new Vector2(m_MonitorAreaRect.x + m_MonitorAreaRect.width, midY));
121 +
122 + if (m_MonitorAreaRect.width > 100f)
123 + {
124 + color.a = 1f;
125 +
126 + // Ticks
127 + Handles.color = color;
128 + for (int i = 0; i < kTickCount; i++)
129 + {
130 + float a = (float)i / (float)kTickCount;
131 + float theta = a * (Mathf.PI * 2f);
132 + float tx = Mathf.Cos(theta + (Mathf.PI / 2f));
133 + float ty = Mathf.Sin(theta - (Mathf.PI / 2f));
134 + var innerVec = center + new Vector2(tx, ty) * (radius - kTickSize);
135 + var outerVec = center + new Vector2(tx, ty) * radius;
136 + Handles.DrawAAPolyLine(3f, innerVec, outerVec);
137 + }
138 +
139 + // Labels (where saturation reaches 75%)
140 + color.a = 1f;
141 + var oldColor = GUI.color;
142 + GUI.color = color * 2f;
143 +
144 + var point = new Vector2(-0.254f, -0.750f) * radius + center;
145 + var rect = new Rect(point.x - 10f, point.y - 10f, 20f, 20f);
146 + GUI.Label(rect, "[R]", FxStyles.tickStyleCenter);
147 +
148 + point = new Vector2(-0.497f, 0.629f) * radius + center;
149 + rect = new Rect(point.x - 10f, point.y - 10f, 20f, 20f);
150 + GUI.Label(rect, "[G]", FxStyles.tickStyleCenter);
151 +
152 + point = new Vector2(0.750f, 0.122f) * radius + center;
153 + rect = new Rect(point.x - 10f, point.y - 10f, 20f, 20f);
154 + GUI.Label(rect, "[B]", FxStyles.tickStyleCenter);
155 +
156 + point = new Vector2(-0.750f, -0.122f) * radius + center;
157 + rect = new Rect(point.x - 10f, point.y - 10f, 20f, 20f);
158 + GUI.Label(rect, "[Y]", FxStyles.tickStyleCenter);
159 +
160 + point = new Vector2(0.254f, 0.750f) * radius + center;
161 + rect = new Rect(point.x - 10f, point.y - 10f, 20f, 20f);
162 + GUI.Label(rect, "[C]", FxStyles.tickStyleCenter);
163 +
164 + point = new Vector2(0.497f, -0.629f) * radius + center;
165 + rect = new Rect(point.x - 10f, point.y - 10f, 20f, 20f);
166 + GUI.Label(rect, "[M]", FxStyles.tickStyleCenter);
167 + GUI.color = oldColor;
168 + }
169 + }
170 + }
171 + }
172 +
173 + public override void OnFrameData(RenderTexture source)
174 + {
175 + if (Application.isPlaying && !m_MonitorSettings.refreshOnPlay)
176 + return;
177 +
178 + if (Mathf.Approximately(m_MonitorAreaRect.width, 0) || Mathf.Approximately(m_MonitorAreaRect.height, 0))
179 + return;
180 +
181 + float ratio = (float)source.width / (float)source.height;
182 + int h = 384;
183 + int w = Mathf.FloorToInt(h * ratio);
184 +
185 + var rt = RenderTexture.GetTemporary(w, h, 0, source.format);
186 + Graphics.Blit(source, rt);
187 + ComputeVectorscope(rt);
188 + m_BaseEditor.Repaint();
189 + RenderTexture.ReleaseTemporary(rt);
190 + }
191 +
192 + void CreateBuffer(int width, int height)
193 + {
194 + m_Buffer = new ComputeBuffer(width * height, sizeof(uint));
195 + }
196 +
197 + void ComputeVectorscope(RenderTexture source)
198 + {
199 + if (m_Buffer == null)
200 + {
201 + CreateBuffer(source.width, source.height);
202 + }
203 + else if (m_Buffer.count != (source.width * source.height))
204 + {
205 + m_Buffer.Release();
206 + CreateBuffer(source.width, source.height);
207 + }
208 +
209 + var cs = m_ComputeShader;
210 +
211 + int kernel = cs.FindKernel("KVectorscopeClear");
212 + cs.SetBuffer(kernel, "_Vectorscope", m_Buffer);
213 + cs.SetVector("_Res", new Vector4(source.width, source.height, 0f, 0f));
214 + cs.Dispatch(kernel, Mathf.CeilToInt(source.width / 32f), Mathf.CeilToInt(source.height / 32f), 1);
215 +
216 + kernel = cs.FindKernel("KVectorscope");
217 + cs.SetBuffer(kernel, "_Vectorscope", m_Buffer);
218 + cs.SetTexture(kernel, "_Source", source);
219 + cs.SetInt("_IsLinear", GraphicsUtils.isLinearColorSpace ? 1 : 0);
220 + cs.SetVector("_Res", new Vector4(source.width, source.height, 0f, 0f));
221 + cs.Dispatch(kernel, Mathf.CeilToInt(source.width / 32f), Mathf.CeilToInt(source.height / 32f), 1);
222 +
223 + if (m_VectorscopeTexture == null || m_VectorscopeTexture.width != source.width || m_VectorscopeTexture.height != source.height)
224 + {
225 + GraphicsUtils.Destroy(m_VectorscopeTexture);
226 + m_VectorscopeTexture = new RenderTexture(source.width, source.height, 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear)
227 + {
228 + hideFlags = HideFlags.DontSave,
229 + wrapMode = TextureWrapMode.Clamp,
230 + filterMode = FilterMode.Bilinear
231 + };
232 + }
233 +
234 + if (m_Material == null)
235 + m_Material = new Material(Shader.Find("Hidden/Post FX/Monitors/Vectorscope Render")) { hideFlags = HideFlags.DontSave };
236 +
237 + m_Material.SetBuffer("_Vectorscope", m_Buffer);
238 + m_Material.SetVector("_Size", new Vector2(m_VectorscopeTexture.width, m_VectorscopeTexture.height));
239 + }
240 + }
241 +}
1 +fileFormatVersion: 2
2 +guid: 805119df0d94800418006c621cc99cc2
3 +timeCreated: 1461748750
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using UnityEditorInternal;
2 +using UnityEngine;
3 +using UnityEngine.PostProcessing;
4 +
5 +namespace UnityEditor.PostProcessing
6 +{
7 + public class WaveformMonitor : PostProcessingMonitor
8 + {
9 + static GUIContent s_MonitorTitle = new GUIContent("Waveform");
10 +
11 + ComputeShader m_ComputeShader;
12 + ComputeBuffer m_Buffer;
13 + Material m_Material;
14 + RenderTexture m_WaveformTexture;
15 + Rect m_MonitorAreaRect;
16 +
17 + public WaveformMonitor()
18 + {
19 + m_ComputeShader = EditorResources.Load<ComputeShader>("Monitors/WaveformCompute.compute");
20 + }
21 +
22 + public override void Dispose()
23 + {
24 + GraphicsUtils.Destroy(m_Material);
25 + GraphicsUtils.Destroy(m_WaveformTexture);
26 +
27 + if (m_Buffer != null)
28 + m_Buffer.Release();
29 +
30 + m_Material = null;
31 + m_WaveformTexture = null;
32 + m_Buffer = null;
33 + }
34 +
35 + public override bool IsSupported()
36 + {
37 + return m_ComputeShader != null && GraphicsUtils.supportsDX11;
38 + }
39 +
40 + public override GUIContent GetMonitorTitle()
41 + {
42 + return s_MonitorTitle;
43 + }
44 +
45 + public override void OnMonitorSettings()
46 + {
47 + EditorGUI.BeginChangeCheck();
48 +
49 + bool refreshOnPlay = m_MonitorSettings.refreshOnPlay;
50 + float exposure = m_MonitorSettings.waveformExposure;
51 + bool Y = m_MonitorSettings.waveformY;
52 + bool R = m_MonitorSettings.waveformR;
53 + bool G = m_MonitorSettings.waveformG;
54 + bool B = m_MonitorSettings.waveformB;
55 +
56 + refreshOnPlay = GUILayout.Toggle(refreshOnPlay, new GUIContent(FxStyles.playIcon, "Keep refreshing the waveform in play mode; this may impact performances."), FxStyles.preButton);
57 +
58 + exposure = GUILayout.HorizontalSlider(exposure, 0.05f, 0.3f, FxStyles.preSlider, FxStyles.preSliderThumb, GUILayout.Width(40f));
59 +
60 + Y = GUILayout.Toggle(Y, new GUIContent("Y", "Show the luminance waveform only."), FxStyles.preButton);
61 +
62 + if (Y)
63 + {
64 + R = false;
65 + G = false;
66 + B = false;
67 + }
68 +
69 + R = GUILayout.Toggle(R, new GUIContent("R", "Show the red waveform."), FxStyles.preButton);
70 + G = GUILayout.Toggle(G, new GUIContent("G", "Show the green waveform."), FxStyles.preButton);
71 + B = GUILayout.Toggle(B, new GUIContent("B", "Show the blue waveform."), FxStyles.preButton);
72 +
73 + if (R || G || B)
74 + Y = false;
75 +
76 + if (!Y && !R && !G && !B)
77 + {
78 + R = true;
79 + G = true;
80 + B = true;
81 + }
82 +
83 + if (EditorGUI.EndChangeCheck())
84 + {
85 + Undo.RecordObject(m_BaseEditor.serializedObject.targetObject, "Waveforme Settings Changed");
86 + m_MonitorSettings.refreshOnPlay = refreshOnPlay;
87 + m_MonitorSettings.waveformExposure = exposure;
88 + m_MonitorSettings.waveformY = Y;
89 + m_MonitorSettings.waveformR = R;
90 + m_MonitorSettings.waveformG = G;
91 + m_MonitorSettings.waveformB = B;
92 + InternalEditorUtility.RepaintAllViews();
93 + }
94 + }
95 +
96 + public override void OnMonitorGUI(Rect r)
97 + {
98 + if (Event.current.type == EventType.Repaint)
99 + {
100 + // If m_MonitorAreaRect isn't set the preview was just opened so refresh the render to get the waveform data
101 + if (Mathf.Approximately(m_MonitorAreaRect.width, 0) && Mathf.Approximately(m_MonitorAreaRect.height, 0))
102 + InternalEditorUtility.RepaintAllViews();
103 +
104 + // Sizing
105 + float width = m_WaveformTexture != null
106 + ? Mathf.Min(m_WaveformTexture.width, r.width - 65f)
107 + : r.width;
108 + float height = m_WaveformTexture != null
109 + ? Mathf.Min(m_WaveformTexture.height, r.height - 45f)
110 + : r.height;
111 +
112 + m_MonitorAreaRect = new Rect(
113 + Mathf.Floor(r.x + r.width / 2f - width / 2f),
114 + Mathf.Floor(r.y + r.height / 2f - height / 2f - 5f),
115 + width, height
116 + );
117 +
118 + if (m_WaveformTexture != null)
119 + {
120 + m_Material.SetFloat("_Exposure", m_MonitorSettings.waveformExposure);
121 +
122 + var oldActive = RenderTexture.active;
123 + Graphics.Blit(null, m_WaveformTexture, m_Material, 0);
124 + RenderTexture.active = oldActive;
125 +
126 + Graphics.DrawTexture(m_MonitorAreaRect, m_WaveformTexture);
127 +
128 + var color = Color.white;
129 + const float kTickSize = 5f;
130 +
131 + // Rect, lines & ticks points
132 + // A B C D E
133 + // P F
134 + // O G
135 + // N H
136 + // M L K J I
137 +
138 + var A = new Vector3(m_MonitorAreaRect.x, m_MonitorAreaRect.y);
139 + var E = new Vector3(A.x + m_MonitorAreaRect.width + 1f, m_MonitorAreaRect.y);
140 + var I = new Vector3(E.x, E.y + m_MonitorAreaRect.height + 1f);
141 + var M = new Vector3(A.x, I.y);
142 +
143 + var C = new Vector3(A.x + (E.x - A.x) / 2f, A.y);
144 + var G = new Vector3(E.x, E.y + (I.y - E.y) / 2f);
145 + var K = new Vector3(M.x + (I.x - M.x) / 2f, M.y);
146 + var O = new Vector3(A.x, A.y + (M.y - A.y) / 2f);
147 +
148 + var P = new Vector3(A.x, A.y + (O.y - A.y) / 2f);
149 + var F = new Vector3(E.x, E.y + (G.y - E.y) / 2f);
150 + var N = new Vector3(A.x, O.y + (M.y - O.y) / 2f);
151 + var H = new Vector3(E.x, G.y + (I.y - G.y) / 2f);
152 +
153 + var B = new Vector3(A.x + (C.x - A.x) / 2f, A.y);
154 + var L = new Vector3(M.x + (K.x - M.x) / 2f, M.y);
155 + var D = new Vector3(C.x + (E.x - C.x) / 2f, A.y);
156 + var J = new Vector3(K.x + (I.x - K.x) / 2f, M.y);
157 +
158 + // Borders
159 + Handles.color = color;
160 + Handles.DrawLine(A, E);
161 + Handles.DrawLine(E, I);
162 + Handles.DrawLine(I, M);
163 + Handles.DrawLine(M, new Vector3(A.x, A.y - 1f));
164 +
165 + // Vertical ticks
166 + Handles.DrawLine(A, new Vector3(A.x - kTickSize, A.y));
167 + Handles.DrawLine(P, new Vector3(P.x - kTickSize, P.y));
168 + Handles.DrawLine(O, new Vector3(O.x - kTickSize, O.y));
169 + Handles.DrawLine(N, new Vector3(N.x - kTickSize, N.y));
170 + Handles.DrawLine(M, new Vector3(M.x - kTickSize, M.y));
171 +
172 + Handles.DrawLine(E, new Vector3(E.x + kTickSize, E.y));
173 + Handles.DrawLine(F, new Vector3(F.x + kTickSize, F.y));
174 + Handles.DrawLine(G, new Vector3(G.x + kTickSize, G.y));
175 + Handles.DrawLine(H, new Vector3(H.x + kTickSize, H.y));
176 + Handles.DrawLine(I, new Vector3(I.x + kTickSize, I.y));
177 +
178 + // Horizontal ticks
179 + Handles.DrawLine(A, new Vector3(A.x, A.y - kTickSize));
180 + Handles.DrawLine(B, new Vector3(B.x, B.y - kTickSize));
181 + Handles.DrawLine(C, new Vector3(C.x, C.y - kTickSize));
182 + Handles.DrawLine(D, new Vector3(D.x, D.y - kTickSize));
183 + Handles.DrawLine(E, new Vector3(E.x, E.y - kTickSize));
184 +
185 + Handles.DrawLine(M, new Vector3(M.x, M.y + kTickSize));
186 + Handles.DrawLine(L, new Vector3(L.x, L.y + kTickSize));
187 + Handles.DrawLine(K, new Vector3(K.x, K.y + kTickSize));
188 + Handles.DrawLine(J, new Vector3(J.x, J.y + kTickSize));
189 + Handles.DrawLine(I, new Vector3(I.x, I.y + kTickSize));
190 +
191 + // Labels
192 + GUI.color = color;
193 + GUI.Label(new Rect(A.x - kTickSize - 34f, A.y - 15f, 30f, 30f), "1.0", FxStyles.tickStyleRight);
194 + GUI.Label(new Rect(O.x - kTickSize - 34f, O.y - 15f, 30f, 30f), "0.5", FxStyles.tickStyleRight);
195 + GUI.Label(new Rect(M.x - kTickSize - 34f, M.y - 15f, 30f, 30f), "0.0", FxStyles.tickStyleRight);
196 +
197 + GUI.Label(new Rect(E.x + kTickSize + 4f, E.y - 15f, 30f, 30f), "1.0", FxStyles.tickStyleLeft);
198 + GUI.Label(new Rect(G.x + kTickSize + 4f, G.y - 15f, 30f, 30f), "0.5", FxStyles.tickStyleLeft);
199 + GUI.Label(new Rect(I.x + kTickSize + 4f, I.y - 15f, 30f, 30f), "0.0", FxStyles.tickStyleLeft);
200 +
201 + GUI.Label(new Rect(M.x - 15f, M.y + kTickSize - 4f, 30f, 30f), "0.0", FxStyles.tickStyleCenter);
202 + GUI.Label(new Rect(K.x - 15f, K.y + kTickSize - 4f, 30f, 30f), "0.5", FxStyles.tickStyleCenter);
203 + GUI.Label(new Rect(I.x - 15f, I.y + kTickSize - 4f, 30f, 30f), "1.0", FxStyles.tickStyleCenter);
204 + }
205 + }
206 + }
207 +
208 + public override void OnFrameData(RenderTexture source)
209 + {
210 + if (Application.isPlaying && !m_MonitorSettings.refreshOnPlay)
211 + return;
212 +
213 + if (Mathf.Approximately(m_MonitorAreaRect.width, 0) || Mathf.Approximately(m_MonitorAreaRect.height, 0))
214 + return;
215 +
216 + float ratio = (float)source.width / (float)source.height;
217 + int h = 384;
218 + int w = Mathf.FloorToInt(h * ratio);
219 +
220 + var rt = RenderTexture.GetTemporary(w, h, 0, source.format);
221 + Graphics.Blit(source, rt);
222 + ComputeWaveform(rt);
223 + m_BaseEditor.Repaint();
224 + RenderTexture.ReleaseTemporary(rt);
225 + }
226 +
227 + void CreateBuffer(int width, int height)
228 + {
229 + m_Buffer = new ComputeBuffer(width * height, sizeof(uint) << 2);
230 + }
231 +
232 + void ComputeWaveform(RenderTexture source)
233 + {
234 + if (m_Buffer == null)
235 + {
236 + CreateBuffer(source.width, source.height);
237 + }
238 + else if (m_Buffer.count != (source.width * source.height))
239 + {
240 + m_Buffer.Release();
241 + CreateBuffer(source.width, source.height);
242 + }
243 +
244 + var channels = m_MonitorSettings.waveformY
245 + ? new Vector4(0f, 0f, 0f, 1f)
246 + : new Vector4(m_MonitorSettings.waveformR ? 1f : 0f, m_MonitorSettings.waveformG ? 1f : 0f, m_MonitorSettings.waveformB ? 1f : 0f, 0f);
247 +
248 + var cs = m_ComputeShader;
249 +
250 + int kernel = cs.FindKernel("KWaveformClear");
251 + cs.SetBuffer(kernel, "_Waveform", m_Buffer);
252 + cs.Dispatch(kernel, source.width, 1, 1);
253 +
254 + kernel = cs.FindKernel("KWaveform");
255 + cs.SetBuffer(kernel, "_Waveform", m_Buffer);
256 + cs.SetTexture(kernel, "_Source", source);
257 + cs.SetInt("_IsLinear", GraphicsUtils.isLinearColorSpace ? 1 : 0);
258 + cs.SetVector("_Channels", channels);
259 + cs.Dispatch(kernel, source.width, 1, 1);
260 +
261 + if (m_WaveformTexture == null || m_WaveformTexture.width != source.width || m_WaveformTexture.height != source.height)
262 + {
263 + GraphicsUtils.Destroy(m_WaveformTexture);
264 + m_WaveformTexture = new RenderTexture(source.width, source.height, 0, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear)
265 + {
266 + hideFlags = HideFlags.DontSave,
267 + wrapMode = TextureWrapMode.Clamp,
268 + filterMode = FilterMode.Bilinear
269 + };
270 + }
271 +
272 + if (m_Material == null)
273 + m_Material = new Material(Shader.Find("Hidden/Post FX/Monitors/Waveform Render")) { hideFlags = HideFlags.DontSave };
274 +
275 + m_Material.SetBuffer("_Waveform", m_Buffer);
276 + m_Material.SetVector("_Size", new Vector2(m_WaveformTexture.width, m_WaveformTexture.height));
277 + m_Material.SetVector("_Channels", channels);
278 + }
279 + }
280 +}
1 +fileFormatVersion: 2
2 +guid: 2d45bc7edb5916446b4fa1ae1b6f9065
3 +timeCreated: 1459957472
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 0c12e797b02402246a52aa270c45059b
3 +timeCreated: 1476193645
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 0dfcadb180d67014cb0a6e18d6b11f90
3 +timeCreated: 1466586271
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 27fa95984763d9d47bbad59e7fdb66fe
3 +timeCreated: 1467188923
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: afe296d4ede60a0479734dc8c7df82c2
3 +timeCreated: 1467188923
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 801186e9e649457469bcddd8ee391c71
3 +timeCreated: 1467188912
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: ced92f1cc2085ae48acacc79a2b8e196
3 +folderAsset: yes
4 +timeCreated: 1467189428
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: e1a43b92f2bbd914ca2e6b4c6a5dba48
3 +timeCreated: 1460383963
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 8995f52f410f0fb4cb1bdaa71a16e04e
3 +timeCreated: 1467364278
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +}
1 +fileFormatVersion: 2
2 +guid: a668d493c5ed56d448b53c19b2c3dfd2
3 +timeCreated: 1460563239
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: b52c69ccefdae7545bfb4d0bf9b7df71
3 +folderAsset: yes
4 +timeCreated: 1467189428
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +using System;
2 +using System.Collections.Generic;
3 +using UnityEngine;
4 +
5 +namespace UnityEditor.PostProcessing
6 +{
7 + public sealed class CurveEditor
8 + {
9 + #region Enums
10 +
11 + enum EditMode
12 + {
13 + None,
14 + Moving,
15 + TangentEdit
16 + }
17 +
18 + enum Tangent
19 + {
20 + In,
21 + Out
22 + }
23 + #endregion
24 +
25 + #region Structs
26 + public struct Settings
27 + {
28 + public Rect bounds;
29 + public RectOffset padding;
30 + public Color selectionColor;
31 + public float curvePickingDistance;
32 + public float keyTimeClampingDistance;
33 +
34 + public static Settings defaultSettings
35 + {
36 + get
37 + {
38 + return new Settings
39 + {
40 + bounds = new Rect(0f, 0f, 1f, 1f),
41 + padding = new RectOffset(10, 10, 10, 10),
42 + selectionColor = Color.yellow,
43 + curvePickingDistance = 6f,
44 + keyTimeClampingDistance = 1e-4f
45 + };
46 + }
47 + }
48 + }
49 +
50 + public struct CurveState
51 + {
52 + public bool visible;
53 + public bool editable;
54 + public uint minPointCount;
55 + public float zeroKeyConstantValue;
56 + public Color color;
57 + public float width;
58 + public float handleWidth;
59 + public bool showNonEditableHandles;
60 + public bool onlyShowHandlesOnSelection;
61 + public bool loopInBounds;
62 +
63 + public static CurveState defaultState
64 + {
65 + get
66 + {
67 + return new CurveState
68 + {
69 + visible = true,
70 + editable = true,
71 + minPointCount = 2,
72 + zeroKeyConstantValue = 0f,
73 + color = Color.white,
74 + width = 2f,
75 + handleWidth = 2f,
76 + showNonEditableHandles = true,
77 + onlyShowHandlesOnSelection = false,
78 + loopInBounds = false
79 + };
80 + }
81 + }
82 + }
83 +
84 + public struct Selection
85 + {
86 + public SerializedProperty curve;
87 + public int keyframeIndex;
88 + public Keyframe? keyframe;
89 +
90 + public Selection(SerializedProperty curve, int keyframeIndex, Keyframe? keyframe)
91 + {
92 + this.curve = curve;
93 + this.keyframeIndex = keyframeIndex;
94 + this.keyframe = keyframe;
95 + }
96 + }
97 +
98 + internal struct MenuAction
99 + {
100 + internal SerializedProperty curve;
101 + internal int index;
102 + internal Vector3 position;
103 +
104 + internal MenuAction(SerializedProperty curve)
105 + {
106 + this.curve = curve;
107 + this.index = -1;
108 + this.position = Vector3.zero;
109 + }
110 +
111 + internal MenuAction(SerializedProperty curve, int index)
112 + {
113 + this.curve = curve;
114 + this.index = index;
115 + this.position = Vector3.zero;
116 + }
117 +
118 + internal MenuAction(SerializedProperty curve, Vector3 position)
119 + {
120 + this.curve = curve;
121 + this.index = -1;
122 + this.position = position;
123 + }
124 + }
125 + #endregion
126 +
127 + #region Fields & properties
128 + public Settings settings { get; private set; }
129 +
130 + Dictionary<SerializedProperty, CurveState> m_Curves;
131 + Rect m_CurveArea;
132 +
133 + SerializedProperty m_SelectedCurve;
134 + int m_SelectedKeyframeIndex = -1;
135 +
136 + EditMode m_EditMode = EditMode.None;
137 + Tangent m_TangentEditMode;
138 +
139 + bool m_Dirty;
140 + #endregion
141 +
142 + #region Constructors & destructors
143 + public CurveEditor()
144 + : this(Settings.defaultSettings)
145 + {}
146 +
147 + public CurveEditor(Settings settings)
148 + {
149 + this.settings = settings;
150 + m_Curves = new Dictionary<SerializedProperty, CurveState>();
151 + }
152 +
153 + #endregion
154 +
155 + #region Public API
156 + public void Add(params SerializedProperty[] curves)
157 + {
158 + foreach (var curve in curves)
159 + Add(curve, CurveState.defaultState);
160 + }
161 +
162 + public void Add(SerializedProperty curve)
163 + {
164 + Add(curve, CurveState.defaultState);
165 + }
166 +
167 + public void Add(SerializedProperty curve, CurveState state)
168 + {
169 + // Make sure the property is in fact an AnimationCurve
170 + var animCurve = curve.animationCurveValue;
171 + if (animCurve == null)
172 + throw new ArgumentException("curve");
173 +
174 + if (m_Curves.ContainsKey(curve))
175 + Debug.LogWarning("Curve has already been added to the editor");
176 +
177 + m_Curves.Add(curve, state);
178 + }
179 +
180 + public void Remove(SerializedProperty curve)
181 + {
182 + m_Curves.Remove(curve);
183 + }
184 +
185 + public void RemoveAll()
186 + {
187 + m_Curves.Clear();
188 + }
189 +
190 + public CurveState GetCurveState(SerializedProperty curve)
191 + {
192 + CurveState state;
193 + if (!m_Curves.TryGetValue(curve, out state))
194 + throw new KeyNotFoundException("curve");
195 +
196 + return state;
197 + }
198 +
199 + public void SetCurveState(SerializedProperty curve, CurveState state)
200 + {
201 + if (!m_Curves.ContainsKey(curve))
202 + throw new KeyNotFoundException("curve");
203 +
204 + m_Curves[curve] = state;
205 + }
206 +
207 + public Selection GetSelection()
208 + {
209 + Keyframe? key = null;
210 + if (m_SelectedKeyframeIndex > -1)
211 + {
212 + var curve = m_SelectedCurve.animationCurveValue;
213 +
214 + if (m_SelectedKeyframeIndex >= curve.length)
215 + m_SelectedKeyframeIndex = -1;
216 + else
217 + key = curve[m_SelectedKeyframeIndex];
218 + }
219 +
220 + return new Selection(m_SelectedCurve, m_SelectedKeyframeIndex, key);
221 + }
222 +
223 + public void SetKeyframe(SerializedProperty curve, int keyframeIndex, Keyframe keyframe)
224 + {
225 + var animCurve = curve.animationCurveValue;
226 + SetKeyframe(animCurve, keyframeIndex, keyframe);
227 + SaveCurve(curve, animCurve);
228 + }
229 +
230 + public bool OnGUI(Rect rect)
231 + {
232 + if (Event.current.type == EventType.Repaint)
233 + m_Dirty = false;
234 +
235 + GUI.BeginClip(rect);
236 + {
237 + var area = new Rect(Vector2.zero, rect.size);
238 + m_CurveArea = settings.padding.Remove(area);
239 +
240 + foreach (var curve in m_Curves)
241 + OnCurveGUI(area, curve.Key, curve.Value);
242 +
243 + OnGeneralUI(area);
244 + }
245 + GUI.EndClip();
246 +
247 + return m_Dirty;
248 + }
249 +
250 + #endregion
251 +
252 + #region UI & events
253 +
254 + void OnCurveGUI(Rect rect, SerializedProperty curve, CurveState state)
255 + {
256 + // Discard invisible curves
257 + if (!state.visible)
258 + return;
259 +
260 + var animCurve = curve.animationCurveValue;
261 + var keys = animCurve.keys;
262 + var length = keys.Length;
263 +
264 + // Curve drawing
265 + // Slightly dim non-editable curves
266 + var color = state.color;
267 + if (!state.editable)
268 + color.a *= 0.5f;
269 +
270 + Handles.color = color;
271 + var bounds = settings.bounds;
272 +
273 + if (length == 0)
274 + {
275 + var p1 = CurveToCanvas(new Vector3(bounds.xMin, state.zeroKeyConstantValue));
276 + var p2 = CurveToCanvas(new Vector3(bounds.xMax, state.zeroKeyConstantValue));
277 + Handles.DrawAAPolyLine(state.width, p1, p2);
278 + }
279 + else if (length == 1)
280 + {
281 + var p1 = CurveToCanvas(new Vector3(bounds.xMin, keys[0].value));
282 + var p2 = CurveToCanvas(new Vector3(bounds.xMax, keys[0].value));
283 + Handles.DrawAAPolyLine(state.width, p1, p2);
284 + }
285 + else
286 + {
287 + var prevKey = keys[0];
288 + for (int k = 1; k < length; k++)
289 + {
290 + var key = keys[k];
291 + var pts = BezierSegment(prevKey, key);
292 +
293 + if (float.IsInfinity(prevKey.outTangent) || float.IsInfinity(key.inTangent))
294 + {
295 + var s = HardSegment(prevKey, key);
296 + Handles.DrawAAPolyLine(state.width, s[0], s[1], s[2]);
297 + }
298 + else Handles.DrawBezier(pts[0], pts[3], pts[1], pts[2], color, null, state.width);
299 +
300 + prevKey = key;
301 + }
302 +
303 + // Curve extents & loops
304 + if (keys[0].time > bounds.xMin)
305 + {
306 + if (state.loopInBounds)
307 + {
308 + var p1 = keys[length - 1];
309 + p1.time -= settings.bounds.width;
310 + var p2 = keys[0];
311 + var pts = BezierSegment(p1, p2);
312 +
313 + if (float.IsInfinity(p1.outTangent) || float.IsInfinity(p2.inTangent))
314 + {
315 + var s = HardSegment(p1, p2);
316 + Handles.DrawAAPolyLine(state.width, s[0], s[1], s[2]);
317 + }
318 + else Handles.DrawBezier(pts[0], pts[3], pts[1], pts[2], color, null, state.width);
319 + }
320 + else
321 + {
322 + var p1 = CurveToCanvas(new Vector3(bounds.xMin, keys[0].value));
323 + var p2 = CurveToCanvas(keys[0]);
324 + Handles.DrawAAPolyLine(state.width, p1, p2);
325 + }
326 + }
327 +
328 + if (keys[length - 1].time < bounds.xMax)
329 + {
330 + if (state.loopInBounds)
331 + {
332 + var p1 = keys[length - 1];
333 + var p2 = keys[0];
334 + p2.time += settings.bounds.width;
335 + var pts = BezierSegment(p1, p2);
336 +
337 + if (float.IsInfinity(p1.outTangent) || float.IsInfinity(p2.inTangent))
338 + {
339 + var s = HardSegment(p1, p2);
340 + Handles.DrawAAPolyLine(state.width, s[0], s[1], s[2]);
341 + }
342 + else Handles.DrawBezier(pts[0], pts[3], pts[1], pts[2], color, null, state.width);
343 + }
344 + else
345 + {
346 + var p1 = CurveToCanvas(keys[length - 1]);
347 + var p2 = CurveToCanvas(new Vector3(bounds.xMax, keys[length - 1].value));
348 + Handles.DrawAAPolyLine(state.width, p1, p2);
349 + }
350 + }
351 + }
352 +
353 + // Make sure selection is correct (undo can break it)
354 + bool isCurrentlySelectedCurve = curve == m_SelectedCurve;
355 +
356 + if (isCurrentlySelectedCurve && m_SelectedKeyframeIndex >= length)
357 + m_SelectedKeyframeIndex = -1;
358 +
359 + // Handles & keys
360 + for (int k = 0; k < length; k++)
361 + {
362 + bool isCurrentlySelectedKeyframe = k == m_SelectedKeyframeIndex;
363 + var e = Event.current;
364 +
365 + var pos = CurveToCanvas(keys[k]);
366 + var hitRect = new Rect(pos.x - 8f, pos.y - 8f, 16f, 16f);
367 + var offset = isCurrentlySelectedCurve
368 + ? new RectOffset(5, 5, 5, 5)
369 + : new RectOffset(6, 6, 6, 6);
370 +
371 + var outTangent = pos + CurveTangentToCanvas(keys[k].outTangent).normalized * 40f;
372 + var inTangent = pos - CurveTangentToCanvas(keys[k].inTangent).normalized * 40f;
373 + var inTangentHitRect = new Rect(inTangent.x - 7f, inTangent.y - 7f, 14f, 14f);
374 + var outTangentHitrect = new Rect(outTangent.x - 7f, outTangent.y - 7f, 14f, 14f);
375 +
376 + // Draw
377 + if (state.showNonEditableHandles)
378 + {
379 + if (e.type == EventType.Repaint)
380 + {
381 + var selectedColor = (isCurrentlySelectedCurve && isCurrentlySelectedKeyframe)
382 + ? settings.selectionColor
383 + : state.color;
384 +
385 + // Keyframe
386 + EditorGUI.DrawRect(offset.Remove(hitRect), selectedColor);
387 +
388 + // Tangents
389 + if (isCurrentlySelectedCurve && (!state.onlyShowHandlesOnSelection || (state.onlyShowHandlesOnSelection && isCurrentlySelectedKeyframe)))
390 + {
391 + Handles.color = selectedColor;
392 +
393 + if (k > 0 || state.loopInBounds)
394 + {
395 + Handles.DrawAAPolyLine(state.handleWidth, pos, inTangent);
396 + EditorGUI.DrawRect(offset.Remove(inTangentHitRect), selectedColor);
397 + }
398 +
399 + if (k < length - 1 || state.loopInBounds)
400 + {
401 + Handles.DrawAAPolyLine(state.handleWidth, pos, outTangent);
402 + EditorGUI.DrawRect(offset.Remove(outTangentHitrect), selectedColor);
403 + }
404 + }
405 + }
406 + }
407 +
408 + // Events
409 + if (state.editable)
410 + {
411 + // Keyframe move
412 + if (m_EditMode == EditMode.Moving && e.type == EventType.MouseDrag && isCurrentlySelectedCurve && isCurrentlySelectedKeyframe)
413 + {
414 + EditMoveKeyframe(animCurve, keys, k);
415 + }
416 +
417 + // Tangent editing
418 + if (m_EditMode == EditMode.TangentEdit && e.type == EventType.MouseDrag && isCurrentlySelectedCurve && isCurrentlySelectedKeyframe)
419 + {
420 + bool alreadyBroken = !(Mathf.Approximately(keys[k].inTangent, keys[k].outTangent) || (float.IsInfinity(keys[k].inTangent) && float.IsInfinity(keys[k].outTangent)));
421 + EditMoveTangent(animCurve, keys, k, m_TangentEditMode, e.shift || !(alreadyBroken || e.control));
422 + }
423 +
424 + // Keyframe selection & context menu
425 + if (e.type == EventType.MouseDown && rect.Contains(e.mousePosition))
426 + {
427 + if (hitRect.Contains(e.mousePosition))
428 + {
429 + if (e.button == 0)
430 + {
431 + SelectKeyframe(curve, k);
432 + m_EditMode = EditMode.Moving;
433 + e.Use();
434 + }
435 + else if (e.button == 1)
436 + {
437 + // Keyframe context menu
438 + var menu = new GenericMenu();
439 + menu.AddItem(new GUIContent("Delete Key"), false, (x) =>
440 + {
441 + var action = (MenuAction)x;
442 + var curveValue = action.curve.animationCurveValue;
443 + action.curve.serializedObject.Update();
444 + RemoveKeyframe(curveValue, action.index);
445 + m_SelectedKeyframeIndex = -1;
446 + SaveCurve(action.curve, curveValue);
447 + action.curve.serializedObject.ApplyModifiedProperties();
448 + }, new MenuAction(curve, k));
449 + menu.ShowAsContext();
450 + e.Use();
451 + }
452 + }
453 + }
454 +
455 + // Tangent selection & edit mode
456 + if (e.type == EventType.MouseDown && rect.Contains(e.mousePosition))
457 + {
458 + if (inTangentHitRect.Contains(e.mousePosition) && (k > 0 || state.loopInBounds))
459 + {
460 + SelectKeyframe(curve, k);
461 + m_EditMode = EditMode.TangentEdit;
462 + m_TangentEditMode = Tangent.In;
463 + e.Use();
464 + }
465 + else if (outTangentHitrect.Contains(e.mousePosition) && (k < length - 1 || state.loopInBounds))
466 + {
467 + SelectKeyframe(curve, k);
468 + m_EditMode = EditMode.TangentEdit;
469 + m_TangentEditMode = Tangent.Out;
470 + e.Use();
471 + }
472 + }
473 +
474 + // Mouse up - clean up states
475 + if (e.rawType == EventType.MouseUp && m_EditMode != EditMode.None)
476 + {
477 + m_EditMode = EditMode.None;
478 + }
479 +
480 + // Set cursors
481 + {
482 + EditorGUIUtility.AddCursorRect(hitRect, MouseCursor.MoveArrow);
483 +
484 + if (k > 0 || state.loopInBounds)
485 + EditorGUIUtility.AddCursorRect(inTangentHitRect, MouseCursor.RotateArrow);
486 +
487 + if (k < length - 1 || state.loopInBounds)
488 + EditorGUIUtility.AddCursorRect(outTangentHitrect, MouseCursor.RotateArrow);
489 + }
490 + }
491 + }
492 +
493 + Handles.color = Color.white;
494 + SaveCurve(curve, animCurve);
495 + }
496 +
497 + void OnGeneralUI(Rect rect)
498 + {
499 + var e = Event.current;
500 +
501 + // Selection
502 + if (e.type == EventType.MouseDown)
503 + {
504 + GUI.FocusControl(null);
505 + m_SelectedCurve = null;
506 + m_SelectedKeyframeIndex = -1;
507 + bool used = false;
508 +
509 + var hit = CanvasToCurve(e.mousePosition);
510 + float curvePickValue = CurveToCanvas(hit).y;
511 +
512 + // Try and select a curve
513 + foreach (var curve in m_Curves)
514 + {
515 + if (!curve.Value.editable || !curve.Value.visible)
516 + continue;
517 +
518 + var prop = curve.Key;
519 + var state = curve.Value;
520 + var animCurve = prop.animationCurveValue;
521 + float hitY = animCurve.length == 0
522 + ? state.zeroKeyConstantValue
523 + : animCurve.Evaluate(hit.x);
524 +
525 + var curvePos = CurveToCanvas(new Vector3(hit.x, hitY));
526 +
527 + if (Mathf.Abs(curvePos.y - curvePickValue) < settings.curvePickingDistance)
528 + {
529 + m_SelectedCurve = prop;
530 +
531 + if (e.clickCount == 2 && e.button == 0)
532 + {
533 + // Create a keyframe on double-click on this curve
534 + EditCreateKeyframe(animCurve, hit, true, state.zeroKeyConstantValue);
535 + SaveCurve(prop, animCurve);
536 + }
537 + else if (e.button == 1)
538 + {
539 + // Curve context menu
540 + var menu = new GenericMenu();
541 + menu.AddItem(new GUIContent("Add Key"), false, (x) =>
542 + {
543 + var action = (MenuAction)x;
544 + var curveValue = action.curve.animationCurveValue;
545 + action.curve.serializedObject.Update();
546 + EditCreateKeyframe(curveValue, hit, true, 0f);
547 + SaveCurve(action.curve, curveValue);
548 + action.curve.serializedObject.ApplyModifiedProperties();
549 + }, new MenuAction(prop, hit));
550 + menu.ShowAsContext();
551 + e.Use();
552 + used = true;
553 + }
554 + }
555 + }
556 +
557 + if (e.clickCount == 2 && e.button == 0 && m_SelectedCurve == null)
558 + {
559 + // Create a keyframe on every curve on double-click
560 + foreach (var curve in m_Curves)
561 + {
562 + if (!curve.Value.editable || !curve.Value.visible)
563 + continue;
564 +
565 + var prop = curve.Key;
566 + var state = curve.Value;
567 + var animCurve = prop.animationCurveValue;
568 + EditCreateKeyframe(animCurve, hit, e.alt, state.zeroKeyConstantValue);
569 + SaveCurve(prop, animCurve);
570 + }
571 + }
572 + else if (!used && e.button == 1)
573 + {
574 + // Global context menu
575 + var menu = new GenericMenu();
576 + menu.AddItem(new GUIContent("Add Key At Position"), false, () => ContextMenuAddKey(hit, false));
577 + menu.AddItem(new GUIContent("Add Key On Curves"), false, () => ContextMenuAddKey(hit, true));
578 + menu.ShowAsContext();
579 + }
580 +
581 + e.Use();
582 + }
583 +
584 + // Delete selected key(s)
585 + if (e.type == EventType.KeyDown && (e.keyCode == KeyCode.Delete || e.keyCode == KeyCode.Backspace))
586 + {
587 + if (m_SelectedKeyframeIndex != -1 && m_SelectedCurve != null)
588 + {
589 + var animCurve = m_SelectedCurve.animationCurveValue;
590 + var length = animCurve.length;
591 +
592 + if (m_Curves[m_SelectedCurve].minPointCount < length && length >= 0)
593 + {
594 + EditDeleteKeyframe(animCurve, m_SelectedKeyframeIndex);
595 + m_SelectedKeyframeIndex = -1;
596 + SaveCurve(m_SelectedCurve, animCurve);
597 + }
598 +
599 + e.Use();
600 + }
601 + }
602 + }
603 +
604 + void SaveCurve(SerializedProperty prop, AnimationCurve curve)
605 + {
606 + prop.animationCurveValue = curve;
607 + }
608 +
609 + void Invalidate()
610 + {
611 + m_Dirty = true;
612 + }
613 +
614 + #endregion
615 +
616 + #region Keyframe manipulations
617 +
618 + void SelectKeyframe(SerializedProperty curve, int keyframeIndex)
619 + {
620 + m_SelectedKeyframeIndex = keyframeIndex;
621 + m_SelectedCurve = curve;
622 + Invalidate();
623 + }
624 +
625 + void ContextMenuAddKey(Vector3 hit, bool createOnCurve)
626 + {
627 + SerializedObject serializedObject = null;
628 +
629 + foreach (var curve in m_Curves)
630 + {
631 + if (!curve.Value.editable || !curve.Value.visible)
632 + continue;
633 +
634 + var prop = curve.Key;
635 + var state = curve.Value;
636 +
637 + if (serializedObject == null)
638 + {
639 + serializedObject = prop.serializedObject;
640 + serializedObject.Update();
641 + }
642 +
643 + var animCurve = prop.animationCurveValue;
644 + EditCreateKeyframe(animCurve, hit, createOnCurve, state.zeroKeyConstantValue);
645 + SaveCurve(prop, animCurve);
646 + }
647 +
648 + if (serializedObject != null)
649 + serializedObject.ApplyModifiedProperties();
650 +
651 + Invalidate();
652 + }
653 +
654 + void EditCreateKeyframe(AnimationCurve curve, Vector3 position, bool createOnCurve, float zeroKeyConstantValue)
655 + {
656 + float tangent = EvaluateTangent(curve, position.x);
657 +
658 + if (createOnCurve)
659 + {
660 + position.y = curve.length == 0
661 + ? zeroKeyConstantValue
662 + : curve.Evaluate(position.x);
663 + }
664 +
665 + AddKeyframe(curve, new Keyframe(position.x, position.y, tangent, tangent));
666 + }
667 +
668 + void EditDeleteKeyframe(AnimationCurve curve, int keyframeIndex)
669 + {
670 + RemoveKeyframe(curve, keyframeIndex);
671 + }
672 +
673 + void AddKeyframe(AnimationCurve curve, Keyframe newValue)
674 + {
675 + curve.AddKey(newValue);
676 + Invalidate();
677 + }
678 +
679 + void RemoveKeyframe(AnimationCurve curve, int keyframeIndex)
680 + {
681 + curve.RemoveKey(keyframeIndex);
682 + Invalidate();
683 + }
684 +
685 + void SetKeyframe(AnimationCurve curve, int keyframeIndex, Keyframe newValue)
686 + {
687 + var keys = curve.keys;
688 +
689 + if (keyframeIndex > 0)
690 + newValue.time = Mathf.Max(keys[keyframeIndex - 1].time + settings.keyTimeClampingDistance, newValue.time);
691 +
692 + if (keyframeIndex < keys.Length - 1)
693 + newValue.time = Mathf.Min(keys[keyframeIndex + 1].time - settings.keyTimeClampingDistance, newValue.time);
694 +
695 + curve.MoveKey(keyframeIndex, newValue);
696 + Invalidate();
697 + }
698 +
699 + void EditMoveKeyframe(AnimationCurve curve, Keyframe[] keys, int keyframeIndex)
700 + {
701 + var key = CanvasToCurve(Event.current.mousePosition);
702 + float inTgt = keys[keyframeIndex].inTangent;
703 + float outTgt = keys[keyframeIndex].outTangent;
704 + SetKeyframe(curve, keyframeIndex, new Keyframe(key.x, key.y, inTgt, outTgt));
705 + }
706 +
707 + void EditMoveTangent(AnimationCurve curve, Keyframe[] keys, int keyframeIndex, Tangent targetTangent, bool linkTangents)
708 + {
709 + var pos = CanvasToCurve(Event.current.mousePosition);
710 +
711 + float time = keys[keyframeIndex].time;
712 + float value = keys[keyframeIndex].value;
713 +
714 + pos -= new Vector3(time, value);
715 +
716 + if (targetTangent == Tangent.In && pos.x > 0f)
717 + pos.x = 0f;
718 +
719 + if (targetTangent == Tangent.Out && pos.x < 0f)
720 + pos.x = 0f;
721 +
722 + float tangent;
723 +
724 + if (Mathf.Approximately(pos.x, 0f))
725 + tangent = pos.y < 0f ? float.PositiveInfinity : float.NegativeInfinity;
726 + else
727 + tangent = pos.y / pos.x;
728 +
729 + float inTangent = keys[keyframeIndex].inTangent;
730 + float outTangent = keys[keyframeIndex].outTangent;
731 +
732 + if (targetTangent == Tangent.In || linkTangents)
733 + inTangent = tangent;
734 + if (targetTangent == Tangent.Out || linkTangents)
735 + outTangent = tangent;
736 +
737 + SetKeyframe(curve, keyframeIndex, new Keyframe(time, value, inTangent, outTangent));
738 + }
739 +
740 + #endregion
741 +
742 + #region Maths utilities
743 +
744 + Vector3 CurveToCanvas(Keyframe keyframe)
745 + {
746 + return CurveToCanvas(new Vector3(keyframe.time, keyframe.value));
747 + }
748 +
749 + Vector3 CurveToCanvas(Vector3 position)
750 + {
751 + var bounds = settings.bounds;
752 + var output = new Vector3((position.x - bounds.x) / (bounds.xMax - bounds.x), (position.y - bounds.y) / (bounds.yMax - bounds.y));
753 + output.x = output.x * (m_CurveArea.xMax - m_CurveArea.xMin) + m_CurveArea.xMin;
754 + output.y = (1f - output.y) * (m_CurveArea.yMax - m_CurveArea.yMin) + m_CurveArea.yMin;
755 + return output;
756 + }
757 +
758 + Vector3 CanvasToCurve(Vector3 position)
759 + {
760 + var bounds = settings.bounds;
761 + var output = position;
762 + output.x = (output.x - m_CurveArea.xMin) / (m_CurveArea.xMax - m_CurveArea.xMin);
763 + output.y = (output.y - m_CurveArea.yMin) / (m_CurveArea.yMax - m_CurveArea.yMin);
764 + output.x = Mathf.Lerp(bounds.x, bounds.xMax, output.x);
765 + output.y = Mathf.Lerp(bounds.yMax, bounds.y, output.y);
766 + return output;
767 + }
768 +
769 + Vector3 CurveTangentToCanvas(float tangent)
770 + {
771 + if (!float.IsInfinity(tangent))
772 + {
773 + var bounds = settings.bounds;
774 + float ratio = (m_CurveArea.width / m_CurveArea.height) / ((bounds.xMax - bounds.x) / (bounds.yMax - bounds.y));
775 + return new Vector3(1f, -tangent / ratio).normalized;
776 + }
777 +
778 + return float.IsPositiveInfinity(tangent) ? Vector3.up : Vector3.down;
779 + }
780 +
781 + Vector3[] BezierSegment(Keyframe start, Keyframe end)
782 + {
783 + var segment = new Vector3[4];
784 +
785 + segment[0] = CurveToCanvas(new Vector3(start.time, start.value));
786 + segment[3] = CurveToCanvas(new Vector3(end.time, end.value));
787 +
788 + float middle = start.time + ((end.time - start.time) * 0.333333f);
789 + float middle2 = start.time + ((end.time - start.time) * 0.666666f);
790 +
791 + segment[1] = CurveToCanvas(new Vector3(middle, ProjectTangent(start.time, start.value, start.outTangent, middle)));
792 + segment[2] = CurveToCanvas(new Vector3(middle2, ProjectTangent(end.time, end.value, end.inTangent, middle2)));
793 +
794 + return segment;
795 + }
796 +
797 + Vector3[] HardSegment(Keyframe start, Keyframe end)
798 + {
799 + var segment = new Vector3[3];
800 +
801 + segment[0] = CurveToCanvas(start);
802 + segment[1] = CurveToCanvas(new Vector3(end.time, start.value));
803 + segment[2] = CurveToCanvas(end);
804 +
805 + return segment;
806 + }
807 +
808 + float ProjectTangent(float inPosition, float inValue, float inTangent, float projPosition)
809 + {
810 + return inValue + ((projPosition - inPosition) * inTangent);
811 + }
812 +
813 + float EvaluateTangent(AnimationCurve curve, float time)
814 + {
815 + int prev = -1, next = 0;
816 + for (int i = 0; i < curve.keys.Length; i++)
817 + {
818 + if (time > curve.keys[i].time)
819 + {
820 + prev = i;
821 + next = i + 1;
822 + }
823 + else break;
824 + }
825 +
826 + if (next == 0)
827 + return 0f;
828 +
829 + if (prev == curve.keys.Length - 1)
830 + return 0f;
831 +
832 + const float kD = 1e-3f;
833 + float tp = Mathf.Max(time - kD, curve.keys[prev].time);
834 + float tn = Mathf.Min(time + kD, curve.keys[next].time);
835 +
836 + float vp = curve.Evaluate(tp);
837 + float vn = curve.Evaluate(tn);
838 +
839 + if (Mathf.Approximately(tn, tp))
840 + return (vn - vp > 0f) ? float.PositiveInfinity : float.NegativeInfinity;
841 +
842 + return (vn - vp) / (tn - tp);
843 + }
844 +
845 + #endregion
846 + }
847 +}
1 +fileFormatVersion: 2
2 +guid: afb349ef0bffd144db2bdd25630f648e
3 +timeCreated: 1472650750
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: 7226e17fa48c86148a3d15584e21b4cb
3 +timeCreated: 1460477750
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +fileFormatVersion: 2
2 +guid: a66d7b0165140a1439be89b5afc000fb
3 +timeCreated: 1476177015
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
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 +}
1 +fileFormatVersion: 2
2 +guid: 8f31cf52f05e80c4ea48570d0c3c8f59
3 +timeCreated: 1461744717
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +using System.Collections.Generic;
3 +using System.Linq.Expressions;
4 +using System.Reflection;
5 +using System.Text;
6 +
7 +namespace UnityEditor.PostProcessing
8 +{
9 + public static class ReflectionUtils
10 + {
11 + static Dictionary<KeyValuePair<object, string>, FieldInfo> s_FieldInfoFromPaths = new Dictionary<KeyValuePair<object, string>, FieldInfo>();
12 +
13 + public static FieldInfo GetFieldInfoFromPath(object source, string path)
14 + {
15 + FieldInfo field = null;
16 + var kvp = new KeyValuePair<object, string>(source, path);
17 +
18 + if (!s_FieldInfoFromPaths.TryGetValue(kvp, out field))
19 + {
20 + var splittedPath = path.Split('.');
21 + var type = source.GetType();
22 +
23 + foreach (var t in splittedPath)
24 + {
25 + field = type.GetField(t, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
26 +
27 + if (field == null)
28 + break;
29 +
30 + type = field.FieldType;
31 + }
32 +
33 + s_FieldInfoFromPaths.Add(kvp, field);
34 + }
35 +
36 + return field;
37 + }
38 +
39 + public static string GetFieldPath<T, TValue>(Expression<Func<T, TValue>> expr)
40 + {
41 + MemberExpression me;
42 + switch (expr.Body.NodeType)
43 + {
44 + case ExpressionType.Convert:
45 + case ExpressionType.ConvertChecked:
46 + var ue = expr.Body as UnaryExpression;
47 + me = (ue != null ? ue.Operand : null) as MemberExpression;
48 + break;
49 + default:
50 + me = expr.Body as MemberExpression;
51 + break;
52 + }
53 +
54 + var members = new List<string>();
55 + while (me != null)
56 + {
57 + members.Add(me.Member.Name);
58 + me = me.Expression as MemberExpression;
59 + }
60 +
61 + var sb = new StringBuilder();
62 + for (int i = members.Count - 1; i >= 0; i--)
63 + {
64 + sb.Append(members[i]);
65 + if (i > 0) sb.Append('.');
66 + }
67 +
68 + return sb.ToString();
69 + }
70 +
71 + public static object GetFieldValue(object source, string name)
72 + {
73 + var type = source.GetType();
74 +
75 + while (type != null)
76 + {
77 + var f = type.GetField(name, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
78 + if (f != null)
79 + return f.GetValue(source);
80 +
81 + type = type.BaseType;
82 + }
83 +
84 + return null;
85 + }
86 +
87 + public static object GetFieldValueFromPath(object source, ref Type baseType, string path)
88 + {
89 + var splittedPath = path.Split('.');
90 + object srcObject = source;
91 +
92 + foreach (var t in splittedPath)
93 + {
94 + var fieldInfo = baseType.GetField(t, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
95 +
96 + if (fieldInfo == null)
97 + {
98 + baseType = null;
99 + break;
100 + }
101 +
102 + baseType = fieldInfo.FieldType;
103 + srcObject = GetFieldValue(srcObject, t);
104 + }
105 +
106 + return baseType == null
107 + ? null
108 + : srcObject;
109 + }
110 +
111 + public static object GetParentObject(string path, object obj)
112 + {
113 + var fields = path.Split('.');
114 +
115 + if (fields.Length == 1)
116 + return obj;
117 +
118 + var info = obj.GetType().GetField(fields[0], BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
119 + obj = info.GetValue(obj);
120 +
121 + return GetParentObject(string.Join(".", fields, 1, fields.Length - 1), obj);
122 + }
123 + }
124 +}
1 +fileFormatVersion: 2
2 +guid: 71f7e805a7fc35046afbcf5c2639d116
3 +timeCreated: 1466604313
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 52380717b4884c04ebc31c46dda84909
3 +folderAsset: yes
4 +timeCreated: 1466585230
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 2be7cf05ee8fb17438022d4869299900
3 +folderAsset: yes
4 +timeCreated: 1485107615
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Creative Commons Legal Code
2 +
3 +CC0 1.0 Universal
4 +
5 + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6 + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7 + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8 + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9 + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10 + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11 + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12 + HEREUNDER.
13 +
14 +Statement of Purpose
15 +
16 +The laws of most jurisdictions throughout the world automatically confer
17 +exclusive Copyright and Related Rights (defined below) upon the creator
18 +and subsequent owner(s) (each and all, an "owner") of an original work of
19 +authorship and/or a database (each, a "Work").
20 +
21 +Certain owners wish to permanently relinquish those rights to a Work for
22 +the purpose of contributing to a commons of creative, cultural and
23 +scientific works ("Commons") that the public can reliably and without fear
24 +of later claims of infringement build upon, modify, incorporate in other
25 +works, reuse and redistribute as freely as possible in any form whatsoever
26 +and for any purposes, including without limitation commercial purposes.
27 +These owners may contribute to the Commons to promote the ideal of a free
28 +culture and the further production of creative, cultural and scientific
29 +works, or to gain reputation or greater distribution for their Work in
30 +part through the use and efforts of others.
31 +
32 +For these and/or other purposes and motivations, and without any
33 +expectation of additional consideration or compensation, the person
34 +associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35 +is an owner of Copyright and Related Rights in the Work, voluntarily
36 +elects to apply CC0 to the Work and publicly distribute the Work under its
37 +terms, with knowledge of his or her Copyright and Related Rights in the
38 +Work and the meaning and intended legal effect of CC0 on those rights.
39 +
40 +1. Copyright and Related Rights. A Work made available under CC0 may be
41 +protected by copyright and related or neighboring rights ("Copyright and
42 +Related Rights"). Copyright and Related Rights include, but are not
43 +limited to, the following:
44 +
45 + i. the right to reproduce, adapt, distribute, perform, display,
46 + communicate, and translate a Work;
47 + ii. moral rights retained by the original author(s) and/or performer(s);
48 +iii. publicity and privacy rights pertaining to a person's image or
49 + likeness depicted in a Work;
50 + iv. rights protecting against unfair competition in regards to a Work,
51 + subject to the limitations in paragraph 4(a), below;
52 + v. rights protecting the extraction, dissemination, use and reuse of data
53 + in a Work;
54 + vi. database rights (such as those arising under Directive 96/9/EC of the
55 + European Parliament and of the Council of 11 March 1996 on the legal
56 + protection of databases, and under any national implementation
57 + thereof, including any amended or successor version of such
58 + directive); and
59 +vii. other similar, equivalent or corresponding rights throughout the
60 + world based on applicable law or treaty, and any national
61 + implementations thereof.
62 +
63 +2. Waiver. To the greatest extent permitted by, but not in contravention
64 +of, applicable law, Affirmer hereby overtly, fully, permanently,
65 +irrevocably and unconditionally waives, abandons, and surrenders all of
66 +Affirmer's Copyright and Related Rights and associated claims and causes
67 +of action, whether now known or unknown (including existing as well as
68 +future claims and causes of action), in the Work (i) in all territories
69 +worldwide, (ii) for the maximum duration provided by applicable law or
70 +treaty (including future time extensions), (iii) in any current or future
71 +medium and for any number of copies, and (iv) for any purpose whatsoever,
72 +including without limitation commercial, advertising or promotional
73 +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74 +member of the public at large and to the detriment of Affirmer's heirs and
75 +successors, fully intending that such Waiver shall not be subject to
76 +revocation, rescission, cancellation, termination, or any other legal or
77 +equitable action to disrupt the quiet enjoyment of the Work by the public
78 +as contemplated by Affirmer's express Statement of Purpose.
79 +
80 +3. Public License Fallback. Should any part of the Waiver for any reason
81 +be judged legally invalid or ineffective under applicable law, then the
82 +Waiver shall be preserved to the maximum extent permitted taking into
83 +account Affirmer's express Statement of Purpose. In addition, to the
84 +extent the Waiver is so judged Affirmer hereby grants to each affected
85 +person a royalty-free, non transferable, non sublicensable, non exclusive,
86 +irrevocable and unconditional license to exercise Affirmer's Copyright and
87 +Related Rights in the Work (i) in all territories worldwide, (ii) for the
88 +maximum duration provided by applicable law or treaty (including future
89 +time extensions), (iii) in any current or future medium and for any number
90 +of copies, and (iv) for any purpose whatsoever, including without
91 +limitation commercial, advertising or promotional purposes (the
92 +"License"). The License shall be deemed effective as of the date CC0 was
93 +applied by Affirmer to the Work. Should any part of the License for any
94 +reason be judged legally invalid or ineffective under applicable law, such
95 +partial invalidity or ineffectiveness shall not invalidate the remainder
96 +of the License, and in such case Affirmer hereby affirms that he or she
97 +will not (i) exercise any of his or her remaining Copyright and Related
98 +Rights in the Work or (ii) assert any associated claims and causes of
99 +action with respect to the Work, in either case contrary to Affirmer's
100 +express Statement of Purpose.
101 +
102 +4. Limitations and Disclaimers.
103 +
104 + a. No trademark or patent rights held by Affirmer are waived, abandoned,
105 + surrendered, licensed or otherwise affected by this document.
106 + b. Affirmer offers the Work as-is and makes no representations or
107 + warranties of any kind concerning the Work, express, implied,
108 + statutory or otherwise, including without limitation warranties of
109 + title, merchantability, fitness for a particular purpose, non
110 + infringement, or the absence of latent or other defects, accuracy, or
111 + the present or absence of errors, whether or not discoverable, all to
112 + the greatest extent permissible under applicable law.
113 + c. Affirmer disclaims responsibility for clearing rights of other persons
114 + that may apply to the Work or any use thereof, including without
115 + limitation any person's Copyright and Related Rights in the Work.
116 + Further, Affirmer disclaims responsibility for obtaining any necessary
117 + consents, permissions or other rights required for any use of the
118 + Work.
119 + d. Affirmer understands and acknowledges that Creative Commons is not a
120 + party to this document and has no duty or obligation with respect to
121 + this CC0 or use of the Work.
1 +fileFormatVersion: 2
2 +guid: fa3fc398fe396744c9299e70b63bfdd7
3 +timeCreated: 1485181015
4 +licenseType: Store
5 +TextScriptImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 50b54341495978843a6f85583ed4417d
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 3c2f1fb7e4b66e74191b7c328ada52d9
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: afe1e502240079342a0a980484b6da8b
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 771903fe7b4674445829e52e91cff019
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 980acadb960f8424c94307ec0e585b4e
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 68613e6a221be1a4b9f31d7fa1c2d1bf
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: f6439b54b28f3884eb67579dec0b6f21
3 +timeCreated: 1485107929
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 2ee161d8945169243b5698fec114e1b7
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 153f7d6dfbe713d4884df0f1e243ba92
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: bf95b6fdc179b0e4f890c841406193fc
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 74aca53eb7273624baffc2bf5e5cc173
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 729a3ae164bcb3b4380459386adcf331
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: a469f920b21fc7c4fb5b950917ce2fb2
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 6dda07f1420a968449cf4c6620c44d9f
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: b7f000750830ddb4bbc80065b9314ce9
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: df01d03f056c6f445b4b8a0ae054207c
3 +timeCreated: 1485107929
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: bfe953600e8fb1849a804ee08ace7b4c
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 32c6a5f7143b86c44bd5cdee2ff3f8ad
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: f4b8ab78b57749d4e96d36f6d8a395d0
3 +timeCreated: 1485107929
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 09f6c01f98a3ded4daf1afc52a3c260f
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: bdd06fb88ef36ed4a85dd506352c2d80
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 02c0a84bd64c6f044954d8bde9b46ec8
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: aa80dc44aa4fe4c43bb9d51d90cf2958
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 373f9bf6b0841af4ebf26d25e4a3f4e2
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 0fa10b21877c61b4db40ba5708815f81
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 6b0a189df0bd4d5448eaefb4e673ace8
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 87a5e40cc271ea648b583616f6ebe7fe
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: b71bb466b71fd13449dd736f63caeb67
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 319b8e66db3faa4438cf6982e9c89b2f
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 0a79c155edf9b2d429d4736abee5acdb
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 351e95d0e20a54849bd4ce5f9b498934
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 1d6958e30e40a254dbe5a54c573eeb3c
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 9660a4ca1ca8425408ac25c641932977
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 547dbd5f858c74047ba3f213e4408307
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 6fa5cf178eaaa5f42b820f636bb6e0bd
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 1a9ce5640cde5934aae0022f020464a6
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: cd9006dc442cc244e89b3f492384d46a
3 +timeCreated: 1485107929
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: b266511438fae724f9d3ce6bd26583e8
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 71bc1b6b66e8b784b972199b7e90204e
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 15e54aa23a938444389469d53765d741
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: b9960364038cbfa4aa49d7b2032d3110
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 8ecbbcae4cc747a4abbc4adce795d25e
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 1378a33cdd085d64c9da863d2484ff21
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: aff59c63d25d43f4c938f248837c30fb
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 3f7c3687170b90e4a8d2ee6b142670f4
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: a1ae041906217ae44a774d4ca139af50
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: d8c290e38ff0425409d0ae6a98c95e41
3 +timeCreated: 1485107929
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: d5a51525b27e3ee4aadbeb39cbcf0750
3 +timeCreated: 1485107929
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: d2e8e90fac2e6a341a38e1c3963c218d
3 +timeCreated: 1485107929
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: c94b57b5a32a22d43ade66e09f6a4bd2
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 936dea238abb0864ab3985a995e16a29
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 5e542d0126a2c7848b66bffc428905fd
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 70f23eaf7d8ae9147aa542d20e93733b
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: e138166e7a7c70f49943be7edda35d35
3 +timeCreated: 1485107929
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 85a45a6d8b2ffb84987d2b028ecfb220
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: d96974690c77f50489eb60ec84bd8dac
3 +timeCreated: 1485107929
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 79b86f3419b87f3429164a956da8cfab
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 404fa8def46b1c447817e1ebdaa7144e
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 119591e0bb084e848835d237546b3882
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: a03c400b0e3959f428ee99dfc6cfc263
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 4a11d65ce13d5f542a0ff136cc2f3fba
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 3ac02e7e783571c468f9c086d2384ba7
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: c55042318a938344ab23cd7f09dd0076
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 71583cfd8899717428d5b1a95fa39cda
3 +timeCreated: 1485107928
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: 0
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 0
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 2
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 10
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 64
55 + textureFormat: -1
56 + textureCompression: 0
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 64
63 + textureFormat: -1
64 + textureCompression: 0
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +To the extent possible under law, Christoph Peters has waived all copyright and
2 +related or neighboring rights to the files in this directory and its
3 +subdirectories. This work is published from: Germany.
4 +
5 +The work is made available under the terms of the Creative Commons CC0 Public
6 +Domain Dedication.
7 +
8 +For more information please visit:
9 +https://creativecommons.org/publicdomain/zero/1.0/
1 +fileFormatVersion: 2
2 +guid: 48ffda675aa0afa4f9eec3a5d5487aeb
3 +timeCreated: 1485181015
4 +licenseType: Store
5 +TextScriptImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: e039bcc30d13c9341aa224f4e89f21b3
3 +folderAsset: yes
4 +timeCreated: 1462199729
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +#ifndef __ACES__
2 +#define __ACES__
3 +
4 +/**
5 + * https://github.com/ampas/aces-dev
6 + *
7 + * Academy Color Encoding System (ACES) software and tools are provided by the
8 + * Academy under the following terms and conditions: A worldwide, royalty-free,
9 + * non-exclusive right to copy, modify, create derivatives, and use, in source and
10 + * binary forms, is hereby granted, subject to acceptance of this license.
11 + *
12 + * Copyright 2015 Academy of Motion Picture Arts and Sciences (A.M.P.A.S.).
13 + * Portions contributed by others as indicated. All rights reserved.
14 + *
15 + * Performance of any of the aforementioned acts indicates acceptance to be bound
16 + * by the following terms and conditions:
17 + *
18 + * * Copies of source code, in whole or in part, must retain the above copyright
19 + * notice, this list of conditions and the Disclaimer of Warranty.
20 + *
21 + * * Use in binary form must retain the above copyright notice, this list of
22 + * conditions and the Disclaimer of Warranty in the documentation and/or other
23 + * materials provided with the distribution.
24 + *
25 + * * Nothing in this license shall be deemed to grant any rights to trademarks,
26 + * copyrights, patents, trade secrets or any other intellectual property of
27 + * A.M.P.A.S. or any contributors, except as expressly stated herein.
28 + *
29 + * * Neither the name "A.M.P.A.S." nor the name of any other contributors to this
30 + * software may be used to endorse or promote products derivative of or based on
31 + * this software without express prior written permission of A.M.P.A.S. or the
32 + * contributors, as appropriate.
33 + *
34 + * This license shall be construed pursuant to the laws of the State of
35 + * California, and any disputes related thereto shall be subject to the
36 + * jurisdiction of the courts therein.
37 + *
38 + * Disclaimer of Warranty: THIS SOFTWARE IS PROVIDED BY A.M.P.A.S. AND CONTRIBUTORS
39 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
40 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
41 + * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL A.M.P.A.S., OR ANY
42 + * CONTRIBUTORS OR DISTRIBUTORS, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 + * SPECIAL, EXEMPLARY, RESITUTIONARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
45 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
46 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
47 + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
48 + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 + *
50 + * WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE ACADEMY SPECIFICALLY
51 + * DISCLAIMS ANY REPRESENTATIONS OR WARRANTIES WHATSOEVER RELATED TO PATENT OR
52 + * OTHER INTELLECTUAL PROPERTY RIGHTS IN THE ACADEMY COLOR ENCODING SYSTEM, OR
53 + * APPLICATIONS THEREOF, HELD BY PARTIES OTHER THAN A.M.P.A.S.,WHETHER DISCLOSED OR
54 + * UNDISCLOSED.
55 + */
56 +
57 +//#define CUSTOM_WHITE_POINT
58 +
59 +/*
60 + Basic usage :
61 +
62 + half4 color = tex2D(_MainTex, i.uv);
63 + half3 aces = unity_to_ACES(color.rgb);
64 + half3 oces = RRT(aces);
65 + half3 odt = ODT_RGBmonitor_100nits_dim(oces);
66 + return half4(odt, color.a);
67 +
68 + If you want to customize the white point, uncomment the previous define and set uniforms accordingly:
69 +
70 + float whitePoint = 48f; // Default ACES value
71 + material.SetFloat("CINEMA_WHITE", whitePoint);
72 + material.SetFloat("CINEMA_DARK", whitePoint / 2400f);
73 + */
74 +
75 +#include "Common.cginc"
76 +
77 +#define ACEScc_MAX 1.4679964
78 +#define ACEScc_MIDGRAY 0.4135884
79 +
80 +//
81 +// Precomputed matrices (pre-transposed)
82 +// See https://github.com/ampas/aces-dev/blob/master/transforms/ctl/README-MATRIX.md
83 +//
84 +static const half3x3 sRGB_2_AP0 = {
85 + 0.4397010, 0.3829780, 0.1773350,
86 + 0.0897923, 0.8134230, 0.0967616,
87 + 0.0175440, 0.1115440, 0.8707040
88 +};
89 +
90 +static const half3x3 sRGB_2_AP1 = {
91 + 0.61319, 0.33951, 0.04737,
92 + 0.07021, 0.91634, 0.01345,
93 + 0.02062, 0.10957, 0.86961
94 +};
95 +
96 +static const half3x3 AP0_2_sRGB = {
97 + 2.52169, -1.13413, -0.38756,
98 + -0.27648, 1.37272, -0.09624,
99 + -0.01538, -0.15298, 1.16835,
100 +};
101 +
102 +static const half3x3 AP1_2_sRGB = {
103 + 1.70505, -0.62179, -0.08326,
104 + -0.13026, 1.14080, -0.01055,
105 + -0.02400, -0.12897, 1.15297,
106 +};
107 +
108 +static const half3x3 AP0_2_AP1_MAT = {
109 + 1.4514393161, -0.2365107469, -0.2149285693,
110 + -0.0765537734, 1.1762296998, -0.0996759264,
111 + 0.0083161484, -0.0060324498, 0.9977163014
112 +};
113 +
114 +static const half3x3 AP1_2_AP0_MAT = {
115 + 0.6954522414, 0.1406786965, 0.1638690622,
116 + 0.0447945634, 0.8596711185, 0.0955343182,
117 + -0.0055258826, 0.0040252103, 1.0015006723
118 +};
119 +
120 +static const half3x3 AP1_2_XYZ_MAT = {
121 + 0.6624541811, 0.1340042065, 0.1561876870,
122 + 0.2722287168, 0.6740817658, 0.0536895174,
123 + -0.0055746495, 0.0040607335, 1.0103391003
124 +};
125 +
126 +static const half3x3 XYZ_2_AP1_MAT = {
127 + 1.6410233797, -0.3248032942, -0.2364246952,
128 + -0.6636628587, 1.6153315917, 0.0167563477,
129 + 0.0117218943, -0.0082844420, 0.9883948585
130 +};
131 +
132 +static const half3x3 XYZ_2_REC709_MAT = {
133 + 3.2409699419, -1.5373831776, -0.4986107603,
134 + -0.9692436363, 1.8759675015, 0.0415550574,
135 + 0.0556300797, -0.2039769589, 1.0569715142
136 +};
137 +
138 +static const half3x3 XYZ_2_REC2020_MAT = {
139 + 1.7166511880, -0.3556707838, -0.2533662814,
140 + -0.6666843518, 1.6164812366, 0.0157685458,
141 + 0.0176398574, -0.0427706133, 0.9421031212
142 +};
143 +
144 +static const half3x3 XYZ_2_DCIP3_MAT = {
145 + 2.7253940305, -1.0180030062, -0.4401631952,
146 + -0.7951680258, 1.6897320548, 0.0226471906,
147 + 0.0412418914, -0.0876390192, 1.1009293786
148 +};
149 +
150 +static const half3 AP1_RGB2Y = half3(0.272229, 0.674082, 0.0536895);
151 +
152 +static const half3x3 RRT_SAT_MAT = {
153 + 0.9708890, 0.0269633, 0.00214758,
154 + 0.0108892, 0.9869630, 0.00214758,
155 + 0.0108892, 0.0269633, 0.96214800
156 +};
157 +
158 +static const half3x3 ODT_SAT_MAT = {
159 + 0.949056, 0.0471857, 0.00375827,
160 + 0.019056, 0.9771860, 0.00375827,
161 + 0.019056, 0.0471857, 0.93375800
162 +};
163 +
164 +static const half3x3 D60_2_D65_CAT = {
165 + 0.98722400, -0.00611327, 0.0159533,
166 + -0.00759836, 1.00186000, 0.0053302,
167 + 0.00307257, -0.00509595, 1.0816800
168 +};
169 +
170 +//
171 +// Unity to ACES
172 +//
173 +// converts Unity raw (sRGB primaries) to
174 +// ACES2065-1 (AP0 w/ linear encoding)
175 +//
176 +half3 unity_to_ACES(half3 x)
177 +{
178 + x = mul(sRGB_2_AP0, x);
179 + return x;
180 +}
181 +
182 +//
183 +// ACES to Unity
184 +//
185 +// converts ACES2065-1 (AP0 w/ linear encoding)
186 +// Unity raw (sRGB primaries) to
187 +//
188 +half3 ACES_to_unity(half3 x)
189 +{
190 + x = mul(AP0_2_sRGB, x);
191 + return x;
192 +}
193 +
194 +//
195 +// Unity to ACEScg
196 +//
197 +// converts Unity raw (sRGB primaries) to
198 +// ACEScg (AP1 w/ linear encoding)
199 +//
200 +half3 unity_to_ACEScg(half3 x)
201 +{
202 + x = mul(sRGB_2_AP1, x);
203 + return x;
204 +}
205 +
206 +//
207 +// ACEScg to Unity
208 +//
209 +// converts ACEScg (AP1 w/ linear encoding) to
210 +// Unity raw (sRGB primaries)
211 +//
212 +half3 ACEScg_to_unity(half3 x)
213 +{
214 + x = mul(AP1_2_sRGB, x);
215 + return x;
216 +}
217 +
218 +//
219 +// ACES Color Space Conversion - ACES to ACEScc
220 +//
221 +// converts ACES2065-1 (AP0 w/ linear encoding) to
222 +// ACEScc (AP1 w/ logarithmic encoding)
223 +//
224 +// This transform follows the formulas from section 4.4 in S-2014-003
225 +//
226 +half ACES_to_ACEScc(half x)
227 +{
228 + if (x <= 0.0)
229 + return -0.35828683; // = (log2(pow(2.0, -15.0) * 0.5) + 9.72) / 17.52
230 + else if (x < pow(2.0, -15.0))
231 + return (log2(pow(2.0, -16.0) + x * 0.5) + 9.72) / 17.52;
232 + else // (x >= pow(2.0, -15.0))
233 + return (log2(x) + 9.72) / 17.52;
234 +}
235 +
236 +half3 ACES_to_ACEScc(half3 x)
237 +{
238 + x = clamp(x, 0.0, HALF_MAX);
239 +
240 + // x is clamped to [0, HALF_MAX], skip the <= 0 check
241 + return (x < 0.00003051757) ? (log2(0.00001525878 + x * 0.5) + 9.72) / 17.52 : (log2(x) + 9.72) / 17.52;
242 +
243 + /*
244 + return half3(
245 + ACES_to_ACEScc(x.r),
246 + ACES_to_ACEScc(x.g),
247 + ACES_to_ACEScc(x.b)
248 + );
249 + */
250 +}
251 +
252 +//
253 +// ACES Color Space Conversion - ACEScc to ACES
254 +//
255 +// converts ACEScc (AP1 w/ ACESlog encoding) to
256 +// ACES2065-1 (AP0 w/ linear encoding)
257 +//
258 +// This transform follows the formulas from section 4.4 in S-2014-003
259 +//
260 +half ACEScc_to_ACES(half x)
261 +{
262 + // TODO: Optimize me
263 + if (x < -0.3013698630) // (9.72 - 15) / 17.52
264 + return (pow(2.0, x * 17.52 - 9.72) - pow(2.0, -16.0)) * 2.0;
265 + else if (x < (log2(HALF_MAX) + 9.72) / 17.52)
266 + return pow(2.0, x * 17.52 - 9.72);
267 + else // (x >= (log2(HALF_MAX) + 9.72) / 17.52)
268 + return HALF_MAX;
269 +}
270 +
271 +half3 ACEScc_to_ACES(half3 x)
272 +{
273 + return half3(
274 + ACEScc_to_ACES(x.r),
275 + ACEScc_to_ACES(x.g),
276 + ACEScc_to_ACES(x.b)
277 + );
278 +}
279 +
280 +//
281 +// ACES Color Space Conversion - ACES to ACEScg
282 +//
283 +// converts ACES2065-1 (AP0 w/ linear encoding) to
284 +// ACEScg (AP1 w/ linear encoding)
285 +//
286 +half3 ACES_to_ACEScg(half3 x)
287 +{
288 + return mul(AP0_2_AP1_MAT, x);
289 +}
290 +
291 +//
292 +// ACES Color Space Conversion - ACEScg to ACES
293 +//
294 +// converts ACEScg (AP1 w/ linear encoding) to
295 +// ACES2065-1 (AP0 w/ linear encoding)
296 +//
297 +half3 ACEScg_to_ACES(half3 x)
298 +{
299 + return mul(AP1_2_AP0_MAT, x);
300 +}
301 +
302 +//
303 +// Reference Rendering Transform (RRT)
304 +//
305 +// Input is ACES
306 +// Output is OCES
307 +//
308 +half rgb_2_saturation(half3 rgb)
309 +{
310 + const half TINY = 1e-10;
311 + half mi = Min3(rgb);
312 + half ma = Max3(rgb);
313 + return (max(ma, TINY) - max(mi, TINY)) / max(ma, 1e-2);
314 +}
315 +
316 +half rgb_2_yc(half3 rgb)
317 +{
318 + const half ycRadiusWeight = 1.75;
319 +
320 + // Converts RGB to a luminance proxy, here called YC
321 + // YC is ~ Y + K * Chroma
322 + // Constant YC is a cone-shaped surface in RGB space, with the tip on the
323 + // neutral axis, towards white.
324 + // YC is normalized: RGB 1 1 1 maps to YC = 1
325 + //
326 + // ycRadiusWeight defaults to 1.75, although can be overridden in function
327 + // call to rgb_2_yc
328 + // ycRadiusWeight = 1 -> YC for pure cyan, magenta, yellow == YC for neutral
329 + // of same value
330 + // ycRadiusWeight = 2 -> YC for pure red, green, blue == YC for neutral of
331 + // same value.
332 +
333 + half r = rgb.x;
334 + half g = rgb.y;
335 + half b = rgb.z;
336 + half chroma = sqrt(b * (b - g) + g * (g - r) + r * (r - b));
337 + return (b + g + r + ycRadiusWeight * chroma) / 3.0;
338 +}
339 +
340 +half rgb_2_hue(half3 rgb)
341 +{
342 + // Returns a geometric hue angle in degrees (0-360) based on RGB values.
343 + // For neutral colors, hue is undefined and the function will return a quiet NaN value.
344 + half hue;
345 + if (rgb.x == rgb.y && rgb.y == rgb.z)
346 + hue = 0.0; // RGB triplets where RGB are equal have an undefined hue
347 + else
348 + hue = (180.0 / UNITY_PI) * atan2(sqrt(3.0) * (rgb.y - rgb.z), 2.0 * rgb.x - rgb.y - rgb.z);
349 +
350 + if (hue < 0.0) hue = hue + 360.0;
351 +
352 + return hue;
353 +}
354 +
355 +half center_hue(half hue, half centerH)
356 +{
357 + half hueCentered = hue - centerH;
358 + if (hueCentered < -180.0) hueCentered = hueCentered + 360.0;
359 + else if (hueCentered > 180.0) hueCentered = hueCentered - 360.0;
360 + return hueCentered;
361 +}
362 +
363 +half sigmoid_shaper(half x)
364 +{
365 + // Sigmoid function in the range 0 to 1 spanning -2 to +2.
366 +
367 + half t = max(1.0 - abs(x / 2.0), 0.0);
368 + half y = 1.0 + sign(x) * (1.0 - t * t);
369 +
370 + return y / 2.0;
371 +}
372 +
373 +half glow_fwd(half ycIn, half glowGainIn, half glowMid)
374 +{
375 + half glowGainOut;
376 +
377 + if (ycIn <= 2.0 / 3.0 * glowMid)
378 + glowGainOut = glowGainIn;
379 + else if (ycIn >= 2.0 * glowMid)
380 + glowGainOut = 0.0;
381 + else
382 + glowGainOut = glowGainIn * (glowMid / ycIn - 1.0 / 2.0);
383 +
384 + return glowGainOut;
385 +}
386 +
387 +/*
388 +half cubic_basis_shaper
389 +(
390 + half x,
391 + half w // full base width of the shaper function (in degrees)
392 +)
393 +{
394 + half M[4][4] = {
395 + { -1.0 / 6, 3.0 / 6, -3.0 / 6, 1.0 / 6 },
396 + { 3.0 / 6, -6.0 / 6, 3.0 / 6, 0.0 / 6 },
397 + { -3.0 / 6, 0.0 / 6, 3.0 / 6, 0.0 / 6 },
398 + { 1.0 / 6, 4.0 / 6, 1.0 / 6, 0.0 / 6 }
399 + };
400 +
401 + half knots[5] = {
402 + -w / 2.0,
403 + -w / 4.0,
404 + 0.0,
405 + w / 4.0,
406 + w / 2.0
407 + };
408 +
409 + half y = 0.0;
410 + if ((x > knots[0]) && (x < knots[4]))
411 + {
412 + half knot_coord = (x - knots[0]) * 4.0 / w;
413 + int j = knot_coord;
414 + half t = knot_coord - j;
415 +
416 + half monomials[4] = { t*t*t, t*t, t, 1.0 };
417 +
418 + // (if/else structure required for compatibility with CTL < v1.5.)
419 + if (j == 3)
420 + {
421 + y = monomials[0] * M[0][0] + monomials[1] * M[1][0] +
422 + monomials[2] * M[2][0] + monomials[3] * M[3][0];
423 + }
424 + else if (j == 2)
425 + {
426 + y = monomials[0] * M[0][1] + monomials[1] * M[1][1] +
427 + monomials[2] * M[2][1] + monomials[3] * M[3][1];
428 + }
429 + else if (j == 1)
430 + {
431 + y = monomials[0] * M[0][2] + monomials[1] * M[1][2] +
432 + monomials[2] * M[2][2] + monomials[3] * M[3][2];
433 + }
434 + else if (j == 0)
435 + {
436 + y = monomials[0] * M[0][3] + monomials[1] * M[1][3] +
437 + monomials[2] * M[2][3] + monomials[3] * M[3][3];
438 + }
439 + else
440 + {
441 + y = 0.0;
442 + }
443 + }
444 +
445 + return y * 3.0 / 2.0;
446 +}
447 +*/
448 +
449 +static const half3x3 M = {
450 + 0.5, -1.0, 0.5,
451 + -1.0, 1.0, 0.0,
452 + 0.5, 0.5, 0.0
453 +};
454 +
455 +half segmented_spline_c5_fwd(half x)
456 +{
457 + const half coefsLow[6] = { -4.0000000000, -4.0000000000, -3.1573765773, -0.4852499958, 1.8477324706, 1.8477324706 }; // coefs for B-spline between minPoint and midPoint (units of log luminance)
458 + const half coefsHigh[6] = { -0.7185482425, 2.0810307172, 3.6681241237, 4.0000000000, 4.0000000000, 4.0000000000 }; // coefs for B-spline between midPoint and maxPoint (units of log luminance)
459 + const half2 minPoint = half2(0.18 * exp2(-15.0), 0.0001); // {luminance, luminance} linear extension below this
460 + const half2 midPoint = half2(0.18, 0.48); // {luminance, luminance}
461 + const half2 maxPoint = half2(0.18 * exp2(18.0), 10000.0); // {luminance, luminance} linear extension above this
462 + const half slopeLow = 0.0; // log-log slope of low linear extension
463 + const half slopeHigh = 0.0; // log-log slope of high linear extension
464 +
465 + const int N_KNOTS_LOW = 4;
466 + const int N_KNOTS_HIGH = 4;
467 +
468 + // Check for negatives or zero before taking the log. If negative or zero,
469 + // set to ACESMIN.1
470 + float xCheck = x;
471 + if (xCheck <= 0.0) xCheck = 0.00006103515; // = pow(2.0, -14.0);
472 +
473 + half logx = log10(xCheck);
474 + half logy;
475 +
476 + if (logx <= log10(minPoint.x))
477 + {
478 + logy = logx * slopeLow + (log10(minPoint.y) - slopeLow * log10(minPoint.x));
479 + }
480 + else if ((logx > log10(minPoint.x)) && (logx < log10(midPoint.x)))
481 + {
482 + half knot_coord = (N_KNOTS_LOW - 1) * (logx - log10(minPoint.x)) / (log10(midPoint.x) - log10(minPoint.x));
483 + int j = knot_coord;
484 + half t = knot_coord - j;
485 +
486 + half3 cf = half3(coefsLow[j], coefsLow[j + 1], coefsLow[j + 2]);
487 + half3 monomials = half3(t * t, t, 1.0);
488 + logy = dot(monomials, mul(M, cf));
489 + }
490 + else if ((logx >= log10(midPoint.x)) && (logx < log10(maxPoint.x)))
491 + {
492 + half knot_coord = (N_KNOTS_HIGH - 1) * (logx - log10(midPoint.x)) / (log10(maxPoint.x) - log10(midPoint.x));
493 + int j = knot_coord;
494 + half t = knot_coord - j;
495 +
496 + half3 cf = half3(coefsHigh[j], coefsHigh[j + 1], coefsHigh[j + 2]);
497 + half3 monomials = half3(t * t, t, 1.0);
498 + logy = dot(monomials, mul(M, cf));
499 + }
500 + else
501 + { //if (logIn >= log10(maxPoint.x)) {
502 + logy = logx * slopeHigh + (log10(maxPoint.y) - slopeHigh * log10(maxPoint.x));
503 + }
504 +
505 + return pow(10.0, logy);
506 +}
507 +
508 +half segmented_spline_c9_fwd(half x)
509 +{
510 + const half coefsLow[10] = { -1.6989700043, -1.6989700043, -1.4779000000, -1.2291000000, -0.8648000000, -0.4480000000, 0.0051800000, 0.4511080334, 0.9113744414, 0.9113744414 }; // coefs for B-spline between minPoint and midPoint (units of log luminance)
511 + const half coefsHigh[10] = { 0.5154386965, 0.8470437783, 1.1358000000, 1.3802000000, 1.5197000000, 1.5985000000, 1.6467000000, 1.6746091357, 1.6878733390, 1.6878733390 }; // coefs for B-spline between midPoint and maxPoint (units of log luminance)
512 + const half2 minPoint = half2(segmented_spline_c5_fwd(0.18 * exp2(-6.5)), 0.02); // {luminance, luminance} linear extension below this
513 + const half2 midPoint = half2(segmented_spline_c5_fwd(0.18), 4.8); // {luminance, luminance}
514 + const half2 maxPoint = half2(segmented_spline_c5_fwd(0.18 * exp2(6.5)), 48.0); // {luminance, luminance} linear extension above this
515 + const half slopeLow = 0.0; // log-log slope of low linear extension
516 + const half slopeHigh = 0.04; // log-log slope of high linear extension
517 +
518 + const int N_KNOTS_LOW = 8;
519 + const int N_KNOTS_HIGH = 8;
520 +
521 + // Check for negatives or zero before taking the log. If negative or zero,
522 + // set to OCESMIN.
523 + half xCheck = x;
524 + if (xCheck <= 0.0) xCheck = 1e-4;
525 +
526 + half logx = log10(xCheck);
527 + half logy;
528 +
529 + if (logx <= log10(minPoint.x))
530 + {
531 + logy = logx * slopeLow + (log10(minPoint.y) - slopeLow * log10(minPoint.x));
532 + }
533 + else if ((logx > log10(minPoint.x)) && (logx < log10(midPoint.x)))
534 + {
535 + half knot_coord = (N_KNOTS_LOW - 1) * (logx - log10(minPoint.x)) / (log10(midPoint.x) - log10(minPoint.x));
536 + int j = knot_coord;
537 + half t = knot_coord - j;
538 +
539 + half3 cf = half3(coefsLow[j], coefsLow[j + 1], coefsLow[j + 2]);
540 + half3 monomials = half3(t * t, t, 1.0);
541 + logy = dot(monomials, mul(M, cf));
542 + }
543 + else if ((logx >= log10(midPoint.x)) && (logx < log10(maxPoint.x)))
544 + {
545 + half knot_coord = (N_KNOTS_HIGH - 1) * (logx - log10(midPoint.x)) / (log10(maxPoint.x) - log10(midPoint.x));
546 + int j = knot_coord;
547 + half t = knot_coord - j;
548 +
549 + half3 cf = half3(coefsHigh[j], coefsHigh[j + 1], coefsHigh[j + 2]);
550 + half3 monomials = half3(t * t, t, 1.0);
551 + logy = dot(monomials, mul(M, cf));
552 + }
553 + else
554 + { //if (logIn >= log10(maxPoint.x)) {
555 + logy = logx * slopeHigh + (log10(maxPoint.y) - slopeHigh * log10(maxPoint.x));
556 + }
557 +
558 + return pow(10.0, logy);
559 +}
560 +
561 +static const half RRT_GLOW_GAIN = 0.05;
562 +static const half RRT_GLOW_MID = 0.08;
563 +
564 +static const half RRT_RED_SCALE = 0.82;
565 +static const half RRT_RED_PIVOT = 0.03;
566 +static const half RRT_RED_HUE = 0.0;
567 +static const half RRT_RED_WIDTH = 135.0;
568 +
569 +static const half RRT_SAT_FACTOR = 0.96;
570 +
571 +half3 RRT(half3 aces)
572 +{
573 + // --- Glow module --- //
574 + half saturation = rgb_2_saturation(aces);
575 + half ycIn = rgb_2_yc(aces);
576 + half s = sigmoid_shaper((saturation - 0.4) / 0.2);
577 + half addedGlow = 1.0 + glow_fwd(ycIn, RRT_GLOW_GAIN * s, RRT_GLOW_MID);
578 + aces *= addedGlow;
579 +
580 + // --- Red modifier --- //
581 + half hue = rgb_2_hue(aces);
582 + half centeredHue = center_hue(hue, RRT_RED_HUE);
583 + half hueWeight;
584 + {
585 + //hueWeight = cubic_basis_shaper(centeredHue, RRT_RED_WIDTH);
586 + hueWeight = smoothstep(0.0, 1.0, 1.0 - abs(2.0 * centeredHue / RRT_RED_WIDTH));
587 + hueWeight *= hueWeight;
588 + }
589 +
590 + aces.r += hueWeight * saturation * (RRT_RED_PIVOT - aces.r) * (1.0 - RRT_RED_SCALE);
591 +
592 + // --- ACES to RGB rendering space --- //
593 + aces = clamp(aces, 0.0, HALF_MAX); // avoids saturated negative colors from becoming positive in the matrix
594 + half3 rgbPre = mul(AP0_2_AP1_MAT, aces);
595 + rgbPre = clamp(rgbPre, 0, HALF_MAX);
596 +
597 + // --- Global desaturation --- //
598 + //rgbPre = mul(RRT_SAT_MAT, rgbPre);
599 + rgbPre = lerp(dot(rgbPre, AP1_RGB2Y).xxx, rgbPre, RRT_SAT_FACTOR.xxx);
600 +
601 + // --- Apply the tonescale independently in rendering-space RGB --- //
602 + half3 rgbPost;
603 + rgbPost.x = segmented_spline_c5_fwd(rgbPre.x);
604 + rgbPost.y = segmented_spline_c5_fwd(rgbPre.y);
605 + rgbPost.z = segmented_spline_c5_fwd(rgbPre.z);
606 +
607 + // --- RGB rendering space to OCES --- //
608 + half3 rgbOces = mul(AP1_2_AP0_MAT, rgbPost);
609 +
610 + return rgbOces;
611 +}
612 +
613 +//
614 +// Output Device Transform
615 +//
616 +half3 Y_2_linCV(half3 Y, half Ymax, half Ymin)
617 +{
618 + return (Y - Ymin) / (Ymax - Ymin);
619 +}
620 +
621 +half3 XYZ_2_xyY(half3 XYZ)
622 +{
623 + half divisor = max(dot(XYZ, (1.0).xxx), 1e-4);
624 + return half3(XYZ.xy / divisor, XYZ.y);
625 +}
626 +
627 +half3 xyY_2_XYZ(half3 xyY)
628 +{
629 + half m = xyY.z / max(xyY.y, 1e-4);
630 + half3 XYZ = half3(xyY.xz, (1.0 - xyY.x - xyY.y));
631 + XYZ.xz *= m;
632 + return XYZ;
633 +}
634 +
635 +static const half DIM_SURROUND_GAMMA = 0.9811;
636 +
637 +half3 darkSurround_to_dimSurround(half3 linearCV)
638 +{
639 + half3 XYZ = mul(AP1_2_XYZ_MAT, linearCV);
640 +
641 + half3 xyY = XYZ_2_xyY(XYZ);
642 + xyY.z = clamp(xyY.z, 0.0, HALF_MAX);
643 + xyY.z = pow(xyY.z, DIM_SURROUND_GAMMA);
644 + XYZ = xyY_2_XYZ(xyY);
645 +
646 + return mul(XYZ_2_AP1_MAT, XYZ);
647 +}
648 +
649 +half moncurve_r(half y, half gamma, half offs)
650 +{
651 + // Reverse monitor curve
652 + half x;
653 + const half yb = pow(offs * gamma / ((gamma - 1.0) * (1.0 + offs)), gamma);
654 + const half rs = pow((gamma - 1.0) / offs, gamma - 1.0) * pow((1.0 + offs) / gamma, gamma);
655 + if (y >= yb)
656 + x = (1.0 + offs) * pow(y, 1.0 / gamma) - offs;
657 + else
658 + x = y * rs;
659 + return x;
660 +}
661 +
662 +half bt1886_r(half L, half gamma, half Lw, half Lb)
663 +{
664 + // The reference EOTF specified in Rec. ITU-R BT.1886
665 + // L = a(max[(V+b),0])^g
666 + half a = pow(pow(Lw, 1.0 / gamma) - pow(Lb, 1.0 / gamma), gamma);
667 + half b = pow(Lb, 1.0 / gamma) / (pow(Lw, 1.0 / gamma) - pow(Lb, 1.0 / gamma));
668 + half V = pow(max(L / a, 0.0), 1.0 / gamma) - b;
669 + return V;
670 +}
671 +
672 +half roll_white_fwd(
673 + half x, // color value to adjust (white scaled to around 1.0)
674 + half new_wht, // white adjustment (e.g. 0.9 for 10% darkening)
675 + half width // adjusted width (e.g. 0.25 for top quarter of the tone scale)
676 + )
677 +{
678 + const half x0 = -1.0;
679 + const half x1 = x0 + width;
680 + const half y0 = -new_wht;
681 + const half y1 = x1;
682 + const half m1 = (x1 - x0);
683 + const half a = y0 - y1 + m1;
684 + const half b = 2.0 * (y1 - y0) - m1;
685 + const half c = y0;
686 + const half t = (-x - x0) / (x1 - x0);
687 + half o = 0.0;
688 + if (t < 0.0)
689 + o = -(t * b + c);
690 + else if (t > 1.0)
691 + o = x;
692 + else
693 + o = -((t * a + b) * t + c);
694 + return o;
695 +}
696 +
697 +half3 linear_to_sRGB(half3 x)
698 +{
699 + return (x <= 0.0031308 ? (x * 12.9232102) : 1.055 * pow(x, 1.0 / 2.4) - 0.055);
700 +}
701 +
702 +half3 linear_to_bt1886(half3 x, half gamma, half Lw, half Lb)
703 +{
704 + // Good enough approximation for now, may consider using the exact formula instead
705 + // TODO: Experiment
706 + return pow(max(x, 0.0), 1.0 / 2.4);
707 +
708 + // Correct implementation (Reference EOTF specified in Rec. ITU-R BT.1886) :
709 + // L = a(max[(V+b),0])^g
710 + half invgamma = 1.0 / gamma;
711 + half p_Lw = pow(Lw, invgamma);
712 + half p_Lb = pow(Lb, invgamma);
713 + half3 a = pow(p_Lw - p_Lb, gamma).xxx;
714 + half3 b = (p_Lb / p_Lw - p_Lb).xxx;
715 + half3 V = pow(max(x / a, 0.0), invgamma.xxx) - b;
716 + return V;
717 +}
718 +
719 +#if defined(CUSTOM_WHITE_POINT)
720 +half CINEMA_WHITE;
721 +half CINEMA_BLACK;
722 +#else
723 +static const half CINEMA_WHITE = 48.0;
724 +static const half CINEMA_BLACK = CINEMA_WHITE / 2400.0;
725 +#endif
726 +
727 +static const half ODT_SAT_FACTOR = 0.93;
728 +
729 +// <ACEStransformID>ODT.Academy.RGBmonitor_100nits_dim.a1.0.3</ACEStransformID>
730 +// <ACESuserName>ACES 1.0 Output - sRGB</ACESuserName>
731 +
732 +//
733 +// Output Device Transform - RGB computer monitor
734 +//
735 +
736 +//
737 +// Summary :
738 +// This transform is intended for mapping OCES onto a desktop computer monitor
739 +// typical of those used in motion picture visual effects production. These
740 +// monitors may occasionally be referred to as "sRGB" displays, however, the
741 +// monitor for which this transform is designed does not exactly match the
742 +// specifications in IEC 61966-2-1:1999.
743 +//
744 +// The assumed observer adapted white is D65, and the viewing environment is
745 +// that of a dim surround.
746 +//
747 +// The monitor specified is intended to be more typical of those found in
748 +// visual effects production.
749 +//
750 +// Device Primaries :
751 +// Primaries are those specified in Rec. ITU-R BT.709
752 +// CIE 1931 chromaticities: x y Y
753 +// Red: 0.64 0.33
754 +// Green: 0.3 0.6
755 +// Blue: 0.15 0.06
756 +// White: 0.3127 0.329 100 cd/m^2
757 +//
758 +// Display EOTF :
759 +// The reference electro-optical transfer function specified in
760 +// IEC 61966-2-1:1999.
761 +//
762 +// Signal Range:
763 +// This transform outputs full range code values.
764 +//
765 +// Assumed observer adapted white point:
766 +// CIE 1931 chromaticities: x y
767 +// 0.3127 0.329
768 +//
769 +// Viewing Environment:
770 +// This ODT has a compensation for viewing environment variables more typical
771 +// of those associated with video mastering.
772 +//
773 +half3 ODT_RGBmonitor_100nits_dim(half3 oces)
774 +{
775 + // OCES to RGB rendering space
776 + half3 rgbPre = mul(AP0_2_AP1_MAT, oces);
777 +
778 + // Apply the tonescale independently in rendering-space RGB
779 + half3 rgbPost;
780 + rgbPost.x = segmented_spline_c9_fwd(rgbPre.x);
781 + rgbPost.y = segmented_spline_c9_fwd(rgbPre.y);
782 + rgbPost.z = segmented_spline_c9_fwd(rgbPre.z);
783 +
784 + // Scale luminance to linear code value
785 + half3 linearCV = Y_2_linCV(rgbPost, CINEMA_WHITE, CINEMA_BLACK);
786 +
787 + // Apply gamma adjustment to compensate for dim surround
788 + linearCV = darkSurround_to_dimSurround(linearCV);
789 +
790 + // Apply desaturation to compensate for luminance difference
791 + //linearCV = mul(ODT_SAT_MAT, linearCV);
792 + linearCV = lerp(dot(linearCV, AP1_RGB2Y).xxx, linearCV, ODT_SAT_FACTOR.xxx);
793 +
794 + // Convert to display primary encoding
795 + // Rendering space RGB to XYZ
796 + half3 XYZ = mul(AP1_2_XYZ_MAT, linearCV);
797 +
798 + // Apply CAT from ACES white point to assumed observer adapted white point
799 + XYZ = mul(D60_2_D65_CAT, XYZ);
800 +
801 + // CIE XYZ to display primaries
802 + linearCV = mul(XYZ_2_REC709_MAT, XYZ);
803 +
804 + // Handle out-of-gamut values
805 + // Clip values < 0 or > 1 (i.e. projecting outside the display primaries)
806 + linearCV = saturate(linearCV);
807 +
808 + // TODO: Revisit when it is possible to deactivate Unity default framebuffer encoding
809 + // with sRGB opto-electrical transfer function (OETF).
810 + /*
811 + // Encode linear code values with transfer function
812 + half3 outputCV;
813 + // moncurve_r with gamma of 2.4 and offset of 0.055 matches the EOTF found in IEC 61966-2-1:1999 (sRGB)
814 + const half DISPGAMMA = 2.4;
815 + const half OFFSET = 0.055;
816 + outputCV.x = moncurve_r(linearCV.x, DISPGAMMA, OFFSET);
817 + outputCV.y = moncurve_r(linearCV.y, DISPGAMMA, OFFSET);
818 + outputCV.z = moncurve_r(linearCV.z, DISPGAMMA, OFFSET);
819 +
820 + outputCV = linear_to_sRGB(linearCV);
821 + */
822 +
823 + // Unity already draws to a sRGB target
824 + return linearCV;
825 +}
826 +
827 +// <ACEStransformID>ODT.Academy.RGBmonitor_D60sim_100nits_dim.a1.0.3</ACEStransformID>
828 +// <ACESuserName>ACES 1.0 Output - sRGB (D60 sim.)</ACESuserName>
829 +
830 +//
831 +// Output Device Transform - RGB computer monitor (D60 simulation)
832 +//
833 +
834 +//
835 +// Summary :
836 +// This transform is intended for mapping OCES onto a desktop computer monitor
837 +// typical of those used in motion picture visual effects production. These
838 +// monitors may occasionally be referred to as "sRGB" displays, however, the
839 +// monitor for which this transform is designed does not exactly match the
840 +// specifications in IEC 61966-2-1:1999.
841 +//
842 +// The assumed observer adapted white is D60, and the viewing environment is
843 +// that of a dim surround.
844 +//
845 +// The monitor specified is intended to be more typical of those found in
846 +// visual effects production.
847 +//
848 +// Device Primaries :
849 +// Primaries are those specified in Rec. ITU-R BT.709
850 +// CIE 1931 chromaticities: x y Y
851 +// Red: 0.64 0.33
852 +// Green: 0.3 0.6
853 +// Blue: 0.15 0.06
854 +// White: 0.3127 0.329 100 cd/m^2
855 +//
856 +// Display EOTF :
857 +// The reference electro-optical transfer function specified in
858 +// IEC 61966-2-1:1999.
859 +//
860 +// Signal Range:
861 +// This transform outputs full range code values.
862 +//
863 +// Assumed observer adapted white point:
864 +// CIE 1931 chromaticities: x y
865 +// 0.32168 0.33767
866 +//
867 +// Viewing Environment:
868 +// This ODT has a compensation for viewing environment variables more typical
869 +// of those associated with video mastering.
870 +//
871 +half3 ODT_RGBmonitor_D60sim_100nits_dim(half3 oces)
872 +{
873 + // OCES to RGB rendering space
874 + half3 rgbPre = mul(AP0_2_AP1_MAT, oces);
875 +
876 + // Apply the tonescale independently in rendering-space RGB
877 + half3 rgbPost;
878 + rgbPost.x = segmented_spline_c9_fwd(rgbPre.x);
879 + rgbPost.y = segmented_spline_c9_fwd(rgbPre.y);
880 + rgbPost.z = segmented_spline_c9_fwd(rgbPre.z);
881 +
882 + // Scale luminance to linear code value
883 + half3 linearCV = Y_2_linCV(rgbPost, CINEMA_WHITE, CINEMA_BLACK);
884 +
885 + // --- Compensate for different white point being darker --- //
886 + // This adjustment is to correct an issue that exists in ODTs where the device
887 + // is calibrated to a white chromaticity other than D60. In order to simulate
888 + // D60 on such devices, unequal code values are sent to the display to achieve
889 + // neutrals at D60. In order to produce D60 on a device calibrated to the DCI
890 + // white point (i.e. equal code values yield CIE x,y chromaticities of 0.314,
891 + // 0.351) the red channel is higher than green and blue to compensate for the
892 + // "greenish" DCI white. This is the correct behavior but it means that as
893 + // highlight increase, the red channel will hit the device maximum first and
894 + // clip, resulting in a chromaticity shift as the green and blue channels
895 + // continue to increase.
896 + // To avoid this clipping error, a slight scale factor is applied to allow the
897 + // ODTs to simulate D60 within the D65 calibration white point.
898 +
899 + // Scale and clamp white to avoid casted highlights due to D60 simulation
900 + const half SCALE = 0.955;
901 + linearCV = min(linearCV, 1.0) * SCALE;
902 +
903 + // Apply gamma adjustment to compensate for dim surround
904 + linearCV = darkSurround_to_dimSurround(linearCV);
905 +
906 + // Apply desaturation to compensate for luminance difference
907 + //linearCV = mul(ODT_SAT_MAT, linearCV);
908 + linearCV = lerp(dot(linearCV, AP1_RGB2Y).xxx, linearCV, ODT_SAT_FACTOR.xxx);
909 +
910 + // Convert to display primary encoding
911 + // Rendering space RGB to XYZ
912 + half3 XYZ = mul(AP1_2_XYZ_MAT, linearCV);
913 +
914 + // CIE XYZ to display primaries
915 + linearCV = mul(XYZ_2_REC709_MAT, XYZ);
916 +
917 + // Handle out-of-gamut values
918 + // Clip values < 0 or > 1 (i.e. projecting outside the display primaries)
919 + linearCV = saturate(linearCV);
920 +
921 + // TODO: Revisit when it is possible to deactivate Unity default framebuffer encoding
922 + // with sRGB opto-electrical transfer function (OETF).
923 + /*
924 + // Encode linear code values with transfer function
925 + half3 outputCV;
926 + // moncurve_r with gamma of 2.4 and offset of 0.055 matches the EOTF found in IEC 61966-2-1:1999 (sRGB)
927 + const half DISPGAMMA = 2.4;
928 + const half OFFSET = 0.055;
929 + outputCV.x = moncurve_r(linearCV.x, DISPGAMMA, OFFSET);
930 + outputCV.y = moncurve_r(linearCV.y, DISPGAMMA, OFFSET);
931 + outputCV.z = moncurve_r(linearCV.z, DISPGAMMA, OFFSET);
932 +
933 + outputCV = linear_to_sRGB(linearCV);
934 + */
935 +
936 + // Unity already draws to a sRGB target
937 + return linearCV;
938 +}
939 +
940 +// <ACEStransformID>ODT.Academy.Rec709_100nits_dim.a1.0.3</ACEStransformID>
941 +// <ACESuserName>ACES 1.0 Output - Rec.709</ACESuserName>
942 +
943 +//
944 +// Output Device Transform - Rec709
945 +//
946 +
947 +//
948 +// Summary :
949 +// This transform is intended for mapping OCES onto a Rec.709 broadcast monitor
950 +// that is calibrated to a D65 white point at 100 cd/m^2. The assumed observer
951 +// adapted white is D65, and the viewing environment is a dim surround.
952 +//
953 +// A possible use case for this transform would be HDTV/video mastering.
954 +//
955 +// Device Primaries :
956 +// Primaries are those specified in Rec. ITU-R BT.709
957 +// CIE 1931 chromaticities: x y Y
958 +// Red: 0.64 0.33
959 +// Green: 0.3 0.6
960 +// Blue: 0.15 0.06
961 +// White: 0.3127 0.329 100 cd/m^2
962 +//
963 +// Display EOTF :
964 +// The reference electro-optical transfer function specified in
965 +// Rec. ITU-R BT.1886.
966 +//
967 +// Signal Range:
968 +// By default, this transform outputs full range code values. If instead a
969 +// SMPTE "legal" signal is desired, there is a runtime flag to output
970 +// SMPTE legal signal. In ctlrender, this can be achieved by appending
971 +// '-param1 legalRange 1' after the '-ctl odt.ctl' string.
972 +//
973 +// Assumed observer adapted white point:
974 +// CIE 1931 chromaticities: x y
975 +// 0.3127 0.329
976 +//
977 +// Viewing Environment:
978 +// This ODT has a compensation for viewing environment variables more typical
979 +// of those associated with video mastering.
980 +//
981 +half3 ODT_Rec709_100nits_dim(half3 oces)
982 +{
983 + // OCES to RGB rendering space
984 + half3 rgbPre = mul(AP0_2_AP1_MAT, oces);
985 +
986 + // Apply the tonescale independently in rendering-space RGB
987 + half3 rgbPost;
988 + rgbPost.x = segmented_spline_c9_fwd(rgbPre.x);
989 + rgbPost.y = segmented_spline_c9_fwd(rgbPre.y);
990 + rgbPost.z = segmented_spline_c9_fwd(rgbPre.z);
991 +
992 + // Scale luminance to linear code value
993 + half3 linearCV = Y_2_linCV(rgbPost, CINEMA_WHITE, CINEMA_BLACK);
994 +
995 + // Apply gamma adjustment to compensate for dim surround
996 + linearCV = darkSurround_to_dimSurround(linearCV);
997 +
998 + // Apply desaturation to compensate for luminance difference
999 + //linearCV = mul(ODT_SAT_MAT, linearCV);
1000 + linearCV = lerp(dot(linearCV, AP1_RGB2Y).xxx, linearCV, ODT_SAT_FACTOR.xxx);
1001 +
1002 + // Convert to display primary encoding
1003 + // Rendering space RGB to XYZ
1004 + half3 XYZ = mul(AP1_2_XYZ_MAT, linearCV);
1005 +
1006 + // Apply CAT from ACES white point to assumed observer adapted white point
1007 + XYZ = mul(D60_2_D65_CAT, XYZ);
1008 +
1009 + // CIE XYZ to display primaries
1010 + linearCV = mul(XYZ_2_REC709_MAT, XYZ);
1011 +
1012 + // Handle out-of-gamut values
1013 + // Clip values < 0 or > 1 (i.e. projecting outside the display primaries)
1014 + linearCV = saturate(linearCV);
1015 +
1016 + // Encode linear code values with transfer function
1017 + const half DISPGAMMA = 2.4;
1018 + const half L_W = 1.0;
1019 + const half L_B = 0.0;
1020 + half3 outputCV = linear_to_bt1886(linearCV, DISPGAMMA, L_W, L_B);
1021 +
1022 + // TODO: Implement support for legal range.
1023 +
1024 + // NOTE: Unity framebuffer encoding is encoded with sRGB opto-electrical transfer function (OETF)
1025 + // by default which will result in double perceptual encoding, thus for now if one want to use
1026 + // this ODT, he needs to decode its output with sRGB electro-optical transfer function (EOTF) to
1027 + // compensate for Unity default behaviour.
1028 +
1029 + return outputCV;
1030 +}
1031 +
1032 +// <ACEStransformID>ODT.Academy.Rec709_D60sim_100nits_dim.a1.0.3</ACEStransformID>
1033 +// <ACESuserName>ACES 1.0 Output - Rec.709 (D60 sim.)</ACESuserName>
1034 +
1035 +//
1036 +// Output Device Transform - Rec709 (D60 simulation)
1037 +//
1038 +
1039 +//
1040 +// Summary :
1041 +// This transform is intended for mapping OCES onto a Rec.709 broadcast monitor
1042 +// that is calibrated to a D65 white point at 100 cd/m^2. The assumed observer
1043 +// adapted white is D60, and the viewing environment is a dim surround.
1044 +//
1045 +// A possible use case for this transform would be cinema "soft-proofing".
1046 +//
1047 +// Device Primaries :
1048 +// Primaries are those specified in Rec. ITU-R BT.709
1049 +// CIE 1931 chromaticities: x y Y
1050 +// Red: 0.64 0.33
1051 +// Green: 0.3 0.6
1052 +// Blue: 0.15 0.06
1053 +// White: 0.3127 0.329 100 cd/m^2
1054 +//
1055 +// Display EOTF :
1056 +// The reference electro-optical transfer function specified in
1057 +// Rec. ITU-R BT.1886.
1058 +//
1059 +// Signal Range:
1060 +// By default, this transform outputs full range code values. If instead a
1061 +// SMPTE "legal" signal is desired, there is a runtime flag to output
1062 +// SMPTE legal signal. In ctlrender, this can be achieved by appending
1063 +// '-param1 legalRange 1' after the '-ctl odt.ctl' string.
1064 +//
1065 +// Assumed observer adapted white point:
1066 +// CIE 1931 chromaticities: x y
1067 +// 0.32168 0.33767
1068 +//
1069 +// Viewing Environment:
1070 +// This ODT has a compensation for viewing environment variables more typical
1071 +// of those associated with video mastering.
1072 +//
1073 +half3 ODT_Rec709_D60sim_100nits_dim(half3 oces)
1074 +{
1075 + // OCES to RGB rendering space
1076 + half3 rgbPre = mul(AP0_2_AP1_MAT, oces);
1077 +
1078 + // Apply the tonescale independently in rendering-space RGB
1079 + half3 rgbPost;
1080 + rgbPost.x = segmented_spline_c9_fwd(rgbPre.x);
1081 + rgbPost.y = segmented_spline_c9_fwd(rgbPre.y);
1082 + rgbPost.z = segmented_spline_c9_fwd(rgbPre.z);
1083 +
1084 + // Scale luminance to linear code value
1085 + half3 linearCV = Y_2_linCV(rgbPost, CINEMA_WHITE, CINEMA_BLACK);
1086 +
1087 + // --- Compensate for different white point being darker --- //
1088 + // This adjustment is to correct an issue that exists in ODTs where the device
1089 + // is calibrated to a white chromaticity other than D60. In order to simulate
1090 + // D60 on such devices, unequal code values must be sent to the display to achieve
1091 + // the chromaticities of D60. More specifically, in order to produce D60 on a device
1092 + // calibrated to a D65 white point (i.e. equal code values yield CIE x,y
1093 + // chromaticities of 0.3127, 0.329) the red channel must be slightly higher than
1094 + // that of green and blue in order to compensate for the relatively more "blue-ish"
1095 + // D65 white. This unequalness of color channels is the correct behavior but it
1096 + // means that as neutral highlights increase, the red channel will hit the
1097 + // device maximum first and clip, resulting in a small chromaticity shift as the
1098 + // green and blue channels continue to increase to their maximums.
1099 + // To avoid this clipping error, a slight scale factor is applied to allow the
1100 + // ODTs to simulate D60 within the D65 calibration white point.
1101 +
1102 + // Scale and clamp white to avoid casted highlights due to D60 simulation
1103 + const half SCALE = 0.955;
1104 + linearCV = min(linearCV, 1.0) * SCALE;
1105 +
1106 + // Apply gamma adjustment to compensate for dim surround
1107 + linearCV = darkSurround_to_dimSurround(linearCV);
1108 +
1109 + // Apply desaturation to compensate for luminance difference
1110 + //linearCV = mul(ODT_SAT_MAT, linearCV);
1111 + linearCV = lerp(dot(linearCV, AP1_RGB2Y).xxx, linearCV, ODT_SAT_FACTOR.xxx);
1112 +
1113 + // Convert to display primary encoding
1114 + // Rendering space RGB to XYZ
1115 + half3 XYZ = mul(AP1_2_XYZ_MAT, linearCV);
1116 +
1117 + // CIE XYZ to display primaries
1118 + linearCV = mul(XYZ_2_REC709_MAT, XYZ);
1119 +
1120 + // Handle out-of-gamut values
1121 + // Clip values < 0 or > 1 (i.e. projecting outside the display primaries)
1122 + linearCV = saturate(linearCV);
1123 +
1124 + // Encode linear code values with transfer function
1125 + const half DISPGAMMA = 2.4;
1126 + const half L_W = 1.0;
1127 + const half L_B = 0.0;
1128 + half3 outputCV = linear_to_bt1886(linearCV, DISPGAMMA, L_W, L_B);
1129 +
1130 + // TODO: Implement support for legal range.
1131 +
1132 + // NOTE: Unity framebuffer encoding is encoded with sRGB opto-electrical transfer function (OETF)
1133 + // by default which will result in double perceptual encoding, thus for now if one want to use
1134 + // this ODT, he needs to decode its output with sRGB electro-optical transfer function (EOTF) to
1135 + // compensate for Unity default behaviour.
1136 +
1137 + return outputCV;
1138 +}
1139 +
1140 +// <ACEStransformID>ODT.Academy.Rec2020_100nits_dim.a1.0.3</ACEStransformID>
1141 +// <ACESuserName>ACES 1.0 Output - Rec.2020</ACESuserName>
1142 +
1143 +//
1144 +// Output Device Transform - Rec2020
1145 +//
1146 +
1147 +//
1148 +// Summary :
1149 +// This transform is intended for mapping OCES onto a Rec.2020 broadcast
1150 +// monitor that is calibrated to a D65 white point at 100 cd/m^2. The assumed
1151 +// observer adapted white is D65, and the viewing environment is that of a dim
1152 +// surround.
1153 +//
1154 +// A possible use case for this transform would be UHDTV/video mastering.
1155 +//
1156 +// Device Primaries :
1157 +// Primaries are those specified in Rec. ITU-R BT.2020
1158 +// CIE 1931 chromaticities: x y Y
1159 +// Red: 0.708 0.292
1160 +// Green: 0.17 0.797
1161 +// Blue: 0.131 0.046
1162 +// White: 0.3127 0.329 100 cd/m^2
1163 +//
1164 +// Display EOTF :
1165 +// The reference electro-optical transfer function specified in
1166 +// Rec. ITU-R BT.1886.
1167 +//
1168 +// Signal Range:
1169 +// By default, this transform outputs full range code values. If instead a
1170 +// SMPTE "legal" signal is desired, there is a runtime flag to output
1171 +// SMPTE legal signal. In ctlrender, this can be achieved by appending
1172 +// '-param1 legalRange 1' after the '-ctl odt.ctl' string.
1173 +//
1174 +// Assumed observer adapted white point:
1175 +// CIE 1931 chromaticities: x y
1176 +// 0.3127 0.329
1177 +//
1178 +// Viewing Environment:
1179 +// This ODT has a compensation for viewing environment variables more typical
1180 +// of those associated with video mastering.
1181 +//
1182 +
1183 +half3 ODT_Rec2020_100nits_dim(half3 oces)
1184 +{
1185 + // OCES to RGB rendering space
1186 + half3 rgbPre = mul(AP0_2_AP1_MAT, oces);
1187 +
1188 + // Apply the tonescale independently in rendering-space RGB
1189 + half3 rgbPost;
1190 + rgbPost.x = segmented_spline_c9_fwd(rgbPre.x);
1191 + rgbPost.y = segmented_spline_c9_fwd(rgbPre.y);
1192 + rgbPost.z = segmented_spline_c9_fwd(rgbPre.z);
1193 +
1194 + // Scale luminance to linear code value
1195 + half3 linearCV = Y_2_linCV(rgbPost, CINEMA_WHITE, CINEMA_BLACK);
1196 +
1197 + // Apply gamma adjustment to compensate for dim surround
1198 + linearCV = darkSurround_to_dimSurround(linearCV);
1199 +
1200 + // Apply desaturation to compensate for luminance difference
1201 + //linearCV = mul(ODT_SAT_MAT, linearCV);
1202 + linearCV = lerp(dot(linearCV, AP1_RGB2Y).xxx, linearCV, ODT_SAT_FACTOR.xxx);
1203 +
1204 + // Convert to display primary encoding
1205 + // Rendering space RGB to XYZ
1206 + half3 XYZ = mul(AP1_2_XYZ_MAT, linearCV);
1207 +
1208 + // Apply CAT from ACES white point to assumed observer adapted white point
1209 + XYZ = mul(D60_2_D65_CAT, XYZ);
1210 +
1211 + // CIE XYZ to display primaries
1212 + linearCV = mul(XYZ_2_REC2020_MAT, XYZ);
1213 +
1214 + // Handle out-of-gamut values
1215 + // Clip values < 0 or > 1 (i.e. projecting outside the display primaries)
1216 + linearCV = saturate(linearCV);
1217 +
1218 + // Encode linear code values with transfer function
1219 + const half DISPGAMMA = 2.4;
1220 + const half L_W = 1.0;
1221 + const half L_B = 0.0;
1222 + half3 outputCV = linear_to_bt1886(linearCV, DISPGAMMA, L_W, L_B);
1223 +
1224 + // TODO: Implement support for legal range.
1225 +
1226 + // NOTE: Unity framebuffer encoding is encoded with sRGB opto-electrical transfer function (OETF)
1227 + // by default which will result in double perceptual encoding, thus for now if one want to use
1228 + // this ODT, he needs to decode its output with sRGB electro-optical transfer function (EOTF) to
1229 + // compensate for Unity default behaviour.
1230 +
1231 + return outputCV;
1232 +}
1233 +
1234 +// <ACEStransformID>ODT.Academy.P3DCI_48nits.a1.0.3</ACEStransformID>
1235 +// <ACESuserName>ACES 1.0 Output - P3-DCI</ACESuserName>
1236 +
1237 +//
1238 +// Output Device Transform - P3DCI (D60 Simulation)
1239 +//
1240 +
1241 +//
1242 +// Summary :
1243 +// This transform is intended for mapping OCES onto a P3 digital cinema
1244 +// projector that is calibrated to a DCI white point at 48 cd/m^2. The assumed
1245 +// observer adapted white is D60, and the viewing environment is that of a dark
1246 +// theater.
1247 +//
1248 +// Device Primaries :
1249 +// CIE 1931 chromaticities: x y Y
1250 +// Red: 0.68 0.32
1251 +// Green: 0.265 0.69
1252 +// Blue: 0.15 0.06
1253 +// White: 0.314 0.351 48 cd/m^2
1254 +//
1255 +// Display EOTF :
1256 +// Gamma: 2.6
1257 +//
1258 +// Assumed observer adapted white point:
1259 +// CIE 1931 chromaticities: x y
1260 +// 0.32168 0.33767
1261 +//
1262 +// Viewing Environment:
1263 +// Environment specified in SMPTE RP 431-2-2007
1264 +//
1265 +half3 ODT_P3DCI_48nits(half3 oces)
1266 +{
1267 + // OCES to RGB rendering space
1268 + half3 rgbPre = mul(AP0_2_AP1_MAT, oces);
1269 +
1270 + // Apply the tonescale independently in rendering-space RGB
1271 + half3 rgbPost;
1272 + rgbPost.x = segmented_spline_c9_fwd(rgbPre.x);
1273 + rgbPost.y = segmented_spline_c9_fwd(rgbPre.y);
1274 + rgbPost.z = segmented_spline_c9_fwd(rgbPre.z);
1275 +
1276 + // Scale luminance to linear code value
1277 + half3 linearCV = Y_2_linCV(rgbPost, CINEMA_WHITE, CINEMA_BLACK);
1278 +
1279 + // --- Compensate for different white point being darker --- //
1280 + // This adjustment is to correct an issue that exists in ODTs where the device
1281 + // is calibrated to a white chromaticity other than D60. In order to simulate
1282 + // D60 on such devices, unequal code values are sent to the display to achieve
1283 + // neutrals at D60. In order to produce D60 on a device calibrated to the DCI
1284 + // white point (i.e. equal code values yield CIE x,y chromaticities of 0.314,
1285 + // 0.351) the red channel is higher than green and blue to compensate for the
1286 + // "greenish" DCI white. This is the correct behavior but it means that as
1287 + // highlight increase, the red channel will hit the device maximum first and
1288 + // clip, resulting in a chromaticity shift as the green and blue channels
1289 + // continue to increase.
1290 + // To avoid this clipping error, a slight scale factor is applied to allow the
1291 + // ODTs to simulate D60 within the D65 calibration white point. However, the
1292 + // magnitude of the scale factor required for the P3DCI ODT was considered too
1293 + // large. Therefore, the scale factor was reduced and the additional required
1294 + // compression was achieved via a reshaping of the highlight rolloff in
1295 + // conjunction with the scale. The shape of this rolloff was determined
1296 + // throught subjective experiments and deemed to best reproduce the
1297 + // "character" of the highlights in the P3D60 ODT.
1298 +
1299 + // Roll off highlights to avoid need for as much scaling
1300 + const half NEW_WHT = 0.918;
1301 + const half ROLL_WIDTH = 0.5;
1302 + linearCV.x = roll_white_fwd(linearCV.x, NEW_WHT, ROLL_WIDTH);
1303 + linearCV.y = roll_white_fwd(linearCV.y, NEW_WHT, ROLL_WIDTH);
1304 + linearCV.z = roll_white_fwd(linearCV.z, NEW_WHT, ROLL_WIDTH);
1305 +
1306 + // Scale and clamp white to avoid casted highlights due to D60 simulation
1307 + const half SCALE = 0.96;
1308 + linearCV = min(linearCV, NEW_WHT) * SCALE;
1309 +
1310 + // Convert to display primary encoding
1311 + // Rendering space RGB to XYZ
1312 + half3 XYZ = mul(AP1_2_XYZ_MAT, linearCV);
1313 +
1314 + // CIE XYZ to display primaries
1315 + linearCV = mul(XYZ_2_DCIP3_MAT, XYZ);
1316 +
1317 + // Handle out-of-gamut values
1318 + // Clip values < 0 or > 1 (i.e. projecting outside the display primaries)
1319 + linearCV = saturate(linearCV);
1320 +
1321 + // Encode linear code values with transfer function
1322 + const half DISPGAMMA = 2.6;
1323 + half3 outputCV = pow(linearCV, 1.0 / DISPGAMMA);
1324 +
1325 + // NOTE: Unity framebuffer encoding is encoded with sRGB opto-electrical transfer function (OETF)
1326 + // by default which will result in double perceptual encoding, thus for now if one want to use
1327 + // this ODT, he needs to decode its output with sRGB electro-optical transfer function (EOTF) to
1328 + // compensate for Unity default behaviour.
1329 +
1330 + return outputCV;
1331 +}
1332 +
1333 +#endif // __ACES__
1 +fileFormatVersion: 2
2 +guid: b8d56fc3449f426408c23c723b58d7b5
3 +timeCreated: 1460363486
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +// Upgrade NOTE: commented out 'float4x4 _WorldToCamera', a built-in variable
2 +// Upgrade NOTE: replaced '_WorldToCamera' with 'unity_WorldToCamera'
3 +
4 +#ifndef __AMBIENT_OCCLUSION__
5 +#define __AMBIENT_OCCLUSION__
6 +
7 +#include "UnityCG.cginc"
8 +#include "Common.cginc"
9 +
10 +// --------
11 +// Options for further customization
12 +// --------
13 +
14 +// By default, a 5-tap Gaussian with the linear sampling technique is used
15 +// in the bilateral noise filter. It can be replaced with a 7-tap Gaussian
16 +// with adaptive sampling by enabling the macro below. Although the
17 +// differences are not noticeable in most cases, it may provide preferable
18 +// results with some special usage (e.g. NPR without textureing).
19 +// #define BLUR_HIGH_QUALITY
20 +
21 +// By default, a fixed sampling pattern is used in the AO estimator. Although
22 +// this gives preferable results in most cases, a completely random sampling
23 +// pattern could give aesthetically better results. Disable the macro below
24 +// to use such a random pattern instead of the fixed one.
25 +#define FIX_SAMPLING_PATTERN
26 +
27 +// The SampleNormal function normalizes samples from G-buffer because
28 +// they're possibly unnormalized. We can eliminate this if it can be said
29 +// that there is no wrong shader that outputs unnormalized normals.
30 +// #define VALIDATE_NORMALS
31 +
32 +// The constant below determines the contrast of occlusion. This allows
33 +// users to control over/under occlusion. At the moment, this is not exposed
34 +// to the editor because it�s rarely useful.
35 +static const float kContrast = 0.6;
36 +
37 +// The constant below controls the geometry-awareness of the bilateral
38 +// filter. The higher value, the more sensitive it is.
39 +static const float kGeometryCoeff = 0.8;
40 +
41 +// The constants below are used in the AO estimator. Beta is mainly used
42 +// for suppressing self-shadowing noise, and Epsilon is used to prevent
43 +// calculation underflow. See the paper (Morgan 2011 http://goo.gl/2iz3P)
44 +// for further details of these constants.
45 +static const float kBeta = 0.002;
46 +
47 +// --------
48 +
49 +// System built-in variables
50 +sampler2D _CameraGBufferTexture2;
51 +sampler2D_float _CameraDepthTexture;
52 +sampler2D _CameraDepthNormalsTexture;
53 +
54 +float4 _CameraDepthTexture_ST;
55 +
56 +// Sample count
57 +#if !defined(SHADER_API_GLES)
58 +int _SampleCount;
59 +#else
60 +// GLES2: In many cases, dynamic looping is not supported.
61 +static const int _SampleCount = 3;
62 +#endif
63 +
64 +// Source texture properties
65 +sampler2D _OcclusionTexture;
66 +float4 _OcclusionTexture_TexelSize;
67 +
68 +// Other parameters
69 +half _Intensity;
70 +float _Radius;
71 +float _Downsample;
72 +float3 _FogParams; // x: density, y: start, z: end
73 +
74 +// Accessors for packed AO/normal buffer
75 +fixed4 PackAONormal(fixed ao, fixed3 n)
76 +{
77 + return fixed4(ao, n * 0.5 + 0.5);
78 +}
79 +
80 +fixed GetPackedAO(fixed4 p)
81 +{
82 + return p.r;
83 +}
84 +
85 +fixed3 GetPackedNormal(fixed4 p)
86 +{
87 + return p.gba * 2.0 - 1.0;
88 +}
89 +
90 +// Boundary check for depth sampler
91 +// (returns a very large value if it lies out of bounds)
92 +float CheckBounds(float2 uv, float d)
93 +{
94 + float ob = any(uv < 0) + any(uv > 1);
95 +#if defined(UNITY_REVERSED_Z)
96 + ob += (d <= 0.00001);
97 +#else
98 + ob += (d >= 0.99999);
99 +#endif
100 + return ob * 1e8;
101 +}
102 +
103 +// Depth/normal sampling functions
104 +float SampleDepth(float2 uv)
105 +{
106 +#if defined(SOURCE_GBUFFER) || defined(SOURCE_DEPTH)
107 + float d = LinearizeDepth(SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv));
108 +#else
109 + float4 cdn = tex2D(_CameraDepthNormalsTexture, uv);
110 + float d = DecodeFloatRG(cdn.zw);
111 +#endif
112 + return d * _ProjectionParams.z + CheckBounds(uv, d);
113 +}
114 +
115 +float3 SampleNormal(float2 uv)
116 +{
117 +#if defined(SOURCE_GBUFFER)
118 + float3 norm = tex2D(_CameraGBufferTexture2, uv).xyz;
119 + norm = norm * 2 - any(norm); // gets (0,0,0) when norm == 0
120 + norm = mul((float3x3)unity_WorldToCamera, norm);
121 +#if defined(VALIDATE_NORMALS)
122 + norm = normalize(norm);
123 +#endif
124 + return norm;
125 +#else
126 + float4 cdn = tex2D(_CameraDepthNormalsTexture, uv);
127 + return DecodeViewNormalStereo(cdn) * float3(1.0, 1.0, -1.0);
128 +#endif
129 +}
130 +
131 +float SampleDepthNormal(float2 uv, out float3 normal)
132 +{
133 +#if defined(SOURCE_GBUFFER) || defined(SOURCE_DEPTH)
134 + normal = SampleNormal(uv);
135 + return SampleDepth(uv);
136 +#else
137 + float4 cdn = tex2D(_CameraDepthNormalsTexture, uv);
138 + normal = DecodeViewNormalStereo(cdn) * float3(1.0, 1.0, -1.0);
139 + float d = DecodeFloatRG(cdn.zw);
140 + return d * _ProjectionParams.z + CheckBounds(uv, d);
141 +#endif
142 +}
143 +
144 +// Normal vector comparer (for geometry-aware weighting)
145 +half CompareNormal(half3 d1, half3 d2)
146 +{
147 + return smoothstep(kGeometryCoeff, 1.0, dot(d1, d2));
148 +}
149 +
150 +// Common vertex shader
151 +struct VaryingsMultitex
152 +{
153 + float4 pos : SV_POSITION;
154 + half2 uv : TEXCOORD0; // Original UV
155 + half2 uv01 : TEXCOORD1; // Alternative UV (supports v-flip case)
156 + half2 uvSPR : TEXCOORD2; // Single pass stereo rendering UV
157 +};
158 +
159 +VaryingsMultitex VertMultitex(AttributesDefault v)
160 +{
161 + half2 uvAlt = v.texcoord.xy;
162 +
163 +#if UNITY_UV_STARTS_AT_TOP
164 + if (_MainTex_TexelSize.y < 0.0) uvAlt.y = 1.0 - uvAlt.y;
165 +#endif
166 +
167 + VaryingsMultitex o;
168 + o.pos = UnityObjectToClipPos(v.vertex);
169 + o.uv = v.texcoord.xy;
170 + o.uv01 = uvAlt;
171 + o.uvSPR = UnityStereoTransformScreenSpaceTex(uvAlt);
172 +
173 + return o;
174 +}
175 +
176 +// Trigonometric function utility
177 +float2 CosSin(float theta)
178 +{
179 + float sn, cs;
180 + sincos(theta, sn, cs);
181 + return float2(cs, sn);
182 +}
183 +
184 +// Pseudo random number generator with 2D coordinates
185 +float UVRandom(float u, float v)
186 +{
187 + float f = dot(float2(12.9898, 78.233), float2(u, v));
188 + return frac(43758.5453 * sin(f));
189 +}
190 +
191 +// Check if the camera is perspective.
192 +// (returns 1.0 when orthographic)
193 +float CheckPerspective(float x)
194 +{
195 + return lerp(x, 1.0, unity_OrthoParams.w);
196 +}
197 +
198 +// Reconstruct view-space position from UV and depth.
199 +// p11_22 = (unity_CameraProjection._11, unity_CameraProjection._22)
200 +// p13_31 = (unity_CameraProjection._13, unity_CameraProjection._23)
201 +float3 ReconstructViewPos(float2 uv, float depth, float2 p11_22, float2 p13_31)
202 +{
203 + return float3((uv * 2.0 - 1.0 - p13_31) / p11_22 * CheckPerspective(depth), depth);
204 +}
205 +
206 +// Sample point picker
207 +float3 PickSamplePoint(float2 uv, float index)
208 +{
209 + // Uniformaly distributed points on a unit sphere http://goo.gl/X2F1Ho
210 +#if defined(FIX_SAMPLING_PATTERN)
211 + float gn = GradientNoise(uv * _Downsample);
212 + // FIXME: This was added to avoid a NVIDIA driver issue.
213 + // vvvvvvvvvvvv
214 + float u = frac(UVRandom(0.0, index + uv.x * 1e-10) + gn) * 2.0 - 1.0;
215 + float theta = (UVRandom(1.0, index + uv.x * 1e-10) + gn) * UNITY_PI_2;
216 +#else
217 + float u = UVRandom(uv.x + _Time.x, uv.y + index) * 2.0 - 1.0;
218 + float theta = UVRandom(-uv.x - _Time.x, uv.y + index) * UNITY_PI_2;
219 +#endif
220 + float3 v = float3(CosSin(theta) * sqrt(1.0 - u * u), u);
221 + // Make them distributed between [0, _Radius]
222 + float l = sqrt((index + 1.0) / _SampleCount) * _Radius;
223 + return v * l;
224 +}
225 +
226 +// Fog handling in forward
227 +half ComputeFog(float z)
228 +{
229 + half fog = 0.0;
230 +#if FOG_LINEAR
231 + fog = (_FogParams.z - z) / (_FogParams.z - _FogParams.y);
232 +#elif FOG_EXP
233 + fog = exp2(-_FogParams.x * z);
234 +#else // FOG_EXP2
235 + fog = _FogParams.x * z;
236 + fog = exp2(-fog * fog);
237 +#endif
238 + return saturate(fog);
239 +}
240 +
241 +float ComputeDistance(float depth)
242 +{
243 + float dist = depth * _ProjectionParams.z;
244 + dist -= _ProjectionParams.y;
245 + return dist;
246 +}
247 +
248 +//
249 +// Distance-based AO estimator based on Morgan 2011 http://goo.gl/2iz3P
250 +//
251 +half4 FragAO(VaryingsMultitex i) : SV_Target
252 +{
253 + float2 uv = i.uv;
254 +
255 + // Parameters used in coordinate conversion
256 + float3x3 proj = (float3x3)unity_CameraProjection;
257 + float2 p11_22 = float2(unity_CameraProjection._11, unity_CameraProjection._22);
258 + float2 p13_31 = float2(unity_CameraProjection._13, unity_CameraProjection._23);
259 +
260 + // View space normal and depth
261 + float3 norm_o;
262 + float depth_o = SampleDepthNormal(UnityStereoScreenSpaceUVAdjust(uv, _CameraDepthTexture_ST), norm_o);
263 +
264 +#if defined(SOURCE_DEPTHNORMALS)
265 + // Offset the depth value to avoid precision error.
266 + // (depth in the DepthNormals mode has only 16-bit precision)
267 + depth_o -= _ProjectionParams.z / 65536;
268 +#endif
269 +
270 + // Reconstruct the view-space position.
271 + float3 vpos_o = ReconstructViewPos(i.uv01, depth_o, p11_22, p13_31);
272 +
273 + float ao = 0.0;
274 +
275 + for (int s = 0; s < _SampleCount; s++)
276 + {
277 + // Sample point
278 +#if defined(SHADER_API_D3D11)
279 + // This 'floor(1.0001 * s)' operation is needed to avoid a NVidia
280 + // shader issue. This issue is only observed on DX11.
281 + float3 v_s1 = PickSamplePoint(uv, floor(1.0001 * s));
282 +#else
283 + float3 v_s1 = PickSamplePoint(uv, s);
284 +#endif
285 + v_s1 = faceforward(v_s1, -norm_o, v_s1);
286 + float3 vpos_s1 = vpos_o + v_s1;
287 +
288 + // Reproject the sample point
289 + float3 spos_s1 = mul(proj, vpos_s1);
290 + float2 uv_s1_01 = (spos_s1.xy / CheckPerspective(vpos_s1.z) + 1.0) * 0.5;
291 +
292 + // Depth at the sample point
293 + float depth_s1 = SampleDepth(UnityStereoScreenSpaceUVAdjust(uv_s1_01, _CameraDepthTexture_ST));
294 +
295 + // Relative position of the sample point
296 + float3 vpos_s2 = ReconstructViewPos(uv_s1_01, depth_s1, p11_22, p13_31);
297 + float3 v_s2 = vpos_s2 - vpos_o;
298 +
299 + // Estimate the obscurance value
300 + float a1 = max(dot(v_s2, norm_o) - kBeta * depth_o, 0.0);
301 + float a2 = dot(v_s2, v_s2) + EPSILON;
302 + ao += a1 / a2;
303 + }
304 +
305 + ao *= _Radius; // intensity normalization
306 +
307 + // Apply other parameters.
308 + ao = pow(ao * _Intensity / _SampleCount, kContrast);
309 +
310 + // Apply fog when enabled (forward-only)
311 +#if !FOG_OFF
312 + float d = Linear01Depth(SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv));
313 + d = ComputeDistance(d);
314 + ao *= ComputeFog(d);
315 +#endif
316 +
317 + return PackAONormal(ao, norm_o);
318 +}
319 +
320 +// Geometry-aware separable bilateral filter
321 +half4 FragBlur(VaryingsMultitex i) : SV_Target
322 +{
323 +#if defined(BLUR_HORIZONTAL)
324 + // Horizontal pass: Always use 2 texels interval to match to
325 + // the dither pattern.
326 + float2 delta = float2(_MainTex_TexelSize.x * 2.0, 0.0);
327 +#else
328 + // Vertical pass: Apply _Downsample to match to the dither
329 + // pattern in the original occlusion buffer.
330 + float2 delta = float2(0.0, _MainTex_TexelSize.y / _Downsample * 2.0);
331 +#endif
332 +
333 +#if defined(BLUR_HIGH_QUALITY)
334 +
335 + // High quality 7-tap Gaussian with adaptive sampling
336 +
337 + fixed4 p0 = tex2D(_MainTex, i.uvSPR);
338 + fixed4 p1a = tex2D(_MainTex, i.uvSPR - delta);
339 + fixed4 p1b = tex2D(_MainTex, i.uvSPR + delta);
340 + fixed4 p2a = tex2D(_MainTex, i.uvSPR - delta * 2.0);
341 + fixed4 p2b = tex2D(_MainTex, i.uvSPR + delta * 2.0);
342 + fixed4 p3a = tex2D(_MainTex, i.uvSPR - delta * 3.2307692308);
343 + fixed4 p3b = tex2D(_MainTex, i.uvSPR + delta * 3.2307692308);
344 +
345 +#if defined(BLUR_SAMPLE_CENTER_NORMAL)
346 + fixed3 n0 = SampleNormal(i.uvSPR);
347 +#else
348 + fixed3 n0 = GetPackedNormal(p0);
349 +#endif
350 +
351 + half w0 = 0.37004405286;
352 + half w1a = CompareNormal(n0, GetPackedNormal(p1a)) * 0.31718061674;
353 + half w1b = CompareNormal(n0, GetPackedNormal(p1b)) * 0.31718061674;
354 + half w2a = CompareNormal(n0, GetPackedNormal(p2a)) * 0.19823788546;
355 + half w2b = CompareNormal(n0, GetPackedNormal(p2b)) * 0.19823788546;
356 + half w3a = CompareNormal(n0, GetPackedNormal(p3a)) * 0.11453744493;
357 + half w3b = CompareNormal(n0, GetPackedNormal(p3b)) * 0.11453744493;
358 +
359 + half s;
360 + s = GetPackedAO(p0) * w0;
361 + s += GetPackedAO(p1a) * w1a;
362 + s += GetPackedAO(p1b) * w1b;
363 + s += GetPackedAO(p2a) * w2a;
364 + s += GetPackedAO(p2b) * w2b;
365 + s += GetPackedAO(p3a) * w3a;
366 + s += GetPackedAO(p3b) * w3b;
367 +
368 + s /= w0 + w1a + w1b + w2a + w2b + w3a + w3b;
369 +
370 +#else
371 +
372 + // Fater 5-tap Gaussian with linear sampling
373 + fixed4 p0 = tex2D(_MainTex, i.uvSPR);
374 + fixed4 p1a = tex2D(_MainTex, i.uvSPR - delta * 1.3846153846);
375 + fixed4 p1b = tex2D(_MainTex, i.uvSPR + delta * 1.3846153846);
376 + fixed4 p2a = tex2D(_MainTex, i.uvSPR - delta * 3.2307692308);
377 + fixed4 p2b = tex2D(_MainTex, i.uvSPR + delta * 3.2307692308);
378 +
379 +#if defined(BLUR_SAMPLE_CENTER_NORMAL)
380 + fixed3 n0 = SampleNormal(i.uvSPR);
381 +#else
382 + fixed3 n0 = GetPackedNormal(p0);
383 +#endif
384 +
385 + half w0 = 0.2270270270;
386 + half w1a = CompareNormal(n0, GetPackedNormal(p1a)) * 0.3162162162;
387 + half w1b = CompareNormal(n0, GetPackedNormal(p1b)) * 0.3162162162;
388 + half w2a = CompareNormal(n0, GetPackedNormal(p2a)) * 0.0702702703;
389 + half w2b = CompareNormal(n0, GetPackedNormal(p2b)) * 0.0702702703;
390 +
391 + half s;
392 + s = GetPackedAO(p0) * w0;
393 + s += GetPackedAO(p1a) * w1a;
394 + s += GetPackedAO(p1b) * w1b;
395 + s += GetPackedAO(p2a) * w2a;
396 + s += GetPackedAO(p2b) * w2b;
397 +
398 + s /= w0 + w1a + w1b + w2a + w2b;
399 +
400 +#endif
401 +
402 + return PackAONormal(s, n0);
403 +}
404 +
405 +// Gamma encoding (only needed in gamma lighting mode)
406 +half EncodeAO(half x)
407 +{
408 + half x_g = 1.0 - max(1.055 * pow(1.0 - x, 0.416666667) - 0.055, 0.0);
409 + // ColorSpaceLuminance.w == 0 (gamma) or 1 (linear)
410 + return lerp(x_g, x, unity_ColorSpaceLuminance.w);
411 +}
412 +
413 +// Geometry-aware bilateral filter (single pass/small kernel)
414 +half BlurSmall(sampler2D tex, float2 uv, float2 delta)
415 +{
416 + fixed4 p0 = tex2D(tex, uv);
417 + fixed4 p1 = tex2D(tex, uv + float2(-delta.x, -delta.y));
418 + fixed4 p2 = tex2D(tex, uv + float2(+delta.x, -delta.y));
419 + fixed4 p3 = tex2D(tex, uv + float2(-delta.x, +delta.y));
420 + fixed4 p4 = tex2D(tex, uv + float2(+delta.x, +delta.y));
421 +
422 + fixed3 n0 = GetPackedNormal(p0);
423 +
424 + half w0 = 1.0;
425 + half w1 = CompareNormal(n0, GetPackedNormal(p1));
426 + half w2 = CompareNormal(n0, GetPackedNormal(p2));
427 + half w3 = CompareNormal(n0, GetPackedNormal(p3));
428 + half w4 = CompareNormal(n0, GetPackedNormal(p4));
429 +
430 + half s;
431 + s = GetPackedAO(p0) * w0;
432 + s += GetPackedAO(p1) * w1;
433 + s += GetPackedAO(p2) * w2;
434 + s += GetPackedAO(p3) * w3;
435 + s += GetPackedAO(p4) * w4;
436 +
437 + return s / (w0 + w1 + w2 + w3 + w4);
438 +}
439 +
440 +// Final composition shader
441 +half4 FragComposition(VaryingsMultitex i) : SV_Target
442 +{
443 + float2 delta = _MainTex_TexelSize.xy / _Downsample;
444 + half ao = BlurSmall(_OcclusionTexture, i.uvSPR, delta);
445 + half4 color = tex2D(_MainTex, i.uvSPR);
446 +
447 +#if !defined(DEBUG_COMPOSITION)
448 + color.rgb *= 1.0 - EncodeAO(ao);
449 +#else
450 + color.rgb = 1.0 - EncodeAO(ao);
451 +#endif
452 +
453 + return color;
454 +}
455 +
456 +// Final composition shader (ambient-only mode)
457 +VaryingsDefault VertCompositionGBuffer(AttributesDefault v)
458 +{
459 + VaryingsDefault o;
460 + o.pos = v.vertex;
461 +#if UNITY_UV_STARTS_AT_TOP
462 + o.uv = v.texcoord.xy * float2(1.0, -1.0) + float2(0.0, 1.0);
463 +#else
464 + o.uv = v.texcoord.xy;
465 +#endif
466 + o.uvSPR = UnityStereoTransformScreenSpaceTex(o.uv);
467 + return o;
468 +}
469 +
470 +#if !SHADER_API_GLES // excluding the MRT pass under GLES2
471 +
472 +struct CompositionOutput
473 +{
474 + half4 gbuffer0 : SV_Target0;
475 + half4 gbuffer3 : SV_Target1;
476 +};
477 +
478 +CompositionOutput FragCompositionGBuffer(VaryingsDefault i)
479 +{
480 + // Workaround: _OcclusionTexture_Texelsize hasn't been set properly
481 + // for some reasons. Use _ScreenParams instead.
482 + float2 delta = (_ScreenParams.zw - 1.0) / _Downsample;
483 + half ao = BlurSmall(_OcclusionTexture, i.uvSPR, delta);
484 +
485 + CompositionOutput o;
486 + o.gbuffer0 = half4(0.0, 0.0, 0.0, ao);
487 + o.gbuffer3 = half4((half3)EncodeAO(ao), 0.0);
488 + return o;
489 +}
490 +
491 +#else
492 +
493 +fixed4 FragCompositionGBuffer(VaryingsDefault i) : SV_Target0
494 +{
495 + return 0.0;
496 +}
497 +
498 +#endif
499 +
500 +#endif // __AMBIENT_OCCLUSION__
1 +fileFormatVersion: 2
2 +guid: 447591ee3d9d4204899be5fe25968ea0
3 +timeCreated: 1473323470
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Hidden/Post FX/Ambient Occlusion"
2 +{
3 + CGINCLUDE
4 +
5 + #pragma target 3.0
6 +
7 + ENDCG
8 +
9 + SubShader
10 + {
11 + ZTest Always Cull Off ZWrite Off
12 +
13 + // 0: Occlusion estimation with CameraDepthTexture
14 + Pass
15 + {
16 + CGPROGRAM
17 + #pragma vertex VertMultitex
18 + #pragma fragment FragAO
19 + #pragma multi_compile FOG_OFF FOG_LINEAR FOG_EXP FOG_EXP2
20 + #define SOURCE_DEPTH
21 + #include "AmbientOcclusion.cginc"
22 + ENDCG
23 + }
24 +
25 + // 1: Occlusion estimation with CameraDepthNormalsTexture
26 + Pass
27 + {
28 + CGPROGRAM
29 + #pragma vertex VertMultitex
30 + #pragma fragment FragAO
31 + #pragma multi_compile FOG_OFF FOG_LINEAR FOG_EXP FOG_EXP2
32 + #define SOURCE_DEPTHNORMALS
33 + #include "AmbientOcclusion.cginc"
34 + ENDCG
35 + }
36 +
37 + // 2: Occlusion estimation with G-Buffer
38 + Pass
39 + {
40 + CGPROGRAM
41 + #pragma vertex VertMultitex
42 + #pragma fragment FragAO
43 + #pragma multi_compile FOG_OFF FOG_LINEAR FOG_EXP FOG_EXP2
44 + #define SOURCE_GBUFFER
45 + #include "AmbientOcclusion.cginc"
46 + ENDCG
47 + }
48 +
49 + // 3: Separable blur (horizontal pass) with CameraDepthNormalsTexture
50 + Pass
51 + {
52 + CGPROGRAM
53 + #pragma vertex VertMultitex
54 + #pragma fragment FragBlur
55 + #define SOURCE_DEPTHNORMALS
56 + #define BLUR_HORIZONTAL
57 + #define BLUR_SAMPLE_CENTER_NORMAL
58 + #include "AmbientOcclusion.cginc"
59 + ENDCG
60 + }
61 +
62 + // 4: Separable blur (horizontal pass) with G-Buffer
63 + Pass
64 + {
65 + CGPROGRAM
66 + #pragma vertex VertMultitex
67 + #pragma fragment FragBlur
68 + #define SOURCE_GBUFFER
69 + #define BLUR_HORIZONTAL
70 + #define BLUR_SAMPLE_CENTER_NORMAL
71 + #include "AmbientOcclusion.cginc"
72 + ENDCG
73 + }
74 +
75 + // 5: Separable blur (vertical pass)
76 + Pass
77 + {
78 + CGPROGRAM
79 + #pragma vertex VertMultitex
80 + #pragma fragment FragBlur
81 + #define BLUR_VERTICAL
82 + #include "AmbientOcclusion.cginc"
83 + ENDCG
84 + }
85 +
86 + // 6: Final composition
87 + Pass
88 + {
89 + CGPROGRAM
90 + #pragma vertex VertMultitex
91 + #pragma fragment FragComposition
92 + #include "AmbientOcclusion.cginc"
93 + ENDCG
94 + }
95 +
96 + // 7: Final composition (ambient only mode)
97 + Pass
98 + {
99 + Blend Zero OneMinusSrcColor, Zero OneMinusSrcAlpha
100 +
101 + CGPROGRAM
102 + #pragma vertex VertCompositionGBuffer
103 + #pragma fragment FragCompositionGBuffer
104 + #include "AmbientOcclusion.cginc"
105 + ENDCG
106 + }
107 +
108 + // 8: Debug visualization
109 + Pass
110 + {
111 + CGPROGRAM
112 + #pragma vertex VertMultitex
113 + #pragma fragment FragComposition
114 + #define DEBUG_COMPOSITION
115 + #include "AmbientOcclusion.cginc"
116 + ENDCG
117 + }
118 + }
119 +}
1 +fileFormatVersion: 2
2 +guid: e881ae5627d1cc84395303acfbca6fb2
3 +timeCreated: 1462280790
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Hidden/Post FX/Blit"
2 +{
3 + Properties
4 + {
5 + _MainTex("Main Texture", 2D) = "white" {}
6 + }
7 +
8 + CGINCLUDE
9 +
10 + #include "UnityCG.cginc"
11 + #include "Common.cginc"
12 +
13 + struct Varyings
14 + {
15 + float2 uv : TEXCOORD0;
16 + float4 vertex : SV_POSITION;
17 + };
18 +
19 + Varyings VertBlit(AttributesDefault v)
20 + {
21 + Varyings o;
22 + o.vertex = UnityObjectToClipPos(v.vertex);
23 + o.uv = UnityStereoScreenSpaceUVAdjust(v.texcoord, _MainTex_ST);
24 + return o;
25 + }
26 +
27 + half4 FragBlit(Varyings i) : SV_Target
28 + {
29 + half4 col = tex2D(_MainTex, i.uv);
30 + return col;
31 + }
32 +
33 + ENDCG
34 +
35 + SubShader
36 + {
37 + Cull Off ZWrite Off ZTest Always
38 +
39 + Pass
40 + {
41 + CGPROGRAM
42 +
43 + #pragma vertex VertBlit
44 + #pragma fragment FragBlit
45 +
46 + ENDCG
47 + }
48 + }
49 +}
1 +fileFormatVersion: 2
2 +guid: 7d89469544dfa214eabdbf37fca76f40
3 +timeCreated: 1474297975
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +#ifndef __BLOOM__
2 +#define __BLOOM__
3 +
4 +#include "Common.cginc"
5 +
6 +// Brightness function
7 +half Brightness(half3 c)
8 +{
9 + return Max3(c);
10 +}
11 +
12 +// 3-tap median filter
13 +half3 Median(half3 a, half3 b, half3 c)
14 +{
15 + return a + b + c - min(min(a, b), c) - max(max(a, b), c);
16 +}
17 +
18 +// Downsample with a 4x4 box filter
19 +half3 DownsampleFilter(sampler2D tex, float2 uv, float2 texelSize)
20 +{
21 + float4 d = texelSize.xyxy * float4(-1.0, -1.0, 1.0, 1.0);
22 +
23 + half3 s;
24 + s = DecodeHDR(tex2D(tex, uv + d.xy));
25 + s += DecodeHDR(tex2D(tex, uv + d.zy));
26 + s += DecodeHDR(tex2D(tex, uv + d.xw));
27 + s += DecodeHDR(tex2D(tex, uv + d.zw));
28 +
29 + return s * (1.0 / 4.0);
30 +}
31 +
32 +// Downsample with a 4x4 box filter + anti-flicker filter
33 +half3 DownsampleAntiFlickerFilter(sampler2D tex, float2 uv, float2 texelSize)
34 +{
35 + float4 d = texelSize.xyxy * float4(-1.0, -1.0, 1.0, 1.0);
36 +
37 + half3 s1 = DecodeHDR(tex2D(tex, uv + d.xy));
38 + half3 s2 = DecodeHDR(tex2D(tex, uv + d.zy));
39 + half3 s3 = DecodeHDR(tex2D(tex, uv + d.xw));
40 + half3 s4 = DecodeHDR(tex2D(tex, uv + d.zw));
41 +
42 + // Karis's luma weighted average (using brightness instead of luma)
43 + half s1w = 1.0 / (Brightness(s1) + 1.0);
44 + half s2w = 1.0 / (Brightness(s2) + 1.0);
45 + half s3w = 1.0 / (Brightness(s3) + 1.0);
46 + half s4w = 1.0 / (Brightness(s4) + 1.0);
47 + half one_div_wsum = 1.0 / (s1w + s2w + s3w + s4w);
48 +
49 + return (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * one_div_wsum;
50 +}
51 +
52 +half3 UpsampleFilter(sampler2D tex, float2 uv, float2 texelSize, float sampleScale)
53 +{
54 +#if MOBILE_OR_CONSOLE
55 + // 4-tap bilinear upsampler
56 + float4 d = texelSize.xyxy * float4(-1.0, -1.0, 1.0, 1.0) * (sampleScale * 0.5);
57 +
58 + half3 s;
59 + s = DecodeHDR(tex2D(tex, uv + d.xy));
60 + s += DecodeHDR(tex2D(tex, uv + d.zy));
61 + s += DecodeHDR(tex2D(tex, uv + d.xw));
62 + s += DecodeHDR(tex2D(tex, uv + d.zw));
63 +
64 + return s * (1.0 / 4.0);
65 +#else
66 + // 9-tap bilinear upsampler (tent filter)
67 + float4 d = texelSize.xyxy * float4(1.0, 1.0, -1.0, 0.0) * sampleScale;
68 +
69 + half3 s;
70 + s = DecodeHDR(tex2D(tex, uv - d.xy));
71 + s += DecodeHDR(tex2D(tex, uv - d.wy)) * 2.0;
72 + s += DecodeHDR(tex2D(tex, uv - d.zy));
73 +
74 + s += DecodeHDR(tex2D(tex, uv + d.zw)) * 2.0;
75 + s += DecodeHDR(tex2D(tex, uv)) * 4.0;
76 + s += DecodeHDR(tex2D(tex, uv + d.xw)) * 2.0;
77 +
78 + s += DecodeHDR(tex2D(tex, uv + d.zy));
79 + s += DecodeHDR(tex2D(tex, uv + d.wy)) * 2.0;
80 + s += DecodeHDR(tex2D(tex, uv + d.xy));
81 +
82 + return s * (1.0 / 16.0);
83 +#endif
84 +}
85 +
86 +#endif // __BLOOM__
1 +fileFormatVersion: 2
2 +guid: 7d1f4dd94c8e6e940b0730076ea7d6d9
3 +timeCreated: 1462980395
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +//
2 +// Kino/Bloom v2 - Bloom filter for Unity
3 +//
4 +// Copyright (C) 2015, 2016 Keijiro Takahashi
5 +//
6 +// Permission is hereby granted, free of charge, to any person obtaining a copy
7 +// of this software and associated documentation files (the "Software"), to deal
8 +// in the Software without restriction, including without limitation the rights
9 +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 +// copies of the Software, and to permit persons to whom the Software is
11 +// furnished to do so, subject to the following conditions:
12 +//
13 +// The above copyright notice and this permission notice shall be included in
14 +// all copies or substantial portions of the Software.
15 +//
16 +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 +// THE SOFTWARE.
23 +//
24 +Shader "Hidden/Post FX/Bloom"
25 +{
26 + Properties
27 + {
28 + _MainTex ("", 2D) = "" {}
29 + _BaseTex ("", 2D) = "" {}
30 + _AutoExposure ("", 2D) = "" {}
31 + }
32 +
33 + CGINCLUDE
34 +
35 + #pragma target 3.0
36 + #include "UnityCG.cginc"
37 + #include "Bloom.cginc"
38 + #include "Common.cginc"
39 +
40 + sampler2D _BaseTex;
41 + float2 _BaseTex_TexelSize;
42 +
43 + sampler2D _AutoExposure;
44 +
45 + float _PrefilterOffs;
46 + float _Threshold;
47 + float3 _Curve;
48 + float _SampleScale;
49 +
50 + // -----------------------------------------------------------------------------
51 + // Vertex shaders
52 +
53 + struct VaryingsMultitex
54 + {
55 + float4 pos : SV_POSITION;
56 + float2 uvMain : TEXCOORD0;
57 + float2 uvBase : TEXCOORD1;
58 + };
59 +
60 + VaryingsMultitex VertMultitex(AttributesDefault v)
61 + {
62 + VaryingsMultitex o;
63 + o.pos = UnityObjectToClipPos(v.vertex);
64 + o.uvMain = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST);
65 + o.uvBase = o.uvMain;
66 +
67 + #if UNITY_UV_STARTS_AT_TOP
68 + if (_BaseTex_TexelSize.y < 0.0)
69 + o.uvBase.y = 1.0 - o.uvBase.y;
70 + #endif
71 +
72 + return o;
73 + }
74 +
75 + // -----------------------------------------------------------------------------
76 + // Fragment shaders
77 +
78 + half4 FetchAutoExposed(sampler2D tex, float2 uv)
79 + {
80 + float autoExposure = 1.0;
81 + uv = UnityStereoScreenSpaceUVAdjust(uv, _MainTex_ST);
82 + autoExposure = tex2D(_AutoExposure, uv).r;
83 + return tex2D(tex, uv) * autoExposure;
84 + }
85 +
86 + half4 FragPrefilter(VaryingsDefault i) : SV_Target
87 + {
88 + float2 uv = i.uv + _MainTex_TexelSize.xy * _PrefilterOffs;
89 +
90 + #if ANTI_FLICKER
91 + float3 d = _MainTex_TexelSize.xyx * float3(1.0, 1.0, 0.0);
92 + half4 s0 = SafeHDR(FetchAutoExposed(_MainTex, uv));
93 + half3 s1 = SafeHDR(FetchAutoExposed(_MainTex, uv - d.xz).rgb);
94 + half3 s2 = SafeHDR(FetchAutoExposed(_MainTex, uv + d.xz).rgb);
95 + half3 s3 = SafeHDR(FetchAutoExposed(_MainTex, uv - d.zy).rgb);
96 + half3 s4 = SafeHDR(FetchAutoExposed(_MainTex, uv + d.zy).rgb);
97 + half3 m = Median(Median(s0.rgb, s1, s2), s3, s4);
98 + #else
99 + half4 s0 = SafeHDR(FetchAutoExposed(_MainTex, uv));
100 + half3 m = s0.rgb;
101 + #endif
102 +
103 + #if UNITY_COLORSPACE_GAMMA
104 + m = GammaToLinearSpace(m);
105 + #endif
106 +
107 + // Pixel brightness
108 + half br = Brightness(m);
109 +
110 + // Under-threshold part: quadratic curve
111 + half rq = clamp(br - _Curve.x, 0.0, _Curve.y);
112 + rq = _Curve.z * rq * rq;
113 +
114 + // Combine and apply the brightness response curve.
115 + m *= max(rq, br - _Threshold) / max(br, 1e-5);
116 +
117 + return EncodeHDR(m);
118 + }
119 +
120 + half4 FragDownsample1(VaryingsDefault i) : SV_Target
121 + {
122 + #if ANTI_FLICKER
123 + return EncodeHDR(DownsampleAntiFlickerFilter(_MainTex, i.uvSPR, _MainTex_TexelSize.xy));
124 + #else
125 + return EncodeHDR(DownsampleFilter(_MainTex, i.uvSPR, _MainTex_TexelSize.xy));
126 + #endif
127 + }
128 +
129 + half4 FragDownsample2(VaryingsDefault i) : SV_Target
130 + {
131 + return EncodeHDR(DownsampleFilter(_MainTex, i.uvSPR, _MainTex_TexelSize.xy));
132 + }
133 +
134 + half4 FragUpsample(VaryingsMultitex i) : SV_Target
135 + {
136 + half3 base = DecodeHDR(tex2D(_BaseTex, i.uvBase));
137 + half3 blur = UpsampleFilter(_MainTex, i.uvMain, _MainTex_TexelSize.xy, _SampleScale);
138 + return EncodeHDR(base + blur);
139 + }
140 +
141 + ENDCG
142 +
143 + SubShader
144 + {
145 + ZTest Always Cull Off ZWrite Off
146 +
147 + Pass
148 + {
149 + CGPROGRAM
150 + #pragma multi_compile __ ANTI_FLICKER
151 + #pragma multi_compile __ UNITY_COLORSPACE_GAMMA
152 + #pragma vertex VertDefault
153 + #pragma fragment FragPrefilter
154 + ENDCG
155 + }
156 +
157 + Pass
158 + {
159 + CGPROGRAM
160 + #pragma multi_compile __ ANTI_FLICKER
161 + #pragma vertex VertDefault
162 + #pragma fragment FragDownsample1
163 + ENDCG
164 + }
165 +
166 + Pass
167 + {
168 + CGPROGRAM
169 + #pragma vertex VertDefault
170 + #pragma fragment FragDownsample2
171 + ENDCG
172 + }
173 +
174 + Pass
175 + {
176 + CGPROGRAM
177 + #pragma vertex VertMultitex
178 + #pragma fragment FragUpsample
179 + ENDCG
180 + }
181 + }
182 +}
1 +fileFormatVersion: 2
2 +guid: 4ceb73bc148699b469361531d6062548
3 +timeCreated: 1462953634
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Hidden/Post FX/Builtin Debug Views"
2 +{
3 + CGINCLUDE
4 +
5 + #include "UnityCG.cginc"
6 + #include "Common.cginc"
7 +
8 + #pragma exclude_renderers d3d11_9x
9 +
10 + sampler2D_float _CameraDepthTexture;
11 + sampler2D_float _CameraDepthNormalsTexture;
12 + sampler2D_float _CameraMotionVectorsTexture;
13 +
14 + float4 _CameraDepthTexture_ST;
15 + float4 _CameraDepthNormalsTexture_ST;
16 + float4 _CameraMotionVectorsTexture_ST;
17 +
18 + #if SOURCE_GBUFFER
19 + sampler2D _CameraGBufferTexture2;
20 + float4 _CameraGBufferTexture2_ST;
21 + #endif
22 +
23 + // -----------------------------------------------------------------------------
24 + // Depth
25 +
26 + float _DepthScale;
27 +
28 + float4 FragDepth(VaryingsDefault i) : SV_Target
29 + {
30 + float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, UnityStereoScreenSpaceUVAdjust(i.uv, _CameraDepthTexture_ST));
31 + depth = Linear01Depth(depth) * _DepthScale;
32 + float3 d = depth.xxx;
33 +
34 + #if !UNITY_COLORSPACE_GAMMA
35 + d = GammaToLinearSpace(d);
36 + #endif
37 +
38 + return float4(d, 1.0);
39 + }
40 +
41 + // -----------------------------------------------------------------------------
42 + // Normals
43 +
44 + float3 SampleNormal(float2 uv)
45 + {
46 + #if SOURCE_GBUFFER
47 + float3 norm = tex2D(_CameraGBufferTexture2, uv).xyz * 2.0 - 1.0;
48 + return mul((float3x3)unity_WorldToCamera, norm);
49 + #else
50 + float4 cdn = tex2D(_CameraDepthNormalsTexture, uv);
51 + return DecodeViewNormalStereo(cdn) * float3(1.0, 1.0, -1.0);
52 + #endif
53 + }
54 +
55 + float4 FragNormals(VaryingsDefault i) : SV_Target
56 + {
57 + float3 n = SampleNormal(UnityStereoScreenSpaceUVAdjust(i.uv, _CameraDepthNormalsTexture_ST));
58 +
59 + #if UNITY_COLORSPACE_GAMMA
60 + n = LinearToGammaSpace(n);
61 + #endif
62 +
63 + return float4(n, 1.0);
64 + }
65 +
66 + // -----------------------------------------------------------------------------
67 + // Motion vectors
68 +
69 + float _Opacity;
70 + float _Amplitude;
71 + float4 _Scale;
72 +
73 + float4 FragMovecsOpacity(VaryingsDefault i) : SV_Target
74 + {
75 + float4 src = tex2D(_MainTex, i.uv);
76 + return float4(src.rgb * _Opacity, src.a);
77 + }
78 +
79 + // Convert a motion vector into RGBA color.
80 + float4 VectorToColor(float2 mv)
81 + {
82 + float phi = atan2(mv.x, mv.y);
83 + float hue = (phi / UNITY_PI + 1.0) * 0.5;
84 +
85 + float r = abs(hue * 6.0 - 3.0) - 1.0;
86 + float g = 2.0 - abs(hue * 6.0 - 2.0);
87 + float b = 2.0 - abs(hue * 6.0 - 4.0);
88 + float a = length(mv);
89 +
90 + return saturate(float4(r, g, b, a));
91 + }
92 +
93 + float4 FragMovecsImaging(VaryingsDefault i) : SV_Target
94 + {
95 + float4 src = tex2D(_MainTex, i.uv);
96 +
97 + float2 mv = tex2D(_CameraMotionVectorsTexture, i.uv).rg * _Amplitude;
98 +
99 + #if UNITY_UV_STARTS_AT_TOP
100 + mv.y *= -1.0;
101 + #endif
102 +
103 + float4 mc = VectorToColor(mv);
104 +
105 + float3 rgb = src.rgb;
106 +
107 + #if !UNITY_COLORSPACE_GAMMA
108 + rgb = LinearToGammaSpace(rgb);
109 + #endif
110 +
111 + rgb = lerp(rgb, mc.rgb, mc.a * _Opacity);
112 +
113 + #if !UNITY_COLORSPACE_GAMMA
114 + rgb = GammaToLinearSpace(rgb);
115 + #endif
116 +
117 + return float4(rgb, src.a);
118 + }
119 +
120 + struct VaryingsArrows
121 + {
122 + float4 vertex : SV_POSITION;
123 + float2 scoord : TEXCOORD;
124 + float4 color : COLOR;
125 + };
126 +
127 + VaryingsArrows VertArrows(AttributesDefault v)
128 + {
129 + // Retrieve the motion vector.
130 + float4 uv = float4(v.texcoord.xy, 0.0, 0.0);
131 +
132 + #if UNITY_UV_STARTS_AT_TOP
133 + uv.y = 1.0 - uv.y;
134 + #endif
135 +
136 + float2 mv = tex2Dlod(_CameraMotionVectorsTexture, uv).rg * _Amplitude;
137 +
138 + #if UNITY_UV_STARTS_AT_TOP
139 + mv.y *= -1.0;
140 + #endif
141 +
142 + // Arrow color
143 + float4 color = VectorToColor(mv);
144 +
145 + // Make a rotation matrix based on the motion vector.
146 + float2x2 rot = float2x2(mv.y, mv.x, -mv.x, mv.y);
147 +
148 + // Rotate and scale the body of the arrow.
149 + float2 pos = mul(rot, v.vertex.zy) * _Scale.xy;
150 +
151 + // Normalized variant of the motion vector and the rotation matrix.
152 + float2 mv_n = normalize(mv);
153 + float2x2 rot_n = float2x2(mv_n.y, mv_n.x, -mv_n.x, mv_n.y);
154 +
155 + // Rotate and scale the head of the arrow.
156 + float2 head = float2(v.vertex.x, -abs(v.vertex.x)) * 0.3;
157 + head *= saturate(color.a);
158 + pos += mul(rot_n, head) * _Scale.xy;
159 +
160 + // Offset the arrow position.
161 + pos += v.texcoord.xy * 2.0 - 1.0;
162 +
163 + // Convert to the screen coordinates.
164 + float2 scoord = (pos + 1.0) * 0.5 * _ScreenParams.xy;
165 +
166 + // Snap to a pixel-perfect position.
167 + scoord = round(scoord);
168 +
169 + // Bring back to the normalized screen space.
170 + pos = (scoord + 0.5) * (_ScreenParams.zw - 1.0) * 2.0 - 1.0;
171 +
172 + // Color tweaks
173 + color.rgb = GammaToLinearSpace(lerp(color.rgb, 1.0, 0.5));
174 + color.a *= _Opacity;
175 +
176 + // Output
177 + VaryingsArrows o;
178 + o.vertex = float4(pos, 0.0, 1.0);
179 + o.scoord = scoord;
180 + o.color = saturate(color);
181 + return o;
182 + }
183 +
184 + float4 FragMovecsArrows(VaryingsArrows i) : SV_Target
185 + {
186 + // Pseudo anti-aliasing.
187 + float aa = length(frac(i.scoord) - 0.5) / 0.707;
188 + aa *= (aa * (aa * 0.305306011 + 0.682171111) + 0.012522878); // gamma
189 + return float4(i.color.rgb, i.color.a * aa);
190 + }
191 +
192 + ENDCG
193 +
194 + SubShader
195 + {
196 + Cull Off ZWrite Off ZTest Always
197 +
198 + // (0) - Depth
199 + Pass
200 + {
201 + CGPROGRAM
202 +
203 + #pragma vertex VertDefault
204 + #pragma fragment FragDepth
205 +
206 + ENDCG
207 + }
208 +
209 + // (1) - Normals
210 + Pass
211 + {
212 + CGPROGRAM
213 +
214 + #pragma vertex VertDefault
215 + #pragma fragment FragNormals
216 + #pragma multi_compile __ SOURCE_GBUFFER
217 +
218 + ENDCG
219 + }
220 +
221 + // (2) - Motion vectors - Opacity
222 + Pass
223 + {
224 + CGPROGRAM
225 +
226 + #pragma vertex VertDefault
227 + #pragma fragment FragMovecsOpacity
228 +
229 + ENDCG
230 + }
231 +
232 + // (3) - Motion vectors - Imaging
233 + Pass
234 + {
235 + CGPROGRAM
236 +
237 + #pragma vertex VertDefault
238 + #pragma fragment FragMovecsImaging
239 + #pragma multi_compile __ UNITY_COLORSPACE_GAMMA
240 +
241 + ENDCG
242 + }
243 +
244 + // (4) - Motion vectors - Arrows
245 + Pass
246 + {
247 + Blend SrcAlpha OneMinusSrcAlpha
248 +
249 + CGPROGRAM
250 +
251 + #pragma vertex VertArrows
252 + #pragma fragment FragMovecsArrows
253 +
254 + ENDCG
255 + }
256 + }
257 +}
1 +fileFormatVersion: 2
2 +guid: 72127ba7dd8c6b04bb3f29c7ee669813
3 +timeCreated: 1468224802
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +#ifndef __COLOR_GRADING__
2 +#define __COLOR_GRADING__
3 +
4 +#include "ACES.cginc"
5 +#include "Common.cginc"
6 +
7 +// Set to 1 to use more precise but more expensive log/linear conversions. I haven't found a proper
8 +// use case for the high precision version yet so I'm leaving this to 0.
9 +#define COLOR_GRADING_PRECISE_LOG 0
10 +
11 +//
12 +// Alexa LogC converters (El 1000)
13 +// See http://www.vocas.nl/webfm_send/964
14 +// It's a good fit to store HDR values in log as the range is pretty wide (1 maps to ~58.85666) and
15 +// is quick enough to compute.
16 +//
17 +struct ParamsLogC
18 +{
19 + half cut;
20 + half a, b, c, d, e, f;
21 +};
22 +
23 +static const ParamsLogC LogC =
24 +{
25 + 0.011361, // cut
26 + 5.555556, // a
27 + 0.047996, // b
28 + 0.244161, // c
29 + 0.386036, // d
30 + 5.301883, // e
31 + 0.092819 // f
32 +};
33 +
34 +half LinearToLogC_Precise(half x)
35 +{
36 + half o;
37 + if (x > LogC.cut)
38 + o = LogC.c * log10(LogC.a * x + LogC.b) + LogC.d;
39 + else
40 + o = LogC.e * x + LogC.f;
41 + return o;
42 +}
43 +
44 +half3 LinearToLogC(half3 x)
45 +{
46 +#if COLOR_GRADING_PRECISE_LOG
47 + return half3(
48 + LinearToLogC_Precise(x.x),
49 + LinearToLogC_Precise(x.y),
50 + LinearToLogC_Precise(x.z)
51 + );
52 +#else
53 + return LogC.c * log10(LogC.a * x + LogC.b) + LogC.d;
54 +#endif
55 +}
56 +
57 +half LogCToLinear_Precise(half x)
58 +{
59 + half o;
60 + if (x > LogC.e * LogC.cut + LogC.f)
61 + o = (pow(10.0, (x - LogC.d) / LogC.c) - LogC.b) / LogC.a;
62 + else
63 + o = (x - LogC.f) / LogC.e;
64 + return o;
65 +}
66 +
67 +half3 LogCToLinear(half3 x)
68 +{
69 +#if COLOR_GRADING_PRECISE_LOG
70 + return half3(
71 + LogCToLinear_Precise(x.x),
72 + LogCToLinear_Precise(x.y),
73 + LogCToLinear_Precise(x.z)
74 + );
75 +#else
76 + return (pow(10.0, (x - LogC.d) / LogC.c) - LogC.b) / LogC.a;
77 +#endif
78 +}
79 +
80 +//
81 +// White balance
82 +// Recommended workspace: ACEScg (linear)
83 +//
84 +static const half3x3 LIN_2_LMS_MAT = {
85 + 3.90405e-1, 5.49941e-1, 8.92632e-3,
86 + 7.08416e-2, 9.63172e-1, 1.35775e-3,
87 + 2.31082e-2, 1.28021e-1, 9.36245e-1
88 +};
89 +
90 +static const half3x3 LMS_2_LIN_MAT = {
91 + 2.85847e+0, -1.62879e+0, -2.48910e-2,
92 + -2.10182e-1, 1.15820e+0, 3.24281e-4,
93 + -4.18120e-2, -1.18169e-1, 1.06867e+0
94 +};
95 +
96 +half3 WhiteBalance(half3 c, half3 balance)
97 +{
98 + half3 lms = mul(LIN_2_LMS_MAT, c);
99 + lms *= balance;
100 + return mul(LMS_2_LIN_MAT, lms);
101 +}
102 +
103 +//
104 +// Luminance (Rec.709 primaries according to ACES specs)
105 +//
106 +half AcesLuminance(half3 c)
107 +{
108 + return dot(c, half3(0.2126, 0.7152, 0.0722));
109 +}
110 +
111 +//
112 +// Offset, Power, Slope (ASC-CDL)
113 +// Works in Log & Linear. Results will be different but still correct.
114 +//
115 +half3 OffsetPowerSlope(half3 c, half3 offset, half3 power, half3 slope)
116 +{
117 + half3 so = c * slope + offset;
118 + so = so > (0.0).xxx ? pow(so, power) : so;
119 + return so;
120 +}
121 +
122 +//
123 +// Lift, Gamma (pre-inverted), Gain
124 +// Recommended workspace: ACEScg (linear)
125 +//
126 +half3 LiftGammaGain(half3 c, half3 lift, half3 invgamma, half3 gain)
127 +{
128 + //return gain * (lift * (1.0 - c) + pow(max(c, kEpsilon), invgamma));
129 + //return pow(gain * (c + lift * (1.0 - c)), invgamma);
130 +
131 + half3 power = invgamma;
132 + half3 offset = lift * gain;
133 + half3 slope = ((1.0).xxx - lift) * gain;
134 + return OffsetPowerSlope(c, offset, power, slope);
135 +}
136 +
137 +//
138 +// Saturation (should be used after offset/power/slope)
139 +// Recommended workspace: ACEScc (log)
140 +// Optimal range: [0.0, 2.0]
141 +//
142 +half3 Saturation(half3 c, half sat)
143 +{
144 + half luma = AcesLuminance(c);
145 + return luma.xxx + sat * (c - luma.xxx);
146 +}
147 +
148 +//
149 +// Basic contrast curve
150 +// Recommended workspace: ACEScc (log)
151 +// Optimal range: [0.0, 2.0]
152 +//
153 +half3 ContrastLog(half3 c, half con)
154 +{
155 + return (c - ACEScc_MIDGRAY) * con + ACEScc_MIDGRAY;
156 +}
157 +
158 +//
159 +// Hue, Saturation, Value
160 +// Ranges:
161 +// Hue [0.0, 1.0]
162 +// Sat [0.0, 1.0]
163 +// Lum [0.0, HALF_MAX]
164 +//
165 +half3 RgbToHsv(half3 c)
166 +{
167 + half4 K = half4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
168 + half4 p = lerp(half4(c.bg, K.wz), half4(c.gb, K.xy), step(c.b, c.g));
169 + half4 q = lerp(half4(p.xyw, c.r), half4(c.r, p.yzx), step(p.x, c.r));
170 + half d = q.x - min(q.w, q.y);
171 + half e = EPSILON;
172 + return half3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
173 +}
174 +
175 +half3 HsvToRgb(half3 c)
176 +{
177 + half4 K = half4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
178 + half3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www);
179 + return c.z * lerp(K.xxx, saturate(p - K.xxx), c.y);
180 +}
181 +
182 +half RotateHue(half value, half low, half hi)
183 +{
184 + return (value < low)
185 + ? value + hi
186 + : (value > hi)
187 + ? value - hi
188 + : value;
189 +}
190 +
191 +//
192 +// Remaps Y/R/G/B values
193 +//
194 +half3 YrgbCurve(half3 c, sampler2D curveTex)
195 +{
196 + const float kHalfPixel = (1.0 / 128.0) / 2.0;
197 +
198 + // Y
199 + c += kHalfPixel.xxx;
200 + float mr = tex2D(curveTex, float2(c.r, 0.75)).a;
201 + float mg = tex2D(curveTex, float2(c.g, 0.75)).a;
202 + float mb = tex2D(curveTex, float2(c.b, 0.75)).a;
203 + c = saturate(float3(mr, mg, mb));
204 +
205 + // RGB
206 + c += kHalfPixel.xxx;
207 + float r = tex2D(curveTex, float2(c.r, 0.75)).r;
208 + float g = tex2D(curveTex, float2(c.g, 0.75)).g;
209 + float b = tex2D(curveTex, float2(c.b, 0.75)).b;
210 + return saturate(half3(r, g, b));
211 +}
212 +
213 +//
214 +// (X) Hue VS Hue - Remaps hue on a curve according to the current hue
215 +// Input is Hue [0.0, 1.0]
216 +// Output is Hue [0.0, 1.0]
217 +//
218 +half SecondaryHueHue(half hue, sampler2D curveTex)
219 +{
220 + half offset = saturate(tex2D(curveTex, half2(hue, 0.25)).x) - 0.5;
221 + hue += offset;
222 + hue = RotateHue(hue, 0.0, 1.0);
223 + return hue;
224 +}
225 +
226 +//
227 +// (Y) Hue VS Saturation - Remaps saturation on a curve according to the current hue
228 +// Input is Hue [0.0, 1.0]
229 +// Output is Saturation multiplier [0.0, 2.0]
230 +//
231 +half SecondaryHueSat(half hue, sampler2D curveTex)
232 +{
233 + return saturate(tex2D(curveTex, half2(hue, 0.25)).y) * 2.0;
234 +}
235 +
236 +//
237 +// (Z) Saturation VS Saturation - Remaps saturation on a curve according to the current saturation
238 +// Input is Saturation [0.0, 1.0]
239 +// Output is Saturation multiplier [0.0, 2.0]
240 +//
241 +half SecondarySatSat(half sat, sampler2D curveTex)
242 +{
243 + return saturate(tex2D(curveTex, half2(sat, 0.25)).z) * 2.0;
244 +}
245 +
246 +//
247 +// (W) Luminance VS Saturation - Remaps saturation on a curve according to the current luminance
248 +// Input is Luminance [0.0, 1.0]
249 +// Output is Saturation multiplier [0.0, 2.0]
250 +//
251 +half SecondaryLumSat(half lum, sampler2D curveTex)
252 +{
253 + return saturate(tex2D(curveTex, half2(lum, 0.25)).w) * 2.0;
254 +}
255 +
256 +//
257 +// Channel mixing (same as Photoshop's and DaVinci's Resolve)
258 +// Recommended workspace: ACEScg (linear)
259 +// Input mixers should be in range [-2.0;2.0]
260 +//
261 +half3 ChannelMixer(half3 c, half3 red, half3 green, half3 blue)
262 +{
263 + return half3(
264 + dot(c, red),
265 + dot(c, green),
266 + dot(c, blue)
267 + );
268 +}
269 +
270 +//
271 +// LUT grading
272 +// scaleOffset = (1 / lut_width, 1 / lut_height, lut_height - 1)
273 +//
274 +half3 ApplyLut2d(sampler2D tex, half3 uvw, half3 scaleOffset)
275 +{
276 + // Strip format where `height = sqrt(width)`
277 + uvw.z *= scaleOffset.z;
278 + half shift = floor(uvw.z);
279 + uvw.xy = uvw.xy * scaleOffset.z * scaleOffset.xy + scaleOffset.xy * 0.5;
280 + uvw.x += shift * scaleOffset.y;
281 + uvw.xyz = lerp(tex2D(tex, uvw.xy).rgb, tex2D(tex, uvw.xy + half2(scaleOffset.y, 0)).rgb, uvw.z - shift);
282 + return uvw;
283 +}
284 +
285 +half3 ApplyLut3d(sampler3D tex, half3 uvw)
286 +{
287 + return tex3D(tex, uvw).rgb;
288 +}
289 +
290 +#endif // __COLOR_GRADING__
1 +fileFormatVersion: 2
2 +guid: 26a62c2e30be83547bdfa9fe837165e3
3 +timeCreated: 1460363486
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +#ifndef __COMMON__
2 +#define __COMMON__
3 +
4 +#include "UnityCG.cginc"
5 +
6 +// Mobile: use RGBM instead of float/half RGB
7 +#define USE_RGBM defined(SHADER_API_MOBILE)
8 +
9 +#define MOBILE_OR_CONSOLE (defined(SHADER_API_MOBILE) || defined(SHADER_API_PSSL) || defined(SHADER_API_XBOXONE) || defined(SHADER_API_WIIU))
10 +
11 +#if defined(SHADER_API_PSSL)
12 +// No support for sampler2D_half on PS4 in 5.4
13 +#define sampler2D_half sampler2D_float
14 +#endif
15 +
16 +// -----------------------------------------------------------------------------
17 +// Uniforms
18 +
19 +#if defined(SEPARATE_TEXTURE_SAMPLER)
20 +Texture2D _MainTex;
21 +SamplerState sampler_MainTex;
22 +#else
23 +sampler2D _MainTex;
24 +#endif
25 +float4 _MainTex_TexelSize;
26 +float4 _MainTex_ST;
27 +
28 +// -----------------------------------------------------------------------------
29 +// Vertex shaders
30 +
31 +struct AttributesDefault
32 +{
33 + float4 vertex : POSITION;
34 + float4 texcoord : TEXCOORD0;
35 +};
36 +
37 +struct VaryingsDefault
38 +{
39 + float4 pos : SV_POSITION;
40 + float2 uv : TEXCOORD0;
41 + float2 uvSPR : TEXCOORD1; // Single Pass Stereo UVs
42 +};
43 +
44 +VaryingsDefault VertDefault(AttributesDefault v)
45 +{
46 + VaryingsDefault o;
47 + o.pos = UnityObjectToClipPos(v.vertex);
48 + o.uv = v.texcoord.xy;
49 + o.uvSPR = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST);
50 + return o;
51 +}
52 +
53 +// -----------------------------------------------------------------------------
54 +// Maths stuff
55 +
56 +#define HALF_MAX 65504.0
57 +#define EPSILON 1.0e-4
58 +#define UNITY_PI_2 (UNITY_PI * 2.0)
59 +
60 +inline half Min3(half3 x) { return min(x.x, min(x.y, x.z)); }
61 +inline half Min3(half x, half y, half z) { return min(x, min(y, z)); }
62 +
63 +inline half Max3(half3 x) { return max(x.x, max(x.y, x.z)); }
64 +inline half Max3(half x, half y, half z) { return max(x, max(y, z)); }
65 +
66 +inline half Min4(half4 x) { return min(x.x, min(x.y, min(x.z, x.w))); }
67 +inline half Min4(half x, half y, half z, half w) { return min(x, min(y, min(z, w))); }
68 +
69 +inline half Max4(half4 x) { return max(x.x, max(x.y, max(x.z, x.w))); }
70 +inline half Max4(half x, half y, half z, half w) { return max(x, max(y, min(z, w))); }
71 +
72 +inline half Pow2(half x) { return x * x; }
73 +inline half2 Pow2(half2 x) { return x * x; }
74 +inline half3 Pow2(half3 x) { return x * x; }
75 +inline half4 Pow2(half4 x) { return x * x; }
76 +
77 +inline half Pow3(half x) { return x * x * x; }
78 +inline half2 Pow3(half2 x) { return x * x * x; }
79 +inline half3 Pow3(half3 x) { return x * x * x; }
80 +inline half4 Pow3(half4 x) { return x * x * x; }
81 +
82 +#ifndef UNITY_STANDARD_BRDF_INCLUDED
83 +inline half Pow4(half x) { return x * x * x * x; }
84 +inline half2 Pow4(half2 x) { return x * x * x * x; }
85 +inline half3 Pow4(half3 x) { return x * x * x * x; }
86 +inline half4 Pow4(half4 x) { return x * x * x * x; }
87 +#endif
88 +
89 +// Returns the largest vector of v1 and v2
90 +inline half2 MaxV(half2 v1, half2 v2) { return dot(v1, v1) < dot(v2, v2) ? v2 : v1; }
91 +inline half3 MaxV(half3 v1, half3 v2) { return dot(v1, v1) < dot(v2, v2) ? v2 : v1; }
92 +inline half4 MaxV(half4 v1, half4 v2) { return dot(v1, v1) < dot(v2, v2) ? v2 : v1; }
93 +
94 +// Clamp HDR value within a safe range
95 +inline half SafeHDR(half c) { return min(c, HALF_MAX); }
96 +inline half2 SafeHDR(half2 c) { return min(c, HALF_MAX); }
97 +inline half3 SafeHDR(half3 c) { return min(c, HALF_MAX); }
98 +inline half4 SafeHDR(half4 c) { return min(c, HALF_MAX); }
99 +
100 +// Compatibility function
101 +#if (SHADER_TARGET < 50 && !defined(SHADER_API_PSSL))
102 +float rcp(float value)
103 +{
104 + return 1.0 / value;
105 +}
106 +#endif
107 +
108 +// Tonemapper from http://gpuopen.com/optimized-reversible-tonemapper-for-resolve/
109 +float4 FastToneMap(in float4 color)
110 +{
111 + return float4(color.rgb * rcp(Max3(color.rgb) + 1.), color.a);
112 +}
113 +
114 +float4 FastToneMap(in float4 color, in float weight)
115 +{
116 + return float4(color.rgb * rcp(weight * Max3(color.rgb) + 1.), color.a);
117 +}
118 +
119 +float4 FastToneUnmap(in float4 color)
120 +{
121 + return float4(color.rgb * rcp(1. - Max3(color.rgb)), color.a);
122 +}
123 +
124 +// Interleaved gradient function from Jimenez 2014 http://goo.gl/eomGso
125 +float GradientNoise(float2 uv)
126 +{
127 + uv = floor(uv * _ScreenParams.xy);
128 + float f = dot(float2(0.06711056, 0.00583715), uv);
129 + return frac(52.9829189 * frac(f));
130 +}
131 +
132 +// Z buffer depth to linear 0-1 depth
133 +// Handles orthographic projection correctly
134 +float LinearizeDepth(float z)
135 +{
136 + float isOrtho = unity_OrthoParams.w;
137 + float isPers = 1.0 - unity_OrthoParams.w;
138 + z *= _ZBufferParams.x;
139 + return (1.0 - isOrtho * z) / (isPers * z + _ZBufferParams.y);
140 +}
141 +
142 +// -----------------------------------------------------------------------------
143 +// RGBM encoding/decoding
144 +
145 +half4 EncodeHDR(float3 rgb)
146 +{
147 +#if USE_RGBM
148 + rgb *= 1.0 / 8.0;
149 + float m = max(max(rgb.r, rgb.g), max(rgb.b, 1e-6));
150 + m = ceil(m * 255.0) / 255.0;
151 + return half4(rgb / m, m);
152 +#else
153 + return half4(rgb, 0.0);
154 +#endif
155 +}
156 +
157 +float3 DecodeHDR(half4 rgba)
158 +{
159 +#if USE_RGBM
160 + return rgba.rgb * rgba.a * 8.0;
161 +#else
162 + return rgba.rgb;
163 +#endif
164 +}
165 +
166 +#endif // __COMMON__
1 +fileFormatVersion: 2
2 +guid: eb88496804341c648b32a75843d92ccb
3 +timeCreated: 1465205118
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +#ifndef __DEPTH_OF_FIELD__
2 +#define __DEPTH_OF_FIELD__
3 +
4 +#if SHADER_TARGET >= 50
5 + // Use separate texture/sampler objects on Shader Model 5.0
6 + #define SEPARATE_TEXTURE_SAMPLER
7 + #define DOF_DECL_TEX2D(tex) Texture2D tex; SamplerState sampler##tex
8 + #define DOF_TEX2D(tex, coord) tex.Sample(sampler##tex, coord)
9 +#else
10 + #define DOF_DECL_TEX2D(tex) sampler2D tex
11 + #define DOF_TEX2D(tex, coord) tex2D(tex, coord)
12 +#endif
13 +
14 +#include "Common.cginc"
15 +#include "DiskKernels.cginc"
16 +
17 +DOF_DECL_TEX2D(_CameraDepthTexture);
18 +DOF_DECL_TEX2D(_CameraMotionVectorsTexture);
19 +DOF_DECL_TEX2D(_CoCTex);
20 +
21 +// Camera parameters
22 +float _Distance;
23 +float _LensCoeff; // f^2 / (N * (S1 - f) * film_width * 2)
24 +float _MaxCoC;
25 +float _RcpMaxCoC;
26 +float _RcpAspect;
27 +half3 _TaaParams; // Jitter.x, Jitter.y, Blending
28 +
29 +struct VaryingsDOF
30 +{
31 + float4 pos : SV_POSITION;
32 + half2 uv : TEXCOORD0;
33 + half2 uvAlt : TEXCOORD1;
34 +};
35 +
36 +// Common vertex shader with single pass stereo rendering support
37 +VaryingsDOF VertDOF(AttributesDefault v)
38 +{
39 + half2 uvAlt = v.texcoord;
40 +#if UNITY_UV_STARTS_AT_TOP
41 + if (_MainTex_TexelSize.y < 0.0) uvAlt.y = 1.0 - uvAlt.y;
42 +#endif
43 +
44 + VaryingsDOF o;
45 + o.pos = UnityObjectToClipPos(v.vertex);
46 +
47 +#if defined(UNITY_SINGLE_PASS_STEREO)
48 + o.uv = UnityStereoScreenSpaceUVAdjust(v.texcoord, _MainTex_ST);
49 + o.uvAlt = UnityStereoScreenSpaceUVAdjust(uvAlt, _MainTex_ST);
50 +#else
51 + o.uv = v.texcoord;
52 + o.uvAlt = uvAlt;
53 +#endif
54 +
55 + return o;
56 +}
57 +
58 +// CoC calculation
59 +half4 FragCoC(VaryingsDOF i) : SV_Target
60 +{
61 + float depth = LinearEyeDepth(DOF_TEX2D(_CameraDepthTexture, i.uv));
62 + half coc = (depth - _Distance) * _LensCoeff / max(depth, 1e-5);
63 + return saturate(coc * 0.5 * _RcpMaxCoC + 0.5);
64 +}
65 +
66 +// Temporal filter
67 +half4 FragTempFilter(VaryingsDOF i) : SV_Target
68 +{
69 + float3 uvOffs = _MainTex_TexelSize.xyy * float3(1, 1, 0);
70 +
71 +#if defined(SEPARATE_TEXTURE_SAMPLER)
72 +
73 + half4 cocTL = _CoCTex.GatherRed(sampler_CoCTex, i.uv - uvOffs.xy * 0.5); // top-left
74 + half4 cocBR = _CoCTex.GatherRed(sampler_CoCTex, i.uv + uvOffs.xy * 0.5); // bottom-right
75 + half coc1 = cocTL.x; // top
76 + half coc2 = cocTL.z; // left
77 + half coc3 = cocBR.x; // bottom
78 + half coc4 = cocBR.z; // right
79 +
80 +#else
81 +
82 + half coc1 = DOF_TEX2D(_CoCTex, i.uv - uvOffs.xz).r; // top
83 + half coc2 = DOF_TEX2D(_CoCTex, i.uv - uvOffs.zy).r; // left
84 + half coc3 = DOF_TEX2D(_CoCTex, i.uv + uvOffs.zy).r; // bottom
85 + half coc4 = DOF_TEX2D(_CoCTex, i.uv + uvOffs.xz).r; // right
86 +
87 +#endif
88 +
89 + // Dejittered center sample.
90 + half coc0 = DOF_TEX2D(_CoCTex, i.uv - _TaaParams.xy).r;
91 +
92 + // CoC dilation: determine the closest point in the four neighbors.
93 + float3 closest = float3(0, 0, coc0);
94 + closest = coc1 < closest.z ? float3(-uvOffs.xz, coc1) : closest;
95 + closest = coc2 < closest.z ? float3(-uvOffs.zy, coc2) : closest;
96 + closest = coc3 < closest.z ? float3(+uvOffs.zy, coc3) : closest;
97 + closest = coc4 < closest.z ? float3(+uvOffs.xz, coc4) : closest;
98 +
99 + // Sample the history buffer with the motion vector at the closest point.
100 + float2 motion = DOF_TEX2D(_CameraMotionVectorsTexture, i.uv + closest.xy).xy;
101 + half cocHis = DOF_TEX2D(_MainTex, i.uv - motion).r;
102 +
103 + // Neighborhood clamping.
104 + half cocMin = closest.z;
105 + half cocMax = max(max(max(max(coc0, coc1), coc2), coc3), coc4);
106 + cocHis = clamp(cocHis, cocMin, cocMax);
107 +
108 + // Blend with the history.
109 + return lerp(coc0, cocHis, _TaaParams.z);
110 +}
111 +
112 +// Prefilter: downsampling and premultiplying.
113 +half4 FragPrefilter(VaryingsDOF i) : SV_Target
114 +{
115 +#if defined(SEPARATE_TEXTURE_SAMPLER)
116 +
117 + // Sample source colors.
118 + half4 c_r = _MainTex.GatherRed (sampler_MainTex, i.uv);
119 + half4 c_g = _MainTex.GatherGreen(sampler_MainTex, i.uv);
120 + half4 c_b = _MainTex.GatherBlue (sampler_MainTex, i.uv);
121 +
122 + half3 c0 = half3(c_r.x, c_g.x, c_b.x);
123 + half3 c1 = half3(c_r.y, c_g.y, c_b.y);
124 + half3 c2 = half3(c_r.z, c_g.z, c_b.z);
125 + half3 c3 = half3(c_r.w, c_g.w, c_b.w);
126 +
127 + // Sample CoCs.
128 + half4 cocs = _CoCTex.Gather(sampler_CoCTex, i.uvAlt) * 2.0 - 1.0;
129 + half coc0 = cocs.x;
130 + half coc1 = cocs.y;
131 + half coc2 = cocs.z;
132 + half coc3 = cocs.w;
133 +
134 +#else
135 +
136 + float3 duv = _MainTex_TexelSize.xyx * float3(0.5, 0.5, -0.5);
137 +
138 + // Sample source colors.
139 + half3 c0 = DOF_TEX2D(_MainTex, i.uv - duv.xy).rgb;
140 + half3 c1 = DOF_TEX2D(_MainTex, i.uv - duv.zy).rgb;
141 + half3 c2 = DOF_TEX2D(_MainTex, i.uv + duv.zy).rgb;
142 + half3 c3 = DOF_TEX2D(_MainTex, i.uv + duv.xy).rgb;
143 +
144 + // Sample CoCs.
145 + half coc0 = DOF_TEX2D(_CoCTex, i.uvAlt - duv.xy).r * 2.0 - 1.0;
146 + half coc1 = DOF_TEX2D(_CoCTex, i.uvAlt - duv.zy).r * 2.0 - 1.0;
147 + half coc2 = DOF_TEX2D(_CoCTex, i.uvAlt + duv.zy).r * 2.0 - 1.0;
148 + half coc3 = DOF_TEX2D(_CoCTex, i.uvAlt + duv.xy).r * 2.0 - 1.0;
149 +
150 +#endif
151 +
152 + // Apply CoC and luma weights to reduce bleeding and flickering.
153 + float w0 = abs(coc0) / (Max3(c0) + 1.0);
154 + float w1 = abs(coc1) / (Max3(c1) + 1.0);
155 + float w2 = abs(coc2) / (Max3(c2) + 1.0);
156 + float w3 = abs(coc3) / (Max3(c3) + 1.0);
157 +
158 + // Weighted average of the color samples
159 + half3 avg = c0 * w0 + c1 * w1 + c2 * w2 + c3 * w3;
160 + avg /= max(w0 + w1 + w2 + w3, 1e-5);
161 +
162 + // Select the largest CoC value.
163 + half coc_min = Min4(coc0, coc1, coc2, coc3);
164 + half coc_max = Max4(coc0, coc1, coc2, coc3);
165 + half coc = (-coc_min > coc_max ? coc_min : coc_max) * _MaxCoC;
166 +
167 + // Premultiply CoC again.
168 + avg *= smoothstep(0, _MainTex_TexelSize.y * 2, abs(coc));
169 +
170 +#if defined(UNITY_COLORSPACE_GAMMA)
171 + avg = GammaToLinearSpace(avg);
172 +#endif
173 +
174 + return half4(avg, coc);
175 +}
176 +
177 +// Bokeh filter with disk-shaped kernels
178 +half4 FragBlur(VaryingsDOF i) : SV_Target
179 +{
180 + half4 samp0 = DOF_TEX2D(_MainTex, i.uv);
181 +
182 + half4 bgAcc = 0.0; // Background: far field bokeh
183 + half4 fgAcc = 0.0; // Foreground: near field bokeh
184 +
185 + UNITY_LOOP for (int si = 0; si < kSampleCount; si++)
186 + {
187 + float2 disp = kDiskKernel[si] * _MaxCoC;
188 + float dist = length(disp);
189 +
190 + float2 duv = float2(disp.x * _RcpAspect, disp.y);
191 + half4 samp = DOF_TEX2D(_MainTex, i.uv + duv);
192 +
193 + // BG: Compare CoC of the current sample and the center sample
194 + // and select smaller one.
195 + half bgCoC = max(min(samp0.a, samp.a), 0.0);
196 +
197 + // Compare the CoC to the sample distance.
198 + // Add a small margin to smooth out.
199 + const half margin = _MainTex_TexelSize.y * 2;
200 + half bgWeight = saturate((bgCoC - dist + margin) / margin);
201 + half fgWeight = saturate((-samp.a - dist + margin) / margin);
202 +
203 + // Cut influence from focused areas because they're darkened by CoC
204 + // premultiplying. This is only needed for near field.
205 + fgWeight *= step(_MainTex_TexelSize.y, -samp.a);
206 +
207 + // Accumulation
208 + bgAcc += half4(samp.rgb, 1.0) * bgWeight;
209 + fgAcc += half4(samp.rgb, 1.0) * fgWeight;
210 + }
211 +
212 + // Get the weighted average.
213 + bgAcc.rgb /= bgAcc.a + (bgAcc.a == 0.0); // zero-div guard
214 + fgAcc.rgb /= fgAcc.a + (fgAcc.a == 0.0);
215 +
216 + // BG: Calculate the alpha value only based on the center CoC.
217 + // This is a rather aggressive approximation but provides stable results.
218 + bgAcc.a = smoothstep(_MainTex_TexelSize.y, _MainTex_TexelSize.y * 2.0, samp0.a);
219 +
220 + // FG: Normalize the total of the weights.
221 + fgAcc.a *= UNITY_PI / kSampleCount;
222 +
223 + // Alpha premultiplying
224 + half alpha = saturate(fgAcc.a);
225 + half3 rgb = lerp(bgAcc.rgb, fgAcc.rgb, alpha);
226 +
227 + return half4(rgb, alpha);
228 +}
229 +
230 +// Postfilter blur
231 +half4 FragPostBlur(VaryingsDOF i) : SV_Target
232 +{
233 + // 9 tap tent filter with 4 bilinear samples
234 + const float4 duv = _MainTex_TexelSize.xyxy * float4(0.5, 0.5, -0.5, 0);
235 + half4 acc;
236 + acc = DOF_TEX2D(_MainTex, i.uv - duv.xy);
237 + acc += DOF_TEX2D(_MainTex, i.uv - duv.zy);
238 + acc += DOF_TEX2D(_MainTex, i.uv + duv.zy);
239 + acc += DOF_TEX2D(_MainTex, i.uv + duv.xy);
240 + return acc / 4.0;
241 +}
242 +
243 +#endif // __DEPTH_OF_FIELD__
1 +fileFormatVersion: 2
2 +guid: ddc2c19b8a216d748a357ffe32ba4dc1
3 +timeCreated: 1472211508
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Hidden/Post FX/Depth Of Field"
2 +{
3 + Properties
4 + {
5 + _MainTex ("", 2D) = "black"
6 + }
7 +
8 + CGINCLUDE
9 + #pragma exclude_renderers d3d11_9x
10 + ENDCG
11 +
12 + // SubShader with SM 5.0 support
13 + // Gather intrinsics are used to reduce texture sample count.
14 + SubShader
15 + {
16 + Cull Off ZWrite Off ZTest Always
17 +
18 + Pass // 0
19 + {
20 + Name "CoC Calculation"
21 + CGPROGRAM
22 + #pragma target 3.0
23 + #pragma vertex VertDOF
24 + #pragma fragment FragCoC
25 + #include "DepthOfField.cginc"
26 + ENDCG
27 + }
28 +
29 + Pass // 1
30 + {
31 + Name "CoC Temporal Filter"
32 + CGPROGRAM
33 + #pragma target 5.0
34 + #pragma vertex VertDOF
35 + #pragma fragment FragTempFilter
36 + #include "DepthOfField.cginc"
37 + ENDCG
38 + }
39 +
40 + Pass // 2
41 + {
42 + Name "Downsample and Prefilter"
43 + CGPROGRAM
44 + #pragma target 5.0
45 + #pragma vertex VertDOF
46 + #pragma fragment FragPrefilter
47 + #pragma multi_compile __ UNITY_COLORSPACE_GAMMA
48 + #include "DepthOfField.cginc"
49 + ENDCG
50 + }
51 +
52 + Pass // 3
53 + {
54 + Name "Bokeh Filter (small)"
55 + CGPROGRAM
56 + #pragma target 3.0
57 + #pragma vertex VertDOF
58 + #pragma fragment FragBlur
59 + #define KERNEL_SMALL
60 + #include "DepthOfField.cginc"
61 + ENDCG
62 + }
63 +
64 + Pass // 4
65 + {
66 + Name "Bokeh Filter (medium)"
67 + CGPROGRAM
68 + #pragma target 3.0
69 + #pragma vertex VertDOF
70 + #pragma fragment FragBlur
71 + #define KERNEL_MEDIUM
72 + #include "DepthOfField.cginc"
73 + ENDCG
74 + }
75 +
76 + Pass // 5
77 + {
78 + Name "Bokeh Filter (large)"
79 + CGPROGRAM
80 + #pragma target 3.0
81 + #pragma vertex VertDOF
82 + #pragma fragment FragBlur
83 + #define KERNEL_LARGE
84 + #include "DepthOfField.cginc"
85 + ENDCG
86 + }
87 +
88 + Pass // 6
89 + {
90 + Name "Bokeh Filter (very large)"
91 + CGPROGRAM
92 + #pragma target 3.0
93 + #pragma vertex VertDOF
94 + #pragma fragment FragBlur
95 + #define KERNEL_VERYLARGE
96 + #include "DepthOfField.cginc"
97 + ENDCG
98 + }
99 +
100 + Pass // 7
101 + {
102 + Name "Postfilter"
103 + CGPROGRAM
104 + #pragma target 3.0
105 + #pragma vertex VertDOF
106 + #pragma fragment FragPostBlur
107 + #include "DepthOfField.cginc"
108 + ENDCG
109 + }
110 + }
111 +
112 + // Fallback SubShader with SM 3.0
113 + SubShader
114 + {
115 + Cull Off ZWrite Off ZTest Always
116 +
117 + Pass // 0
118 + {
119 + Name "CoC Calculation"
120 + CGPROGRAM
121 + #pragma target 3.0
122 + #pragma vertex VertDOF
123 + #pragma fragment FragCoC
124 + #include "DepthOfField.cginc"
125 + ENDCG
126 + }
127 +
128 + Pass // 1
129 + {
130 + Name "CoC Temporal Filter"
131 + CGPROGRAM
132 + #pragma target 3.0
133 + #pragma vertex VertDOF
134 + #pragma fragment FragTempFilter
135 + #include "DepthOfField.cginc"
136 + ENDCG
137 + }
138 +
139 + Pass // 2
140 + {
141 + Name "Downsample and Prefilter"
142 + CGPROGRAM
143 + #pragma target 3.0
144 + #pragma vertex VertDOF
145 + #pragma fragment FragPrefilter
146 + #pragma multi_compile __ UNITY_COLORSPACE_GAMMA
147 + #include "DepthOfField.cginc"
148 + ENDCG
149 + }
150 +
151 + Pass // 3
152 + {
153 + Name "Bokeh Filter (small)"
154 + CGPROGRAM
155 + #pragma target 3.0
156 + #pragma vertex VertDOF
157 + #pragma fragment FragBlur
158 + #define KERNEL_SMALL
159 + #include "DepthOfField.cginc"
160 + ENDCG
161 + }
162 +
163 + Pass // 4
164 + {
165 + Name "Bokeh Filter (medium)"
166 + CGPROGRAM
167 + #pragma target 3.0
168 + #pragma vertex VertDOF
169 + #pragma fragment FragBlur
170 + #define KERNEL_MEDIUM
171 + #include "DepthOfField.cginc"
172 + ENDCG
173 + }
174 +
175 + Pass // 5
176 + {
177 + Name "Bokeh Filter (large)"
178 + CGPROGRAM
179 + #pragma target 3.0
180 + #pragma vertex VertDOF
181 + #pragma fragment FragBlur
182 + #define KERNEL_LARGE
183 + #include "DepthOfField.cginc"
184 + ENDCG
185 + }
186 +
187 + Pass // 6
188 + {
189 + Name "Bokeh Filter (very large)"
190 + CGPROGRAM
191 + #pragma target 3.0
192 + #pragma vertex VertDOF
193 + #pragma fragment FragBlur
194 + #define KERNEL_VERYLARGE
195 + #include "DepthOfField.cginc"
196 + ENDCG
197 + }
198 +
199 + Pass // 7
200 + {
201 + Name "Postfilter"
202 + CGPROGRAM
203 + #pragma target 3.0
204 + #pragma vertex VertDOF
205 + #pragma fragment FragPostBlur
206 + #include "DepthOfField.cginc"
207 + ENDCG
208 + }
209 + }
210 +
211 + FallBack Off
212 +}
1 +fileFormatVersion: 2
2 +guid: ac8ed710934a3564686a096bb351caee
3 +timeCreated: 1465484939
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +#ifndef __DISK_KERNELS__
2 +#define __DISK_KERNELS__
3 +
4 +#if !defined(KERNEL_SMALL) && !defined(KERNEL_MEDIUM) && \
5 + !defined(KERNEL_LARGE) && !defined(KERNEL_VERYLARGE)
6 +
7 +static const int kSampleCount = 1;
8 +static const float2 kDiskKernel[1] = { float2(0, 0) };
9 +
10 +#endif
11 +
12 +#if defined(KERNEL_SMALL)
13 +
14 +// rings = 2
15 +// points per ring = 5
16 +static const int kSampleCount = 16;
17 +static const float2 kDiskKernel[kSampleCount] = {
18 + float2(0,0),
19 + float2(0.54545456,0),
20 + float2(0.16855472,0.5187581),
21 + float2(-0.44128203,0.3206101),
22 + float2(-0.44128197,-0.3206102),
23 + float2(0.1685548,-0.5187581),
24 + float2(1,0),
25 + float2(0.809017,0.58778524),
26 + float2(0.30901697,0.95105654),
27 + float2(-0.30901703,0.9510565),
28 + float2(-0.80901706,0.5877852),
29 + float2(-1,0),
30 + float2(-0.80901694,-0.58778536),
31 + float2(-0.30901664,-0.9510566),
32 + float2(0.30901712,-0.9510565),
33 + float2(0.80901694,-0.5877853),
34 +};
35 +
36 +#endif
37 +
38 +#if defined(KERNEL_MEDIUM)
39 +
40 +// rings = 3
41 +// points per ring = 7
42 +static const int kSampleCount = 22;
43 +static const float2 kDiskKernel[kSampleCount] = {
44 + float2(0,0),
45 + float2(0.53333336,0),
46 + float2(0.3325279,0.4169768),
47 + float2(-0.11867785,0.5199616),
48 + float2(-0.48051673,0.2314047),
49 + float2(-0.48051673,-0.23140468),
50 + float2(-0.11867763,-0.51996166),
51 + float2(0.33252785,-0.4169769),
52 + float2(1,0),
53 + float2(0.90096885,0.43388376),
54 + float2(0.6234898,0.7818315),
55 + float2(0.22252098,0.9749279),
56 + float2(-0.22252095,0.9749279),
57 + float2(-0.62349,0.7818314),
58 + float2(-0.90096885,0.43388382),
59 + float2(-1,0),
60 + float2(-0.90096885,-0.43388376),
61 + float2(-0.6234896,-0.7818316),
62 + float2(-0.22252055,-0.974928),
63 + float2(0.2225215,-0.9749278),
64 + float2(0.6234897,-0.7818316),
65 + float2(0.90096885,-0.43388376),
66 +};
67 +
68 +#endif
69 +
70 +#if defined(KERNEL_LARGE)
71 +
72 +// rings = 4
73 +// points per ring = 7
74 +static const int kSampleCount = 43;
75 +static const float2 kDiskKernel[kSampleCount] = {
76 + float2(0,0),
77 + float2(0.36363637,0),
78 + float2(0.22672357,0.28430238),
79 + float2(-0.08091671,0.35451925),
80 + float2(-0.32762504,0.15777594),
81 + float2(-0.32762504,-0.15777591),
82 + float2(-0.08091656,-0.35451928),
83 + float2(0.22672352,-0.2843024),
84 + float2(0.6818182,0),
85 + float2(0.614297,0.29582983),
86 + float2(0.42510667,0.5330669),
87 + float2(0.15171885,0.6647236),
88 + float2(-0.15171883,0.6647236),
89 + float2(-0.4251068,0.53306687),
90 + float2(-0.614297,0.29582986),
91 + float2(-0.6818182,0),
92 + float2(-0.614297,-0.29582983),
93 + float2(-0.42510656,-0.53306705),
94 + float2(-0.15171856,-0.66472363),
95 + float2(0.1517192,-0.6647235),
96 + float2(0.4251066,-0.53306705),
97 + float2(0.614297,-0.29582983),
98 + float2(1,0),
99 + float2(0.9555728,0.2947552),
100 + float2(0.82623875,0.5633201),
101 + float2(0.6234898,0.7818315),
102 + float2(0.36534098,0.93087375),
103 + float2(0.07473,0.9972038),
104 + float2(-0.22252095,0.9749279),
105 + float2(-0.50000006,0.8660254),
106 + float2(-0.73305196,0.6801727),
107 + float2(-0.90096885,0.43388382),
108 + float2(-0.98883086,0.14904208),
109 + float2(-0.9888308,-0.14904249),
110 + float2(-0.90096885,-0.43388376),
111 + float2(-0.73305184,-0.6801728),
112 + float2(-0.4999999,-0.86602545),
113 + float2(-0.222521,-0.9749279),
114 + float2(0.07473029,-0.99720377),
115 + float2(0.36534148,-0.9308736),
116 + float2(0.6234897,-0.7818316),
117 + float2(0.8262388,-0.56332),
118 + float2(0.9555729,-0.29475483),
119 +};
120 +
121 +#endif
122 +
123 +#if defined(KERNEL_VERYLARGE)
124 +
125 +// rings = 5
126 +// points per ring = 7
127 +static const int kSampleCount = 71;
128 +static const float2 kDiskKernel[kSampleCount] = {
129 + float2(0,0),
130 + float2(0.2758621,0),
131 + float2(0.1719972,0.21567768),
132 + float2(-0.061385095,0.26894566),
133 + float2(-0.24854316,0.1196921),
134 + float2(-0.24854316,-0.11969208),
135 + float2(-0.061384983,-0.2689457),
136 + float2(0.17199717,-0.21567771),
137 + float2(0.51724136,0),
138 + float2(0.46601835,0.22442262),
139 + float2(0.32249472,0.40439558),
140 + float2(0.11509705,0.50427306),
141 + float2(-0.11509704,0.50427306),
142 + float2(-0.3224948,0.40439552),
143 + float2(-0.46601835,0.22442265),
144 + float2(-0.51724136,0),
145 + float2(-0.46601835,-0.22442262),
146 + float2(-0.32249463,-0.40439564),
147 + float2(-0.11509683,-0.5042731),
148 + float2(0.11509732,-0.504273),
149 + float2(0.32249466,-0.40439564),
150 + float2(0.46601835,-0.22442262),
151 + float2(0.7586207,0),
152 + float2(0.7249173,0.22360738),
153 + float2(0.6268018,0.4273463),
154 + float2(0.47299224,0.59311354),
155 + float2(0.27715522,0.7061801),
156 + float2(0.056691725,0.75649947),
157 + float2(-0.168809,0.7396005),
158 + float2(-0.3793104,0.65698475),
159 + float2(-0.55610836,0.51599306),
160 + float2(-0.6834936,0.32915324),
161 + float2(-0.7501475,0.113066405),
162 + float2(-0.7501475,-0.11306671),
163 + float2(-0.6834936,-0.32915318),
164 + float2(-0.5561083,-0.5159932),
165 + float2(-0.37931028,-0.6569848),
166 + float2(-0.16880904,-0.7396005),
167 + float2(0.056691945,-0.7564994),
168 + float2(0.2771556,-0.7061799),
169 + float2(0.47299215,-0.59311366),
170 + float2(0.62680185,-0.4273462),
171 + float2(0.72491735,-0.22360711),
172 + float2(1,0),
173 + float2(0.9749279,0.22252093),
174 + float2(0.90096885,0.43388376),
175 + float2(0.7818315,0.6234898),
176 + float2(0.6234898,0.7818315),
177 + float2(0.43388364,0.9009689),
178 + float2(0.22252098,0.9749279),
179 + float2(0,1),
180 + float2(-0.22252095,0.9749279),
181 + float2(-0.43388385,0.90096885),
182 + float2(-0.62349,0.7818314),
183 + float2(-0.7818317,0.62348956),
184 + float2(-0.90096885,0.43388382),
185 + float2(-0.9749279,0.22252093),
186 + float2(-1,0),
187 + float2(-0.9749279,-0.22252087),
188 + float2(-0.90096885,-0.43388376),
189 + float2(-0.7818314,-0.6234899),
190 + float2(-0.6234896,-0.7818316),
191 + float2(-0.43388346,-0.900969),
192 + float2(-0.22252055,-0.974928),
193 + float2(0,-1),
194 + float2(0.2225215,-0.9749278),
195 + float2(0.4338835,-0.90096897),
196 + float2(0.6234897,-0.7818316),
197 + float2(0.78183144,-0.62348986),
198 + float2(0.90096885,-0.43388376),
199 + float2(0.9749279,-0.22252086),
200 +};
201 +
202 +#endif
203 +
204 +#endif // __DISK_KERNELS__
1 +fileFormatVersion: 2
2 +guid: faeb738b5a2c3ff43bd104dd5b1a275c
3 +timeCreated: 1476954194
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +#ifndef __EYE_ADAPTATION__
2 +#define __EYE_ADAPTATION__
3 +
4 +// Optimal values for PS4/GCN
5 +// Using a group size of 32x32 seems to be a bit faster on Kepler/Maxwell
6 +// Don't forget to update 'EyeAdaptationController.cs' if you change these values !
7 +#define HISTOGRAM_BINS 64
8 +#define HISTOGRAM_TEXELS HISTOGRAM_BINS / 4
9 +#define HISTOGRAM_THREAD_X 16
10 +#define HISTOGRAM_THREAD_Y 16
11 +
12 +float GetHistogramBinFromLuminance(float value, float2 scaleOffset)
13 +{
14 + return saturate(log2(value) * scaleOffset.x + scaleOffset.y);
15 +}
16 +
17 +float GetLuminanceFromHistogramBin(float bin, float2 scaleOffset)
18 +{
19 + return exp2((bin - scaleOffset.y) / scaleOffset.x);
20 +}
21 +
22 +#endif // __EYE_ADAPTATION__
1 +fileFormatVersion: 2
2 +guid: d2f406cad28afda489b94594fb3ce0af
3 +timeCreated: 1465898178
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Hidden/Post FX/Eye Adaptation"
2 +{
3 + Properties
4 + {
5 + _MainTex("Texture", 2D) = "white" {}
6 + }
7 +
8 + CGINCLUDE
9 +
10 + #pragma target 4.5
11 + #pragma multi_compile __ AUTO_KEY_VALUE
12 + #include "UnityCG.cginc"
13 + #include "Common.cginc"
14 + #include "EyeAdaptation.cginc"
15 +
16 + // Eye adaptation pass
17 + float4 _Params; // x: lowPercent, y: highPercent, z: minBrightness, w: maxBrightness
18 + float2 _Speed; // x: down, y: up
19 + float4 _ScaleOffsetRes; // x: scale, y: offset, w: histogram pass width, h: histogram pass height
20 + float _ExposureCompensation;
21 +
22 + StructuredBuffer<uint> _Histogram;
23 +
24 + float GetBinValue(uint index, float maxHistogramValue)
25 + {
26 + return float(_Histogram[index]) * maxHistogramValue;
27 + }
28 +
29 + // Done in the vertex shader
30 + float FindMaxHistogramValue()
31 + {
32 + uint maxValue = 0u;
33 +
34 + for (uint i = 0; i < HISTOGRAM_BINS; i++)
35 + {
36 + uint h = _Histogram[i];
37 + maxValue = max(maxValue, h);
38 + }
39 +
40 + return float(maxValue);
41 + }
42 +
43 + void FilterLuminance(uint i, float maxHistogramValue, inout float4 filter)
44 + {
45 + float binValue = GetBinValue(i, maxHistogramValue);
46 +
47 + // Filter dark areas
48 + float offset = min(filter.z, binValue);
49 + binValue -= offset;
50 + filter.zw -= offset.xx;
51 +
52 + // Filter highlights
53 + binValue = min(filter.w, binValue);
54 + filter.w -= binValue;
55 +
56 + // Luminance at the bin
57 + float luminance = GetLuminanceFromHistogramBin(float(i) / float(HISTOGRAM_BINS), _ScaleOffsetRes.xy);
58 +
59 + filter.xy += float2(luminance * binValue, binValue);
60 + }
61 +
62 + float GetAverageLuminance(float maxHistogramValue)
63 + {
64 + // Sum of all bins
65 + uint i;
66 + float totalSum = 0.0;
67 +
68 + UNITY_LOOP
69 + for (i = 0; i < HISTOGRAM_BINS; i++)
70 + totalSum += GetBinValue(i, maxHistogramValue);
71 +
72 + // Skip darker and lighter parts of the histogram to stabilize the auto exposure
73 + // x: filtered sum
74 + // y: accumulator
75 + // zw: fractions
76 + float4 filter = float4(0.0, 0.0, totalSum * _Params.xy);
77 +
78 + UNITY_LOOP
79 + for (i = 0; i < HISTOGRAM_BINS; i++)
80 + FilterLuminance(i, maxHistogramValue, filter);
81 +
82 + // Clamp to user brightness range
83 + return clamp(filter.x / max(filter.y, EPSILON), _Params.z, _Params.w);
84 + }
85 +
86 + float GetExposureMultiplier(float avgLuminance)
87 + {
88 + avgLuminance = max(EPSILON, avgLuminance);
89 +
90 + #if AUTO_KEY_VALUE
91 + half keyValue = 1.03 - (2.0 / (2.0 + log2(avgLuminance + 1.0)));
92 + #else
93 + half keyValue = _ExposureCompensation;
94 + #endif
95 +
96 + half exposure = keyValue / avgLuminance;
97 +
98 + return exposure;
99 + }
100 +
101 + float InterpolateExposure(float newExposure, float oldExposure)
102 + {
103 + float delta = newExposure - oldExposure;
104 + float speed = delta > 0.0 ? _Speed.x : _Speed.y;
105 + float exposure = oldExposure + delta * (1.0 - exp2(-unity_DeltaTime.x * speed));
106 + //float exposure = oldExposure + delta * (unity_DeltaTime.x * speed);
107 + return exposure;
108 + }
109 +
110 + float4 FragAdaptProgressive(VaryingsDefault i) : SV_Target
111 + {
112 + float maxValue = 1.0 / FindMaxHistogramValue();
113 + float avgLuminance = GetAverageLuminance(maxValue);
114 + float exposure = GetExposureMultiplier(avgLuminance);
115 + float prevExposure = tex2D(_MainTex, (0.5).xx);
116 + exposure = InterpolateExposure(exposure, prevExposure);
117 + return exposure.xxxx;
118 + }
119 +
120 + float4 FragAdaptFixed(VaryingsDefault i) : SV_Target
121 + {
122 + float maxValue = 1.0 / FindMaxHistogramValue();
123 + float avgLuminance = GetAverageLuminance(maxValue);
124 + float exposure = GetExposureMultiplier(avgLuminance);
125 + return exposure.xxxx;
126 + }
127 +
128 + // ---- Editor stuff
129 + int _DebugWidth;
130 +
131 + struct VaryingsEditorHisto
132 + {
133 + float4 pos : SV_POSITION;
134 + float2 uv : TEXCOORD0;
135 + float maxValue : TEXCOORD1;
136 + float avgLuminance : TEXCOORD2;
137 + };
138 +
139 + VaryingsEditorHisto VertEditorHisto(AttributesDefault v)
140 + {
141 + VaryingsEditorHisto o;
142 + o.pos = UnityObjectToClipPos(v.vertex);
143 + o.uv = v.texcoord.xy;
144 + o.maxValue = 1.0 / FindMaxHistogramValue();
145 + o.avgLuminance = GetAverageLuminance(o.maxValue);
146 + return o;
147 + }
148 +
149 + float4 FragEditorHisto(VaryingsEditorHisto i) : SV_Target
150 + {
151 + const float3 kRangeColor = float3(0.05, 0.4, 0.6);
152 + const float3 kAvgColor = float3(0.8, 0.3, 0.05);
153 +
154 + float4 color = float4(0.0, 0.0, 0.0, 0.7);
155 +
156 + uint ix = (uint)(round(i.uv.x * HISTOGRAM_BINS));
157 + float bin = saturate(float(_Histogram[ix]) * i.maxValue);
158 + float fill = step(i.uv.y, bin);
159 +
160 + // Min / max brightness markers
161 + float luminanceMin = GetHistogramBinFromLuminance(_Params.z, _ScaleOffsetRes.xy);
162 + float luminanceMax = GetHistogramBinFromLuminance(_Params.w, _ScaleOffsetRes.xy);
163 +
164 + color.rgb += fill.rrr;
165 +
166 + if (i.uv.x > luminanceMin && i.uv.x < luminanceMax)
167 + {
168 + color.rgb = fill.rrr * kRangeColor;
169 + color.rgb += kRangeColor;
170 + }
171 +
172 + // Current average luminance marker
173 + float luminanceAvg = GetHistogramBinFromLuminance(i.avgLuminance, _ScaleOffsetRes.xy);
174 + float avgPx = luminanceAvg * _DebugWidth;
175 +
176 + if (abs(i.pos.x - avgPx) < 2)
177 + color.rgb = kAvgColor;
178 +
179 + return color;
180 + }
181 +
182 + ENDCG
183 +
184 + SubShader
185 + {
186 + Cull Off ZWrite Off ZTest Always
187 +
188 + Pass
189 + {
190 + CGPROGRAM
191 +
192 + #pragma vertex VertDefault
193 + #pragma fragment FragAdaptProgressive
194 +
195 + ENDCG
196 + }
197 +
198 + Pass
199 + {
200 + CGPROGRAM
201 +
202 + #pragma vertex VertDefault
203 + #pragma fragment FragAdaptFixed
204 +
205 + ENDCG
206 + }
207 +
208 + Pass
209 + {
210 + CGPROGRAM
211 +
212 + #pragma vertex VertEditorHisto
213 + #pragma fragment FragEditorHisto
214 +
215 + ENDCG
216 + }
217 + }
218 +}
1 +fileFormatVersion: 2
2 +guid: 81899cddfbc72494497a6db0ae045f2c
3 +timeCreated: 1465903628
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +// Put the following line to 0 or comment it to disable vignette weighting
2 +#define USE_VIGNETTE_WEIGHTING 1
3 +
4 +#include "Common.cginc"
5 +#include "EyeAdaptation.cginc"
6 +
7 +RWStructuredBuffer<uint> _Histogram;
8 +Texture2D<float4> _Source;
9 +
10 +CBUFFER_START(Params)
11 + float4 _ScaleOffsetRes; // x: scale, y: offset, z: width, w: height
12 +CBUFFER_END
13 +
14 +groupshared uint gs_histogram[HISTOGRAM_BINS];
15 +
16 +#pragma kernel KEyeHistogram
17 +[numthreads(HISTOGRAM_THREAD_X,HISTOGRAM_THREAD_Y,1)]
18 +void KEyeHistogram(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupThreadId : SV_GroupThreadID)
19 +{
20 + // Pretty straightforward implementation of histogram gathering using atomic ops.
21 + // I tried a few methods (no atomic ops / heavy LDS leveraging) but this one turned out to be
22 + // the fastest on desktop (Nvidia - Kepler/Maxwell) and PS4. Still need to try it on GCN/desktop
23 + // but considering it runs very fast on PS4 we can expect it to run well (?).
24 +
25 + const uint localThreadId = groupThreadId.y * HISTOGRAM_THREAD_X + groupThreadId.x;
26 +
27 + // Clears the shared memory
28 + if (localThreadId < HISTOGRAM_BINS)
29 + gs_histogram[localThreadId] = 0u;
30 +
31 + GroupMemoryBarrierWithGroupSync();
32 +
33 + // Gather local group histogram
34 + if (dispatchThreadId.x < (uint)_ScaleOffsetRes.z && dispatchThreadId.y < (uint)_ScaleOffsetRes.w)
35 + {
36 +#if USE_VIGNETTE_WEIGHTING
37 + // Vignette weighting to put more focus on what's in the center of the screen
38 + float2 uv01 = float2(dispatchThreadId) / float2(_ScaleOffsetRes.z, _ScaleOffsetRes.w);
39 + float2 d = abs(uv01 - (0.5).xx);
40 + float vfactor = Pow2(saturate(1.0 - dot(d, d)));
41 + uint weight = (uint)(64.0 * vfactor);
42 +#else
43 + uint weight = 1u;
44 +#endif
45 +
46 + float3 color = _Source[dispatchThreadId].xyz;
47 + float luminance = Max3(color); // Looks more natural than using a Rec.709 luminance for some reason
48 + float logLuminance = GetHistogramBinFromLuminance(luminance, _ScaleOffsetRes.xy);
49 + uint idx = (uint)(logLuminance * (HISTOGRAM_BINS - 1u));
50 + InterlockedAdd(gs_histogram[idx], weight);
51 + }
52 +
53 + GroupMemoryBarrierWithGroupSync();
54 +
55 + // Merge everything
56 + if (localThreadId < HISTOGRAM_BINS)
57 + InterlockedAdd(_Histogram[localThreadId], gs_histogram[localThreadId]);
58 +}
1 +fileFormatVersion: 2
2 +guid: e213272ad8ff213409a6e13b5c26b4e4
3 +timeCreated: 1464341416
4 +licenseType: Store
5 +ComputeShaderImporter:
6 + currentAPIMask: 4
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Hidden/Post FX/FXAA"
2 +{
3 + Properties
4 + {
5 + _MainTex ("Texture", 2D) = "white" {}
6 + }
7 +
8 + CGINCLUDE
9 +
10 + #include "UnityCG.cginc"
11 + #include "Common.cginc"
12 + #include "UberSecondPass.cginc"
13 + #pragma multi_compile __ GRAIN
14 + #pragma multi_compile __ DITHERING
15 +
16 + #if defined(SHADER_API_PS3)
17 + #define FXAA_PS3 1
18 +
19 + // Shaves off 2 cycles from the shader
20 + #define FXAA_EARLY_EXIT 0
21 + #elif defined(SHADER_API_XBOX360)
22 + #define FXAA_360 1
23 +
24 + // Shaves off 10ms from the shader's execution time
25 + #define FXAA_EARLY_EXIT 1
26 + #else
27 + #define FXAA_PC 1
28 + #endif
29 +
30 + #define FXAA_HLSL_3 1
31 + #define FXAA_QUALITY__PRESET 39
32 +
33 + #define FXAA_GREEN_AS_LUMA 1
34 +
35 + #pragma target 3.0
36 + #include "FXAA3.cginc"
37 +
38 + float3 _QualitySettings;
39 + float4 _ConsoleSettings;
40 +
41 + half4 Frag(VaryingsDefault i) : SV_Target
42 + {
43 + const float4 consoleUV = i.uv.xyxy + 0.5 * float4(-_MainTex_TexelSize.xy, _MainTex_TexelSize.xy);
44 + const float4 consoleSubpixelFrame = _ConsoleSettings.x * float4(-1.0, -1.0, 1.0, 1.0) *
45 + _MainTex_TexelSize.xyxy;
46 +
47 + const float4 consoleSubpixelFramePS3 = float4(-2.0, -2.0, 2.0, 2.0) * _MainTex_TexelSize.xyxy;
48 + const float4 consoleSubpixelFrameXBOX = float4(8.0, 8.0, -4.0, -4.0) * _MainTex_TexelSize.xyxy;
49 +
50 + #if defined(SHADER_API_XBOX360)
51 + const float4 consoleConstants = float4(1.0, -1.0, 0.25, -0.25);
52 + #else
53 + const float4 consoleConstants = float4(0.0, 0.0, 0.0, 0.0);
54 + #endif
55 +
56 + half4 color = FxaaPixelShader(
57 + UnityStereoScreenSpaceUVAdjust(i.uv, _MainTex_ST),
58 + UnityStereoScreenSpaceUVAdjust(consoleUV, _MainTex_ST),
59 + _MainTex, _MainTex, _MainTex, _MainTex_TexelSize.xy,
60 + consoleSubpixelFrame, consoleSubpixelFramePS3, consoleSubpixelFrameXBOX,
61 + _QualitySettings.x, _QualitySettings.y, _QualitySettings.z,
62 + _ConsoleSettings.y, _ConsoleSettings.z, _ConsoleSettings.w, consoleConstants);
63 +
64 + color.rgb = UberSecondPass(color.rgb, i.uv);
65 +
66 + return half4(color.rgb, 1.0);
67 + }
68 +
69 + ENDCG
70 +
71 + SubShader
72 + {
73 + Cull Off ZWrite Off ZTest Always
74 +
75 + Pass
76 + {
77 + CGPROGRAM
78 +
79 + #pragma vertex VertDefault
80 + #pragma fragment Frag
81 +
82 + ENDCG
83 + }
84 + }
85 +}
1 +fileFormatVersion: 2
2 +guid: 291f0d5b6045f4646847c59b4ce13ac5
3 +timeCreated: 1462350540
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +#ifndef __FXAA3_INC__
2 +#define __FXAA3_INC__
3 +
4 +/*============================================================================
5 +
6 +
7 +NVIDIA FXAA 3.11 by TIMOTHY LOTTES
8 +
9 +
10 +------------------------------------------------------------------------------
11 +COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED.
12 +------------------------------------------------------------------------------
13 +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
14 +*AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
15 +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
16 +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA
17 +OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR
18 +CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR
19 +LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION,
20 +OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE
21 +THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
22 +DAMAGES.
23 +
24 +------------------------------------------------------------------------------
25 +INTEGRATION CHECKLIST
26 +------------------------------------------------------------------------------
27 +(1.)
28 +In the shader source, setup defines for the desired configuration.
29 +When providing multiple shaders (for different presets),
30 +simply setup the defines differently in multiple files.
31 +Example,
32 +
33 +#define FXAA_PC 1
34 +#define FXAA_HLSL_5 1
35 +#define FXAA_QUALITY__PRESET 12
36 +
37 +Or,
38 +
39 +#define FXAA_360 1
40 +
41 +Or,
42 +
43 +#define FXAA_PS3 1
44 +
45 +Etc.
46 +
47 +(2.)
48 +Then include this file,
49 +
50 +#include "Fxaa3_11.h"
51 +
52 +(3.)
53 +Then call the FXAA pixel shader from within your desired shader.
54 +Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
55 +As for FXAA 3.11 all inputs for all shaders are the same
56 +to enable easy porting between platforms.
57 +
58 +return FxaaPixelShader(...);
59 +
60 +(4.)
61 +Insure pass prior to FXAA outputs RGBL (see next section).
62 +Or use,
63 +
64 +#define FXAA_GREEN_AS_LUMA 1
65 +
66 +(5.)
67 +Setup engine to provide the following constants
68 +which are used in the FxaaPixelShader() inputs,
69 +
70 +FxaaFloat2 fxaaQualityRcpFrame,
71 +FxaaFloat4 fxaaConsoleRcpFrameOpt,
72 +FxaaFloat4 fxaaConsoleRcpFrameOpt2,
73 +FxaaFloat4 fxaaConsole360RcpFrameOpt2,
74 +FxaaFloat fxaaQualitySubpix,
75 +FxaaFloat fxaaQualityEdgeThreshold,
76 +FxaaFloat fxaaQualityEdgeThresholdMin,
77 +FxaaFloat fxaaConsoleEdgeSharpness,
78 +FxaaFloat fxaaConsoleEdgeThreshold,
79 +FxaaFloat fxaaConsoleEdgeThresholdMin,
80 +FxaaFloat4 fxaaConsole360ConstDir
81 +
82 +Look at the FXAA Quality FxaaPixelShader() for docs on inputs.
83 +
84 +(6.)
85 +Have FXAA vertex shader run as a full screen triangle,
86 +and output "pos" and "fxaaConsolePosPos"
87 +such that inputs in the pixel shader provide,
88 +
89 +// {xy} = center of pixel
90 +FxaaFloat2 pos,
91 +
92 +// {xy__} = upper left of pixel
93 +// {__zw} = lower right of pixel
94 +FxaaFloat4 fxaaConsolePosPos,
95 +
96 +(7.)
97 +Insure the texture sampler(s) used by FXAA are set to bilinear filtering.
98 +
99 +
100 +------------------------------------------------------------------------------
101 +INTEGRATION - RGBL AND COLORSPACE
102 +------------------------------------------------------------------------------
103 +FXAA3 requires RGBL as input unless the following is set,
104 +
105 +#define FXAA_GREEN_AS_LUMA 1
106 +
107 +In which case the engine uses green in place of luma,
108 +and requires RGB input is in a non-linear colorspace.
109 +
110 +RGB should be LDR (low dynamic range).
111 +Specifically do FXAA after tonemapping.
112 +
113 +RGB data as returned by a texture fetch can be non-linear,
114 +or linear when FXAA_GREEN_AS_LUMA is not set.
115 +Note an "sRGB format" texture counts as linear,
116 +because the result of a texture fetch is linear data.
117 +Regular "RGBA8" textures in the sRGB colorspace are non-linear.
118 +
119 +If FXAA_GREEN_AS_LUMA is not set,
120 +luma must be stored in the alpha channel prior to running FXAA.
121 +This luma should be in a perceptual space (could be gamma 2.0).
122 +Example pass before FXAA where output is gamma 2.0 encoded,
123 +
124 +color.rgb = ToneMap(color.rgb); // linear color output
125 +color.rgb = sqrt(color.rgb); // gamma 2.0 color output
126 +return color;
127 +
128 +To use FXAA,
129 +
130 +color.rgb = ToneMap(color.rgb); // linear color output
131 +color.rgb = sqrt(color.rgb); // gamma 2.0 color output
132 +color.a = dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114)); // compute luma
133 +return color;
134 +
135 +Another example where output is linear encoded,
136 +say for instance writing to an sRGB formated render target,
137 +where the render target does the conversion back to sRGB after blending,
138 +
139 +color.rgb = ToneMap(color.rgb); // linear color output
140 +return color;
141 +
142 +To use FXAA,
143 +
144 +color.rgb = ToneMap(color.rgb); // linear color output
145 +color.a = sqrt(dot(color.rgb, FxaaFloat3(0.299, 0.587, 0.114))); // compute luma
146 +return color;
147 +
148 +Getting luma correct is required for the algorithm to work correctly.
149 +
150 +
151 +------------------------------------------------------------------------------
152 +BEING LINEARLY CORRECT?
153 +------------------------------------------------------------------------------
154 +Applying FXAA to a framebuffer with linear RGB color will look worse.
155 +This is very counter intuitive, but happends to be true in this case.
156 +The reason is because dithering artifacts will be more visiable
157 +in a linear colorspace.
158 +
159 +
160 +------------------------------------------------------------------------------
161 +COMPLEX INTEGRATION
162 +------------------------------------------------------------------------------
163 +Q. What if the engine is blending into RGB before wanting to run FXAA?
164 +
165 +A. In the last opaque pass prior to FXAA,
166 +have the pass write out luma into alpha.
167 +Then blend into RGB only.
168 +FXAA should be able to run ok
169 +assuming the blending pass did not any add aliasing.
170 +This should be the common case for particles and common blending passes.
171 +
172 +A. Or use FXAA_GREEN_AS_LUMA.
173 +
174 +============================================================================*/
175 +
176 +/*============================================================================
177 +
178 +INTEGRATION KNOBS
179 +
180 +============================================================================*/
181 +//
182 +// FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE).
183 +// FXAA_360_OPT is a prototype for the new optimized 360 version.
184 +//
185 +// 1 = Use API.
186 +// 0 = Don't use API.
187 +//
188 +/*--------------------------------------------------------------------------*/
189 +#ifndef FXAA_PS3
190 +#define FXAA_PS3 0
191 +#endif
192 +/*--------------------------------------------------------------------------*/
193 +#ifndef FXAA_360
194 +#define FXAA_360 0
195 +#endif
196 +/*--------------------------------------------------------------------------*/
197 +#ifndef FXAA_360_OPT
198 +#define FXAA_360_OPT 0
199 +#endif
200 +/*==========================================================================*/
201 +#ifndef FXAA_PC
202 +//
203 +// FXAA Quality
204 +// The high quality PC algorithm.
205 +//
206 +#define FXAA_PC 0
207 +#endif
208 +/*--------------------------------------------------------------------------*/
209 +#ifndef FXAA_PC_CONSOLE
210 +//
211 +// The console algorithm for PC is included
212 +// for developers targeting really low spec machines.
213 +// Likely better to just run FXAA_PC, and use a really low preset.
214 +//
215 +#define FXAA_PC_CONSOLE 0
216 +#endif
217 +/*--------------------------------------------------------------------------*/
218 +#ifndef FXAA_GLSL_120
219 +#define FXAA_GLSL_120 0
220 +#endif
221 +/*--------------------------------------------------------------------------*/
222 +#ifndef FXAA_GLSL_130
223 +#define FXAA_GLSL_130 0
224 +#endif
225 +/*--------------------------------------------------------------------------*/
226 +#ifndef FXAA_HLSL_3
227 +#define FXAA_HLSL_3 0
228 +#endif
229 +/*--------------------------------------------------------------------------*/
230 +#ifndef FXAA_HLSL_4
231 +#define FXAA_HLSL_4 0
232 +#endif
233 +/*--------------------------------------------------------------------------*/
234 +#ifndef FXAA_HLSL_5
235 +#define FXAA_HLSL_5 0
236 +#endif
237 +/*==========================================================================*/
238 +#ifndef FXAA_GREEN_AS_LUMA
239 +//
240 +// For those using non-linear color,
241 +// and either not able to get luma in alpha, or not wanting to,
242 +// this enables FXAA to run using green as a proxy for luma.
243 +// So with this enabled, no need to pack luma in alpha.
244 +//
245 +// This will turn off AA on anything which lacks some amount of green.
246 +// Pure red and blue or combination of only R and B, will get no AA.
247 +//
248 +// Might want to lower the settings for both,
249 +// fxaaConsoleEdgeThresholdMin
250 +// fxaaQualityEdgeThresholdMin
251 +// In order to insure AA does not get turned off on colors
252 +// which contain a minor amount of green.
253 +//
254 +// 1 = On.
255 +// 0 = Off.
256 +//
257 +#define FXAA_GREEN_AS_LUMA 0
258 +#endif
259 +/*--------------------------------------------------------------------------*/
260 +#ifndef FXAA_EARLY_EXIT
261 +//
262 +// Controls algorithm's early exit path.
263 +// On PS3 turning this ON adds 2 cycles to the shader.
264 +// On 360 turning this OFF adds 10ths of a millisecond to the shader.
265 +// Turning this off on console will result in a more blurry image.
266 +// So this defaults to on.
267 +//
268 +// 1 = On.
269 +// 0 = Off.
270 +//
271 +#define FXAA_EARLY_EXIT 1
272 +#endif
273 +/*--------------------------------------------------------------------------*/
274 +#ifndef FXAA_DISCARD
275 +//
276 +// Only valid for PC OpenGL currently.
277 +// Probably will not work when FXAA_GREEN_AS_LUMA = 1.
278 +//
279 +// 1 = Use discard on pixels which don't need AA.
280 +// For APIs which enable concurrent TEX+ROP from same surface.
281 +// 0 = Return unchanged color on pixels which don't need AA.
282 +//
283 +#define FXAA_DISCARD 0
284 +#endif
285 +/*--------------------------------------------------------------------------*/
286 +#ifndef FXAA_FAST_PIXEL_OFFSET
287 +//
288 +// Used for GLSL 120 only.
289 +//
290 +// 1 = GL API supports fast pixel offsets
291 +// 0 = do not use fast pixel offsets
292 +//
293 +#ifdef GL_EXT_gpu_shader4
294 +#define FXAA_FAST_PIXEL_OFFSET 1
295 +#endif
296 +#ifdef GL_NV_gpu_shader5
297 +#define FXAA_FAST_PIXEL_OFFSET 1
298 +#endif
299 +#ifdef GL_ARB_gpu_shader5
300 +#define FXAA_FAST_PIXEL_OFFSET 1
301 +#endif
302 +#ifndef FXAA_FAST_PIXEL_OFFSET
303 +#define FXAA_FAST_PIXEL_OFFSET 0
304 +#endif
305 +#endif
306 +/*--------------------------------------------------------------------------*/
307 +#ifndef FXAA_GATHER4_ALPHA
308 +//
309 +// 1 = API supports gather4 on alpha channel.
310 +// 0 = API does not support gather4 on alpha channel.
311 +//
312 +#if (FXAA_HLSL_5 == 1)
313 +#define FXAA_GATHER4_ALPHA 1
314 +#endif
315 +#ifdef GL_ARB_gpu_shader5
316 +#define FXAA_GATHER4_ALPHA 1
317 +#endif
318 +#ifdef GL_NV_gpu_shader5
319 +#define FXAA_GATHER4_ALPHA 1
320 +#endif
321 +#ifndef FXAA_GATHER4_ALPHA
322 +#define FXAA_GATHER4_ALPHA 0
323 +#endif
324 +#endif
325 +
326 +/*============================================================================
327 +FXAA CONSOLE PS3 - TUNING KNOBS
328 +============================================================================*/
329 +#ifndef FXAA_CONSOLE__PS3_EDGE_SHARPNESS
330 +//
331 +// Consoles the sharpness of edges on PS3 only.
332 +// Non-PS3 tuning is done with shader input.
333 +//
334 +// Due to the PS3 being ALU bound,
335 +// there are only two safe values here: 4 and 8.
336 +// These options use the shaders ability to a free *|/ by 2|4|8.
337 +//
338 +// 8.0 is sharper
339 +// 4.0 is softer
340 +// 2.0 is really soft (good for vector graphics inputs)
341 +//
342 +#if 1
343 +#define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 8.0
344 +#endif
345 +#if 0
346 +#define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 4.0
347 +#endif
348 +#if 0
349 +#define FXAA_CONSOLE__PS3_EDGE_SHARPNESS 2.0
350 +#endif
351 +#endif
352 +/*--------------------------------------------------------------------------*/
353 +#ifndef FXAA_CONSOLE__PS3_EDGE_THRESHOLD
354 +//
355 +// Only effects PS3.
356 +// Non-PS3 tuning is done with shader input.
357 +//
358 +// The minimum amount of local contrast required to apply algorithm.
359 +// The console setting has a different mapping than the quality setting.
360 +//
361 +// This only applies when FXAA_EARLY_EXIT is 1.
362 +//
363 +// Due to the PS3 being ALU bound,
364 +// there are only two safe values here: 0.25 and 0.125.
365 +// These options use the shaders ability to a free *|/ by 2|4|8.
366 +//
367 +// 0.125 leaves less aliasing, but is softer
368 +// 0.25 leaves more aliasing, and is sharper
369 +//
370 +#if 1
371 +#define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.125
372 +#else
373 +#define FXAA_CONSOLE__PS3_EDGE_THRESHOLD 0.25
374 +#endif
375 +#endif
376 +
377 +/*============================================================================
378 +FXAA QUALITY - TUNING KNOBS
379 +------------------------------------------------------------------------------
380 +NOTE the other tuning knobs are now in the shader function inputs!
381 +============================================================================*/
382 +#ifndef FXAA_QUALITY__PRESET
383 +//
384 +// Choose the quality preset.
385 +// This needs to be compiled into the shader as it effects code.
386 +// Best option to include multiple presets is to
387 +// in each shader define the preset, then include this file.
388 +//
389 +// OPTIONS
390 +// -----------------------------------------------------------------------
391 +// 10 to 15 - default medium dither (10=fastest, 15=highest quality)
392 +// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
393 +// 39 - no dither, very expensive
394 +//
395 +// NOTES
396 +// -----------------------------------------------------------------------
397 +// 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
398 +// 13 = about same speed as FXAA 3.9 and better than 12
399 +// 23 = closest to FXAA 3.9 visually and performance wise
400 +// _ = the lowest digit is directly related to performance
401 +// _ = the highest digit is directly related to style
402 +//
403 +#define FXAA_QUALITY__PRESET 12
404 +#endif
405 +
406 +
407 +/*============================================================================
408 +
409 +FXAA QUALITY - PRESETS
410 +
411 +============================================================================*/
412 +
413 +/*============================================================================
414 +FXAA QUALITY - MEDIUM DITHER PRESETS
415 +============================================================================*/
416 +#if (FXAA_QUALITY__PRESET == 10)
417 +#define FXAA_QUALITY__PS 3
418 +#define FXAA_QUALITY__P0 1.5
419 +#define FXAA_QUALITY__P1 3.0
420 +#define FXAA_QUALITY__P2 12.0
421 +#endif
422 +/*--------------------------------------------------------------------------*/
423 +#if (FXAA_QUALITY__PRESET == 11)
424 +#define FXAA_QUALITY__PS 4
425 +#define FXAA_QUALITY__P0 1.0
426 +#define FXAA_QUALITY__P1 1.5
427 +#define FXAA_QUALITY__P2 3.0
428 +#define FXAA_QUALITY__P3 12.0
429 +#endif
430 +/*--------------------------------------------------------------------------*/
431 +#if (FXAA_QUALITY__PRESET == 12)
432 +#define FXAA_QUALITY__PS 5
433 +#define FXAA_QUALITY__P0 1.0
434 +#define FXAA_QUALITY__P1 1.5
435 +#define FXAA_QUALITY__P2 2.0
436 +#define FXAA_QUALITY__P3 4.0
437 +#define FXAA_QUALITY__P4 12.0
438 +#endif
439 +/*--------------------------------------------------------------------------*/
440 +#if (FXAA_QUALITY__PRESET == 13)
441 +#define FXAA_QUALITY__PS 6
442 +#define FXAA_QUALITY__P0 1.0
443 +#define FXAA_QUALITY__P1 1.5
444 +#define FXAA_QUALITY__P2 2.0
445 +#define FXAA_QUALITY__P3 2.0
446 +#define FXAA_QUALITY__P4 4.0
447 +#define FXAA_QUALITY__P5 12.0
448 +#endif
449 +/*--------------------------------------------------------------------------*/
450 +#if (FXAA_QUALITY__PRESET == 14)
451 +#define FXAA_QUALITY__PS 7
452 +#define FXAA_QUALITY__P0 1.0
453 +#define FXAA_QUALITY__P1 1.5
454 +#define FXAA_QUALITY__P2 2.0
455 +#define FXAA_QUALITY__P3 2.0
456 +#define FXAA_QUALITY__P4 2.0
457 +#define FXAA_QUALITY__P5 4.0
458 +#define FXAA_QUALITY__P6 12.0
459 +#endif
460 +/*--------------------------------------------------------------------------*/
461 +#if (FXAA_QUALITY__PRESET == 15)
462 +#define FXAA_QUALITY__PS 8
463 +#define FXAA_QUALITY__P0 1.0
464 +#define FXAA_QUALITY__P1 1.5
465 +#define FXAA_QUALITY__P2 2.0
466 +#define FXAA_QUALITY__P3 2.0
467 +#define FXAA_QUALITY__P4 2.0
468 +#define FXAA_QUALITY__P5 2.0
469 +#define FXAA_QUALITY__P6 4.0
470 +#define FXAA_QUALITY__P7 12.0
471 +#endif
472 +
473 +/*============================================================================
474 +FXAA QUALITY - LOW DITHER PRESETS
475 +============================================================================*/
476 +#if (FXAA_QUALITY__PRESET == 20)
477 +#define FXAA_QUALITY__PS 3
478 +#define FXAA_QUALITY__P0 1.5
479 +#define FXAA_QUALITY__P1 2.0
480 +#define FXAA_QUALITY__P2 8.0
481 +#endif
482 +/*--------------------------------------------------------------------------*/
483 +#if (FXAA_QUALITY__PRESET == 21)
484 +#define FXAA_QUALITY__PS 4
485 +#define FXAA_QUALITY__P0 1.0
486 +#define FXAA_QUALITY__P1 1.5
487 +#define FXAA_QUALITY__P2 2.0
488 +#define FXAA_QUALITY__P3 8.0
489 +#endif
490 +/*--------------------------------------------------------------------------*/
491 +#if (FXAA_QUALITY__PRESET == 22)
492 +#define FXAA_QUALITY__PS 5
493 +#define FXAA_QUALITY__P0 1.0
494 +#define FXAA_QUALITY__P1 1.5
495 +#define FXAA_QUALITY__P2 2.0
496 +#define FXAA_QUALITY__P3 2.0
497 +#define FXAA_QUALITY__P4 8.0
498 +#endif
499 +/*--------------------------------------------------------------------------*/
500 +#if (FXAA_QUALITY__PRESET == 23)
501 +#define FXAA_QUALITY__PS 6
502 +#define FXAA_QUALITY__P0 1.0
503 +#define FXAA_QUALITY__P1 1.5
504 +#define FXAA_QUALITY__P2 2.0
505 +#define FXAA_QUALITY__P3 2.0
506 +#define FXAA_QUALITY__P4 2.0
507 +#define FXAA_QUALITY__P5 8.0
508 +#endif
509 +/*--------------------------------------------------------------------------*/
510 +#if (FXAA_QUALITY__PRESET == 24)
511 +#define FXAA_QUALITY__PS 7
512 +#define FXAA_QUALITY__P0 1.0
513 +#define FXAA_QUALITY__P1 1.5
514 +#define FXAA_QUALITY__P2 2.0
515 +#define FXAA_QUALITY__P3 2.0
516 +#define FXAA_QUALITY__P4 2.0
517 +#define FXAA_QUALITY__P5 3.0
518 +#define FXAA_QUALITY__P6 8.0
519 +#endif
520 +/*--------------------------------------------------------------------------*/
521 +#if (FXAA_QUALITY__PRESET == 25)
522 +#define FXAA_QUALITY__PS 8
523 +#define FXAA_QUALITY__P0 1.0
524 +#define FXAA_QUALITY__P1 1.5
525 +#define FXAA_QUALITY__P2 2.0
526 +#define FXAA_QUALITY__P3 2.0
527 +#define FXAA_QUALITY__P4 2.0
528 +#define FXAA_QUALITY__P5 2.0
529 +#define FXAA_QUALITY__P6 4.0
530 +#define FXAA_QUALITY__P7 8.0
531 +#endif
532 +/*--------------------------------------------------------------------------*/
533 +#if (FXAA_QUALITY__PRESET == 26)
534 +#define FXAA_QUALITY__PS 9
535 +#define FXAA_QUALITY__P0 1.0
536 +#define FXAA_QUALITY__P1 1.5
537 +#define FXAA_QUALITY__P2 2.0
538 +#define FXAA_QUALITY__P3 2.0
539 +#define FXAA_QUALITY__P4 2.0
540 +#define FXAA_QUALITY__P5 2.0
541 +#define FXAA_QUALITY__P6 2.0
542 +#define FXAA_QUALITY__P7 4.0
543 +#define FXAA_QUALITY__P8 8.0
544 +#endif
545 +/*--------------------------------------------------------------------------*/
546 +#if (FXAA_QUALITY__PRESET == 27)
547 +#define FXAA_QUALITY__PS 10
548 +#define FXAA_QUALITY__P0 1.0
549 +#define FXAA_QUALITY__P1 1.5
550 +#define FXAA_QUALITY__P2 2.0
551 +#define FXAA_QUALITY__P3 2.0
552 +#define FXAA_QUALITY__P4 2.0
553 +#define FXAA_QUALITY__P5 2.0
554 +#define FXAA_QUALITY__P6 2.0
555 +#define FXAA_QUALITY__P7 2.0
556 +#define FXAA_QUALITY__P8 4.0
557 +#define FXAA_QUALITY__P9 8.0
558 +#endif
559 +/*--------------------------------------------------------------------------*/
560 +#if (FXAA_QUALITY__PRESET == 28)
561 +#define FXAA_QUALITY__PS 11
562 +#define FXAA_QUALITY__P0 1.0
563 +#define FXAA_QUALITY__P1 1.5
564 +#define FXAA_QUALITY__P2 2.0
565 +#define FXAA_QUALITY__P3 2.0
566 +#define FXAA_QUALITY__P4 2.0
567 +#define FXAA_QUALITY__P5 2.0
568 +#define FXAA_QUALITY__P6 2.0
569 +#define FXAA_QUALITY__P7 2.0
570 +#define FXAA_QUALITY__P8 2.0
571 +#define FXAA_QUALITY__P9 4.0
572 +#define FXAA_QUALITY__P10 8.0
573 +#endif
574 +/*--------------------------------------------------------------------------*/
575 +#if (FXAA_QUALITY__PRESET == 29)
576 +#define FXAA_QUALITY__PS 12
577 +#define FXAA_QUALITY__P0 1.0
578 +#define FXAA_QUALITY__P1 1.5
579 +#define FXAA_QUALITY__P2 2.0
580 +#define FXAA_QUALITY__P3 2.0
581 +#define FXAA_QUALITY__P4 2.0
582 +#define FXAA_QUALITY__P5 2.0
583 +#define FXAA_QUALITY__P6 2.0
584 +#define FXAA_QUALITY__P7 2.0
585 +#define FXAA_QUALITY__P8 2.0
586 +#define FXAA_QUALITY__P9 2.0
587 +#define FXAA_QUALITY__P10 4.0
588 +#define FXAA_QUALITY__P11 8.0
589 +#endif
590 +
591 +/*============================================================================
592 +FXAA QUALITY - EXTREME QUALITY
593 +============================================================================*/
594 +#if (FXAA_QUALITY__PRESET == 39)
595 +#define FXAA_QUALITY__PS 12
596 +#define FXAA_QUALITY__P0 1.0
597 +#define FXAA_QUALITY__P1 1.0
598 +#define FXAA_QUALITY__P2 1.0
599 +#define FXAA_QUALITY__P3 1.0
600 +#define FXAA_QUALITY__P4 1.0
601 +#define FXAA_QUALITY__P5 1.5
602 +#define FXAA_QUALITY__P6 2.0
603 +#define FXAA_QUALITY__P7 2.0
604 +#define FXAA_QUALITY__P8 2.0
605 +#define FXAA_QUALITY__P9 2.0
606 +#define FXAA_QUALITY__P10 4.0
607 +#define FXAA_QUALITY__P11 8.0
608 +#endif
609 +
610 +
611 +
612 +/*============================================================================
613 +
614 +API PORTING
615 +
616 +============================================================================*/
617 +#if (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)
618 +#define FxaaBool bool
619 +#define FxaaDiscard discard
620 +#define FxaaFloat float
621 +#define FxaaFloat2 vec2
622 +#define FxaaFloat3 vec3
623 +#define FxaaFloat4 vec4
624 +#define FxaaHalf float
625 +#define FxaaHalf2 vec2
626 +#define FxaaHalf3 vec3
627 +#define FxaaHalf4 vec4
628 +#define FxaaInt2 ivec2
629 +#define FxaaSat(x) clamp(x, 0.0, 1.0)
630 +#define FxaaTex sampler2D
631 +#else
632 +#define FxaaBool bool
633 +#define FxaaDiscard clip(-1)
634 +#define FxaaFloat float
635 +#define FxaaFloat2 float2
636 +#define FxaaFloat3 float3
637 +#define FxaaFloat4 float4
638 +#define FxaaHalf half
639 +#define FxaaHalf2 half2
640 +#define FxaaHalf3 half3
641 +#define FxaaHalf4 half4
642 +#define FxaaSat(x) saturate(x)
643 +#endif
644 +/*--------------------------------------------------------------------------*/
645 +#if (FXAA_GLSL_120 == 1)
646 +// Requires,
647 +// #version 120
648 +// And at least,
649 +// #extension GL_EXT_gpu_shader4 : enable
650 +// (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)
651 +#define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
652 +#if (FXAA_FAST_PIXEL_OFFSET == 1)
653 +#define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)
654 +#else
655 +#define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
656 +#endif
657 +#if (FXAA_GATHER4_ALPHA == 1)
658 +// use #extension GL_ARB_gpu_shader5 : enable
659 +#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
660 +#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
661 +#define FxaaTexGreen4(t, p) textureGather(t, p, 1)
662 +#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
663 +#endif
664 +#endif
665 +/*--------------------------------------------------------------------------*/
666 +#if (FXAA_GLSL_130 == 1)
667 +// Requires "#version 130" or better
668 +#define FxaaTexTop(t, p) textureLod(t, p, 0.0)
669 +#define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)
670 +#if (FXAA_GATHER4_ALPHA == 1)
671 +// use #extension GL_ARB_gpu_shader5 : enable
672 +#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)
673 +#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)
674 +#define FxaaTexGreen4(t, p) textureGather(t, p, 1)
675 +#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)
676 +#endif
677 +#endif
678 +/*--------------------------------------------------------------------------*/
679 +#if (FXAA_HLSL_3 == 1) || (FXAA_360 == 1) || (FXAA_PS3 == 1)
680 +#define FxaaInt2 float2
681 +#define FxaaTex sampler2D
682 +#define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))
683 +#define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))
684 +#endif
685 +/*--------------------------------------------------------------------------*/
686 +#if (FXAA_HLSL_4 == 1)
687 +#define FxaaInt2 int2
688 +struct FxaaTex { SamplerState smpl; Texture2D tex; };
689 +#define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
690 +#define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
691 +#endif
692 +/*--------------------------------------------------------------------------*/
693 +#if (FXAA_HLSL_5 == 1)
694 +#define FxaaInt2 int2
695 +struct FxaaTex { SamplerState smpl; Texture2D tex; };
696 +#define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
697 +#define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)
698 +#define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)
699 +#define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)
700 +#define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)
701 +#define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)
702 +#endif
703 +
704 +
705 +/*============================================================================
706 +GREEN AS LUMA OPTION SUPPORT FUNCTION
707 +============================================================================*/
708 +#if (FXAA_GREEN_AS_LUMA == 0)
709 +FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }
710 +#else
711 +FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
712 +#endif
713 +
714 +
715 +
716 +
717 +/*============================================================================
718 +
719 +FXAA3 QUALITY - PC
720 +
721 +============================================================================*/
722 +#if (FXAA_PC == 1)
723 +/*--------------------------------------------------------------------------*/
724 +FxaaFloat4 FxaaPixelShader(
725 + //
726 + // Use noperspective interpolation here (turn off perspective interpolation).
727 + // {xy} = center of pixel
728 + FxaaFloat2 pos,
729 + //
730 + // Used only for FXAA Console, and not used on the 360 version.
731 + // Use noperspective interpolation here (turn off perspective interpolation).
732 + // {xy__} = upper left of pixel
733 + // {__zw} = lower right of pixel
734 + FxaaFloat4 fxaaConsolePosPos,
735 + //
736 + // Input color texture.
737 + // {rgb_} = color in linear or perceptual color space
738 + // if (FXAA_GREEN_AS_LUMA == 0)
739 + // {___a} = luma in perceptual color space (not linear)
740 + FxaaTex tex,
741 + //
742 + // Only used on the optimized 360 version of FXAA Console.
743 + // For everything but 360, just use the same input here as for "tex".
744 + // For 360, same texture, just alias with a 2nd sampler.
745 + // This sampler needs to have an exponent bias of -1.
746 + FxaaTex fxaaConsole360TexExpBiasNegOne,
747 + //
748 + // Only used on the optimized 360 version of FXAA Console.
749 + // For everything but 360, just use the same input here as for "tex".
750 + // For 360, same texture, just alias with a 3nd sampler.
751 + // This sampler needs to have an exponent bias of -2.
752 + FxaaTex fxaaConsole360TexExpBiasNegTwo,
753 + //
754 + // Only used on FXAA Quality.
755 + // This must be from a constant/uniform.
756 + // {x_} = 1.0/screenWidthInPixels
757 + // {_y} = 1.0/screenHeightInPixels
758 + FxaaFloat2 fxaaQualityRcpFrame,
759 + //
760 + // Only used on FXAA Console.
761 + // This must be from a constant/uniform.
762 + // This effects sub-pixel AA quality and inversely sharpness.
763 + // Where N ranges between,
764 + // N = 0.50 (default)
765 + // N = 0.33 (sharper)
766 + // {x___} = -N/screenWidthInPixels
767 + // {_y__} = -N/screenHeightInPixels
768 + // {__z_} = N/screenWidthInPixels
769 + // {___w} = N/screenHeightInPixels
770 + FxaaFloat4 fxaaConsoleRcpFrameOpt,
771 + //
772 + // Only used on FXAA Console.
773 + // Not used on 360, but used on PS3 and PC.
774 + // This must be from a constant/uniform.
775 + // {x___} = -2.0/screenWidthInPixels
776 + // {_y__} = -2.0/screenHeightInPixels
777 + // {__z_} = 2.0/screenWidthInPixels
778 + // {___w} = 2.0/screenHeightInPixels
779 + FxaaFloat4 fxaaConsoleRcpFrameOpt2,
780 + //
781 + // Only used on FXAA Console.
782 + // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.
783 + // This must be from a constant/uniform.
784 + // {x___} = 8.0/screenWidthInPixels
785 + // {_y__} = 8.0/screenHeightInPixels
786 + // {__z_} = -4.0/screenWidthInPixels
787 + // {___w} = -4.0/screenHeightInPixels
788 + FxaaFloat4 fxaaConsole360RcpFrameOpt2,
789 + //
790 + // Only used on FXAA Quality.
791 + // This used to be the FXAA_QUALITY__SUBPIX define.
792 + // It is here now to allow easier tuning.
793 + // Choose the amount of sub-pixel aliasing removal.
794 + // This can effect sharpness.
795 + // 1.00 - upper limit (softer)
796 + // 0.75 - default amount of filtering
797 + // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)
798 + // 0.25 - almost off
799 + // 0.00 - completely off
800 + FxaaFloat fxaaQualitySubpix,
801 + //
802 + // Only used on FXAA Quality.
803 + // This used to be the FXAA_QUALITY__EDGE_THRESHOLD define.
804 + // It is here now to allow easier tuning.
805 + // The minimum amount of local contrast required to apply algorithm.
806 + // 0.333 - too little (faster)
807 + // 0.250 - low quality
808 + // 0.166 - default
809 + // 0.125 - high quality
810 + // 0.063 - overkill (slower)
811 + FxaaFloat fxaaQualityEdgeThreshold,
812 + //
813 + // Only used on FXAA Quality.
814 + // This used to be the FXAA_QUALITY__EDGE_THRESHOLD_MIN define.
815 + // It is here now to allow easier tuning.
816 + // Trims the algorithm from processing darks.
817 + // 0.0833 - upper limit (default, the start of visible unfiltered edges)
818 + // 0.0625 - high quality (faster)
819 + // 0.0312 - visible limit (slower)
820 + // Special notes when using FXAA_GREEN_AS_LUMA,
821 + // Likely want to set this to zero.
822 + // As colors that are mostly not-green
823 + // will appear very dark in the green channel!
824 + // Tune by looking at mostly non-green content,
825 + // then start at zero and increase until aliasing is a problem.
826 + FxaaFloat fxaaQualityEdgeThresholdMin,
827 + //
828 + // Only used on FXAA Console.
829 + // This used to be the FXAA_CONSOLE__EDGE_SHARPNESS define.
830 + // It is here now to allow easier tuning.
831 + // This does not effect PS3, as this needs to be compiled in.
832 + // Use FXAA_CONSOLE__PS3_EDGE_SHARPNESS for PS3.
833 + // Due to the PS3 being ALU bound,
834 + // there are only three safe values here: 2 and 4 and 8.
835 + // These options use the shaders ability to a free *|/ by 2|4|8.
836 + // For all other platforms can be a non-power of two.
837 + // 8.0 is sharper (default!!!)
838 + // 4.0 is softer
839 + // 2.0 is really soft (good only for vector graphics inputs)
840 + FxaaFloat fxaaConsoleEdgeSharpness,
841 + //
842 + // Only used on FXAA Console.
843 + // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD define.
844 + // It is here now to allow easier tuning.
845 + // This does not effect PS3, as this needs to be compiled in.
846 + // Use FXAA_CONSOLE__PS3_EDGE_THRESHOLD for PS3.
847 + // Due to the PS3 being ALU bound,
848 + // there are only two safe values here: 1/4 and 1/8.
849 + // These options use the shaders ability to a free *|/ by 2|4|8.
850 + // The console setting has a different mapping than the quality setting.
851 + // Other platforms can use other values.
852 + // 0.125 leaves less aliasing, but is softer (default!!!)
853 + // 0.25 leaves more aliasing, and is sharper
854 + FxaaFloat fxaaConsoleEdgeThreshold,
855 + //
856 + // Only used on FXAA Console.
857 + // This used to be the FXAA_CONSOLE__EDGE_THRESHOLD_MIN define.
858 + // It is here now to allow easier tuning.
859 + // Trims the algorithm from processing darks.
860 + // The console setting has a different mapping than the quality setting.
861 + // This only applies when FXAA_EARLY_EXIT is 1.
862 + // This does not apply to PS3,
863 + // PS3 was simplified to avoid more shader instructions.
864 + // 0.06 - faster but more aliasing in darks
865 + // 0.05 - default
866 + // 0.04 - slower and less aliasing in darks
867 + // Special notes when using FXAA_GREEN_AS_LUMA,
868 + // Likely want to set this to zero.
869 + // As colors that are mostly not-green
870 + // will appear very dark in the green channel!
871 + // Tune by looking at mostly non-green content,
872 + // then start at zero and increase until aliasing is a problem.
873 + FxaaFloat fxaaConsoleEdgeThresholdMin,
874 + //
875 + // Extra constants for 360 FXAA Console only.
876 + // Use zeros or anything else for other platforms.
877 + // These must be in physical constant registers and NOT immedates.
878 + // Immedates will result in compiler un-optimizing.
879 + // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)
880 + FxaaFloat4 fxaaConsole360ConstDir
881 +) {
882 + /*--------------------------------------------------------------------------*/
883 + FxaaFloat2 posM;
884 + posM.x = pos.x;
885 + posM.y = pos.y;
886 +#if (FXAA_GATHER4_ALPHA == 1)
887 +#if (FXAA_DISCARD == 0)
888 + FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
889 +#if (FXAA_GREEN_AS_LUMA == 0)
890 +#define lumaM rgbyM.w
891 +#else
892 +#define lumaM rgbyM.y
893 +#endif
894 +#endif
895 +#if (FXAA_GREEN_AS_LUMA == 0)
896 + FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);
897 + FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));
898 +#else
899 + FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);
900 + FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));
901 +#endif
902 +#if (FXAA_DISCARD == 1)
903 +#define lumaM luma4A.w
904 +#endif
905 +#define lumaE luma4A.z
906 +#define lumaS luma4A.x
907 +#define lumaSE luma4A.y
908 +#define lumaNW luma4B.w
909 +#define lumaN luma4B.z
910 +#define lumaW luma4B.x
911 +#else
912 + FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
913 +#if (FXAA_GREEN_AS_LUMA == 0)
914 +#define lumaM rgbyM.w
915 +#else
916 +#define lumaM rgbyM.y
917 +#endif
918 + FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(0, 1), fxaaQualityRcpFrame.xy));
919 + FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, 0), fxaaQualityRcpFrame.xy));
920 + FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(0, -1), fxaaQualityRcpFrame.xy));
921 + FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
922 +#endif
923 + /*--------------------------------------------------------------------------*/
924 + FxaaFloat maxSM = max(lumaS, lumaM);
925 + FxaaFloat minSM = min(lumaS, lumaM);
926 + FxaaFloat maxESM = max(lumaE, maxSM);
927 + FxaaFloat minESM = min(lumaE, minSM);
928 + FxaaFloat maxWN = max(lumaN, lumaW);
929 + FxaaFloat minWN = min(lumaN, lumaW);
930 + FxaaFloat rangeMax = max(maxWN, maxESM);
931 + FxaaFloat rangeMin = min(minWN, minESM);
932 + FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
933 + FxaaFloat range = rangeMax - rangeMin;
934 + FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
935 + FxaaBool earlyExit = range < rangeMaxClamped;
936 + /*--------------------------------------------------------------------------*/
937 + if (earlyExit)
938 +#if (FXAA_DISCARD == 1)
939 + FxaaDiscard;
940 +#else
941 + return rgbyM;
942 +#endif
943 + /*--------------------------------------------------------------------------*/
944 +#if (FXAA_GATHER4_ALPHA == 0)
945 + FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, -1), fxaaQualityRcpFrame.xy));
946 + FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, 1), fxaaQualityRcpFrame.xy));
947 + FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));
948 + FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
949 +#else
950 + FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));
951 + FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
952 +#endif
953 + /*--------------------------------------------------------------------------*/
954 + FxaaFloat lumaNS = lumaN + lumaS;
955 + FxaaFloat lumaWE = lumaW + lumaE;
956 + FxaaFloat subpixRcpRange = 1.0 / range;
957 + FxaaFloat subpixNSWE = lumaNS + lumaWE;
958 + FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
959 + FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
960 + /*--------------------------------------------------------------------------*/
961 + FxaaFloat lumaNESE = lumaNE + lumaSE;
962 + FxaaFloat lumaNWNE = lumaNW + lumaNE;
963 + FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
964 + FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
965 + /*--------------------------------------------------------------------------*/
966 + FxaaFloat lumaNWSW = lumaNW + lumaSW;
967 + FxaaFloat lumaSWSE = lumaSW + lumaSE;
968 + FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
969 + FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
970 + FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
971 + FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
972 + FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
973 + FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
974 + /*--------------------------------------------------------------------------*/
975 + FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
976 + FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
977 + FxaaBool horzSpan = edgeHorz >= edgeVert;
978 + FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
979 + /*--------------------------------------------------------------------------*/
980 + if (!horzSpan) lumaN = lumaW;
981 + if (!horzSpan) lumaS = lumaE;
982 + if (horzSpan) lengthSign = fxaaQualityRcpFrame.y;
983 + FxaaFloat subpixB = (subpixA * (1.0 / 12.0)) - lumaM;
984 + /*--------------------------------------------------------------------------*/
985 + FxaaFloat gradientN = lumaN - lumaM;
986 + FxaaFloat gradientS = lumaS - lumaM;
987 + FxaaFloat lumaNN = lumaN + lumaM;
988 + FxaaFloat lumaSS = lumaS + lumaM;
989 + FxaaBool pairN = abs(gradientN) >= abs(gradientS);
990 + FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
991 + if (pairN) lengthSign = -lengthSign;
992 + FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
993 + /*--------------------------------------------------------------------------*/
994 + FxaaFloat2 posB;
995 + posB.x = posM.x;
996 + posB.y = posM.y;
997 + FxaaFloat2 offNP;
998 + offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
999 + offNP.y = (horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
1000 + if (!horzSpan) posB.x += lengthSign * 0.5;
1001 + if (horzSpan) posB.y += lengthSign * 0.5;
1002 + /*--------------------------------------------------------------------------*/
1003 + FxaaFloat2 posN;
1004 + posN.x = posB.x - offNP.x * FXAA_QUALITY__P0;
1005 + posN.y = posB.y - offNP.y * FXAA_QUALITY__P0;
1006 + FxaaFloat2 posP;
1007 + posP.x = posB.x + offNP.x * FXAA_QUALITY__P0;
1008 + posP.y = posB.y + offNP.y * FXAA_QUALITY__P0;
1009 + FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
1010 + FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
1011 + FxaaFloat subpixE = subpixC * subpixC;
1012 + FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
1013 + /*--------------------------------------------------------------------------*/
1014 + if (!pairN) lumaNN = lumaSS;
1015 + FxaaFloat gradientScaled = gradient * 1.0 / 4.0;
1016 + FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
1017 + FxaaFloat subpixF = subpixD * subpixE;
1018 + FxaaBool lumaMLTZero = lumaMM < 0.0;
1019 + /*--------------------------------------------------------------------------*/
1020 + lumaEndN -= lumaNN * 0.5;
1021 + lumaEndP -= lumaNN * 0.5;
1022 + FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
1023 + FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
1024 + if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P1;
1025 + if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P1;
1026 + FxaaBool doneNP = (!doneN) || (!doneP);
1027 + if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P1;
1028 + if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P1;
1029 + /*--------------------------------------------------------------------------*/
1030 + if (doneNP)
1031 + {
1032 + if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
1033 + if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
1034 + if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
1035 + if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
1036 + doneN = abs(lumaEndN) >= gradientScaled;
1037 + doneP = abs(lumaEndP) >= gradientScaled;
1038 + if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P2;
1039 + if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P2;
1040 + doneNP = (!doneN) || (!doneP);
1041 + if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P2;
1042 + if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P2;
1043 + /*--------------------------------------------------------------------------*/
1044 +#if (FXAA_QUALITY__PS > 3)
1045 + if (doneNP)
1046 + {
1047 + if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
1048 + if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
1049 + if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
1050 + if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
1051 + doneN = abs(lumaEndN) >= gradientScaled;
1052 + doneP = abs(lumaEndP) >= gradientScaled;
1053 + if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P3;
1054 + if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P3;
1055 + doneNP = (!doneN) || (!doneP);
1056 + if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P3;
1057 + if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P3;
1058 + /*--------------------------------------------------------------------------*/
1059 +#if (FXAA_QUALITY__PS > 4)
1060 + if (doneNP)
1061 + {
1062 + if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
1063 + if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
1064 + if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
1065 + if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
1066 + doneN = abs(lumaEndN) >= gradientScaled;
1067 + doneP = abs(lumaEndP) >= gradientScaled;
1068 + if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P4;
1069 + if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P4;
1070 + doneNP = (!doneN) || (!doneP);
1071 + if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P4;
1072 + if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P4;
1073 + /*--------------------------------------------------------------------------*/
1074 +#if (FXAA_QUALITY__PS > 5)
1075 + if (doneNP)
1076 + {
1077 + if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
1078 + if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
1079 + if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
1080 + if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
1081 + doneN = abs(lumaEndN) >= gradientScaled;
1082 + doneP = abs(lumaEndP) >= gradientScaled;
1083 + if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P5;
1084 + if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P5;
1085 + doneNP = (!doneN) || (!doneP);
1086 + if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P5;
1087 + if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P5;
1088 + /*--------------------------------------------------------------------------*/
1089 +#if (FXAA_QUALITY__PS > 6)
1090 + if (doneNP)
1091 + {
1092 + if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
1093 + if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
1094 + if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
1095 + if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
1096 + doneN = abs(lumaEndN) >= gradientScaled;
1097 + doneP = abs(lumaEndP) >= gradientScaled;
1098 + if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P6;
1099 + if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P6;
1100 + doneNP = (!doneN) || (!doneP);
1101 + if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P6;
1102 + if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P6;
1103 + /*--------------------------------------------------------------------------*/
1104 +#if (FXAA_QUALITY__PS > 7)
1105 + if (doneNP)
1106 + {
1107 + if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
1108 + if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
1109 + if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
1110 + if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
1111 + doneN = abs(lumaEndN) >= gradientScaled;
1112 + doneP = abs(lumaEndP) >= gradientScaled;
1113 + if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P7;
1114 + if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P7;
1115 + doneNP = (!doneN) || (!doneP);
1116 + if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P7;
1117 + if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P7;
1118 + /*--------------------------------------------------------------------------*/
1119 +#if (FXAA_QUALITY__PS > 8)
1120 + if (doneNP)
1121 + {
1122 + if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
1123 + if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
1124 + if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
1125 + if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
1126 + doneN = abs(lumaEndN) >= gradientScaled;
1127 + doneP = abs(lumaEndP) >= gradientScaled;
1128 + if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P8;
1129 + if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P8;
1130 + doneNP = (!doneN) || (!doneP);
1131 + if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P8;
1132 + if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P8;
1133 + /*--------------------------------------------------------------------------*/
1134 +#if (FXAA_QUALITY__PS > 9)
1135 + if (doneNP)
1136 + {
1137 + if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
1138 + if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
1139 + if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
1140 + if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
1141 + doneN = abs(lumaEndN) >= gradientScaled;
1142 + doneP = abs(lumaEndP) >= gradientScaled;
1143 + if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P9;
1144 + if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P9;
1145 + doneNP = (!doneN) || (!doneP);
1146 + if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P9;
1147 + if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P9;
1148 + /*--------------------------------------------------------------------------*/
1149 +#if (FXAA_QUALITY__PS > 10)
1150 + if (doneNP)
1151 + {
1152 + if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
1153 + if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
1154 + if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
1155 + if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
1156 + doneN = abs(lumaEndN) >= gradientScaled;
1157 + doneP = abs(lumaEndP) >= gradientScaled;
1158 + if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P10;
1159 + if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P10;
1160 + doneNP = (!doneN) || (!doneP);
1161 + if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P10;
1162 + if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P10;
1163 + /*--------------------------------------------------------------------------*/
1164 +#if (FXAA_QUALITY__PS > 11)
1165 + if (doneNP)
1166 + {
1167 + if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
1168 + if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
1169 + if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
1170 + if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
1171 + doneN = abs(lumaEndN) >= gradientScaled;
1172 + doneP = abs(lumaEndP) >= gradientScaled;
1173 + if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P11;
1174 + if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P11;
1175 + doneNP = (!doneN) || (!doneP);
1176 + if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P11;
1177 + if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P11;
1178 + /*--------------------------------------------------------------------------*/
1179 +#if (FXAA_QUALITY__PS > 12)
1180 + if (doneNP)
1181 + {
1182 + if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
1183 + if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
1184 + if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
1185 + if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
1186 + doneN = abs(lumaEndN) >= gradientScaled;
1187 + doneP = abs(lumaEndP) >= gradientScaled;
1188 + if (!doneN) posN.x -= offNP.x * FXAA_QUALITY__P12;
1189 + if (!doneN) posN.y -= offNP.y * FXAA_QUALITY__P12;
1190 + doneNP = (!doneN) || (!doneP);
1191 + if (!doneP) posP.x += offNP.x * FXAA_QUALITY__P12;
1192 + if (!doneP) posP.y += offNP.y * FXAA_QUALITY__P12;
1193 + /*--------------------------------------------------------------------------*/
1194 + }
1195 +#endif
1196 + /*--------------------------------------------------------------------------*/
1197 + }
1198 +#endif
1199 + /*--------------------------------------------------------------------------*/
1200 + }
1201 +#endif
1202 + /*--------------------------------------------------------------------------*/
1203 + }
1204 +#endif
1205 + /*--------------------------------------------------------------------------*/
1206 + }
1207 +#endif
1208 + /*--------------------------------------------------------------------------*/
1209 + }
1210 +#endif
1211 + /*--------------------------------------------------------------------------*/
1212 + }
1213 +#endif
1214 + /*--------------------------------------------------------------------------*/
1215 + }
1216 +#endif
1217 + /*--------------------------------------------------------------------------*/
1218 + }
1219 +#endif
1220 + /*--------------------------------------------------------------------------*/
1221 + }
1222 +#endif
1223 + /*--------------------------------------------------------------------------*/
1224 + }
1225 + /*--------------------------------------------------------------------------*/
1226 + FxaaFloat dstN = posM.x - posN.x;
1227 + FxaaFloat dstP = posP.x - posM.x;
1228 + if (!horzSpan) dstN = posM.y - posN.y;
1229 + if (!horzSpan) dstP = posP.y - posM.y;
1230 + /*--------------------------------------------------------------------------*/
1231 + FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
1232 + FxaaFloat spanLength = (dstP + dstN);
1233 + FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
1234 + FxaaFloat spanLengthRcp = 1.0 / spanLength;
1235 + /*--------------------------------------------------------------------------*/
1236 + FxaaBool directionN = dstN < dstP;
1237 + FxaaFloat dst = min(dstN, dstP);
1238 + FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
1239 + FxaaFloat subpixG = subpixF * subpixF;
1240 + FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
1241 + FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
1242 + /*--------------------------------------------------------------------------*/
1243 + FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
1244 + FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
1245 + if (!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
1246 + if (horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
1247 +#if (FXAA_DISCARD == 1)
1248 + return FxaaTexTop(tex, posM);
1249 +#else
1250 + return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
1251 +#endif
1252 +}
1253 +/*==========================================================================*/
1254 +#endif
1255 +
1256 +
1257 +
1258 +
1259 +/*============================================================================
1260 +
1261 +FXAA3 CONSOLE - PC VERSION
1262 +
1263 +------------------------------------------------------------------------------
1264 +Instead of using this on PC, I'd suggest just using FXAA Quality with
1265 +#define FXAA_QUALITY__PRESET 10
1266 +Or
1267 +#define FXAA_QUALITY__PRESET 20
1268 +Either are higher qualilty and almost as fast as this on modern PC GPUs.
1269 +============================================================================*/
1270 +#if (FXAA_PC_CONSOLE == 1)
1271 +/*--------------------------------------------------------------------------*/
1272 +FxaaFloat4 FxaaPixelShader(
1273 + // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
1274 + FxaaFloat2 pos,
1275 + FxaaFloat4 fxaaConsolePosPos,
1276 + FxaaTex tex,
1277 + FxaaTex fxaaConsole360TexExpBiasNegOne,
1278 + FxaaTex fxaaConsole360TexExpBiasNegTwo,
1279 + FxaaFloat2 fxaaQualityRcpFrame,
1280 + FxaaFloat4 fxaaConsoleRcpFrameOpt,
1281 + FxaaFloat4 fxaaConsoleRcpFrameOpt2,
1282 + FxaaFloat4 fxaaConsole360RcpFrameOpt2,
1283 + FxaaFloat fxaaQualitySubpix,
1284 + FxaaFloat fxaaQualityEdgeThreshold,
1285 + FxaaFloat fxaaQualityEdgeThresholdMin,
1286 + FxaaFloat fxaaConsoleEdgeSharpness,
1287 + FxaaFloat fxaaConsoleEdgeThreshold,
1288 + FxaaFloat fxaaConsoleEdgeThresholdMin,
1289 + FxaaFloat4 fxaaConsole360ConstDir
1290 +)
1291 +{
1292 + /*--------------------------------------------------------------------------*/
1293 + FxaaFloat lumaNw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xy));
1294 + FxaaFloat lumaSw = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.xw));
1295 + FxaaFloat lumaNe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zy));
1296 + FxaaFloat lumaSe = FxaaLuma(FxaaTexTop(tex, fxaaConsolePosPos.zw));
1297 + /*--------------------------------------------------------------------------*/
1298 + FxaaFloat4 rgbyM = FxaaTexTop(tex, pos.xy);
1299 +#if (FXAA_GREEN_AS_LUMA == 0)
1300 + FxaaFloat lumaM = rgbyM.w;
1301 +#else
1302 + FxaaFloat lumaM = rgbyM.y;
1303 +#endif
1304 + /*--------------------------------------------------------------------------*/
1305 + FxaaFloat lumaMaxNwSw = max(lumaNw, lumaSw);
1306 + lumaNe += 1.0 / 384.0;
1307 + FxaaFloat lumaMinNwSw = min(lumaNw, lumaSw);
1308 + /*--------------------------------------------------------------------------*/
1309 + FxaaFloat lumaMaxNeSe = max(lumaNe, lumaSe);
1310 + FxaaFloat lumaMinNeSe = min(lumaNe, lumaSe);
1311 + /*--------------------------------------------------------------------------*/
1312 + FxaaFloat lumaMax = max(lumaMaxNeSe, lumaMaxNwSw);
1313 + FxaaFloat lumaMin = min(lumaMinNeSe, lumaMinNwSw);
1314 + /*--------------------------------------------------------------------------*/
1315 + FxaaFloat lumaMaxScaled = lumaMax * fxaaConsoleEdgeThreshold;
1316 + /*--------------------------------------------------------------------------*/
1317 + FxaaFloat lumaMinM = min(lumaMin, lumaM);
1318 + FxaaFloat lumaMaxScaledClamped = max(fxaaConsoleEdgeThresholdMin, lumaMaxScaled);
1319 + FxaaFloat lumaMaxM = max(lumaMax, lumaM);
1320 + FxaaFloat dirSwMinusNe = lumaSw - lumaNe;
1321 + FxaaFloat lumaMaxSubMinM = lumaMaxM - lumaMinM;
1322 + FxaaFloat dirSeMinusNw = lumaSe - lumaNw;
1323 + if (lumaMaxSubMinM < lumaMaxScaledClamped) return rgbyM;
1324 + /*--------------------------------------------------------------------------*/
1325 + FxaaFloat2 dir;
1326 + dir.x = dirSwMinusNe + dirSeMinusNw;
1327 + dir.y = dirSwMinusNe - dirSeMinusNw;
1328 + /*--------------------------------------------------------------------------*/
1329 + FxaaFloat2 dir1 = normalize(dir.xy);
1330 + FxaaFloat4 rgbyN1 = FxaaTexTop(tex, pos.xy - dir1 * fxaaConsoleRcpFrameOpt.zw);
1331 + FxaaFloat4 rgbyP1 = FxaaTexTop(tex, pos.xy + dir1 * fxaaConsoleRcpFrameOpt.zw);
1332 + /*--------------------------------------------------------------------------*/
1333 + FxaaFloat dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * fxaaConsoleEdgeSharpness;
1334 + FxaaFloat2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0);
1335 + /*--------------------------------------------------------------------------*/
1336 + FxaaFloat4 rgbyN2 = FxaaTexTop(tex, pos.xy - dir2 * fxaaConsoleRcpFrameOpt2.zw);
1337 + FxaaFloat4 rgbyP2 = FxaaTexTop(tex, pos.xy + dir2 * fxaaConsoleRcpFrameOpt2.zw);
1338 + /*--------------------------------------------------------------------------*/
1339 + FxaaFloat4 rgbyA = rgbyN1 + rgbyP1;
1340 + FxaaFloat4 rgbyB = ((rgbyN2 + rgbyP2) * 0.25) + (rgbyA * 0.25);
1341 + /*--------------------------------------------------------------------------*/
1342 +#if (FXAA_GREEN_AS_LUMA == 0)
1343 + FxaaBool twoTap = (rgbyB.w < lumaMin) || (rgbyB.w > lumaMax);
1344 +#else
1345 + FxaaBool twoTap = (rgbyB.y < lumaMin) || (rgbyB.y > lumaMax);
1346 +#endif
1347 + if (twoTap) rgbyB.xyz = rgbyA.xyz * 0.5;
1348 + return rgbyB;
1349 +}
1350 +/*==========================================================================*/
1351 +#endif
1352 +
1353 +
1354 +
1355 +/*============================================================================
1356 +
1357 +FXAA3 CONSOLE - 360 PIXEL SHADER
1358 +
1359 +------------------------------------------------------------------------------
1360 +This optimized version thanks to suggestions from Andy Luedke.
1361 +Should be fully tex bound in all cases.
1362 +As of the FXAA 3.11 release, I have still not tested this code,
1363 +however I fixed a bug which was in both FXAA 3.9 and FXAA 3.10.
1364 +And note this is replacing the old unoptimized version.
1365 +If it does not work, please let me know so I can fix it.
1366 +============================================================================*/
1367 +#if (FXAA_360 == 1)
1368 +/*--------------------------------------------------------------------------*/
1369 +[reduceTempRegUsage(4)]
1370 +float4 FxaaPixelShader(
1371 + // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
1372 + FxaaFloat2 pos,
1373 + FxaaFloat4 fxaaConsolePosPos,
1374 + FxaaTex tex,
1375 + FxaaTex fxaaConsole360TexExpBiasNegOne,
1376 + FxaaTex fxaaConsole360TexExpBiasNegTwo,
1377 + FxaaFloat2 fxaaQualityRcpFrame,
1378 + FxaaFloat4 fxaaConsoleRcpFrameOpt,
1379 + FxaaFloat4 fxaaConsoleRcpFrameOpt2,
1380 + FxaaFloat4 fxaaConsole360RcpFrameOpt2,
1381 + FxaaFloat fxaaQualitySubpix,
1382 + FxaaFloat fxaaQualityEdgeThreshold,
1383 + FxaaFloat fxaaQualityEdgeThresholdMin,
1384 + FxaaFloat fxaaConsoleEdgeSharpness,
1385 + FxaaFloat fxaaConsoleEdgeThreshold,
1386 + FxaaFloat fxaaConsoleEdgeThresholdMin,
1387 + FxaaFloat4 fxaaConsole360ConstDir
1388 +)
1389 +{
1390 + /*--------------------------------------------------------------------------*/
1391 + float4 lumaNwNeSwSe;
1392 +#if (FXAA_GREEN_AS_LUMA == 0)
1393 + asm
1394 + {
1395 + tfetch2D lumaNwNeSwSe.w___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD = false
1396 + tfetch2D lumaNwNeSwSe._w__, tex, pos.xy, OffsetX = 0.5, OffsetY = -0.5, UseComputedLOD = false
1397 + tfetch2D lumaNwNeSwSe.__w_, tex, pos.xy, OffsetX = -0.5, OffsetY = 0.5, UseComputedLOD = false
1398 + tfetch2D lumaNwNeSwSe.___w, tex, pos.xy, OffsetX = 0.5, OffsetY = 0.5, UseComputedLOD = false
1399 + };
1400 +#else
1401 + asm
1402 + {
1403 + tfetch2D lumaNwNeSwSe.y___, tex, pos.xy, OffsetX = -0.5, OffsetY = -0.5, UseComputedLOD = false
1404 + tfetch2D lumaNwNeSwSe._y__, tex, pos.xy, OffsetX = 0.5, OffsetY = -0.5, UseComputedLOD = false
1405 + tfetch2D lumaNwNeSwSe.__y_, tex, pos.xy, OffsetX = -0.5, OffsetY = 0.5, UseComputedLOD = false
1406 + tfetch2D lumaNwNeSwSe.___y, tex, pos.xy, OffsetX = 0.5, OffsetY = 0.5, UseComputedLOD = false
1407 + };
1408 +#endif
1409 + /*--------------------------------------------------------------------------*/
1410 + lumaNwNeSwSe.y += 1.0 / 384.0;
1411 + float2 lumaMinTemp = min(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
1412 + float2 lumaMaxTemp = max(lumaNwNeSwSe.xy, lumaNwNeSwSe.zw);
1413 + float lumaMin = min(lumaMinTemp.x, lumaMinTemp.y);
1414 + float lumaMax = max(lumaMaxTemp.x, lumaMaxTemp.y);
1415 + /*--------------------------------------------------------------------------*/
1416 + float4 rgbyM = tex2Dlod(tex, float4(pos.xy, 0.0, 0.0));
1417 +#if (FXAA_GREEN_AS_LUMA == 0)
1418 + float lumaMinM = min(lumaMin, rgbyM.w);
1419 + float lumaMaxM = max(lumaMax, rgbyM.w);
1420 +#else
1421 + float lumaMinM = min(lumaMin, rgbyM.y);
1422 + float lumaMaxM = max(lumaMax, rgbyM.y);
1423 +#endif
1424 + if ((lumaMaxM - lumaMinM) < max(fxaaConsoleEdgeThresholdMin, lumaMax * fxaaConsoleEdgeThreshold)) return rgbyM;
1425 + /*--------------------------------------------------------------------------*/
1426 + float2 dir;
1427 + dir.x = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.yyxx);
1428 + dir.y = dot(lumaNwNeSwSe, fxaaConsole360ConstDir.xyxy);
1429 + dir = normalize(dir);
1430 + /*--------------------------------------------------------------------------*/
1431 + float4 dir1 = dir.xyxy * fxaaConsoleRcpFrameOpt.xyzw;
1432 + /*--------------------------------------------------------------------------*/
1433 + float4 dir2;
1434 + float dirAbsMinTimesC = min(abs(dir.x), abs(dir.y)) * fxaaConsoleEdgeSharpness;
1435 + dir2 = saturate(fxaaConsole360ConstDir.zzww * dir.xyxy / dirAbsMinTimesC + 0.5);
1436 + dir2 = dir2 * fxaaConsole360RcpFrameOpt2.xyxy + fxaaConsole360RcpFrameOpt2.zwzw;
1437 + /*--------------------------------------------------------------------------*/
1438 + float4 rgbyN1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.xy, 0.0, 0.0));
1439 + float4 rgbyP1 = tex2Dlod(fxaaConsole360TexExpBiasNegOne, float4(pos.xy + dir1.zw, 0.0, 0.0));
1440 + float4 rgbyN2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.xy, 0.0, 0.0));
1441 + float4 rgbyP2 = tex2Dlod(fxaaConsole360TexExpBiasNegTwo, float4(pos.xy + dir2.zw, 0.0, 0.0));
1442 + /*--------------------------------------------------------------------------*/
1443 + float4 rgbyA = rgbyN1 + rgbyP1;
1444 + float4 rgbyB = rgbyN2 + rgbyP2 + rgbyA * 0.5;
1445 + /*--------------------------------------------------------------------------*/
1446 + float4 rgbyR = ((FxaaLuma(rgbyB) - lumaMax) > 0.0) ? rgbyA : rgbyB;
1447 + rgbyR = ((FxaaLuma(rgbyB) - lumaMin) > 0.0) ? rgbyR : rgbyA;
1448 + return rgbyR;
1449 +}
1450 +/*==========================================================================*/
1451 +#endif
1452 +
1453 +
1454 +
1455 +/*============================================================================
1456 +
1457 +FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (NO EARLY EXIT)
1458 +
1459 +==============================================================================
1460 +The code below does not exactly match the assembly.
1461 +I have a feeling that 12 cycles is possible, but was not able to get there.
1462 +Might have to increase register count to get full performance.
1463 +Note this shader does not use perspective interpolation.
1464 +
1465 +Use the following cgc options,
1466 +
1467 +--fenable-bx2 --fastmath --fastprecision --nofloatbindings
1468 +
1469 +------------------------------------------------------------------------------
1470 +NVSHADERPERF OUTPUT
1471 +------------------------------------------------------------------------------
1472 +For reference and to aid in debug, output of NVShaderPerf should match this,
1473 +
1474 +Shader to schedule:
1475 +0: texpkb h0.w(TRUE), v5.zyxx, #0
1476 +2: addh h2.z(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
1477 +4: texpkb h0.w(TRUE), v5.xwxx, #0
1478 +6: addh h0.z(TRUE), -h2, h0.w
1479 +7: texpkb h1.w(TRUE), v5, #0
1480 +9: addh h0.x(TRUE), h0.z, -h1.w
1481 +10: addh h3.w(TRUE), h0.z, h1
1482 +11: texpkb h2.w(TRUE), v5.zwzz, #0
1483 +13: addh h0.z(TRUE), h3.w, -h2.w
1484 +14: addh h0.x(TRUE), h2.w, h0
1485 +15: nrmh h1.xz(TRUE), h0_n
1486 +16: minh_m8 h0.x(TRUE), |h1|, |h1.z|
1487 +17: maxh h4.w(TRUE), h0, h1
1488 +18: divx h2.xy(TRUE), h1_n.xzzw, h0_n
1489 +19: movr r1.zw(TRUE), v4.xxxy
1490 +20: madr r2.xz(TRUE), -h1, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zzww, r1.zzww
1491 +22: minh h5.w(TRUE), h0, h1
1492 +23: texpkb h0(TRUE), r2.xzxx, #0
1493 +25: madr r0.zw(TRUE), h1.xzxz, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w), r1
1494 +27: maxh h4.x(TRUE), h2.z, h2.w
1495 +28: texpkb h1(TRUE), r0.zwzz, #0
1496 +30: addh_d2 h1(TRUE), h0, h1
1497 +31: madr r0.xy(TRUE), -h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
1498 +33: texpkb h0(TRUE), r0, #0
1499 +35: minh h4.z(TRUE), h2, h2.w
1500 +36: fenct TRUE
1501 +37: madr r1.xy(TRUE), h2, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
1502 +39: texpkb h2(TRUE), r1, #0
1503 +41: addh_d2 h0(TRUE), h0, h2
1504 +42: maxh h2.w(TRUE), h4, h4.x
1505 +43: minh h2.x(TRUE), h5.w, h4.z
1506 +44: addh_d2 h0(TRUE), h0, h1
1507 +45: slth h2.x(TRUE), h0.w, h2
1508 +46: sgth h2.w(TRUE), h0, h2
1509 +47: movh h0(TRUE), h0
1510 +48: addx.c0 rc(TRUE), h2, h2.w
1511 +49: movh h0(c0.NE.x), h1
1512 +
1513 +IPU0 ------ Simplified schedule: --------
1514 +Pass | Unit | uOp | PC: Op
1515 +-----+--------+------+-------------------------
1516 +1 | SCT0/1 | mov | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
1517 +| TEX | txl | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
1518 +| SCB1 | add | 2: ADDh h2.z, h0.--w-, const.--x-;
1519 +| | |
1520 +2 | SCT0/1 | mov | 4: TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
1521 +| TEX | txl | 4: TXLr h0.w, g[TEX1].xwxx, const.xxxx, TEX0;
1522 +| SCB1 | add | 6: ADDh h0.z,-h2, h0.--w-;
1523 +| | |
1524 +3 | SCT0/1 | mov | 7: TXLr h1.w, g[TEX1], const.xxxx, TEX0;
1525 +| TEX | txl | 7: TXLr h1.w, g[TEX1], const.xxxx, TEX0;
1526 +| SCB0 | add | 9: ADDh h0.x, h0.z---,-h1.w---;
1527 +| SCB1 | add | 10: ADDh h3.w, h0.---z, h1;
1528 +| | |
1529 +4 | SCT0/1 | mov | 11: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
1530 +| TEX | txl | 11: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
1531 +| SCB0 | add | 14: ADDh h0.x, h2.w---, h0;
1532 +| SCB1 | add | 13: ADDh h0.z, h3.--w-,-h2.--w-;
1533 +| | |
1534 +5 | SCT1 | mov | 15: NRMh h1.xz, h0;
1535 +| SRB | nrm | 15: NRMh h1.xz, h0;
1536 +| SCB0 | min | 16: MINh*8 h0.x, |h1|, |h1.z---|;
1537 +| SCB1 | max | 17: MAXh h4.w, h0, h1;
1538 +| | |
1539 +6 | SCT0 | div | 18: DIVx h2.xy, h1.xz--, h0;
1540 +| SCT1 | mov | 19: MOVr r1.zw, g[TEX0].--xy;
1541 +| SCB0 | mad | 20: MADr r2.xz,-h1, const.z-w-, r1.z-w-;
1542 +| SCB1 | min | 22: MINh h5.w, h0, h1;
1543 +| | |
1544 +7 | SCT0/1 | mov | 23: TXLr h0, r2.xzxx, const.xxxx, TEX0;
1545 +| TEX | txl | 23: TXLr h0, r2.xzxx, const.xxxx, TEX0;
1546 +| SCB0 | max | 27: MAXh h4.x, h2.z---, h2.w---;
1547 +| SCB1 | mad | 25: MADr r0.zw, h1.--xz, const, r1;
1548 +| | |
1549 +8 | SCT0/1 | mov | 28: TXLr h1, r0.zwzz, const.xxxx, TEX0;
1550 +| TEX | txl | 28: TXLr h1, r0.zwzz, const.xxxx, TEX0;
1551 +| SCB0/1 | add | 30: ADDh/2 h1, h0, h1;
1552 +| | |
1553 +9 | SCT0 | mad | 31: MADr r0.xy,-h2, const.xy--, r1.zw--;
1554 +| SCT1 | mov | 33: TXLr h0, r0, const.zzzz, TEX0;
1555 +| TEX | txl | 33: TXLr h0, r0, const.zzzz, TEX0;
1556 +| SCB1 | min | 35: MINh h4.z, h2, h2.--w-;
1557 +| | |
1558 +10 | SCT0 | mad | 37: MADr r1.xy, h2, const.xy--, r1.zw--;
1559 +| SCT1 | mov | 39: TXLr h2, r1, const.zzzz, TEX0;
1560 +| TEX | txl | 39: TXLr h2, r1, const.zzzz, TEX0;
1561 +| SCB0/1 | add | 41: ADDh/2 h0, h0, h2;
1562 +| | |
1563 +11 | SCT0 | min | 43: MINh h2.x, h5.w---, h4.z---;
1564 +| SCT1 | max | 42: MAXh h2.w, h4, h4.---x;
1565 +| SCB0/1 | add | 44: ADDh/2 h0, h0, h1;
1566 +| | |
1567 +12 | SCT0 | set | 45: SLTh h2.x, h0.w---, h2;
1568 +| SCT1 | set | 46: SGTh h2.w, h0, h2;
1569 +| SCB0/1 | mul | 47: MOVh h0, h0;
1570 +| | |
1571 +13 | SCT0 | mad | 48: ADDxc0_s rc, h2, h2.w---;
1572 +| SCB0/1 | mul | 49: MOVh h0(NE0.xxxx), h1;
1573 +
1574 +Pass SCT TEX SCB
1575 +1: 0% 100% 25%
1576 +2: 0% 100% 25%
1577 +3: 0% 100% 50%
1578 +4: 0% 100% 50%
1579 +5: 0% 0% 50%
1580 +6: 100% 0% 75%
1581 +7: 0% 100% 75%
1582 +8: 0% 100% 100%
1583 +9: 0% 100% 25%
1584 +10: 0% 100% 100%
1585 +11: 50% 0% 100%
1586 +12: 50% 0% 100%
1587 +13: 25% 0% 100%
1588 +
1589 +MEAN: 17% 61% 67%
1590 +
1591 +Pass SCT0 SCT1 TEX SCB0 SCB1
1592 +1: 0% 0% 100% 0% 100%
1593 +2: 0% 0% 100% 0% 100%
1594 +3: 0% 0% 100% 100% 100%
1595 +4: 0% 0% 100% 100% 100%
1596 +5: 0% 0% 0% 100% 100%
1597 +6: 100% 100% 0% 100% 100%
1598 +7: 0% 0% 100% 100% 100%
1599 +8: 0% 0% 100% 100% 100%
1600 +9: 0% 0% 100% 0% 100%
1601 +10: 0% 0% 100% 100% 100%
1602 +11: 100% 100% 0% 100% 100%
1603 +12: 100% 100% 0% 100% 100%
1604 +13: 100% 0% 0% 100% 100%
1605 +
1606 +MEAN: 30% 23% 61% 76% 100%
1607 +Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
1608 +Results 13 cycles, 3 r regs, 923,076,923 pixels/s
1609 +============================================================================*/
1610 +#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 0)
1611 +/*--------------------------------------------------------------------------*/
1612 +#pragma regcount 7
1613 +#pragma disablepc all
1614 +#pragma option O3
1615 +#pragma option OutColorPrec=fp16
1616 +#pragma texformat default RGBA8
1617 +/*==========================================================================*/
1618 +half4 FxaaPixelShader(
1619 + // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
1620 + FxaaFloat2 pos,
1621 + FxaaFloat4 fxaaConsolePosPos,
1622 + FxaaTex tex,
1623 + FxaaTex fxaaConsole360TexExpBiasNegOne,
1624 + FxaaTex fxaaConsole360TexExpBiasNegTwo,
1625 + FxaaFloat2 fxaaQualityRcpFrame,
1626 + FxaaFloat4 fxaaConsoleRcpFrameOpt,
1627 + FxaaFloat4 fxaaConsoleRcpFrameOpt2,
1628 + FxaaFloat4 fxaaConsole360RcpFrameOpt2,
1629 + FxaaFloat fxaaQualitySubpix,
1630 + FxaaFloat fxaaQualityEdgeThreshold,
1631 + FxaaFloat fxaaQualityEdgeThresholdMin,
1632 + FxaaFloat fxaaConsoleEdgeSharpness,
1633 + FxaaFloat fxaaConsoleEdgeThreshold,
1634 + FxaaFloat fxaaConsoleEdgeThresholdMin,
1635 + FxaaFloat4 fxaaConsole360ConstDir
1636 +)
1637 +{
1638 + /*--------------------------------------------------------------------------*/
1639 + // (1)
1640 + half4 dir;
1641 + half4 lumaNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
1642 +#if (FXAA_GREEN_AS_LUMA == 0)
1643 + lumaNe.w += half(1.0 / 512.0);
1644 + dir.x = -lumaNe.w;
1645 + dir.z = -lumaNe.w;
1646 +#else
1647 + lumaNe.y += half(1.0 / 512.0);
1648 + dir.x = -lumaNe.y;
1649 + dir.z = -lumaNe.y;
1650 +#endif
1651 + /*--------------------------------------------------------------------------*/
1652 + // (2)
1653 + half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
1654 +#if (FXAA_GREEN_AS_LUMA == 0)
1655 + dir.x += lumaSw.w;
1656 + dir.z += lumaSw.w;
1657 +#else
1658 + dir.x += lumaSw.y;
1659 + dir.z += lumaSw.y;
1660 +#endif
1661 + /*--------------------------------------------------------------------------*/
1662 + // (3)
1663 + half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
1664 +#if (FXAA_GREEN_AS_LUMA == 0)
1665 + dir.x -= lumaNw.w;
1666 + dir.z += lumaNw.w;
1667 +#else
1668 + dir.x -= lumaNw.y;
1669 + dir.z += lumaNw.y;
1670 +#endif
1671 + /*--------------------------------------------------------------------------*/
1672 + // (4)
1673 + half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
1674 +#if (FXAA_GREEN_AS_LUMA == 0)
1675 + dir.x += lumaSe.w;
1676 + dir.z -= lumaSe.w;
1677 +#else
1678 + dir.x += lumaSe.y;
1679 + dir.z -= lumaSe.y;
1680 +#endif
1681 + /*--------------------------------------------------------------------------*/
1682 + // (5)
1683 + half4 dir1_pos;
1684 + dir1_pos.xy = normalize(dir.xyz).xz;
1685 + half dirAbsMinTimesC = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
1686 + /*--------------------------------------------------------------------------*/
1687 + // (6)
1688 + half4 dir2_pos;
1689 + dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimesC, half(-2.0), half(2.0));
1690 + dir1_pos.zw = pos.xy;
1691 + dir2_pos.zw = pos.xy;
1692 + half4 temp1N;
1693 + temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
1694 + /*--------------------------------------------------------------------------*/
1695 + // (7)
1696 + temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
1697 + half4 rgby1;
1698 + rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
1699 + /*--------------------------------------------------------------------------*/
1700 + // (8)
1701 + rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
1702 + rgby1 = (temp1N + rgby1) * 0.5;
1703 + /*--------------------------------------------------------------------------*/
1704 + // (9)
1705 + half4 temp2N;
1706 + temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
1707 + temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
1708 + /*--------------------------------------------------------------------------*/
1709 + // (10)
1710 + half4 rgby2;
1711 + rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
1712 + rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
1713 + rgby2 = (temp2N + rgby2) * 0.5;
1714 + /*--------------------------------------------------------------------------*/
1715 + // (11)
1716 + // compilier moves these scalar ops up to other cycles
1717 +#if (FXAA_GREEN_AS_LUMA == 0)
1718 + half lumaMin = min(min(lumaNw.w, lumaSw.w), min(lumaNe.w, lumaSe.w));
1719 + half lumaMax = max(max(lumaNw.w, lumaSw.w), max(lumaNe.w, lumaSe.w));
1720 +#else
1721 + half lumaMin = min(min(lumaNw.y, lumaSw.y), min(lumaNe.y, lumaSe.y));
1722 + half lumaMax = max(max(lumaNw.y, lumaSw.y), max(lumaNe.y, lumaSe.y));
1723 +#endif
1724 + rgby2 = (rgby2 + rgby1) * 0.5;
1725 + /*--------------------------------------------------------------------------*/
1726 + // (12)
1727 +#if (FXAA_GREEN_AS_LUMA == 0)
1728 + bool twoTapLt = rgby2.w < lumaMin;
1729 + bool twoTapGt = rgby2.w > lumaMax;
1730 +#else
1731 + bool twoTapLt = rgby2.y < lumaMin;
1732 + bool twoTapGt = rgby2.y > lumaMax;
1733 +#endif
1734 + /*--------------------------------------------------------------------------*/
1735 + // (13)
1736 + if (twoTapLt || twoTapGt) rgby2 = rgby1;
1737 + /*--------------------------------------------------------------------------*/
1738 + return rgby2;
1739 +}
1740 +/*==========================================================================*/
1741 +#endif
1742 +
1743 +
1744 +
1745 +/*============================================================================
1746 +
1747 +FXAA3 CONSOLE - OPTIMIZED PS3 PIXEL SHADER (WITH EARLY EXIT)
1748 +
1749 +==============================================================================
1750 +The code mostly matches the assembly.
1751 +I have a feeling that 14 cycles is possible, but was not able to get there.
1752 +Might have to increase register count to get full performance.
1753 +Note this shader does not use perspective interpolation.
1754 +
1755 +Use the following cgc options,
1756 +
1757 +--fenable-bx2 --fastmath --fastprecision --nofloatbindings
1758 +
1759 +Use of FXAA_GREEN_AS_LUMA currently adds a cycle (16 clks).
1760 +Will look at fixing this for FXAA 3.12.
1761 +------------------------------------------------------------------------------
1762 +NVSHADERPERF OUTPUT
1763 +------------------------------------------------------------------------------
1764 +For reference and to aid in debug, output of NVShaderPerf should match this,
1765 +
1766 +Shader to schedule:
1767 +0: texpkb h0.w(TRUE), v5.zyxx, #0
1768 +2: addh h2.y(TRUE), h0.w, constant(0.001953, 0.000000, 0.000000, 0.000000).x
1769 +4: texpkb h1.w(TRUE), v5.xwxx, #0
1770 +6: addh h0.x(TRUE), h1.w, -h2.y
1771 +7: texpkb h2.w(TRUE), v5.zwzz, #0
1772 +9: minh h4.w(TRUE), h2.y, h2
1773 +10: maxh h5.x(TRUE), h2.y, h2.w
1774 +11: texpkb h0.w(TRUE), v5, #0
1775 +13: addh h3.w(TRUE), -h0, h0.x
1776 +14: addh h0.x(TRUE), h0.w, h0
1777 +15: addh h0.z(TRUE), -h2.w, h0.x
1778 +16: addh h0.x(TRUE), h2.w, h3.w
1779 +17: minh h5.y(TRUE), h0.w, h1.w
1780 +18: nrmh h2.xz(TRUE), h0_n
1781 +19: minh_m8 h2.w(TRUE), |h2.x|, |h2.z|
1782 +20: divx h4.xy(TRUE), h2_n.xzzw, h2_n.w
1783 +21: movr r1.zw(TRUE), v4.xxxy
1784 +22: maxh h2.w(TRUE), h0, h1
1785 +23: fenct TRUE
1786 +24: madr r0.xy(TRUE), -h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
1787 +26: texpkb h0(TRUE), r0, #0
1788 +28: maxh h5.x(TRUE), h2.w, h5
1789 +29: minh h5.w(TRUE), h5.y, h4
1790 +30: madr r1.xy(TRUE), h2.xzzw, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).zwzz, r1.zwzz
1791 +32: texpkb h2(TRUE), r1, #0
1792 +34: addh_d2 h2(TRUE), h0, h2
1793 +35: texpkb h1(TRUE), v4, #0
1794 +37: maxh h5.y(TRUE), h5.x, h1.w
1795 +38: minh h4.w(TRUE), h1, h5
1796 +39: madr r0.xy(TRUE), -h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
1797 +41: texpkb h0(TRUE), r0, #0
1798 +43: addh_m8 h5.z(TRUE), h5.y, -h4.w
1799 +44: madr r2.xy(TRUE), h4, constant(cConst5.x, cConst5.y, cConst5.z, cConst5.w).xyxx, r1.zwzz
1800 +46: texpkb h3(TRUE), r2, #0
1801 +48: addh_d2 h0(TRUE), h0, h3
1802 +49: addh_d2 h3(TRUE), h0, h2
1803 +50: movh h0(TRUE), h3
1804 +51: slth h3.x(TRUE), h3.w, h5.w
1805 +52: sgth h3.w(TRUE), h3, h5.x
1806 +53: addx.c0 rc(TRUE), h3.x, h3
1807 +54: slth.c0 rc(TRUE), h5.z, h5
1808 +55: movh h0(c0.NE.w), h2
1809 +56: movh h0(c0.NE.x), h1
1810 +
1811 +IPU0 ------ Simplified schedule: --------
1812 +Pass | Unit | uOp | PC: Op
1813 +-----+--------+------+-------------------------
1814 +1 | SCT0/1 | mov | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
1815 +| TEX | txl | 0: TXLr h0.w, g[TEX1].zyxx, const.xxxx, TEX0;
1816 +| SCB0 | add | 2: ADDh h2.y, h0.-w--, const.-x--;
1817 +| | |
1818 +2 | SCT0/1 | mov | 4: TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
1819 +| TEX | txl | 4: TXLr h1.w, g[TEX1].xwxx, const.xxxx, TEX0;
1820 +| SCB0 | add | 6: ADDh h0.x, h1.w---,-h2.y---;
1821 +| | |
1822 +3 | SCT0/1 | mov | 7: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
1823 +| TEX | txl | 7: TXLr h2.w, g[TEX1].zwzz, const.xxxx, TEX0;
1824 +| SCB0 | max | 10: MAXh h5.x, h2.y---, h2.w---;
1825 +| SCB1 | min | 9: MINh h4.w, h2.---y, h2;
1826 +| | |
1827 +4 | SCT0/1 | mov | 11: TXLr h0.w, g[TEX1], const.xxxx, TEX0;
1828 +| TEX | txl | 11: TXLr h0.w, g[TEX1], const.xxxx, TEX0;
1829 +| SCB0 | add | 14: ADDh h0.x, h0.w---, h0;
1830 +| SCB1 | add | 13: ADDh h3.w,-h0, h0.---x;
1831 +| | |
1832 +5 | SCT0 | mad | 16: ADDh h0.x, h2.w---, h3.w---;
1833 +| SCT1 | mad | 15: ADDh h0.z,-h2.--w-, h0.--x-;
1834 +| SCB0 | min | 17: MINh h5.y, h0.-w--, h1.-w--;
1835 +| | |
1836 +6 | SCT1 | mov | 18: NRMh h2.xz, h0;
1837 +| SRB | nrm | 18: NRMh h2.xz, h0;
1838 +| SCB1 | min | 19: MINh*8 h2.w, |h2.---x|, |h2.---z|;
1839 +| | |
1840 +7 | SCT0 | div | 20: DIVx h4.xy, h2.xz--, h2.ww--;
1841 +| SCT1 | mov | 21: MOVr r1.zw, g[TEX0].--xy;
1842 +| SCB1 | max | 22: MAXh h2.w, h0, h1;
1843 +| | |
1844 +8 | SCT0 | mad | 24: MADr r0.xy,-h2.xz--, const.zw--, r1.zw--;
1845 +| SCT1 | mov | 26: TXLr h0, r0, const.xxxx, TEX0;
1846 +| TEX | txl | 26: TXLr h0, r0, const.xxxx, TEX0;
1847 +| SCB0 | max | 28: MAXh h5.x, h2.w---, h5;
1848 +| SCB1 | min | 29: MINh h5.w, h5.---y, h4;
1849 +| | |
1850 +9 | SCT0 | mad | 30: MADr r1.xy, h2.xz--, const.zw--, r1.zw--;
1851 +| SCT1 | mov | 32: TXLr h2, r1, const.xxxx, TEX0;
1852 +| TEX | txl | 32: TXLr h2, r1, const.xxxx, TEX0;
1853 +| SCB0/1 | add | 34: ADDh/2 h2, h0, h2;
1854 +| | |
1855 +10 | SCT0/1 | mov | 35: TXLr h1, g[TEX0], const.xxxx, TEX0;
1856 +| TEX | txl | 35: TXLr h1, g[TEX0], const.xxxx, TEX0;
1857 +| SCB0 | max | 37: MAXh h5.y, h5.-x--, h1.-w--;
1858 +| SCB1 | min | 38: MINh h4.w, h1, h5;
1859 +| | |
1860 +11 | SCT0 | mad | 39: MADr r0.xy,-h4, const.xy--, r1.zw--;
1861 +| SCT1 | mov | 41: TXLr h0, r0, const.zzzz, TEX0;
1862 +| TEX | txl | 41: TXLr h0, r0, const.zzzz, TEX0;
1863 +| SCB0 | mad | 44: MADr r2.xy, h4, const.xy--, r1.zw--;
1864 +| SCB1 | add | 43: ADDh*8 h5.z, h5.--y-,-h4.--w-;
1865 +| | |
1866 +12 | SCT0/1 | mov | 46: TXLr h3, r2, const.xxxx, TEX0;
1867 +| TEX | txl | 46: TXLr h3, r2, const.xxxx, TEX0;
1868 +| SCB0/1 | add | 48: ADDh/2 h0, h0, h3;
1869 +| | |
1870 +13 | SCT0/1 | mad | 49: ADDh/2 h3, h0, h2;
1871 +| SCB0/1 | mul | 50: MOVh h0, h3;
1872 +| | |
1873 +14 | SCT0 | set | 51: SLTh h3.x, h3.w---, h5.w---;
1874 +| SCT1 | set | 52: SGTh h3.w, h3, h5.---x;
1875 +| SCB0 | set | 54: SLThc0 rc, h5.z---, h5;
1876 +| SCB1 | add | 53: ADDxc0_s rc, h3.---x, h3;
1877 +| | |
1878 +15 | SCT0/1 | mul | 55: MOVh h0(NE0.wwww), h2;
1879 +| SCB0/1 | mul | 56: MOVh h0(NE0.xxxx), h1;
1880 +
1881 +Pass SCT TEX SCB
1882 +1: 0% 100% 25%
1883 +2: 0% 100% 25%
1884 +3: 0% 100% 50%
1885 +4: 0% 100% 50%
1886 +5: 50% 0% 25%
1887 +6: 0% 0% 25%
1888 +7: 100% 0% 25%
1889 +8: 0% 100% 50%
1890 +9: 0% 100% 100%
1891 +10: 0% 100% 50%
1892 +11: 0% 100% 75%
1893 +12: 0% 100% 100%
1894 +13: 100% 0% 100%
1895 +14: 50% 0% 50%
1896 +15: 100% 0% 100%
1897 +
1898 +MEAN: 26% 60% 56%
1899 +
1900 +Pass SCT0 SCT1 TEX SCB0 SCB1
1901 +1: 0% 0% 100% 100% 0%
1902 +2: 0% 0% 100% 100% 0%
1903 +3: 0% 0% 100% 100% 100%
1904 +4: 0% 0% 100% 100% 100%
1905 +5: 100% 100% 0% 100% 0%
1906 +6: 0% 0% 0% 0% 100%
1907 +7: 100% 100% 0% 0% 100%
1908 +8: 0% 0% 100% 100% 100%
1909 +9: 0% 0% 100% 100% 100%
1910 +10: 0% 0% 100% 100% 100%
1911 +11: 0% 0% 100% 100% 100%
1912 +12: 0% 0% 100% 100% 100%
1913 +13: 100% 100% 0% 100% 100%
1914 +14: 100% 100% 0% 100% 100%
1915 +15: 100% 100% 0% 100% 100%
1916 +
1917 +MEAN: 33% 33% 60% 86% 80%
1918 +Fragment Performance Setup: Driver RSX Compiler, GPU RSX, Flags 0x5
1919 +Results 15 cycles, 3 r regs, 800,000,000 pixels/s
1920 +============================================================================*/
1921 +#if (FXAA_PS3 == 1) && (FXAA_EARLY_EXIT == 1)
1922 +/*--------------------------------------------------------------------------*/
1923 +#pragma regcount 7
1924 +#pragma disablepc all
1925 +#pragma option O2
1926 +#pragma option OutColorPrec=fp16
1927 +#pragma texformat default RGBA8
1928 +/*==========================================================================*/
1929 +half4 FxaaPixelShader(
1930 + // See FXAA Quality FxaaPixelShader() source for docs on Inputs!
1931 + FxaaFloat2 pos,
1932 + FxaaFloat4 fxaaConsolePosPos,
1933 + FxaaTex tex,
1934 + FxaaTex fxaaConsole360TexExpBiasNegOne,
1935 + FxaaTex fxaaConsole360TexExpBiasNegTwo,
1936 + FxaaFloat2 fxaaQualityRcpFrame,
1937 + FxaaFloat4 fxaaConsoleRcpFrameOpt,
1938 + FxaaFloat4 fxaaConsoleRcpFrameOpt2,
1939 + FxaaFloat4 fxaaConsole360RcpFrameOpt2,
1940 + FxaaFloat fxaaQualitySubpix,
1941 + FxaaFloat fxaaQualityEdgeThreshold,
1942 + FxaaFloat fxaaQualityEdgeThresholdMin,
1943 + FxaaFloat fxaaConsoleEdgeSharpness,
1944 + FxaaFloat fxaaConsoleEdgeThreshold,
1945 + FxaaFloat fxaaConsoleEdgeThresholdMin,
1946 + FxaaFloat4 fxaaConsole360ConstDir
1947 +)
1948 +{
1949 + /*--------------------------------------------------------------------------*/
1950 + // (1)
1951 + half4 rgbyNe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zy, 0, 0));
1952 +#if (FXAA_GREEN_AS_LUMA == 0)
1953 + half lumaNe = rgbyNe.w + half(1.0 / 512.0);
1954 +#else
1955 + half lumaNe = rgbyNe.y + half(1.0 / 512.0);
1956 +#endif
1957 + /*--------------------------------------------------------------------------*/
1958 + // (2)
1959 + half4 lumaSw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xw, 0, 0));
1960 +#if (FXAA_GREEN_AS_LUMA == 0)
1961 + half lumaSwNegNe = lumaSw.w - lumaNe;
1962 +#else
1963 + half lumaSwNegNe = lumaSw.y - lumaNe;
1964 +#endif
1965 + /*--------------------------------------------------------------------------*/
1966 + // (3)
1967 + half4 lumaNw = h4tex2Dlod(tex, half4(fxaaConsolePosPos.xy, 0, 0));
1968 +#if (FXAA_GREEN_AS_LUMA == 0)
1969 + half lumaMaxNwSw = max(lumaNw.w, lumaSw.w);
1970 + half lumaMinNwSw = min(lumaNw.w, lumaSw.w);
1971 +#else
1972 + half lumaMaxNwSw = max(lumaNw.y, lumaSw.y);
1973 + half lumaMinNwSw = min(lumaNw.y, lumaSw.y);
1974 +#endif
1975 + /*--------------------------------------------------------------------------*/
1976 + // (4)
1977 + half4 lumaSe = h4tex2Dlod(tex, half4(fxaaConsolePosPos.zw, 0, 0));
1978 +#if (FXAA_GREEN_AS_LUMA == 0)
1979 + half dirZ = lumaNw.w + lumaSwNegNe;
1980 + half dirX = -lumaNw.w + lumaSwNegNe;
1981 +#else
1982 + half dirZ = lumaNw.y + lumaSwNegNe;
1983 + half dirX = -lumaNw.y + lumaSwNegNe;
1984 +#endif
1985 + /*--------------------------------------------------------------------------*/
1986 + // (5)
1987 + half3 dir;
1988 + dir.y = 0.0;
1989 +#if (FXAA_GREEN_AS_LUMA == 0)
1990 + dir.x = lumaSe.w + dirX;
1991 + dir.z = -lumaSe.w + dirZ;
1992 + half lumaMinNeSe = min(lumaNe, lumaSe.w);
1993 +#else
1994 + dir.x = lumaSe.y + dirX;
1995 + dir.z = -lumaSe.y + dirZ;
1996 + half lumaMinNeSe = min(lumaNe, lumaSe.y);
1997 +#endif
1998 + /*--------------------------------------------------------------------------*/
1999 + // (6)
2000 + half4 dir1_pos;
2001 + dir1_pos.xy = normalize(dir).xz;
2002 + half dirAbsMinTimes8 = min(abs(dir1_pos.x), abs(dir1_pos.y)) * half(FXAA_CONSOLE__PS3_EDGE_SHARPNESS);
2003 + /*--------------------------------------------------------------------------*/
2004 + // (7)
2005 + half4 dir2_pos;
2006 + dir2_pos.xy = clamp(dir1_pos.xy / dirAbsMinTimes8, half(-2.0), half(2.0));
2007 + dir1_pos.zw = pos.xy;
2008 + dir2_pos.zw = pos.xy;
2009 +#if (FXAA_GREEN_AS_LUMA == 0)
2010 + half lumaMaxNeSe = max(lumaNe, lumaSe.w);
2011 +#else
2012 + half lumaMaxNeSe = max(lumaNe, lumaSe.y);
2013 +#endif
2014 + /*--------------------------------------------------------------------------*/
2015 + // (8)
2016 + half4 temp1N;
2017 + temp1N.xy = dir1_pos.zw - dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
2018 + temp1N = h4tex2Dlod(tex, half4(temp1N.xy, 0.0, 0.0));
2019 + half lumaMax = max(lumaMaxNwSw, lumaMaxNeSe);
2020 + half lumaMin = min(lumaMinNwSw, lumaMinNeSe);
2021 + /*--------------------------------------------------------------------------*/
2022 + // (9)
2023 + half4 rgby1;
2024 + rgby1.xy = dir1_pos.zw + dir1_pos.xy * fxaaConsoleRcpFrameOpt.zw;
2025 + rgby1 = h4tex2Dlod(tex, half4(rgby1.xy, 0.0, 0.0));
2026 + rgby1 = (temp1N + rgby1) * 0.5;
2027 + /*--------------------------------------------------------------------------*/
2028 + // (10)
2029 + half4 rgbyM = h4tex2Dlod(tex, half4(pos.xy, 0.0, 0.0));
2030 +#if (FXAA_GREEN_AS_LUMA == 0)
2031 + half lumaMaxM = max(lumaMax, rgbyM.w);
2032 + half lumaMinM = min(lumaMin, rgbyM.w);
2033 +#else
2034 + half lumaMaxM = max(lumaMax, rgbyM.y);
2035 + half lumaMinM = min(lumaMin, rgbyM.y);
2036 +#endif
2037 + /*--------------------------------------------------------------------------*/
2038 + // (11)
2039 + half4 temp2N;
2040 + temp2N.xy = dir2_pos.zw - dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
2041 + temp2N = h4tex2Dlod(tex, half4(temp2N.xy, 0.0, 0.0));
2042 + half4 rgby2;
2043 + rgby2.xy = dir2_pos.zw + dir2_pos.xy * fxaaConsoleRcpFrameOpt2.zw;
2044 + half lumaRangeM = (lumaMaxM - lumaMinM) / FXAA_CONSOLE__PS3_EDGE_THRESHOLD;
2045 + /*--------------------------------------------------------------------------*/
2046 + // (12)
2047 + rgby2 = h4tex2Dlod(tex, half4(rgby2.xy, 0.0, 0.0));
2048 + rgby2 = (temp2N + rgby2) * 0.5;
2049 + /*--------------------------------------------------------------------------*/
2050 + // (13)
2051 + rgby2 = (rgby2 + rgby1) * 0.5;
2052 + /*--------------------------------------------------------------------------*/
2053 + // (14)
2054 +#if (FXAA_GREEN_AS_LUMA == 0)
2055 + bool twoTapLt = rgby2.w < lumaMin;
2056 + bool twoTapGt = rgby2.w > lumaMax;
2057 +#else
2058 + bool twoTapLt = rgby2.y < lumaMin;
2059 + bool twoTapGt = rgby2.y > lumaMax;
2060 +#endif
2061 + bool earlyExit = lumaRangeM < lumaMax;
2062 + bool twoTap = twoTapLt || twoTapGt;
2063 + /*--------------------------------------------------------------------------*/
2064 + // (15)
2065 + if (twoTap) rgby2 = rgby1;
2066 + if (earlyExit) rgby2 = rgbyM;
2067 + /*--------------------------------------------------------------------------*/
2068 + return rgby2;
2069 +}
2070 +/*==========================================================================*/
2071 +#endif
2072 +
2073 +#endif // __FXAA3_INC__
1 +fileFormatVersion: 2
2 +guid: 613b4036a9f55c34fb054bde02455e46
3 +timeCreated: 1462350552
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Hidden/Post FX/Fog"
2 +{
3 + Properties
4 + {
5 + _MainTex("Main Texture", 2D) = "white" {}
6 + }
7 +
8 + CGINCLUDE
9 +
10 + #pragma multi_compile __ FOG_LINEAR FOG_EXP FOG_EXP2
11 + #include "UnityCG.cginc"
12 + #include "Common.cginc"
13 +
14 + #define SKYBOX_THREASHOLD_VALUE 0.9999
15 +
16 + struct Varyings
17 + {
18 + float2 uv : TEXCOORD0;
19 + float4 vertex : SV_POSITION;
20 + };
21 +
22 + Varyings VertFog(AttributesDefault v)
23 + {
24 + Varyings o;
25 + o.vertex = UnityObjectToClipPos(v.vertex);
26 + o.uv = UnityStereoScreenSpaceUVAdjust(v.texcoord, _MainTex_ST);
27 + return o;
28 + }
29 +
30 + sampler2D _CameraDepthTexture;
31 +
32 + half4 _FogColor;
33 + float _Density;
34 + float _Start;
35 + float _End;
36 +
37 + half ComputeFog(float z)
38 + {
39 + half fog = 0.0;
40 + #if FOG_LINEAR
41 + fog = (_End - z) / (_End - _Start);
42 + #elif FOG_EXP
43 + fog = exp2(-_Density * z);
44 + #else // FOG_EXP2
45 + fog = _Density * z;
46 + fog = exp2(-fog * fog);
47 + #endif
48 + return saturate(fog);
49 + }
50 +
51 + float ComputeDistance(float depth)
52 + {
53 + float dist = depth * _ProjectionParams.z;
54 + dist -= _ProjectionParams.y;
55 + return dist;
56 + }
57 +
58 + half4 FragFog(Varyings i) : SV_Target
59 + {
60 + half4 color = tex2D(_MainTex, i.uv);
61 +
62 + float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv);
63 + depth = Linear01Depth(depth);
64 + float dist = ComputeDistance(depth);
65 + half fog = 1.0 - ComputeFog(dist);
66 +
67 + return lerp(color, _FogColor, fog);
68 + }
69 +
70 + half4 FragFogExcludeSkybox(Varyings i) : SV_Target
71 + {
72 + half4 color = tex2D(_MainTex, i.uv);
73 +
74 + float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv);
75 + depth = Linear01Depth(depth);
76 + float skybox = depth < SKYBOX_THREASHOLD_VALUE;
77 + float dist = ComputeDistance(depth);
78 + half fog = 1.0 - ComputeFog(dist);
79 +
80 + return lerp(color, _FogColor, fog * skybox);
81 + }
82 +
83 + ENDCG
84 +
85 + SubShader
86 + {
87 + Cull Off ZWrite Off ZTest Always
88 +
89 + Pass
90 + {
91 + CGPROGRAM
92 +
93 + #pragma vertex VertFog
94 + #pragma fragment FragFog
95 +
96 + ENDCG
97 + }
98 +
99 + Pass
100 + {
101 + CGPROGRAM
102 +
103 + #pragma vertex VertFog
104 + #pragma fragment FragFogExcludeSkybox
105 +
106 + ENDCG
107 + }
108 + }
109 +}
1 +fileFormatVersion: 2
2 +guid: 2a72fc91cbae3cc4686a6143e8517993
3 +timeCreated: 1487335480
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Hidden/Post FX/Grain Generator"
2 +{
3 + CGINCLUDE
4 +
5 + #pragma exclude_renderers d3d11_9x
6 + #pragma target 3.0
7 + #include "UnityCG.cginc"
8 + #include "Common.cginc"
9 +
10 + float _Phase;
11 +
12 + // Implementation based on Timothy Lottes' "Large Grain"
13 + // Reference code: https://www.shadertoy.com/view/4sSXDW
14 + // Other article of interest: http://devlog-martinsh.blogspot.fr/2013/05/image-imperfections-and-film-grain-post.html
15 + float Noise(float2 n, float x)
16 + {
17 + n += x;
18 + return frac(sin(dot(n.xy, float2(12.9898, 78.233))) * 43758.5453);
19 + }
20 +
21 + float Step1(float2 uv, float n)
22 + {
23 + float b = 2.0, c = -12.0;
24 + return (1.0 / (4.0 + b * 4.0 + abs(c))) * (
25 + Noise(uv + float2(-1.0, -1.0), n) +
26 + Noise(uv + float2( 0.0, -1.0), n) * b +
27 + Noise(uv + float2( 1.0, -1.0), n) +
28 + Noise(uv + float2(-1.0, 0.0), n) * b +
29 + Noise(uv + float2( 0.0, 0.0), n) * c +
30 + Noise(uv + float2( 1.0, 0.0), n) * b +
31 + Noise(uv + float2(-1.0, 1.0), n) +
32 + Noise(uv + float2( 0.0, 1.0), n) * b +
33 + Noise(uv + float2( 1.0, 1.0), n)
34 + );
35 + }
36 +
37 + float Step2(float2 uv, float n)
38 + {
39 + float b = 2.0, c = 4.0;
40 + return (1.0 / (4.0 + b * 4.0 + abs(c))) * (
41 + Step1(uv + float2(-1.0, -1.0), n) +
42 + Step1(uv + float2( 0.0, -1.0), n) * b +
43 + Step1(uv + float2( 1.0, -1.0), n) +
44 + Step1(uv + float2(-1.0, 0.0), n) * b +
45 + Step1(uv + float2( 0.0, 0.0), n) * c +
46 + Step1(uv + float2( 1.0, 0.0), n) * b +
47 + Step1(uv + float2(-1.0, 1.0), n) +
48 + Step1(uv + float2( 0.0, 1.0), n) * b +
49 + Step1(uv + float2( 1.0, 1.0), n)
50 + );
51 + }
52 +
53 + float Step3BW(float2 uv)
54 + {
55 + return Step2(uv, frac(_Phase));
56 + }
57 +
58 + float3 Step3(float2 uv)
59 + {
60 + float a = Step2(uv, 0.07 * frac(_Phase));
61 + float b = Step2(uv, 0.11 * frac(_Phase));
62 + float c = Step2(uv, 0.13 * frac(_Phase));
63 + return float3(a, b, c);
64 + }
65 +
66 + float4 FragGrain(VaryingsDefault i) : SV_Target
67 + {
68 + float grain = Step3BW(i.uv * float2(192.0, 192.0));
69 + return float4(grain.xxx, 1.0);
70 + }
71 +
72 + float4 FragGrainColored(VaryingsDefault i) : SV_Target
73 + {
74 + float3 grain = Step3(i.uv * float2(192.0, 192.0));
75 + return float4(grain, 1.0);
76 + }
77 +
78 + ENDCG
79 +
80 + SubShader
81 + {
82 + Cull Off ZWrite Off ZTest Always
83 +
84 + Pass
85 + {
86 + CGPROGRAM
87 +
88 + #pragma vertex VertDefault
89 + #pragma fragment FragGrain
90 +
91 + ENDCG
92 + }
93 +
94 + Pass
95 + {
96 + CGPROGRAM
97 +
98 + #pragma vertex VertDefault
99 + #pragma fragment FragGrainColored
100 +
101 + ENDCG
102 + }
103 + }
104 +}
1 +fileFormatVersion: 2
2 +guid: 11852d1b1b034654bb03e7c8fda28fbf
3 +timeCreated: 1476347976
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Hidden/Post FX/Lut Generator"
2 +{
3 + CGINCLUDE
4 +
5 + #pragma target 3.0
6 + #pragma multi_compile __ TONEMAPPING_NEUTRAL TONEMAPPING_FILMIC
7 +
8 + #include "UnityCG.cginc"
9 + #include "ACES.cginc"
10 + #include "Common.cginc"
11 + #include "ColorGrading.cginc"
12 + #include "Tonemapping.cginc"
13 +
14 + half3 _Balance;
15 +
16 + half3 _Lift;
17 + half3 _InvGamma;
18 + half3 _Gain;
19 +
20 + half3 _Offset;
21 + half3 _Power;
22 + half3 _Slope;
23 +
24 + half _HueShift;
25 + half _Saturation;
26 + half _Contrast;
27 +
28 + half3 _ChannelMixerRed;
29 + half3 _ChannelMixerGreen;
30 + half3 _ChannelMixerBlue;
31 +
32 + half4 _NeutralTonemapperParams1;
33 + half4 _NeutralTonemapperParams2;
34 +
35 + sampler2D _Curves;
36 +
37 + half4 _LutParams;
38 +
39 + half3 ColorGrade(half3 color)
40 + {
41 + half3 aces = unity_to_ACES(color);
42 +
43 + // ACEScc (log) space
44 + half3 acescc = ACES_to_ACEScc(aces);
45 +
46 + acescc = OffsetPowerSlope(acescc, _Offset, _Power, _Slope);
47 +
48 + half2 hs = RgbToHsv(acescc).xy;
49 + half satMultiplier = SecondaryHueSat(hs.x, _Curves);
50 + satMultiplier *= SecondarySatSat(hs.y, _Curves);
51 + satMultiplier *= SecondaryLumSat(AcesLuminance(acescc), _Curves);
52 +
53 + acescc = Saturation(acescc, _Saturation * satMultiplier);
54 + acescc = ContrastLog(acescc, _Contrast);
55 +
56 + aces = ACEScc_to_ACES(acescc);
57 +
58 + // ACEScg (linear) space
59 + half3 acescg = ACES_to_ACEScg(aces);
60 +
61 + acescg = WhiteBalance(acescg, _Balance);
62 + acescg = LiftGammaGain(acescg, _Lift, _InvGamma, _Gain);
63 +
64 + half3 hsv = RgbToHsv(max(acescg, 0.0));
65 + hsv.x = SecondaryHueHue(hsv.x + _HueShift, _Curves);
66 + acescg = HsvToRgb(hsv);
67 +
68 + acescg = ChannelMixer(acescg, _ChannelMixerRed, _ChannelMixerGreen, _ChannelMixerBlue);
69 +
70 + #if TONEMAPPING_FILMIC
71 +
72 + aces = ACEScg_to_ACES(acescg);
73 + color = FilmicTonemap(aces);
74 +
75 + #elif TONEMAPPING_NEUTRAL
76 +
77 + color = ACEScg_to_unity(acescg);
78 + color = NeutralTonemap(color, _NeutralTonemapperParams1, _NeutralTonemapperParams2);
79 +
80 + #else
81 +
82 + color = ACEScg_to_unity(acescg);
83 +
84 + #endif
85 +
86 + // YRGB curves (done in linear/LDR for now)
87 + color = YrgbCurve(color, _Curves);
88 +
89 + return color;
90 + }
91 +
92 + half4 FragCreateLut(VaryingsDefault i) : SV_Target
93 + {
94 + // 2D strip lut
95 + half2 uv = i.uv - _LutParams.yz;
96 + half3 color;
97 + color.r = frac(uv.x * _LutParams.x);
98 + color.b = uv.x - color.r / _LutParams.x;
99 + color.g = uv.y;
100 +
101 + // Lut is in LogC
102 + half3 colorLogC = color * _LutParams.w;
103 +
104 + // Switch back to unity linear and color grade
105 + half3 colorLinear = LogCToLinear(colorLogC);
106 + half3 graded = ColorGrade(colorLinear);
107 +
108 + return half4(graded, 1.0);
109 + }
110 +
111 + ENDCG
112 +
113 + SubShader
114 + {
115 + Cull Off ZWrite Off ZTest Always
116 +
117 + // (0)
118 + Pass
119 + {
120 + CGPROGRAM
121 +
122 + #pragma vertex VertDefault
123 + #pragma fragment FragCreateLut
124 +
125 + ENDCG
126 + }
127 + }
128 +}
1 +fileFormatVersion: 2
2 +guid: d248d4d1588851f43a9fa18a4e6f0209
3 +timeCreated: 1460361871
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +#ifndef __MOTION_BLUR__
2 +#define __MOTION_BLUR__
3 +
4 +#include "UnityCG.cginc"
5 +#include "Common.cginc"
6 +
7 +// Camera depth texture
8 +sampler2D_float _CameraDepthTexture;
9 +
10 +// Camera motion vectors texture
11 +sampler2D_half _CameraMotionVectorsTexture;
12 +float4 _CameraMotionVectorsTexture_TexelSize;
13 +
14 +// Packed velocity texture (2/10/10/10)
15 +sampler2D_half _VelocityTex;
16 +float2 _VelocityTex_TexelSize;
17 +
18 +// NeighborMax texture
19 +sampler2D_half _NeighborMaxTex;
20 +float2 _NeighborMaxTex_TexelSize;
21 +
22 +// Velocity scale factor
23 +float _VelocityScale;
24 +
25 +// TileMax filter parameters
26 +int _TileMaxLoop;
27 +float2 _TileMaxOffs;
28 +
29 +// Maximum blur radius (in pixels)
30 +half _MaxBlurRadius;
31 +float _RcpMaxBlurRadius;
32 +
33 +// Filter parameters/coefficients
34 +half _LoopCount;
35 +
36 +// History buffer for frame blending
37 +sampler2D _History1LumaTex;
38 +sampler2D _History2LumaTex;
39 +sampler2D _History3LumaTex;
40 +sampler2D _History4LumaTex;
41 +
42 +sampler2D _History1ChromaTex;
43 +sampler2D _History2ChromaTex;
44 +sampler2D _History3ChromaTex;
45 +sampler2D _History4ChromaTex;
46 +
47 +half _History1Weight;
48 +half _History2Weight;
49 +half _History3Weight;
50 +half _History4Weight;
51 +
52 +struct VaryingsMultitex
53 +{
54 + float4 pos : SV_POSITION;
55 + float2 uv0 : TEXCOORD0;
56 + float2 uv1 : TEXCOORD1;
57 +};
58 +
59 +VaryingsMultitex VertMultitex(AttributesDefault v)
60 +{
61 + VaryingsMultitex o;
62 + o.pos = UnityObjectToClipPos(v.vertex);
63 + o.uv0 = v.texcoord.xy;
64 + o.uv1 = v.texcoord.xy;
65 +
66 +#if UNITY_UV_STARTS_AT_TOP
67 + if (_MainTex_TexelSize.y < 0.0)
68 + o.uv1.y = 1.0 - v.texcoord.y;
69 +#endif
70 +
71 + return o;
72 +}
73 +
74 +// -----------------------------------------------------------------------------
75 +// Prefilter
76 +
77 +// Velocity texture setup
78 +half4 FragVelocitySetup(VaryingsDefault i) : SV_Target
79 +{
80 + // Sample the motion vector.
81 + float2 v = tex2D(_CameraMotionVectorsTexture, i.uv).rg;
82 +
83 + // Apply the exposure time and convert to the pixel space.
84 + v *= (_VelocityScale * 0.5) * _CameraMotionVectorsTexture_TexelSize.zw;
85 +
86 + // Clamp the vector with the maximum blur radius.
87 + v /= max(1.0, length(v) * _RcpMaxBlurRadius);
88 +
89 + // Sample the depth of the pixel.
90 + half d = LinearizeDepth(SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv));
91 +
92 + // Pack into 10/10/10/2 format.
93 + return half4((v * _RcpMaxBlurRadius + 1.0) * 0.5, d, 0.0);
94 +}
95 +
96 +// TileMax filter (2 pixel width with normalization)
97 +half4 FragTileMax1(VaryingsDefault i) : SV_Target
98 +{
99 + float4 d = _MainTex_TexelSize.xyxy * float4(-0.5, -0.5, 0.5, 0.5);
100 +
101 + half2 v1 = tex2D(_MainTex, i.uv + d.xy).rg;
102 + half2 v2 = tex2D(_MainTex, i.uv + d.zy).rg;
103 + half2 v3 = tex2D(_MainTex, i.uv + d.xw).rg;
104 + half2 v4 = tex2D(_MainTex, i.uv + d.zw).rg;
105 +
106 + v1 = (v1 * 2.0 - 1.0) * _MaxBlurRadius;
107 + v2 = (v2 * 2.0 - 1.0) * _MaxBlurRadius;
108 + v3 = (v3 * 2.0 - 1.0) * _MaxBlurRadius;
109 + v4 = (v4 * 2.0 - 1.0) * _MaxBlurRadius;
110 +
111 + return half4(MaxV(MaxV(MaxV(v1, v2), v3), v4), 0.0, 0.0);
112 +}
113 +
114 +// TileMax filter (2 pixel width)
115 +half4 FragTileMax2(VaryingsDefault i) : SV_Target
116 +{
117 + float4 d = _MainTex_TexelSize.xyxy * float4(-0.5, -0.5, 0.5, 0.5);
118 +
119 + half2 v1 = tex2D(_MainTex, i.uv + d.xy).rg;
120 + half2 v2 = tex2D(_MainTex, i.uv + d.zy).rg;
121 + half2 v3 = tex2D(_MainTex, i.uv + d.xw).rg;
122 + half2 v4 = tex2D(_MainTex, i.uv + d.zw).rg;
123 +
124 + return half4(MaxV(MaxV(MaxV(v1, v2), v3), v4), 0.0, 0.0);
125 +}
126 +
127 +// TileMax filter (variable width)
128 +half4 FragTileMaxV(VaryingsDefault i) : SV_Target
129 +{
130 + float2 uv0 = i.uv + _MainTex_TexelSize.xy * _TileMaxOffs.xy;
131 +
132 + float2 du = float2(_MainTex_TexelSize.x, 0.0);
133 + float2 dv = float2(0, _MainTex_TexelSize.y);
134 +
135 + half2 vo = 0;
136 +
137 + UNITY_LOOP
138 + for (int ix = 0; ix < _TileMaxLoop; ix++)
139 + {
140 + UNITY_LOOP
141 + for (int iy = 0; iy < _TileMaxLoop; iy++)
142 + {
143 + float2 uv = uv0 + du * ix + dv * iy;
144 + vo = MaxV(vo, tex2D(_MainTex, uv).rg);
145 + }
146 + }
147 +
148 + return half4(vo, 0.0, 0.0);
149 +}
150 +
151 +// NeighborMax filter
152 +half4 FragNeighborMax(VaryingsDefault i) : SV_Target
153 +{
154 + const half cw = 1.01; // Center weight tweak
155 +
156 + float4 d = _MainTex_TexelSize.xyxy * float4(1.0, 1.0, -1.0, 0.0);
157 +
158 + half2 v1 = tex2D(_MainTex, i.uv - d.xy).rg;
159 + half2 v2 = tex2D(_MainTex, i.uv - d.wy).rg;
160 + half2 v3 = tex2D(_MainTex, i.uv - d.zy).rg;
161 +
162 + half2 v4 = tex2D(_MainTex, i.uv - d.xw).rg;
163 + half2 v5 = tex2D(_MainTex, i.uv).rg * cw;
164 + half2 v6 = tex2D(_MainTex, i.uv + d.xw).rg;
165 +
166 + half2 v7 = tex2D(_MainTex, i.uv + d.zy).rg;
167 + half2 v8 = tex2D(_MainTex, i.uv + d.wy).rg;
168 + half2 v9 = tex2D(_MainTex, i.uv + d.xy).rg;
169 +
170 + half2 va = MaxV(v1, MaxV(v2, v3));
171 + half2 vb = MaxV(v4, MaxV(v5, v6));
172 + half2 vc = MaxV(v7, MaxV(v8, v9));
173 +
174 + return half4(MaxV(va, MaxV(vb, vc)) * (1.0 / cw), 0.0, 0.0);
175 +}
176 +
177 +// -----------------------------------------------------------------------------
178 +// Reconstruction
179 +
180 +// Returns true or false with a given interval.
181 +bool Interval(half phase, half interval)
182 +{
183 + return frac(phase / interval) > 0.499;
184 +}
185 +
186 +// Jitter function for tile lookup
187 +float2 JitterTile(float2 uv)
188 +{
189 + float rx, ry;
190 + sincos(GradientNoise(uv + float2(2.0, 0.0)) * UNITY_PI_2, ry, rx);
191 + return float2(rx, ry) * _NeighborMaxTex_TexelSize.xy * 0.25;
192 +}
193 +
194 +// Velocity sampling function
195 +half3 SampleVelocity(float2 uv)
196 +{
197 + half3 v = tex2Dlod(_VelocityTex, float4(uv, 0.0, 0.0)).xyz;
198 + return half3((v.xy * 2.0 - 1.0) * _MaxBlurRadius, v.z);
199 +}
200 +
201 +// Reconstruction filter
202 +half4 FragReconstruction(VaryingsMultitex i) : SV_Target
203 +{
204 + // Color sample at the center point
205 + const half4 c_p = tex2D(_MainTex, i.uv0);
206 +
207 + // Velocity/Depth sample at the center point
208 + const half3 vd_p = SampleVelocity(i.uv1);
209 + const half l_v_p = max(length(vd_p.xy), 0.5);
210 + const half rcp_d_p = 1.0 / vd_p.z;
211 +
212 + // NeighborMax vector sample at the center point
213 + const half2 v_max = tex2D(_NeighborMaxTex, i.uv1 + JitterTile(i.uv1)).xy;
214 + const half l_v_max = length(v_max);
215 + const half rcp_l_v_max = 1.0 / l_v_max;
216 +
217 + // Escape early if the NeighborMax vector is small enough.
218 + if (l_v_max < 2.0) return c_p;
219 +
220 + // Use V_p as a secondary sampling direction except when it's too small
221 + // compared to V_max. This vector is rescaled to be the length of V_max.
222 + const half2 v_alt = (l_v_p * 2.0 > l_v_max) ? vd_p.xy * (l_v_max / l_v_p) : v_max;
223 +
224 + // Determine the sample count.
225 + const half sc = floor(min(_LoopCount, l_v_max * 0.5));
226 +
227 + // Loop variables (starts from the outermost sample)
228 + const half dt = 1.0 / sc;
229 + const half t_offs = (GradientNoise(i.uv0) - 0.5) * dt;
230 + half t = 1.0 - dt * 0.5;
231 + half count = 0.0;
232 +
233 + // Background velocity
234 + // This is used for tracking the maximum velocity in the background layer.
235 + half l_v_bg = max(l_v_p, 1.0);
236 +
237 + // Color accumlation
238 + half4 acc = 0.0;
239 +
240 + UNITY_LOOP while (t > dt * 0.25)
241 + {
242 + // Sampling direction (switched per every two samples)
243 + const half2 v_s = Interval(count, 4.0) ? v_alt : v_max;
244 +
245 + // Sample position (inverted per every sample)
246 + const half t_s = (Interval(count, 2.0) ? -t : t) + t_offs;
247 +
248 + // Distance to the sample position
249 + const half l_t = l_v_max * abs(t_s);
250 +
251 + // UVs for the sample position
252 + const float2 uv0 = i.uv0 + v_s * t_s * _MainTex_TexelSize.xy;
253 + const float2 uv1 = i.uv1 + v_s * t_s * _VelocityTex_TexelSize.xy;
254 +
255 + // Color sample
256 + const half3 c = tex2Dlod(_MainTex, float4(uv0, 0.0, 0.0)).rgb;
257 +
258 + // Velocity/Depth sample
259 + const half3 vd = SampleVelocity(uv1);
260 +
261 + // Background/Foreground separation
262 + const half fg = saturate((vd_p.z - vd.z) * 20.0 * rcp_d_p);
263 +
264 + // Length of the velocity vector
265 + const half l_v = lerp(l_v_bg, length(vd.xy), fg);
266 +
267 + // Sample weight
268 + // (Distance test) * (Spreading out by motion) * (Triangular window)
269 + const half w = saturate(l_v - l_t) / l_v * (1.2 - t);
270 +
271 + // Color accumulation
272 + acc += half4(c, 1.0) * w;
273 +
274 + // Update the background velocity.
275 + l_v_bg = max(l_v_bg, l_v);
276 +
277 + // Advance to the next sample.
278 + t = Interval(count, 2.0) ? t - dt : t;
279 + count += 1.0;
280 + }
281 +
282 + // Add the center sample.
283 + acc += half4(c_p.rgb, 1.0) * (1.2 / (l_v_bg * sc * 2.0));
284 +
285 + return half4(acc.rgb / acc.a, c_p.a);
286 +}
287 +
288 +// -----------------------------------------------------------------------------
289 +// Frame blending
290 +
291 +VaryingsDefault VertFrameCompress(AttributesDefault v)
292 +{
293 + VaryingsDefault o;
294 + o.pos = v.vertex;
295 + o.uvSPR = 0;
296 +#if UNITY_UV_STARTS_AT_TOP
297 + o.uv = v.texcoord * float2(1.0, -1.0) + float2(0.0, 1.0);
298 +#else
299 + o.uv = v.texcoord;
300 +#endif
301 + return o;
302 +}
303 +
304 +#if !SHADER_API_GLES
305 +
306 +// MRT output struct for the compressor
307 +struct CompressorOutput
308 +{
309 + half4 luma : SV_Target0;
310 + half4 chroma : SV_Target1;
311 +};
312 +
313 +// Frame compression fragment shader
314 +CompressorOutput FragFrameCompress(VaryingsDefault i)
315 +{
316 + float sw = _ScreenParams.x; // Screen width
317 + float pw = _ScreenParams.z - 1; // Pixel width
318 +
319 + // RGB to YCbCr convertion matrix
320 + const half3 kY = half3( 0.299 , 0.587 , 0.114 );
321 + const half3 kCB = half3(-0.168736, -0.331264, 0.5 );
322 + const half3 kCR = half3( 0.5 , -0.418688, -0.081312);
323 +
324 + // 0: even column, 1: odd column
325 + half odd = frac(i.uv.x * sw * 0.5) > 0.5;
326 +
327 + // Calculate UV for chroma componetns.
328 + // It's between the even and odd columns.
329 + float2 uv_c = i.uv.xy;
330 + uv_c.x = (floor(uv_c.x * sw * 0.5) * 2.0 + 1.0) * pw;
331 +
332 + // Sample the source texture.
333 + half3 rgb_y = tex2D(_MainTex, i.uv).rgb;
334 + half3 rgb_c = tex2D(_MainTex, uv_c).rgb;
335 +
336 + #if !UNITY_COLORSPACE_GAMMA
337 + rgb_y = LinearToGammaSpace(rgb_y);
338 + rgb_c = LinearToGammaSpace(rgb_c);
339 + #endif
340 +
341 + // Convertion and subsampling
342 + CompressorOutput o;
343 + o.luma = dot(kY, rgb_y);
344 + o.chroma = dot(lerp(kCB, kCR, odd), rgb_c) + 0.5;
345 + return o;
346 +}
347 +
348 +#else
349 +
350 +// MRT might not be supported. Replace it with a null shader.
351 +half4 FragFrameCompress(VaryingsDefault i) : SV_Target
352 +{
353 + return 0;
354 +}
355 +
356 +#endif
357 +
358 +// Sample luma-chroma textures and convert to RGB
359 +half3 DecodeHistory(float2 uvLuma, float2 uvCb, float2 uvCr, sampler2D lumaTex, sampler2D chromaTex)
360 +{
361 + half y = tex2D(lumaTex, uvLuma).r;
362 + half cb = tex2D(chromaTex, uvCb).r - 0.5;
363 + half cr = tex2D(chromaTex, uvCr).r - 0.5;
364 + return y + half3(1.402 * cr, -0.34414 * cb - 0.71414 * cr, 1.772 * cb);
365 +}
366 +
367 +// Frame blending fragment shader
368 +half4 FragFrameBlending(VaryingsMultitex i) : SV_Target
369 +{
370 + float sw = _MainTex_TexelSize.z; // Texture width
371 + float pw = _MainTex_TexelSize.x; // Texel width
372 +
373 + // UV for luma
374 + float2 uvLuma = i.uv1;
375 +
376 + // UV for Cb (even columns)
377 + float2 uvCb = i.uv1;
378 + uvCb.x = (floor(uvCb.x * sw * 0.5) * 2.0 + 0.5) * pw;
379 +
380 + // UV for Cr (even columns)
381 + float2 uvCr = uvCb;
382 + uvCr.x += pw;
383 +
384 + // Sample from the source image
385 + half4 src = tex2D(_MainTex, i.uv0);
386 +
387 + // Sampling and blending
388 + #if UNITY_COLORSPACE_GAMMA
389 + half3 acc = src.rgb;
390 + #else
391 + half3 acc = LinearToGammaSpace(src.rgb);
392 + #endif
393 +
394 + acc += DecodeHistory(uvLuma, uvCb, uvCr, _History1LumaTex, _History1ChromaTex) * _History1Weight;
395 + acc += DecodeHistory(uvLuma, uvCb, uvCr, _History2LumaTex, _History2ChromaTex) * _History2Weight;
396 + acc += DecodeHistory(uvLuma, uvCb, uvCr, _History3LumaTex, _History3ChromaTex) * _History3Weight;
397 + acc += DecodeHistory(uvLuma, uvCb, uvCr, _History4LumaTex, _History4ChromaTex) * _History4Weight;
398 + acc /= 1.0 + _History1Weight + _History2Weight +_History3Weight +_History4Weight;
399 +
400 + #if !UNITY_COLORSPACE_GAMMA
401 + acc = GammaToLinearSpace(acc);
402 + #endif
403 +
404 + return half4(acc, src.a);
405 +}
406 +
407 +// Frame blending fragment shader (without chroma subsampling)
408 +half4 FragFrameBlendingRaw(VaryingsMultitex i) : SV_Target
409 +{
410 + half4 src = tex2D(_MainTex, i.uv0);
411 + half3 acc = src.rgb;
412 + acc += tex2D(_History1LumaTex, i.uv0) * _History1Weight;
413 + acc += tex2D(_History2LumaTex, i.uv0) * _History2Weight;
414 + acc += tex2D(_History3LumaTex, i.uv0) * _History3Weight;
415 + acc += tex2D(_History4LumaTex, i.uv0) * _History4Weight;
416 + acc /= 1.0 + _History1Weight + _History2Weight +_History3Weight +_History4Weight;
417 + return half4(acc, src.a);
418 +}
419 +
420 +#endif // __MOTION_BLUR__
1 +fileFormatVersion: 2
2 +guid: c83956915580e42489479d2a109470ab
3 +timeCreated: 1470404606
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Hidden/Post FX/Motion Blur"
2 +{
3 + CGINCLUDE
4 +
5 + #pragma target 3.0
6 +
7 + ENDCG
8 +
9 + SubShader
10 + {
11 + Cull Off ZWrite Off ZTest Always
12 +
13 + // (0) Velocity texture setup
14 + Pass
15 + {
16 + CGPROGRAM
17 +
18 + #include "MotionBlur.cginc"
19 + #pragma vertex VertDefault
20 + #pragma fragment FragVelocitySetup
21 +
22 + ENDCG
23 + }
24 +
25 + // (1) TileMax filter (2 pixel width with normalization)
26 + Pass
27 + {
28 + CGPROGRAM
29 +
30 + #include "MotionBlur.cginc"
31 + #pragma vertex VertDefault
32 + #pragma fragment FragTileMax1
33 +
34 + ENDCG
35 + }
36 +
37 + // (2) TileMax filter (2 pixel width)
38 + Pass
39 + {
40 + CGPROGRAM
41 +
42 + #include "MotionBlur.cginc"
43 + #pragma vertex VertDefault
44 + #pragma fragment FragTileMax2
45 +
46 + ENDCG
47 + }
48 +
49 + // (3) TileMax filter (variable width)
50 + Pass
51 + {
52 + CGPROGRAM
53 +
54 + #include "MotionBlur.cginc"
55 + #pragma vertex VertDefault
56 + #pragma fragment FragTileMaxV
57 +
58 + ENDCG
59 + }
60 +
61 + // (4) NeighborMax filter
62 + Pass
63 + {
64 + CGPROGRAM
65 +
66 + #include "MotionBlur.cginc"
67 + #pragma vertex VertDefault
68 + #pragma fragment FragNeighborMax
69 +
70 + ENDCG
71 + }
72 +
73 + // (5) Reconstruction filter
74 + Pass
75 + {
76 + CGPROGRAM
77 +
78 + #include "MotionBlur.cginc"
79 + #pragma vertex VertMultitex
80 + #pragma fragment FragReconstruction
81 +
82 + ENDCG
83 + }
84 +
85 + // (6) Frame compression
86 + Pass
87 + {
88 + CGPROGRAM
89 +
90 + #pragma multi_compile __ UNITY_COLORSPACE_GAMMA
91 + #include "MotionBlur.cginc"
92 + #pragma vertex VertFrameCompress
93 + #pragma fragment FragFrameCompress
94 +
95 + ENDCG
96 + }
97 +
98 + // (7) Frame blending
99 + Pass
100 + {
101 + CGPROGRAM
102 +
103 + #pragma multi_compile __ UNITY_COLORSPACE_GAMMA
104 + #include "MotionBlur.cginc"
105 + #pragma vertex VertMultitex
106 + #pragma fragment FragFrameBlending
107 +
108 + ENDCG
109 + }
110 +
111 + // (8) Frame blending (without chroma subsampling)
112 + Pass
113 + {
114 + CGPROGRAM
115 +
116 + #include "MotionBlur.cginc"
117 + #pragma vertex VertMultitex
118 + #pragma fragment FragFrameBlendingRaw
119 +
120 + ENDCG
121 + }
122 + }
123 +}
1 +fileFormatVersion: 2
2 +guid: 6ab8493603d8f8e408750b81666a95f1
3 +timeCreated: 1468327385
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +/**
2 +\author Michael Mara and Morgan McGuire, Casual Effects. 2015.
3 +*/
4 +
5 +#ifndef __SCREEN_SPACE_RAYTRACE__
6 +#define __SCREEN_SPACE_RAYTRACE__
7 +
8 +sampler2D_float _CameraDepthTexture;
9 +
10 +float distanceSquared(float2 A, float2 B)
11 +{
12 + A -= B;
13 + return dot(A, A);
14 +}
15 +
16 +float distanceSquared(float3 A, float3 B)
17 +{
18 + A -= B;
19 + return dot(A, A);
20 +}
21 +
22 +void swap(inout float v0, inout float v1)
23 +{
24 + float temp = v0;
25 + v0 = v1;
26 + v1 = temp;
27 +}
28 +
29 +bool isIntersecting(float rayZMin, float rayZMax, float sceneZ, float layerThickness)
30 +{
31 + return (rayZMax >= sceneZ - layerThickness) && (rayZMin <= sceneZ);
32 +}
33 +
34 +void rayIterations(in bool traceBehindObjects, inout float2 P, inout float stepDirection, inout float end, inout int stepCount, inout int maxSteps, inout bool intersecting,
35 + inout float sceneZ, inout float2 dP, inout float3 Q, inout float3 dQ, inout float k, inout float dk,
36 + inout float rayZMin, inout float rayZMax, inout float prevZMaxEstimate, inout bool permute, inout float2 hitPixel,
37 + inout float2 invSize, inout float layerThickness)
38 +{
39 + bool stop = intersecting;
40 +
41 + UNITY_LOOP
42 + for (; (P.x * stepDirection) <= end && stepCount < maxSteps && !stop; P += dP, Q.z += dQ.z, k += dk, stepCount += 1)
43 + {
44 + // The depth range that the ray covers within this loop iteration.
45 + // Assume that the ray is moving in increasing z and swap if backwards.
46 + rayZMin = prevZMaxEstimate;
47 + //rayZMin = (dQ.z * -0.5 + Q.z) / (dk * -0.5 + k);
48 + // Compute the value at 1/2 pixel into the future
49 + rayZMax = (dQ.z * 0.5 + Q.z) / (dk * 0.5 + k);
50 + prevZMaxEstimate = rayZMax;
51 +
52 + if (rayZMin > rayZMax)
53 + {
54 + swap(rayZMin, rayZMax);
55 + }
56 +
57 + // Undo the homogeneous operation to obtain the camera-space
58 + // Q at each point
59 + hitPixel = permute ? P.yx : P;
60 +
61 + sceneZ = tex2Dlod(_CameraDepthTexture, float4(hitPixel * invSize,0,0)).r;
62 + sceneZ = -LinearEyeDepth(sceneZ);
63 +
64 + bool isBehind = (rayZMin <= sceneZ);
65 + intersecting = isBehind && (rayZMax >= sceneZ - layerThickness);
66 + stop = traceBehindObjects ? intersecting : isBehind;
67 +
68 + } // pixel on ray
69 +
70 + P -= dP, Q.z -= dQ.z, k -= dk;
71 +}
72 +
73 +/**
74 + \param csOrigin must have z < -0.01, and project within the valid screen rectangle
75 + \param stepRate Set to 1.0 by default, higher to step faster
76 + */
77 +bool castDenseScreenSpaceRay
78 + (float3 csOrigin,
79 + float3 csDirection,
80 + float4x4 projectToPixelMatrix,
81 + float2 csZBufferSize,
82 + float3 clipInfo,
83 + float jitterFraction,
84 + int maxSteps,
85 + float layerThickness,
86 + float maxRayTraceDistance,
87 + out float2 hitPixel,
88 + int stepRate,
89 + bool traceBehindObjects,
90 + out float3 csHitPoint,
91 + out float stepCount) {
92 +
93 + float2 invSize = float2(1.0 / csZBufferSize.x, 1.0 / csZBufferSize.y);
94 +
95 + // Initialize to off screen
96 + hitPixel = float2(-1, -1);
97 +
98 + float nearPlaneZ = -0.01;
99 + // Clip ray to a near plane in 3D (doesn't have to be *the* near plane, although that would be a good idea)
100 + float rayLength = ((csOrigin.z + csDirection.z * maxRayTraceDistance) > nearPlaneZ) ?
101 + ((nearPlaneZ - csOrigin.z) / csDirection.z) :
102 + maxRayTraceDistance;
103 +
104 + float3 csEndPoint = csDirection * rayLength + csOrigin;
105 +
106 + // Project into screen space
107 + // This matrix has a lot of zeroes in it. We could expand
108 + // out these multiplies to avoid multiplying by zero
109 + // ...but 16 MADDs are not a big deal compared to what's ahead
110 + float4 H0 = mul(projectToPixelMatrix, float4(csOrigin, 1.0));
111 + float4 H1 = mul(projectToPixelMatrix, float4(csEndPoint, 1.0));
112 +
113 + // There are a lot of divisions by w that can be turned into multiplications
114 + // at some minor precision loss...and we need to interpolate these 1/w values
115 + // anyway.
116 + //
117 + // Because the caller was required to clip to the near plane,
118 + // this homogeneous division (projecting from 4D to 2D) is guaranteed
119 + // to succeed.
120 + float k0 = 1.0 / H0.w;
121 + float k1 = 1.0 / H1.w;
122 +
123 + // Screen-space endpoints
124 + float2 P0 = H0.xy * k0;
125 + float2 P1 = H1.xy * k1;
126 +
127 + // Switch the original points to values that interpolate linearly in 2D:
128 + float3 Q0 = csOrigin * k0;
129 + float3 Q1 = csEndPoint * k1;
130 +
131 +#if 1 // Clipping to the screen coordinates. We could simply modify maxSteps instead
132 + float yMax = csZBufferSize.y - 0.5;
133 + float yMin = 0.5;
134 + float xMax = csZBufferSize.x - 0.5;
135 + float xMin = 0.5;
136 +
137 + // 2D interpolation parameter
138 + float alpha = 0.0;
139 + // P0 must be in bounds
140 + if (P1.y > yMax || P1.y < yMin) {
141 + float yClip = (P1.y > yMax) ? yMax : yMin;
142 + float yAlpha = (P1.y - yClip) / (P1.y - P0.y); // Denominator is not zero, since P0 != P1 (or P0 would have been clipped!)
143 + alpha = yAlpha;
144 + }
145 +
146 + // P0 must be in bounds
147 + if (P1.x > xMax || P1.x < xMin) {
148 + float xClip = (P1.x > xMax) ? xMax : xMin;
149 + float xAlpha = (P1.x - xClip) / (P1.x - P0.x); // Denominator is not zero, since P0 != P1 (or P0 would have been clipped!)
150 + alpha = max(alpha, xAlpha);
151 + }
152 +
153 + // These are all in homogeneous space, so they interpolate linearly
154 + P1 = lerp(P1, P0, alpha);
155 + k1 = lerp(k1, k0, alpha);
156 + Q1 = lerp(Q1, Q0, alpha);
157 +#endif
158 +
159 + // We're doing this to avoid divide by zero (rays exactly parallel to an eye ray)
160 + P1 = (distanceSquared(P0, P1) < 0.0001) ? P0 + float2(0.01, 0.01) : P1;
161 +
162 + float2 delta = P1 - P0;
163 +
164 + // Assume horizontal
165 + bool permute = false;
166 + if (abs(delta.x) < abs(delta.y)) {
167 + // More-vertical line. Create a permutation that swaps x and y in the output
168 + permute = true;
169 +
170 + // Directly swizzle the inputs
171 + delta = delta.yx;
172 + P1 = P1.yx;
173 + P0 = P0.yx;
174 + }
175 +
176 + // From now on, "x" is the primary iteration direction and "y" is the secondary one
177 +
178 + float stepDirection = sign(delta.x);
179 + float invdx = stepDirection / delta.x;
180 + float2 dP = float2(stepDirection, invdx * delta.y);
181 +
182 + // Track the derivatives of Q and k
183 + float3 dQ = (Q1 - Q0) * invdx;
184 + float dk = (k1 - k0) * invdx;
185 +
186 + dP *= stepRate;
187 + dQ *= stepRate;
188 + dk *= stepRate;
189 +
190 + P0 += dP * jitterFraction;
191 + Q0 += dQ * jitterFraction;
192 + k0 += dk * jitterFraction;
193 +
194 + // Slide P from P0 to P1, (now-homogeneous) Q from Q0 to Q1, and k from k0 to k1
195 + float3 Q = Q0;
196 + float k = k0;
197 +
198 + // We track the ray depth at +/- 1/2 pixel to treat pixels as clip-space solid
199 + // voxels. Because the depth at -1/2 for a given pixel will be the same as at
200 + // +1/2 for the previous iteration, we actually only have to compute one value
201 + // per iteration.
202 + float prevZMaxEstimate = csOrigin.z;
203 + stepCount = 0.0;
204 + float rayZMax = prevZMaxEstimate, rayZMin = prevZMaxEstimate;
205 + float sceneZ = 100000;
206 +
207 + // P1.x is never modified after this point, so pre-scale it by
208 + // the step direction for a signed comparison
209 + float end = P1.x * stepDirection;
210 +
211 + bool intersecting = isIntersecting(rayZMin, rayZMax, sceneZ, layerThickness);
212 + // We only advance the z field of Q in the inner loop, since
213 + // Q.xy is never used until after the loop terminates
214 +
215 + //int rayIterations = min(maxSteps, stepsToGetOffscreen);
216 +
217 +
218 + float2 P = P0;
219 +
220 + int originalStepCount = 0;
221 + rayIterations(traceBehindObjects, P, stepDirection, end, originalStepCount, maxSteps, intersecting,
222 + sceneZ, dP, Q, dQ, k, dk,
223 + rayZMin, rayZMax, prevZMaxEstimate, permute, hitPixel,
224 + invSize, layerThickness);
225 +
226 +
227 + stepCount = originalStepCount;
228 +
229 + // Loop only advanced the Z component. Now that we know where we are going
230 + // update xy
231 + Q.xy += dQ.xy * stepCount;
232 + // Q is a vector, so we are trying to get by with 1 division instead of 3.
233 + csHitPoint = Q * (1.0 / k);
234 +
235 + return intersecting;
236 +}
237 +
238 +#endif // __SCREEN_SPACE_RAYTRACE__
1 +fileFormatVersion: 2
2 +guid: a92d6fdbe2c35f94190497c18b88f9af
3 +timeCreated: 1464350148
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +/**
2 +\author Michael Mara and Morgan McGuire, Casual Effects. 2015.
3 +*/
4 +Shader "Hidden/Post FX/Screen Space Reflection"
5 +{
6 + Properties
7 + {
8 + _MainTex ("Base (RGB)", 2D) = "white" {}
9 + }
10 +
11 + CGINCLUDE
12 +
13 + #pragma target 3.0
14 + #include "UnityCG.cginc"
15 + #include "UnityPBSLighting.cginc"
16 + #include "UnityStandardBRDF.cginc"
17 + #include "UnityStandardUtils.cginc"
18 + #include "Common.cginc"
19 + #include "ScreenSpaceRaytrace.cginc"
20 +
21 + float4 _ProjInfo;
22 + float4x4 _WorldToCameraMatrix;
23 + float4x4 _CameraToWorldMatrix;
24 + float4x4 _ProjectToPixelMatrix;
25 + float2 _ScreenSize;
26 + float2 _ReflectionBufferSize;
27 + float2 _InvScreenSize;
28 + float3 _CameraClipInfo;
29 +
30 + sampler2D _CameraGBufferTexture0;
31 + sampler2D _CameraGBufferTexture1;
32 + sampler2D _CameraGBufferTexture2;
33 + sampler2D _CameraGBufferTexture3;
34 + sampler2D _CameraReflectionsTexture;
35 +
36 + float _CurrentMipLevel;
37 + float _RayStepSize;
38 + float _MaxRayTraceDistance;
39 + float _LayerThickness;
40 + float _FresnelFade;
41 + float _FresnelFadePower;
42 + float _ReflectionBlur;
43 +
44 +
45 + int _HalfResolution;
46 + int _TreatBackfaceHitAsMiss;
47 + int _AllowBackwardsRays;
48 +
49 +
50 + // RG: SS Hitpoint of ray
51 + // B: distance ray travelled, used for mip-selection in the final resolve
52 + // A: confidence value
53 + sampler2D _HitPointTexture;
54 + sampler2D _FinalReflectionTexture;
55 +
56 + // RGB: camera-space normal (encoded in [0-1])
57 + // A: Roughness
58 + sampler2D _NormalAndRoughnessTexture;
59 +
60 + int _EnableRefine;
61 + int _AdditiveReflection;
62 +
63 + float _ScreenEdgeFading;
64 +
65 + int _MaxSteps;
66 +
67 + int _BilateralUpsampling;
68 +
69 + float _MaxRoughness;
70 + float _RoughnessFalloffRange;
71 + float _SSRMultiplier;
72 +
73 + float _FadeDistance;
74 +
75 + int _TraceBehindObjects;
76 + int _UseEdgeDetector;
77 + int _HighlightSuppression;
78 +
79 + /** The height in pixels of a 1m object if viewed from 1m away. */
80 + float _PixelsPerMeterAtOneMeter;
81 +
82 + // For temporal filtering:
83 + float4x4 _CurrentCameraToPreviousCamera;
84 + sampler2D _PreviousReflectionTexture;
85 + sampler2D _PreviousCSZBuffer;
86 + float _TemporalAlpha;
87 + int _UseTemporalConfidence;
88 +
89 + struct v2f
90 + {
91 + float4 pos : SV_POSITION;
92 + float2 uv : TEXCOORD0;
93 + float2 uv2 : TEXCOORD1;
94 + };
95 +
96 + v2f vert( appdata_img v )
97 + {
98 + v2f o;
99 +
100 + o.pos = UnityObjectToClipPos(v.vertex);
101 + o.uv = v.texcoord.xy;
102 + o.uv2 = v.texcoord.xy;
103 +
104 + #if UNITY_UV_STARTS_AT_TOP
105 + if (_MainTex_TexelSize.y < 0)
106 + o.uv2.y = 1.0 - o.uv2.y;
107 + #endif
108 +
109 + return o;
110 + }
111 +
112 + float2 mipToSize(int mip)
113 + {
114 + return floor(_ReflectionBufferSize * exp2(-mip));
115 + }
116 +
117 + float3 ReconstructCSPosition(float2 S, float z)
118 + {
119 + float linEyeZ = -LinearEyeDepth(z);
120 + return float3((((S.xy * _MainTex_TexelSize.zw)) * _ProjInfo.xy + _ProjInfo.zw) * linEyeZ, linEyeZ);
121 + }
122 +
123 + /** Read the camera-space position of the point at screen-space pixel ssP */
124 + float3 GetPosition(float2 ssP)
125 + {
126 + float3 P;
127 +
128 + P.z = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, ssP.xy);
129 +
130 + // Offset to pixel center
131 + P = ReconstructCSPosition(float2(ssP) /*+ float2(0.5, 0.5)*/, P.z);
132 + return P;
133 + }
134 +
135 + float applyEdgeFade(float2 tsP, float fadeStrength)
136 + {
137 + float maxFade = 0.1;
138 +
139 + float2 itsP = float2(1.0, 1.0) - tsP;
140 + float dist = min(min(itsP.x, itsP.y), min(tsP.x, tsP.x));
141 + float fade = dist / (maxFade*fadeStrength + 0.001);
142 + fade = max(min(fade, 1.0), 0.0);
143 + fade = pow(fade, 0.2);
144 +
145 + return fade;
146 + }
147 +
148 + float3 csMirrorVector(float3 csPosition, float3 csN)
149 + {
150 + float3 csE = -normalize(csPosition.xyz);
151 + float cos_o = dot(csN, csE);
152 + float3 c_mi = normalize((csN * (2.0 * cos_o)) - csE);
153 +
154 + return c_mi;
155 + }
156 +
157 + float4 fragRaytrace(v2f i, int stepRate)
158 + {
159 + float2 ssP = i.uv2.xy;
160 + float3 csPosition = GetPosition(ssP);
161 +
162 + float smoothness = tex2D(_CameraGBufferTexture1, ssP).a;
163 + if (csPosition.z < -100.0 || smoothness == 0.0)
164 + {
165 + return float4(0.0,0.0,0.0,0.0);
166 + }
167 +
168 + float3 wsNormal = tex2D(_CameraGBufferTexture2, ssP).rgb * 2.0 - 1.0;
169 +
170 + int2 ssC = int2(ssP * _ScreenSize);
171 +
172 + float3 csN = mul((float3x3)(_WorldToCameraMatrix), wsNormal);
173 + float3 csRayDirection = csMirrorVector(csPosition, csN);
174 +
175 + if (_AllowBackwardsRays == 0 && csRayDirection.z > 0.0)
176 + {
177 + return float4(0.0, 0.0, 0.0, 0.0);
178 + }
179 +
180 + float maxRayTraceDistance = _MaxRayTraceDistance;
181 + float jitterFraction = 0.0f;
182 + float layerThickness = _LayerThickness;
183 +
184 + int maxSteps = _MaxSteps;
185 +
186 + // Bump the ray more in world space as it gets farther away (and so each pixel covers more WS distance)
187 + float rayBump = max(-0.01*csPosition.z, 0.001);
188 + float2 hitPixel;
189 + float3 csHitPoint;
190 + float stepCount;
191 +
192 + bool wasHit = castDenseScreenSpaceRay
193 + (csPosition + (csN) * rayBump,
194 + csRayDirection,
195 + _ProjectToPixelMatrix,
196 + _ScreenSize,
197 + _CameraClipInfo,
198 + jitterFraction,
199 + maxSteps,
200 + layerThickness,
201 + maxRayTraceDistance,
202 + hitPixel,
203 + stepRate,
204 + _TraceBehindObjects == 1,
205 + csHitPoint,
206 + stepCount);
207 +
208 + float2 tsPResult = hitPixel / _ScreenSize;
209 +
210 + float rayDist = dot(csHitPoint - csPosition, csRayDirection);
211 + float confidence = 0.0;
212 +
213 + if (wasHit)
214 + {
215 + confidence = Pow2(1.0 - max(2.0*float(stepCount) / float(maxSteps) - 1.0, 0.0));
216 + confidence *= clamp(((_MaxRayTraceDistance - rayDist) / _FadeDistance), 0.0, 1.0);
217 +
218 + // Fake fresnel fade
219 + float3 csE = -normalize(csPosition.xyz);
220 + confidence *= max(0.0, lerp(pow(abs(dot(csRayDirection, -csE)), _FresnelFadePower), 1, 1.0 - _FresnelFade));
221 +
222 + if (_TreatBackfaceHitAsMiss > 0)
223 + {
224 + float3 wsHitNormal = tex2Dlod(_CameraGBufferTexture2, float4(tsPResult, 0, 0)).rgb * 2.0 - 1.0;
225 + float3 wsRayDirection = mul(_CameraToWorldMatrix, float4(csRayDirection, 0)).xyz;
226 +
227 + if (dot(wsHitNormal, wsRayDirection) > 0)
228 + {
229 + confidence = 0.0;
230 + }
231 + }
232 + }
233 +
234 + // Fade out reflections that hit near edge of screen, to prevent abrupt appearance/disappearance when object go off screen
235 + // Fade out reflections that hit near edge of screen,
236 + // to prevent abrupt appearance/disappearance when object go off screen
237 + float vignette = applyEdgeFade(tsPResult, _ScreenEdgeFading);
238 + confidence *= vignette;
239 + confidence *= vignette;
240 +
241 + return float4(tsPResult, rayDist, confidence);
242 + }
243 +
244 + float4 fragComposite(v2f i) : SV_Target
245 + {
246 + // Pixel being shaded
247 + float2 tsP = i.uv2.xy;
248 +
249 + // View space point being shaded
250 + float3 C = GetPosition(tsP);
251 +
252 + // Final image before this pass
253 + float4 gbuffer3 = tex2D(_MainTex, i.uv);
254 +
255 + float4 specEmission = float4(0.0,0.0,0.0,0.0);
256 + float3 specColor = tex2D(_CameraGBufferTexture1, tsP).rgb;
257 +
258 + float roughness = tex2D(_CameraGBufferTexture1, tsP).a;
259 +
260 + float4 reflectionTexel = tex2D(_FinalReflectionTexture, tsP);
261 +
262 + float4 gbuffer0 = tex2D(_CameraGBufferTexture0, tsP);
263 + // Let core Unity functions do the dirty work of applying the BRDF
264 + float3 baseColor = gbuffer0.rgb;
265 + float occlusion = gbuffer0.a;
266 + float oneMinusReflectivity;
267 + baseColor = EnergyConservationBetweenDiffuseAndSpecular(baseColor, specColor, oneMinusReflectivity);
268 +
269 + float3 wsNormal = tex2D(_CameraGBufferTexture2, tsP).rgb * 2.0 - 1.0;
270 +
271 + float3 csEyeVec = normalize(C);
272 + float3 eyeVec = mul(_CameraToWorldMatrix, float4(csEyeVec, 0)).xyz;
273 +
274 + float3 worldPos = mul(_CameraToWorldMatrix, float4(C, 1)).xyz;
275 +
276 + float cos_o = dot(wsNormal, eyeVec);
277 + float3 w_mi = -normalize((wsNormal * (2.0 * cos_o)) - eyeVec);
278 +
279 + float3 incomingRadiance = reflectionTexel.rgb;
280 +
281 + UnityLight light;
282 + light.color = 0;
283 + light.dir = 0;
284 + #if UNITY_VERSION < 550
285 + light.ndotl = 0;
286 + #endif
287 +
288 + UnityIndirect ind;
289 + ind.diffuse = 0;
290 + ind.specular = incomingRadiance;
291 +
292 + float3 ssrResult = UNITY_BRDF_PBS (0, specColor, oneMinusReflectivity, roughness, wsNormal, -eyeVec, light, ind).rgb * _SSRMultiplier;
293 + float confidence = reflectionTexel.a;
294 +
295 + specEmission.rgb = tex2D(_CameraReflectionsTexture, tsP).rgb;
296 + float3 finalGlossyTerm;
297 +
298 + // Subtract out Unity's glossy result: (we're just applying the delta)
299 + if (_AdditiveReflection == 0)
300 + {
301 + gbuffer3 -= specEmission;
302 + // We may have blown out our dynamic range by adding then subtracting the reflection probes.
303 + // As a half-measure to fix this, simply clamp to zero
304 + gbuffer3 = max(gbuffer3, 0);
305 + finalGlossyTerm = lerp(specEmission.rgb, ssrResult, saturate(confidence));
306 + }
307 + else
308 + {
309 + finalGlossyTerm = ssrResult*saturate(confidence);
310 + }
311 +
312 + finalGlossyTerm *= occlusion;
313 +
314 + // Additively blend the glossy GI result with the output buffer
315 + return gbuffer3 + float4(finalGlossyTerm, 0);
316 + }
317 +
318 + float roughnessWeight(float midpointRoughness, float tapRoughness)
319 + {
320 + return (1.0 - sqrt(sqrt(abs(midpointRoughness-tapRoughness))));
321 + }
322 +
323 + float normalWeight(float3 midpointNormal, float3 tapNormal)
324 + {
325 + return clamp(dot(midpointNormal, tapNormal), 0, 1);
326 + }
327 +
328 + float highlightDecompression(float x)
329 + {
330 + return x / (1.0 - x);
331 + }
332 +
333 + float3 highlightDecompression(float3 x)
334 + {
335 + return float3(
336 + highlightDecompression(x.x),
337 + highlightDecompression(x.y),
338 + highlightDecompression(x.z)
339 + );
340 + }
341 +
342 + float highlightCompression(float x)
343 + {
344 + return x / (1.0 + x);
345 + }
346 +
347 + float3 highlightCompression(float3 x)
348 + {
349 + return float3(
350 + highlightCompression(x.x),
351 + highlightCompression(x.y),
352 + highlightCompression(x.z)
353 + );
354 + }
355 +
356 + float4 _Axis;
357 + float4 fragGBlur(v2f i) : SV_Target
358 + {
359 + int radius = 4;
360 +
361 + // Pixel being shaded
362 + float2 tsP = i.uv2.xy;
363 +
364 + float weightSum = 0.0;
365 + float gaussWeights[5] = { 0.225, 0.150, 0.110, 0.075, 0.0525 };//{0.225, 0.150, 0.110, 0.075, 0.0525};
366 + float4 resultSum = float4(0.0, 0.0, 0.0, 0.0);
367 + float4 unweightedResultSum = float4(0.0, 0.0, 0.0, 0.0);
368 + float4 nAndRough = tex2D(_NormalAndRoughnessTexture, tsP);
369 + float midpointRoughness = nAndRough.a;
370 + float3 midpointNormal = nAndRough.rgb * 2 - 1;
371 +
372 + for (int i = -radius; i <= radius; ++i)
373 + {
374 + float4 temp;
375 + float tapRoughness;
376 + float3 tapNormal;
377 + float2 tsTap = tsP + (_Axis.xy * _MainTex_TexelSize.xy * float2(i,i)*2.0);
378 +
379 + temp = tex2D(_MainTex, tsTap);
380 +
381 + float weight = temp.a * gaussWeights[abs(i)];
382 + // Bilateral filtering
383 + // if (_ImproveCorners)
384 + // {
385 + nAndRough = tex2D(_NormalAndRoughnessTexture, tsTap);
386 + tapRoughness = nAndRough.a;
387 + tapNormal = nAndRough.rgb * 2 - 1;
388 + weight *= normalWeight(midpointNormal, tapNormal);
389 + // }
390 +
391 + weightSum += weight;
392 +
393 + if (_HighlightSuppression)
394 + {
395 + temp.rgb = highlightCompression(temp.rgb);
396 + }
397 +
398 + unweightedResultSum += temp;
399 + resultSum += temp*weight;
400 + }
401 +
402 + if (weightSum > 0.01)
403 + {
404 + float invWeightSum = (1.0/weightSum);
405 + // Adding the sqrt seems to decrease temporal flickering at the expense
406 + // of having larger "halos" of fallback on rough surfaces
407 + // Subject to change with testing. Sqrt around only half the expression is *intentional*.
408 + float confidence = min(resultSum.a * sqrt(max(invWeightSum, 2.0)), 1.0);
409 + float3 finalColor = resultSum.rgb * invWeightSum;
410 +
411 + if (_HighlightSuppression)
412 + {
413 + finalColor = highlightDecompression(finalColor);
414 + }
415 +
416 + return float4(finalColor, confidence);
417 + }
418 + else
419 + {
420 + float3 finalColor = unweightedResultSum.rgb / (2 * radius + 1);
421 +
422 + if (_HighlightSuppression)
423 + {
424 + finalColor = highlightDecompression(finalColor);
425 + }
426 +
427 + return float4(finalColor, 0.0);
428 + }
429 + }
430 +
431 + sampler2D _ReflectionTexture0;
432 + sampler2D _ReflectionTexture1;
433 + sampler2D _ReflectionTexture2;
434 + sampler2D _ReflectionTexture3;
435 + sampler2D _ReflectionTexture4;
436 +
437 + // Simulate mip maps, since we don't have NPOT mip-chains
438 + float4 getReflectionValue(float2 tsP, int mip)
439 + {
440 + float4 coord = float4(tsP,0,0);
441 + if (mip == 0)
442 + {
443 + return tex2Dlod(_ReflectionTexture0, coord);
444 + }
445 + else if (mip == 1)
446 + {
447 + return tex2Dlod(_ReflectionTexture1, coord);
448 + }
449 + else if (mip == 2)
450 + {
451 + return tex2Dlod(_ReflectionTexture2, coord);
452 + }
453 + else if (mip == 3)
454 + {
455 + return tex2Dlod(_ReflectionTexture3, coord);
456 + }
457 + else
458 + {
459 + return tex2Dlod(_ReflectionTexture4, coord);
460 + }
461 + }
462 +
463 + sampler2D _EdgeTexture0;
464 + sampler2D _EdgeTexture1;
465 + sampler2D _EdgeTexture2;
466 + sampler2D _EdgeTexture3;
467 + sampler2D _EdgeTexture4;
468 +
469 + // Simulate mip maps, since we don't have NPOT mip-chains
470 + float4 getEdgeValue(float2 tsP, int mip)
471 + {
472 + float4 coord = float4(tsP + float2(1.0/(2 * mipToSize(mip))),0,0);
473 +
474 + if (mip == 0)
475 + {
476 + return tex2Dlod(_EdgeTexture0, coord);
477 + }
478 + else if (mip == 1)
479 + {
480 + return tex2Dlod(_EdgeTexture1, coord);
481 + }
482 + else if (mip == 2)
483 + {
484 + return tex2Dlod(_EdgeTexture2, coord);
485 + }
486 + else if (mip == 3)
487 + {
488 + return tex2Dlod(_EdgeTexture3, coord);
489 + }
490 + else
491 + {
492 + return tex2Dlod(_EdgeTexture4, coord);
493 + }
494 + }
495 +
496 + float2 centerPixel(float2 inputP)
497 + {
498 + return floor(inputP - float2(0.5,0.5)) + float2(0.5,0.5);
499 + }
500 +
501 + float2 snapToTexelCenter(float2 inputP, float2 texSize, float2 texSizeInv)
502 + {
503 + return centerPixel(inputP * texSize) * texSizeInv;
504 + }
505 +
506 + float4 bilateralUpsampleReflection(float2 tsP, int mip)
507 + {
508 + float2 smallTexSize = mipToSize(mip);
509 + float2 smallPixelPos = tsP * smallTexSize;
510 + float2 smallPixelPosi = centerPixel(smallPixelPos);
511 + float2 smallTexSizeInv = 1.0 / smallTexSize;
512 +
513 +
514 + float2 p0 = smallPixelPosi * smallTexSizeInv;
515 + float2 p3 = (smallPixelPosi + float2(1.0, 1.0)) * smallTexSizeInv;
516 + float2 p1 = float2(p3.x, p0.y);
517 + float2 p2 = float2(p0.x, p3.y);
518 +
519 + float4 V0 = getReflectionValue(p0.xy, mip);
520 + float4 V1 = getReflectionValue(p1.xy, mip);
521 + float4 V2 = getReflectionValue(p2.xy, mip);
522 + float4 V3 = getReflectionValue(p3.xy, mip);
523 +
524 + // Bilateral weights:
525 + // Bilinear interpolation (filter distance)
526 + float2 smallPixelPosf = smallPixelPos - smallPixelPosi;
527 + float a0 = (1.0 - smallPixelPosf.x) * (1.0 - smallPixelPosf.y);
528 + float a1 = smallPixelPosf.x * (1.0 - smallPixelPosf.y);
529 + float a2 = (1.0 - smallPixelPosf.x) * smallPixelPosf.y;
530 + float a3 = smallPixelPosf.x * smallPixelPosf.y;
531 +
532 + float2 fullTexSize = _ReflectionBufferSize;
533 + float2 fullTexSizeInv = 1.0 / fullTexSize;
534 +
535 + float4 hiP0 = float4(snapToTexelCenter(p0, fullTexSize, fullTexSizeInv), 0,0);
536 + float4 hiP3 = float4(snapToTexelCenter(p3, fullTexSize, fullTexSizeInv), 0,0);
537 + float4 hiP1 = float4(snapToTexelCenter(p1, fullTexSize, fullTexSizeInv), 0,0);
538 + float4 hiP2 = float4(snapToTexelCenter(p2, fullTexSize, fullTexSizeInv), 0,0);
539 +
540 + float4 tempCenter = tex2Dlod(_NormalAndRoughnessTexture, float4(tsP, 0, 0));
541 + float3 n = tempCenter.xyz * 2 - 1;
542 +
543 + float4 temp0 = tex2Dlod(_NormalAndRoughnessTexture, hiP0);
544 + float4 temp1 = tex2Dlod(_NormalAndRoughnessTexture, hiP1);
545 + float4 temp2 = tex2Dlod(_NormalAndRoughnessTexture, hiP2);
546 + float4 temp3 = tex2Dlod(_NormalAndRoughnessTexture, hiP3);
547 +
548 + float3 n0 = temp0.xyz * 2 - 1;
549 + float3 n1 = temp1.xyz * 2 - 1;
550 + float3 n2 = temp2.xyz * 2 - 1;
551 + float3 n3 = temp3.xyz * 2 - 1;
552 +
553 + a0 *= normalWeight(n, n0);
554 + a1 *= normalWeight(n, n1);
555 + a2 *= normalWeight(n, n2);
556 + a3 *= normalWeight(n, n3);
557 +
558 + float r = tempCenter.a;
559 + float r0 = temp0.a;
560 + float r1 = temp1.a;
561 + float r2 = temp2.a;
562 + float r3 = temp3.a;
563 +
564 + a0 *= roughnessWeight(r, r0);
565 + a1 *= roughnessWeight(r, r1);
566 + a2 *= roughnessWeight(r, r2);
567 + a3 *= roughnessWeight(r, r3);
568 +
569 + // Slightly offset from zero
570 + a0 = max(a0, 0.001);
571 + a1 = max(a1, 0.001);
572 + a2 = max(a2, 0.001);
573 + a3 = max(a3, 0.001);
574 +
575 + // Nearest neighbor
576 + // a0 = a1 = a2 = a3 = 1.0;
577 +
578 + // Normalize the blending weights (weights were chosen so that
579 + // the denominator can never be zero)
580 + float norm = 1.0 / (a0 + a1 + a2 + a3);
581 +
582 + // Blend
583 + float4 value = (V0 * a0 + V1 * a1 + V2 * a2 + V3 * a3) * norm;
584 + //return V0;
585 + return value;
586 + }
587 +
588 + /** Explicit bilinear fetches; must be used if the reflection buffer is bound using point sampling */
589 + float4 bilinearUpsampleReflection(float2 tsP, int mip)
590 + {
591 + float2 smallTexSize = mipToSize(mip);
592 + float2 smallPixelPos = tsP * smallTexSize;
593 + float2 smallPixelPosi = centerPixel(smallPixelPos);
594 + float2 smallTexSizeInv = 1.0 / smallTexSize;
595 +
596 +
597 + float2 p0 = smallPixelPosi * smallTexSizeInv;
598 + float2 p3 = (smallPixelPosi + float2(1.0, 1.0)) * smallTexSizeInv;
599 + float2 p1 = float2(p3.x, p0.y);
600 + float2 p2 = float2(p0.x, p3.y);
601 +
602 + float4 V0 = getReflectionValue(p0.xy, mip);
603 + float4 V1 = getReflectionValue(p1.xy, mip);
604 + float4 V2 = getReflectionValue(p2.xy, mip);
605 + float4 V3 = getReflectionValue(p3.xy, mip);
606 +
607 + float a0 = 1.0;
608 + float a1 = 1.0;
609 + float a2 = 1.0;
610 + float a3 = 1.0;
611 +
612 + // Bilateral weights:
613 + // Bilinear interpolation (filter distance)
614 + float2 smallPixelPosf = smallPixelPos - smallPixelPosi;
615 + a0 = (1.0 - smallPixelPosf.x) * (1.0 - smallPixelPosf.y);
616 + a1 = smallPixelPosf.x * (1.0 - smallPixelPosf.y);
617 + a2 = (1.0 - smallPixelPosf.x) * smallPixelPosf.y;
618 + a3 = smallPixelPosf.x * smallPixelPosf.y;
619 +
620 + // Blend
621 + float4 value = (V0 * a0 + V1 * a1 + V2 * a2 + V3 * a3);
622 + return value;
623 + }
624 +
625 + // Unity's roughness is GGX roughness squared
626 + float roughnessToBlinnPhongExponent(float roughness)
627 + {
628 + float r2 = roughness*roughness;
629 + return 2.0f / r2*r2 - 2.0f;
630 + }
631 +
632 + float glossyLobeSlope(float roughness)
633 + {
634 + return pow(roughness, 4.0/3.0);
635 + }
636 +
637 + // Empirically based on our filter:
638 + // Mip | Pixels
639 + // --------------
640 + // 0 | 1 no filter, so single pixel
641 + // 1 | 17 2r + 1 filter applied once, grabbing from pixels r away in either direction (r=8, four samples times stride of 2)
642 + // 2 | 50 2r + 1 filter applied on double size pixels, and each of those pixels had reached another r out to the side 2(2r + 1) + m_1
643 + // 3 | 118 4(2r + 1) + m_2
644 + // 4 | 254 8(2r + 1) + m_3
645 + //
646 + // Approximated by pixels = 16*2^mip-15
647 + // rearranging we get mip = log_2((pixels + 15) / 16)
648 + //
649 + float filterFootprintInPixelsToMip(float footprint)
650 + {
651 + return log2((footprint + 15) / 16);
652 + }
653 +
654 + float3 ansiGradient(float t)
655 + {
656 + //return float3(t, t, t);
657 + return fmod(floor(t * float3(8.0, 4.0, 2.0)), 2.0);
658 + }
659 +
660 + float4 fragCompositeSSR(v2f i) : SV_Target
661 + {
662 + // Pixel being shaded
663 + float2 tsP = i.uv2.xy;
664 +
665 + float roughness = 1.0-tex2D(_CameraGBufferTexture1, tsP).a;
666 +
667 + float rayDistance = tex2D(_HitPointTexture, tsP).z;
668 +
669 + // Get the camera space position of the reflection hit
670 + float3 csPosition = GetPosition(tsP);
671 + float3 wsNormal = tex2D(_CameraGBufferTexture2, tsP).rgb * 2.0 - 1.0;
672 + float3 csN = mul((float3x3)(_WorldToCameraMatrix), wsNormal);
673 + float3 c_mi = csMirrorVector(csPosition, csN);
674 + float3 csHitpoint = c_mi * rayDistance + csPosition;
675 +
676 +
677 + float gatherFootprintInMeters = glossyLobeSlope(roughness) * rayDistance;
678 + // We could add a term that incorporates the normal
679 + // This approximation assumes reflections happen at a glancing angle
680 + float filterFootprintInPixels = gatherFootprintInMeters * _PixelsPerMeterAtOneMeter / csHitpoint.z;
681 + if (_HalfResolution == 1)
682 + {
683 + filterFootprintInPixels *= 0.5;
684 + }
685 +
686 + float mip = filterFootprintInPixelsToMip(filterFootprintInPixels);
687 +
688 + float nonPhysicalMip = pow(roughness, 3.0 / 4.0) * UNITY_SPECCUBE_LOD_STEPS;
689 +
690 + if (_HalfResolution == 1)
691 + {
692 + nonPhysicalMip = nonPhysicalMip * 0.7;
693 + }
694 +
695 + mip = max(0, min(4, mip));
696 +
697 + float4 result = 0.;
698 +
699 + {
700 + int mipMin = int(mip);
701 + int mipMax = min(mipMin + 1, 4);
702 + float mipLerp = mip-mipMin;
703 +
704 + if (_BilateralUpsampling == 1)
705 + {
706 + result = lerp(bilateralUpsampleReflection(tsP, mipMin), bilateralUpsampleReflection(tsP, mipMax), mipLerp);
707 + }
708 + else
709 + {
710 + float4 minResult = getReflectionValue(tsP, mipMin);
711 + float4 maxResult = getReflectionValue(tsP, mipMax);
712 + result = lerp(minResult, maxResult, mipLerp);
713 + result.a = min(minResult.a, maxResult.a);
714 + }
715 + }
716 +
717 + result.a = min(result.a, 1.0);
718 + float vignette = applyEdgeFade(tsP, _ScreenEdgeFading);
719 + result.a *= vignette;
720 +
721 +
722 + // THIS MIGHT BE SLIGHTLY WRONG, TRY STEP()
723 + float alphaModifier = 1.0 - clamp(roughness * .3, 0., 1.);
724 + result.a *= alphaModifier;
725 + return result;
726 + }
727 +
728 + int _LastMip;
729 +
730 + float4 fragMin(v2f i) : SV_Target
731 + {
732 + float2 tsP = i.uv2.xy;
733 + float2 lastTexSize = mipToSize(_LastMip);
734 + float2 lastTexSizeInv = 1.0 / lastTexSize;
735 + float2 p00 = snapToTexelCenter(tsP, lastTexSize, lastTexSizeInv);
736 + float2 p11 = p00 + lastTexSizeInv;
737 +
738 + return min(
739 + min(tex2D(_MainTex, p00), tex2D(_MainTex, p11)),
740 + min(tex2D(_MainTex, float2(p00.x, p11.y)), tex2D(_MainTex, float2(p11.x, p00.y)))
741 + );
742 + }
743 +
744 + float4 fragResolveHitPoints(v2f i) : SV_Target
745 + {
746 + float2 tsP = i.uv2.xy;
747 + float4 temp = tex2D(_HitPointTexture, tsP);
748 + float2 hitPoint = temp.xy;
749 + float confidence = temp.w;
750 + float3 colorResult = confidence > 0.0 ? tex2D(_MainTex, hitPoint).rgb : tex2D(_CameraReflectionsTexture, tsP).rgb;
751 +
752 + if (any(isnan(colorResult)))
753 + colorResult = float3(0.0, 0.0, 0.0);
754 +
755 + // As of 11/29/2015, on Unity 5.3 on a Windows 8.1 computer with a NVIDIA GeForce 980,
756 + // with driver 347.62, the above check does not actually work to get rid of NaNs!
757 + // So we add this "redundant" check.
758 + if (!all(isfinite(colorResult)))
759 + colorResult = float3(0.0, 0.0, 0.0);
760 +
761 + return float4(colorResult, confidence);
762 + }
763 +
764 + float4 fragBilatKeyPack(v2f i) : SV_Target
765 + {
766 + float2 tsP = i.uv2.xy;
767 + float3 csN = tex2D(_CameraGBufferTexture2, tsP).xyz;
768 + float roughness = tex2D(_CameraGBufferTexture1, tsP).a;
769 + return float4(csN, roughness);
770 + }
771 +
772 + float4 fragDepthToCSZ(v2f i) : SV_Target
773 + {
774 + float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv2.xy);
775 + return float4(-LinearEyeDepth(depth), 0.0, 0.0, 0.0);
776 + }
777 +
778 + static const int NUM_POISSON_TAPS = 12;
779 + // Same as used in CameraMotionBlur.shader
780 + static const float2 poissonSamples[NUM_POISSON_TAPS] =
781 + {
782 + float2(-0.326212,-0.40581),
783 + float2(-0.840144,-0.07358),
784 + float2(-0.695914,0.457137),
785 + float2(-0.203345,0.620716),
786 + float2(0.96234,-0.194983),
787 + float2(0.473434,-0.480026),
788 + float2(0.519456,0.767022),
789 + float2(0.185461,-0.893124),
790 + float2(0.507431,0.064425),
791 + float2(0.89642,0.412458),
792 + float2(-0.32194,-0.932615),
793 + float2(-0.791559,-0.59771)
794 + };
795 +
796 + float4 fragFilterSharpReflections(v2f i) : SV_Target
797 + {
798 + // Could improve perf by not computing blur when we won't be sampling the highest level anyways
799 + float2 tsP = i.uv2.xy;
800 + float4 sum = 0.0;
801 + float sampleRadius = _MainTex_TexelSize.xy * _ReflectionBlur;
802 +
803 + for (int i = 0; i < NUM_POISSON_TAPS; i++)
804 + {
805 + float2 p = tsP + poissonSamples[i] * sampleRadius;
806 +
807 + float4 tap = tex2D(_MainTex, p);
808 + if (_HighlightSuppression)
809 + {
810 + tap.rgb = highlightCompression(tap.rgb);
811 + }
812 +
813 + sum += tap;
814 + }
815 +
816 + float4 result = sum / float(NUM_POISSON_TAPS);
817 +
818 + if (_HighlightSuppression)
819 + {
820 + result.rgb = highlightDecompression(result.rgb);
821 + }
822 +
823 + return result;
824 + }
825 +
826 + ENDCG
827 +
828 + SubShader
829 + {
830 + ZTest Always Cull Off ZWrite Off
831 +
832 + // 0: Raytrace
833 + Pass
834 + {
835 + CGPROGRAM
836 + #pragma exclude_renderers gles xbox360 ps3
837 + #pragma vertex vert
838 + #pragma fragment fragRaytrace1
839 +
840 + float4 fragRaytrace1(v2f i) : SV_Target
841 + {
842 + return fragRaytrace(i, _RayStepSize);
843 + }
844 + ENDCG
845 + }
846 +
847 + // 1: Composite
848 + Pass
849 + {
850 + CGPROGRAM
851 + #pragma exclude_renderers gles xbox360 ps3
852 + #pragma vertex vert
853 + #pragma fragment fragComposite
854 + ENDCG
855 + }
856 +
857 + // 2: GBlur
858 + Pass
859 + {
860 + CGPROGRAM
861 + #pragma exclude_renderers gles xbox360 ps3
862 + #pragma vertex vert
863 + #pragma fragment fragGBlur
864 + ENDCG
865 + }
866 +
867 + // 3: CompositeSSR
868 + Pass
869 + {
870 + CGPROGRAM
871 + #pragma exclude_renderers gles xbox360 ps3
872 + #pragma vertex vert
873 + #pragma fragment fragCompositeSSR
874 + ENDCG
875 + }
876 +
877 + // 4: Min mip generation
878 + Pass
879 + {
880 + CGPROGRAM
881 + #pragma exclude_renderers gles xbox360 ps3
882 + #pragma vertex vert
883 + #pragma fragment fragMin
884 + ENDCG
885 + }
886 +
887 + // 5: Hit point texture to reflection buffer
888 + Pass
889 + {
890 + CGPROGRAM
891 + #pragma exclude_renderers gles xbox360 ps3
892 + #pragma vertex vert
893 + #pragma fragment fragResolveHitPoints
894 + ENDCG
895 + }
896 +
897 + // 6: Pack Bilateral Filter Keys in single buffer
898 + Pass
899 + {
900 + CGPROGRAM
901 + #pragma exclude_renderers gles xbox360 ps3
902 + #pragma vertex vert
903 + #pragma fragment fragBilatKeyPack
904 + ENDCG
905 + }
906 +
907 + // 7: Blit depth information as camera space Z
908 + Pass
909 + {
910 + CGPROGRAM
911 + #pragma exclude_renderers gles xbox360 ps3
912 + #pragma vertex vert
913 + #pragma fragment fragDepthToCSZ
914 + ENDCG
915 + }
916 +
917 + // 8: Filter the highest quality reflection buffer
918 + Pass
919 + {
920 + CGPROGRAM
921 + #pragma exclude_renderers gles xbox360 ps3
922 + #pragma vertex vert
923 + #pragma fragment fragFilterSharpReflections
924 + ENDCG
925 + }
926 + }
927 +
928 + Fallback "Diffuse"
929 +}
1 +fileFormatVersion: 2
2 +guid: 607a5643efb168f429e438f7d6ad270a
3 +timeCreated: 1464350149
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +#ifndef __TAA__
2 +#define __TAA__
3 +
4 +#pragma only_renderers ps4 xboxone d3d11 d3d9 xbox360 opengl glcore
5 +#pragma exclude_renderers gles
6 +
7 +#include "UnityCG.cginc"
8 +#include "Common.cginc"
9 +
10 +// -----------------------------------------------------------------------------
11 +// Solver
12 +
13 +#define TAA_USE_STABLE_BUT_GHOSTY_VARIANT 0
14 +
15 +#if !defined(TAA_DILATE_MOTION_VECTOR_SAMPLE)
16 + #define TAA_DILATE_MOTION_VECTOR_SAMPLE 1
17 +#endif
18 +
19 +#define TAA_FRAGMENT_MOTION_HISTORY_DECAY 0.85
20 +
21 +#define TAA_FINAL_BLEND_STATIC_FACTOR _FinalBlendParameters.x
22 +#define TAA_FINAL_BLEND_DYNAMIC_FACTOR _FinalBlendParameters.y
23 +#define TAA_MOTION_AMPLIFICATION _FinalBlendParameters.z
24 +
25 +struct VaryingsSolver
26 +{
27 + float4 vertex : SV_POSITION;
28 + float4 uv : TEXCOORD0; // [xy: _MainTex.uv, zw: _HistoryTex.uv]
29 +};
30 +
31 +struct OutputSolver
32 +{
33 + float4 destination : SV_Target0;
34 + float4 history : SV_Target1;
35 +};
36 +
37 +sampler2D _HistoryTex;
38 +
39 +sampler2D _CameraMotionVectorsTexture;
40 +sampler2D _CameraDepthTexture;
41 +
42 +float4 _HistoryTex_TexelSize;
43 +float4 _CameraDepthTexture_TexelSize;
44 +
45 +float2 _Jitter;
46 +float4 _SharpenParameters;
47 +float4 _FinalBlendParameters;
48 +
49 +VaryingsSolver VertSolver(AttributesDefault input)
50 +{
51 + VaryingsSolver output;
52 +
53 + float4 vertex = UnityObjectToClipPos(input.vertex);
54 +
55 + output.vertex = vertex;
56 + output.uv = input.texcoord.xyxy;
57 +
58 +#if UNITY_UV_STARTS_AT_TOP
59 + if (_MainTex_TexelSize.y < 0)
60 + output.uv.y = 1.0 - input.texcoord.y;
61 +#endif
62 +
63 + return output;
64 +}
65 +
66 +float2 GetClosestFragment(float2 uv)
67 +{
68 + const float2 k = _CameraDepthTexture_TexelSize.xy;
69 + const float4 neighborhood = float4(
70 + SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv - k),
71 + SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv + float2(k.x, -k.y)),
72 + SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv + float2(-k.x, k.y)),
73 + SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv + k)
74 + );
75 +
76 +#if defined(UNITY_REVERSED_Z)
77 + #define COMPARE_DEPTH(a, b) step(b, a)
78 +#else
79 + #define COMPARE_DEPTH(a, b) step(a, b)
80 +#endif
81 +
82 + float3 result = float3(0.0, 0.0, SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv));
83 + result = lerp(result, float3(-1.0, -1.0, neighborhood.x), COMPARE_DEPTH(neighborhood.x, result.z));
84 + result = lerp(result, float3( 1.0, -1.0, neighborhood.y), COMPARE_DEPTH(neighborhood.y, result.z));
85 + result = lerp(result, float3(-1.0, 1.0, neighborhood.z), COMPARE_DEPTH(neighborhood.z, result.z));
86 + result = lerp(result, float3( 1.0, 1.0, neighborhood.w), COMPARE_DEPTH(neighborhood.w, result.z));
87 +
88 + return (uv + result.xy * k);
89 +}
90 +
91 +// Adapted from Playdead's TAA implementation
92 +// https://github.com/playdeadgames/temporal
93 +float4 ClipToAABB(float4 color, float p, float3 minimum, float3 maximum)
94 +{
95 + // note: only clips towards aabb center (but fast!)
96 + float3 center = 0.5 * (maximum + minimum);
97 + float3 extents = 0.5 * (maximum - minimum);
98 +
99 + // This is actually `distance`, however the keyword is reserved
100 + float4 offset = color - float4(center, p);
101 + float3 repeat = abs(offset.xyz / extents);
102 +
103 + repeat.x = max(repeat.x, max(repeat.y, repeat.z));
104 +
105 + if (repeat.x > 1.0)
106 + {
107 + // `color` is not intersecting (nor inside) the AABB; it's clipped to the closest extent
108 + return float4(center, p) + offset / repeat.x;
109 + }
110 + else
111 + {
112 + // `color` is intersecting (or inside) the AABB.
113 +
114 + // Note: for whatever reason moving this return statement from this else into a higher
115 + // scope makes the NVIDIA drivers go beyond bonkers
116 + return color;
117 + }
118 +}
119 +
120 +OutputSolver FragSolver(VaryingsSolver input)
121 +{
122 +#if TAA_DILATE_MOTION_VECTOR_SAMPLE
123 + float2 motion = tex2D(_CameraMotionVectorsTexture, GetClosestFragment(input.uv.zw)).xy;
124 +#else
125 + // Don't dilate in ortho !
126 + float2 motion = tex2D(_CameraMotionVectorsTexture, input.uv.zw).xy;
127 +#endif
128 +
129 + const float2 k = _MainTex_TexelSize.xy;
130 + float2 uv = input.uv.xy;
131 +
132 +#if UNITY_UV_STARTS_AT_TOP
133 + uv -= _MainTex_TexelSize.y < 0 ? _Jitter * float2(1.0, -1.0) : _Jitter;
134 +#else
135 + uv -= _Jitter;
136 +#endif
137 +
138 + float4 color = tex2D(_MainTex, uv);
139 +
140 + float4 topLeft = tex2D(_MainTex, uv - k * 0.5);
141 + float4 bottomRight = tex2D(_MainTex, uv + k * 0.5);
142 +
143 + float4 corners = 4.0 * (topLeft + bottomRight) - 2.0 * color;
144 +
145 + // Sharpen output
146 + color += (color - (corners * 0.166667)) * 2.718282 * _SharpenParameters.x;
147 + color = max(0.0, color);
148 +
149 + // Tonemap color and history samples
150 + float4 average = FastToneMap((corners + color) * 0.142857);
151 +
152 + topLeft = FastToneMap(topLeft);
153 + bottomRight = FastToneMap(bottomRight);
154 +
155 + color = FastToneMap(color);
156 +
157 + float4 history = tex2D(_HistoryTex, input.uv.zw - motion);
158 +
159 +// Only use this variant for arch viz or scenes that don't have any animated objects (camera animation is fine)
160 +#if TAA_USE_STABLE_BUT_GHOSTY_VARIANT
161 + float4 luma = float4(Luminance(topLeft.rgb), Luminance(bottomRight.rgb), Luminance(average.rgb), Luminance(color.rgb));
162 + float nudge = lerp(6.28318530718, 0.5, saturate(2.0 * history.a)) * max(abs(luma.z - luma.w), abs(luma.x - luma.y));
163 +
164 + float4 minimum = lerp(bottomRight, topLeft, step(luma.x, luma.y)) - nudge;
165 + float4 maximum = lerp(topLeft, bottomRight, step(luma.x, luma.y)) + nudge;
166 +#else
167 + float2 luma = float2(Luminance(average.rgb), Luminance(color.rgb));
168 + float nudge = 4.0 * abs(luma.x - luma.y);
169 +
170 + float4 minimum = min(bottomRight, topLeft) - nudge;
171 + float4 maximum = max(topLeft, bottomRight) + nudge;
172 +#endif
173 +
174 + history = FastToneMap(history);
175 +
176 + // Clip history samples
177 + history = ClipToAABB(history, history.a, minimum.xyz, maximum.xyz);
178 +
179 + // Store fragment motion history
180 + color.a = saturate(smoothstep(0.002 * _MainTex_TexelSize.z, 0.0035 * _MainTex_TexelSize.z, length(motion)));
181 +
182 + // Blend method
183 + float weight = clamp(lerp(TAA_FINAL_BLEND_STATIC_FACTOR, TAA_FINAL_BLEND_DYNAMIC_FACTOR,
184 + length(motion) * TAA_MOTION_AMPLIFICATION), TAA_FINAL_BLEND_DYNAMIC_FACTOR, TAA_FINAL_BLEND_STATIC_FACTOR);
185 +
186 + color = FastToneUnmap(lerp(color, history, weight));
187 +
188 + OutputSolver output;
189 +
190 + output.destination = color;
191 + color.a *= TAA_FRAGMENT_MOTION_HISTORY_DECAY;
192 +
193 + output.history = color;
194 +
195 + return output;
196 +}
197 +
198 +// -----------------------------------------------------------------------------
199 +// Alpha clearance
200 +
201 +float4 FragAlphaClear(VaryingsDefault input) : SV_Target
202 +{
203 + return float4(tex2D(_MainTex, input.uv).rgb, 0.0);
204 +}
205 +
206 +#endif // __TAA__
1 +fileFormatVersion: 2
2 +guid: 241b7a6a033e9dc4da9d2595cef7f477
3 +timeCreated: 1472807158
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Hidden/Post FX/Temporal Anti-aliasing"
2 +{
3 + Properties
4 + {
5 + _MainTex("", 2D) = "black"
6 + }
7 +
8 + SubShader
9 + {
10 + Cull Off ZWrite Off ZTest Always
11 +
12 + // Perspective
13 + Pass
14 + {
15 + CGPROGRAM
16 + #pragma target 5.0
17 + #pragma vertex VertSolver
18 + #pragma fragment FragSolver
19 + #include "TAA.cginc"
20 + ENDCG
21 + }
22 +
23 + // Ortho
24 + Pass
25 + {
26 + CGPROGRAM
27 + #pragma target 5.0
28 + #pragma vertex VertSolver
29 + #pragma fragment FragSolver
30 + #define TAA_DILATE_MOTION_VECTOR_SAMPLE 0
31 + #include "TAA.cginc"
32 + ENDCG
33 + }
34 +
35 + // Alpha Clear
36 + Pass
37 + {
38 + CGPROGRAM
39 + #pragma target 5.0
40 + #pragma vertex VertDefault
41 + #pragma fragment FragAlphaClear
42 + #include "TAA.cginc"
43 + ENDCG
44 + }
45 + }
46 +
47 + SubShader
48 + {
49 + Cull Off ZWrite Off ZTest Always
50 +
51 + // Perspective
52 + Pass
53 + {
54 + CGPROGRAM
55 + #pragma target 3.0
56 + #pragma vertex VertSolver
57 + #pragma fragment FragSolver
58 + #include "TAA.cginc"
59 + ENDCG
60 + }
61 +
62 + // Ortho
63 + Pass
64 + {
65 + CGPROGRAM
66 + #pragma target 3.0
67 + #pragma vertex VertSolver
68 + #pragma fragment FragSolver
69 + #define TAA_DILATE_MOTION_VECTOR_SAMPLE 0
70 + #include "TAA.cginc"
71 + ENDCG
72 + }
73 +
74 + // Alpha Clear
75 + Pass
76 + {
77 + CGPROGRAM
78 + #pragma target 3.0
79 + #pragma vertex VertDefault
80 + #pragma fragment FragAlphaClear
81 + #include "TAA.cginc"
82 + ENDCG
83 + }
84 + }
85 +}
1 +fileFormatVersion: 2
2 +guid: ec6c5af987867f54aa08fba81ee279bd
3 +timeCreated: 1472807140
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +#ifndef __TONEMAPPING__
2 +#define __TONEMAPPING__
3 +
4 +#include "ACES.cginc"
5 +
6 +// Set to 1 to use the full reference ACES tonemapper. This should only be used for research
7 +// purposes and it's quite heavy and generally overkill.
8 +#define TONEMAPPING_USE_FULL_ACES 0
9 +
10 +//
11 +// Neutral tonemapping (Hable/Hejl/Frostbite)
12 +// Input is linear RGB
13 +//
14 +half3 NeutralCurve(half3 x, half a, half b, half c, half d, half e, half f)
15 +{
16 + return ((x * (a * x + c * b) + d * e) / (x * (a * x + b) + d * f)) - e / f;
17 +}
18 +
19 +half3 NeutralTonemap(half3 x, half4 params1, half4 params2)
20 +{
21 + // ACES supports negative color values and WILL output negative values when coming from ACES or ACEScg
22 + // Make sure negative channels are clamped to 0.0 as this neutral tonemapper can't deal with them properly
23 + x = max((0.0).xxx, x);
24 +
25 + // Tonemap
26 + half a = params1.x;
27 + half b = params1.y;
28 + half c = params1.z;
29 + half d = params1.w;
30 + half e = params2.x;
31 + half f = params2.y;
32 + half whiteLevel = params2.z;
33 + half whiteClip = params2.w;
34 +
35 + half3 whiteScale = (1.0).xxx / NeutralCurve(whiteLevel, a, b, c, d, e, f);
36 + x = NeutralCurve(x * whiteScale, a, b, c, d, e, f);
37 + x *= whiteScale;
38 +
39 + // Post-curve white point adjustment
40 + x /= whiteClip.xxx;
41 +
42 + return x;
43 +}
44 +
45 +//
46 +// Filmic tonemapping (ACES fitting, unless TONEMAPPING_USE_FULL_ACES is set to 1)
47 +// Input is ACES2065-1 (AP0 w/ linear encoding)
48 +//
49 +half3 FilmicTonemap(half3 aces)
50 +{
51 +#if TONEMAPPING_USE_FULL_ACES
52 +
53 + half3 oces = RRT(aces);
54 + half3 odt = ODT_RGBmonitor_100nits_dim(oces);
55 + return odt;
56 +
57 +#else
58 +
59 + // --- Glow module --- //
60 + half saturation = rgb_2_saturation(aces);
61 + half ycIn = rgb_2_yc(aces);
62 + half s = sigmoid_shaper((saturation - 0.4) / 0.2);
63 + half addedGlow = 1.0 + glow_fwd(ycIn, RRT_GLOW_GAIN * s, RRT_GLOW_MID);
64 + aces *= addedGlow;
65 +
66 + // --- Red modifier --- //
67 + half hue = rgb_2_hue(aces);
68 + half centeredHue = center_hue(hue, RRT_RED_HUE);
69 + half hueWeight;
70 + {
71 + //hueWeight = cubic_basis_shaper(centeredHue, RRT_RED_WIDTH);
72 + hueWeight = Pow2(smoothstep(0.0, 1.0, 1.0 - abs(2.0 * centeredHue / RRT_RED_WIDTH)));
73 + }
74 +
75 + aces.r += hueWeight * saturation * (RRT_RED_PIVOT - aces.r) * (1.0 - RRT_RED_SCALE);
76 +
77 + // --- ACES to RGB rendering space --- //
78 + half3 acescg = max(0.0, ACES_to_ACEScg(aces));
79 +
80 + // --- Global desaturation --- //
81 + //acescg = mul(RRT_SAT_MAT, acescg);
82 + acescg = lerp(dot(acescg, AP1_RGB2Y).xxx, acescg, RRT_SAT_FACTOR.xxx);
83 +
84 + // Luminance fitting of *RRT.a1.0.3 + ODT.Academy.RGBmonitor_100nits_dim.a1.0.3*.
85 + // https://github.com/colour-science/colour-unity/blob/master/Assets/Colour/Notebooks/CIECAM02_Unity.ipynb
86 + // RMSE: 0.0012846272106
87 + const half a = 278.5085;
88 + const half b = 10.7772;
89 + const half c = 293.6045;
90 + const half d = 88.7122;
91 + const half e = 80.6889;
92 + half3 x = acescg;
93 + half3 rgbPost = (x * (a * x + b)) / (x * (c * x + d) + e);
94 +
95 + // Scale luminance to linear code value
96 + // half3 linearCV = Y_2_linCV(rgbPost, CINEMA_WHITE, CINEMA_BLACK);
97 +
98 + // Apply gamma adjustment to compensate for dim surround
99 + half3 linearCV = darkSurround_to_dimSurround(rgbPost);
100 +
101 + // Apply desaturation to compensate for luminance difference
102 + //linearCV = mul(ODT_SAT_MAT, color);
103 + linearCV = lerp(dot(linearCV, AP1_RGB2Y).xxx, linearCV, ODT_SAT_FACTOR.xxx);
104 +
105 + // Convert to display primary encoding
106 + // Rendering space RGB to XYZ
107 + half3 XYZ = mul(AP1_2_XYZ_MAT, linearCV);
108 +
109 + // Apply CAT from ACES white point to assumed observer adapted white point
110 + XYZ = mul(D60_2_D65_CAT, XYZ);
111 +
112 + // CIE XYZ to display primaries
113 + linearCV = mul(XYZ_2_REC709_MAT, XYZ);
114 +
115 + return linearCV;
116 +
117 +#endif
118 +}
119 +
120 +#endif // __TONEMAPPING__
1 +fileFormatVersion: 2
2 +guid: 0a999e641c982a14d9c68dfd53a98afc
3 +timeCreated: 1469104178
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Hidden/Post FX/Uber Shader"
2 +{
3 + Properties
4 + {
5 + _MainTex ("Texture", 2D) = "white" {}
6 + _AutoExposure ("", 2D) = "" {}
7 + _BloomTex ("", 2D) = "" {}
8 + _Bloom_DirtTex ("", 2D) = "" {}
9 + _GrainTex ("", 2D) = "" {}
10 + _LogLut ("", 2D) = "" {}
11 + _UserLut ("", 2D) = "" {}
12 + _Vignette_Mask ("", 2D) = "" {}
13 + _ChromaticAberration_Spectrum ("", 2D) = "" {}
14 + _DitheringTex ("", 2D) = "" {}
15 + }
16 +
17 + CGINCLUDE
18 +
19 + #pragma target 3.0
20 +
21 + #pragma multi_compile __ UNITY_COLORSPACE_GAMMA
22 + #pragma multi_compile __ CHROMATIC_ABERRATION
23 + #pragma multi_compile __ DEPTH_OF_FIELD DEPTH_OF_FIELD_COC_VIEW
24 + #pragma multi_compile __ BLOOM BLOOM_LENS_DIRT
25 + #pragma multi_compile __ COLOR_GRADING COLOR_GRADING_LOG_VIEW
26 + #pragma multi_compile __ USER_LUT
27 + #pragma multi_compile __ GRAIN
28 + #pragma multi_compile __ VIGNETTE_CLASSIC VIGNETTE_MASKED
29 + #pragma multi_compile __ DITHERING
30 +
31 + #include "UnityCG.cginc"
32 + #include "Bloom.cginc"
33 + #include "ColorGrading.cginc"
34 + #include "UberSecondPass.cginc"
35 +
36 + // Auto exposure / eye adaptation
37 + sampler2D _AutoExposure;
38 +
39 + // Chromatic aberration
40 + half _ChromaticAberration_Amount;
41 + sampler2D _ChromaticAberration_Spectrum;
42 +
43 + // Depth of field
44 + sampler2D_float _CameraDepthTexture;
45 + sampler2D _DepthOfFieldTex;
46 + sampler2D _DepthOfFieldCoCTex;
47 + float4 _DepthOfFieldTex_TexelSize;
48 + float3 _DepthOfFieldParams; // x: distance, y: f^2 / (N * (S1 - f) * film_width * 2), z: max coc
49 +
50 + // Bloom
51 + sampler2D _BloomTex;
52 + float4 _BloomTex_TexelSize;
53 + half2 _Bloom_Settings; // x: sampleScale, y: bloom.intensity
54 +
55 + sampler2D _Bloom_DirtTex;
56 + half _Bloom_DirtIntensity;
57 +
58 + // Color grading & tonemapping
59 + sampler2D _LogLut;
60 + half3 _LogLut_Params; // x: 1 / lut_width, y: 1 / lut_height, z: lut_height - 1
61 + half _ExposureEV; // EV (exp2)
62 +
63 + // User lut
64 + sampler2D _UserLut;
65 + half4 _UserLut_Params; // @see _LogLut_Params
66 +
67 + // Vignette
68 + half3 _Vignette_Color;
69 + half2 _Vignette_Center; // UV space
70 + half4 _Vignette_Settings; // x: intensity, y: smoothness, z: roundness, w: rounded
71 + sampler2D _Vignette_Mask;
72 + half _Vignette_Opacity; // [0;1]
73 +
74 + struct VaryingsFlipped
75 + {
76 + float4 pos : SV_POSITION;
77 + float2 uv : TEXCOORD0;
78 + float2 uvSPR : TEXCOORD1; // Single Pass Stereo UVs
79 + float2 uvFlipped : TEXCOORD2; // Flipped UVs (DX/MSAA/Forward)
80 + float2 uvFlippedSPR : TEXCOORD3; // Single Pass Stereo flipped UVs
81 + };
82 +
83 + VaryingsFlipped VertUber(AttributesDefault v)
84 + {
85 + VaryingsFlipped o;
86 + o.pos = UnityObjectToClipPos(v.vertex);
87 + o.uv = v.texcoord.xy;
88 + o.uvSPR = UnityStereoScreenSpaceUVAdjust(v.texcoord.xy, _MainTex_ST);
89 + o.uvFlipped = v.texcoord.xy;
90 +
91 + #if UNITY_UV_STARTS_AT_TOP
92 + if (_MainTex_TexelSize.y < 0.0)
93 + o.uvFlipped.y = 1.0 - o.uvFlipped.y;
94 + #endif
95 +
96 + o.uvFlippedSPR = UnityStereoScreenSpaceUVAdjust(o.uvFlipped, _MainTex_ST);
97 +
98 + return o;
99 + }
100 +
101 + half4 FragUber(VaryingsFlipped i) : SV_Target
102 + {
103 + float2 uv = i.uv;
104 + half autoExposure = tex2D(_AutoExposure, uv).r;
105 +
106 + half3 color = (0.0).xxx;
107 + #if DEPTH_OF_FIELD && CHROMATIC_ABERRATION
108 + half4 dof = (0.0).xxxx;
109 + half ffa = 0.0; // far field alpha
110 + #endif
111 +
112 + //
113 + // HDR effects
114 + // ---------------------------------------------------------
115 +
116 + // Chromatic Aberration
117 + // Inspired by the method described in "Rendering Inside" [Playdead 2016]
118 + // https://twitter.com/pixelmager/status/717019757766123520
119 + #if CHROMATIC_ABERRATION
120 + {
121 + float2 coords = 2.0 * uv - 1.0;
122 + float2 end = uv - coords * dot(coords, coords) * _ChromaticAberration_Amount;
123 +
124 + float2 diff = end - uv;
125 + int samples = clamp(int(length(_MainTex_TexelSize.zw * diff / 2.0)), 3, 16);
126 + float2 delta = diff / samples;
127 + float2 pos = uv;
128 + half3 sum = (0.0).xxx, filterSum = (0.0).xxx;
129 +
130 + #if DEPTH_OF_FIELD
131 + float2 dofDelta = delta;
132 + float2 dofPos = pos;
133 + if (_MainTex_TexelSize.y < 0.0)
134 + {
135 + dofDelta.y = -dofDelta.y;
136 + dofPos.y = 1.0 - dofPos.y;
137 + }
138 + half4 dofSum = (0.0).xxxx;
139 + half ffaSum = 0.0;
140 + #endif
141 +
142 + for (int i = 0; i < samples; i++)
143 + {
144 + half t = (i + 0.5) / samples;
145 + half3 s = tex2Dlod(_MainTex, float4(UnityStereoScreenSpaceUVAdjust(pos, _MainTex_ST), 0, 0)).rgb;
146 + half3 filter = tex2Dlod(_ChromaticAberration_Spectrum, float4(t, 0, 0, 0)).rgb;
147 +
148 + sum += s * filter;
149 + filterSum += filter;
150 + pos += delta;
151 +
152 + #if DEPTH_OF_FIELD
153 + float4 uvDof = float4(UnityStereoScreenSpaceUVAdjust(dofPos, _MainTex_ST), 0, 0);
154 + half4 sdof = tex2Dlod(_DepthOfFieldTex, uvDof).rgba;
155 + half scoc = tex2Dlod(_DepthOfFieldCoCTex, uvDof).r;
156 + scoc = (scoc - 0.5) * 2 * _DepthOfFieldParams.z;
157 + dofSum += sdof * half4(filter, 1);
158 + ffaSum += smoothstep(_MainTex_TexelSize.y * 2, _MainTex_TexelSize.y * 4, scoc);
159 + dofPos += dofDelta;
160 + #endif
161 + }
162 +
163 + color = sum / filterSum;
164 + #if DEPTH_OF_FIELD
165 + dof = dofSum / half4(filterSum, samples);
166 + ffa = ffaSum / samples;
167 + #endif
168 + }
169 + #else
170 + {
171 + color = tex2D(_MainTex, i.uvSPR).rgb;
172 + }
173 + #endif
174 +
175 + // Apply auto exposure if any
176 + color *= autoExposure;
177 +
178 + // Gamma space... Gah.
179 + #if UNITY_COLORSPACE_GAMMA
180 + {
181 + color = GammaToLinearSpace(color);
182 + }
183 + #endif
184 +
185 + // Depth of field
186 + #if DEPTH_OF_FIELD_COC_VIEW
187 + {
188 + // Calculate the radiuses of CoC.
189 + half4 src = tex2D(_DepthOfFieldTex, uv);
190 + float depth = LinearEyeDepth(SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uvFlippedSPR));
191 + float coc = (depth - _DepthOfFieldParams.x) * _DepthOfFieldParams.y / depth;
192 + coc *= 80;
193 +
194 + // Visualize CoC (white -> red -> gray)
195 + half3 rgb = lerp(half3(1, 0, 0), half3(1.0, 1.0, 1.0), saturate(-coc));
196 + rgb = lerp(rgb, half3(0.4, 0.4, 0.4), saturate(coc));
197 +
198 + // Black and white image overlay
199 + rgb *= AcesLuminance(color) + 0.5;
200 +
201 + // Gamma correction
202 + #if !UNITY_COLORSPACE_GAMMA
203 + {
204 + rgb = GammaToLinearSpace(rgb);
205 + }
206 + #endif
207 +
208 + color = rgb;
209 + }
210 + #elif DEPTH_OF_FIELD
211 + {
212 + #if !CHROMATIC_ABERRATION
213 + half4 dof = tex2D(_DepthOfFieldTex, i.uvFlippedSPR);
214 + half coc = tex2D(_DepthOfFieldCoCTex, i.uvFlippedSPR);
215 + coc = (coc - 0.5) * 2 * _DepthOfFieldParams.z;
216 + // Convert CoC to far field alpha value.
217 + float ffa = smoothstep(_MainTex_TexelSize.y * 2, _MainTex_TexelSize.y * 4, coc);
218 + #endif
219 + // lerp(lerp(color, dof, ffa), dof, dof.a)
220 + color = lerp(color, dof.rgb * autoExposure, ffa + dof.a - ffa * dof.a);
221 + }
222 + #endif
223 +
224 + // HDR Bloom
225 + #if BLOOM || BLOOM_LENS_DIRT
226 + {
227 + half3 bloom = UpsampleFilter(_BloomTex, i.uvFlippedSPR, _BloomTex_TexelSize.xy, _Bloom_Settings.x) * _Bloom_Settings.y;
228 + color += bloom;
229 +
230 + #if BLOOM_LENS_DIRT
231 + {
232 + half3 dirt = tex2D(_Bloom_DirtTex, i.uvFlipped).rgb * _Bloom_DirtIntensity;
233 + color += bloom * dirt;
234 + }
235 + #endif
236 + }
237 + #endif
238 +
239 + // Procedural vignette
240 + #if VIGNETTE_CLASSIC
241 + {
242 + half2 d = abs(uv - _Vignette_Center) * _Vignette_Settings.x;
243 + d.x *= lerp(1.0, _ScreenParams.x / _ScreenParams.y, _Vignette_Settings.w);
244 + d = pow(d, _Vignette_Settings.z); // Roundness
245 + half vfactor = pow(saturate(1.0 - dot(d, d)), _Vignette_Settings.y);
246 + color *= lerp(_Vignette_Color, (1.0).xxx, vfactor);
247 + }
248 +
249 + // Masked vignette
250 + #elif VIGNETTE_MASKED
251 + {
252 + half vfactor = tex2D(_Vignette_Mask, uv).a;
253 + half3 new_color = color * lerp(_Vignette_Color, (1.0).xxx, vfactor);
254 + color = lerp(color, new_color, _Vignette_Opacity);
255 + }
256 + #endif
257 +
258 + // HDR color grading & tonemapping
259 + #if COLOR_GRADING_LOG_VIEW
260 + {
261 + color *= _ExposureEV;
262 + color = saturate(LinearToLogC(color));
263 + }
264 + #elif COLOR_GRADING
265 + {
266 + color *= _ExposureEV; // Exposure is in ev units (or 'stops')
267 +
268 + half3 colorLogC = saturate(LinearToLogC(color));
269 + color = ApplyLut2d(_LogLut, colorLogC, _LogLut_Params);
270 + }
271 + #endif
272 +
273 + //
274 + // All the following effects happen in LDR
275 + // ---------------------------------------------------------
276 +
277 + color = saturate(color);
278 +
279 + // Back to gamma space if needed
280 + #if UNITY_COLORSPACE_GAMMA
281 + {
282 + color = LinearToGammaSpace(color);
283 + }
284 + #endif
285 +
286 + // LDR user lut
287 + #if USER_LUT
288 + {
289 + color = saturate(color);
290 + half3 colorGraded;
291 +
292 + #if !UNITY_COLORSPACE_GAMMA
293 + {
294 + colorGraded = ApplyLut2d(_UserLut, LinearToGammaSpace(color), _UserLut_Params.xyz);
295 + colorGraded = GammaToLinearSpace(colorGraded);
296 + }
297 + #else
298 + {
299 + colorGraded = ApplyLut2d(_UserLut, color, _UserLut_Params.xyz);
300 + }
301 + #endif
302 +
303 + color = lerp(color, colorGraded, _UserLut_Params.w);
304 + }
305 + #endif
306 +
307 + color = UberSecondPass(color, uv);
308 +
309 + // Done !
310 + return half4(color, 1.0);
311 + }
312 +
313 + ENDCG
314 +
315 + SubShader
316 + {
317 + Cull Off ZWrite Off ZTest Always
318 +
319 + // (0)
320 + Pass
321 + {
322 + CGPROGRAM
323 +
324 + #pragma vertex VertUber
325 + #pragma fragment FragUber
326 +
327 + ENDCG
328 + }
329 + }
330 +}
1 +fileFormatVersion: 2
2 +guid: 8ce0a6f4c8cae334d8a5617f302b6769
3 +timeCreated: 1459956426
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +#include "ColorGrading.cginc"
2 +
3 +// Grain
4 +half2 _Grain_Params1; // x: lum_contrib, y: intensity
5 +half4 _Grain_Params2; // x: xscale, h: yscale, z: xoffset, w: yoffset
6 +sampler2D _GrainTex;
7 +
8 +// Dithering
9 +sampler2D _DitheringTex;
10 +float4 _DitheringCoords;
11 +
12 +float3 UberSecondPass(half3 color, float2 uv)
13 +{
14 + // Grain
15 + #if GRAIN
16 + {
17 + float3 grain = tex2D(_GrainTex, uv * _Grain_Params2.xy + _Grain_Params2.zw).rgb;
18 +
19 + // Noisiness response curve based on scene luminance
20 + float lum = 1.0 - sqrt(AcesLuminance(color));
21 + lum = lerp(1.0, lum, _Grain_Params1.x);
22 +
23 + color += color * grain * _Grain_Params1.y * lum;
24 + }
25 + #endif
26 +
27 + // Blue noise dithering
28 + #if DITHERING
29 + {
30 + // Symmetric triangular distribution on [-1,1] with maximal density at 0
31 + float noise = tex2D(_DitheringTex, uv * _DitheringCoords.xy + _DitheringCoords.zw).a * 2.0 - 1.0;
32 + noise = sign(noise) * (1.0 - sqrt(1.0 - abs(noise))) / 255.0;
33 +
34 + color += noise;
35 + }
36 + #endif
37 +
38 + return color;
39 +}
1 +fileFormatVersion: 2
2 +guid: b6e42614562a56445ba4b5d90301f06f
3 +timeCreated: 1487080088
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 4b79d54138d9d1a498085393504c7d02
3 +folderAsset: yes
4 +timeCreated: 1466585248
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 68327f748e8ffd94889a47317b7d327b
3 +folderAsset: yes
4 +timeCreated: 1460383911
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public sealed class GetSetAttribute : PropertyAttribute
4 + {
5 + public readonly string name;
6 + public bool dirty;
7 +
8 + public GetSetAttribute(string name)
9 + {
10 + this.name = name;
11 + }
12 + }
13 +}
1 +fileFormatVersion: 2
2 +guid: f17e8602928ea02419dae051ec79c5a2
3 +timeCreated: 1460383955
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public sealed class MinAttribute : PropertyAttribute
4 + {
5 + public readonly float min;
6 +
7 + public MinAttribute(float min)
8 + {
9 + this.min = min;
10 + }
11 + }
12 +}
1 +fileFormatVersion: 2
2 +guid: 9af2f505033843c46a362e251937acb1
3 +timeCreated: 1462281908
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public sealed class TrackballAttribute : PropertyAttribute
4 + {
5 + public readonly string method;
6 +
7 + public TrackballAttribute(string method)
8 + {
9 + this.method = method;
10 + }
11 + }
12 +}
1 +fileFormatVersion: 2
2 +guid: 65e30143f4e114f45b84a1d9cba8f469
3 +timeCreated: 1463400829
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public sealed class TrackballGroupAttribute : PropertyAttribute
4 + {
5 + }
6 +}
1 +fileFormatVersion: 2
2 +guid: aa62a51ebe4821e4b89a64d267b30a27
3 +timeCreated: 1460563239
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: c1f765b2bd3d2ad49b2677f6478a9ba3
3 +folderAsset: yes
4 +timeCreated: 1466585494
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +using UnityEngine.Rendering;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + using DebugMode = BuiltinDebugViewsModel.Mode;
6 +
7 + public sealed class AmbientOcclusionComponent : PostProcessingComponentCommandBuffer<AmbientOcclusionModel>
8 + {
9 + static class Uniforms
10 + {
11 + internal static readonly int _Intensity = Shader.PropertyToID("_Intensity");
12 + internal static readonly int _Radius = Shader.PropertyToID("_Radius");
13 + internal static readonly int _FogParams = Shader.PropertyToID("_FogParams");
14 + internal static readonly int _Downsample = Shader.PropertyToID("_Downsample");
15 + internal static readonly int _SampleCount = Shader.PropertyToID("_SampleCount");
16 + internal static readonly int _OcclusionTexture1 = Shader.PropertyToID("_OcclusionTexture1");
17 + internal static readonly int _OcclusionTexture2 = Shader.PropertyToID("_OcclusionTexture2");
18 + internal static readonly int _OcclusionTexture = Shader.PropertyToID("_OcclusionTexture");
19 + internal static readonly int _MainTex = Shader.PropertyToID("_MainTex");
20 + internal static readonly int _TempRT = Shader.PropertyToID("_TempRT");
21 + }
22 +
23 + const string k_BlitShaderString = "Hidden/Post FX/Blit";
24 + const string k_ShaderString = "Hidden/Post FX/Ambient Occlusion";
25 +
26 + readonly RenderTargetIdentifier[] m_MRT =
27 + {
28 + BuiltinRenderTextureType.GBuffer0, // Albedo, Occ
29 + BuiltinRenderTextureType.CameraTarget // Ambient
30 + };
31 +
32 + enum OcclusionSource
33 + {
34 + DepthTexture,
35 + DepthNormalsTexture,
36 + GBuffer
37 + }
38 +
39 + OcclusionSource occlusionSource
40 + {
41 + get
42 + {
43 + if (context.isGBufferAvailable && !model.settings.forceForwardCompatibility)
44 + return OcclusionSource.GBuffer;
45 +
46 + if (model.settings.highPrecision && (!context.isGBufferAvailable || model.settings.forceForwardCompatibility))
47 + return OcclusionSource.DepthTexture;
48 +
49 + return OcclusionSource.DepthNormalsTexture;
50 + }
51 + }
52 +
53 + bool ambientOnlySupported
54 + {
55 + get { return context.isHdr && model.settings.ambientOnly && context.isGBufferAvailable && !model.settings.forceForwardCompatibility; }
56 + }
57 +
58 + public override bool active
59 + {
60 + get
61 + {
62 + return model.enabled
63 + && model.settings.intensity > 0f
64 + && !context.interrupted;
65 + }
66 + }
67 +
68 + public override DepthTextureMode GetCameraFlags()
69 + {
70 + var flags = DepthTextureMode.None;
71 +
72 + if (occlusionSource == OcclusionSource.DepthTexture)
73 + flags |= DepthTextureMode.Depth;
74 +
75 + if (occlusionSource != OcclusionSource.GBuffer)
76 + flags |= DepthTextureMode.DepthNormals;
77 +
78 + return flags;
79 + }
80 +
81 + public override string GetName()
82 + {
83 + return "Ambient Occlusion";
84 + }
85 +
86 + public override CameraEvent GetCameraEvent()
87 + {
88 + return ambientOnlySupported && !context.profile.debugViews.IsModeActive(DebugMode.AmbientOcclusion)
89 + ? CameraEvent.BeforeReflections
90 + : CameraEvent.BeforeImageEffectsOpaque;
91 + }
92 +
93 + public override void PopulateCommandBuffer(CommandBuffer cb)
94 + {
95 + var settings = model.settings;
96 +
97 + // Material setup
98 + var blitMaterial = context.materialFactory.Get(k_BlitShaderString);
99 +
100 + var material = context.materialFactory.Get(k_ShaderString);
101 + material.shaderKeywords = null;
102 + material.SetFloat(Uniforms._Intensity, settings.intensity);
103 + material.SetFloat(Uniforms._Radius, settings.radius);
104 + material.SetFloat(Uniforms._Downsample, settings.downsampling ? 0.5f : 1f);
105 + material.SetInt(Uniforms._SampleCount, (int)settings.sampleCount);
106 +
107 + if (!context.isGBufferAvailable && RenderSettings.fog)
108 + {
109 + material.SetVector(Uniforms._FogParams, new Vector3(RenderSettings.fogDensity, RenderSettings.fogStartDistance, RenderSettings.fogEndDistance));
110 +
111 + switch (RenderSettings.fogMode)
112 + {
113 + case FogMode.Linear:
114 + material.EnableKeyword("FOG_LINEAR");
115 + break;
116 + case FogMode.Exponential:
117 + material.EnableKeyword("FOG_EXP");
118 + break;
119 + case FogMode.ExponentialSquared:
120 + material.EnableKeyword("FOG_EXP2");
121 + break;
122 + }
123 + }
124 + else
125 + {
126 + material.EnableKeyword("FOG_OFF");
127 + }
128 +
129 + int tw = context.width;
130 + int th = context.height;
131 + int ts = settings.downsampling ? 2 : 1;
132 + const RenderTextureFormat kFormat = RenderTextureFormat.ARGB32;
133 + const RenderTextureReadWrite kRWMode = RenderTextureReadWrite.Linear;
134 + const FilterMode kFilter = FilterMode.Bilinear;
135 +
136 + // AO buffer
137 + var rtMask = Uniforms._OcclusionTexture1;
138 + cb.GetTemporaryRT(rtMask, tw / ts, th / ts, 0, kFilter, kFormat, kRWMode);
139 +
140 + // AO estimation
141 + cb.Blit((Texture)null, rtMask, material, (int)occlusionSource);
142 +
143 + // Blur buffer
144 + var rtBlur = Uniforms._OcclusionTexture2;
145 +
146 + // Separable blur (horizontal pass)
147 + cb.GetTemporaryRT(rtBlur, tw, th, 0, kFilter, kFormat, kRWMode);
148 + cb.SetGlobalTexture(Uniforms._MainTex, rtMask);
149 + cb.Blit(rtMask, rtBlur, material, occlusionSource == OcclusionSource.GBuffer ? 4 : 3);
150 + cb.ReleaseTemporaryRT(rtMask);
151 +
152 + // Separable blur (vertical pass)
153 + rtMask = Uniforms._OcclusionTexture;
154 + cb.GetTemporaryRT(rtMask, tw, th, 0, kFilter, kFormat, kRWMode);
155 + cb.SetGlobalTexture(Uniforms._MainTex, rtBlur);
156 + cb.Blit(rtBlur, rtMask, material, 5);
157 + cb.ReleaseTemporaryRT(rtBlur);
158 +
159 + if (context.profile.debugViews.IsModeActive(DebugMode.AmbientOcclusion))
160 + {
161 + cb.SetGlobalTexture(Uniforms._MainTex, rtMask);
162 + cb.Blit(rtMask, BuiltinRenderTextureType.CameraTarget, material, 8);
163 + context.Interrupt();
164 + }
165 + else if (ambientOnlySupported)
166 + {
167 + cb.SetRenderTarget(m_MRT, BuiltinRenderTextureType.CameraTarget);
168 + cb.DrawMesh(GraphicsUtils.quad, Matrix4x4.identity, material, 0, 7);
169 + }
170 + else
171 + {
172 + var fbFormat = context.isHdr ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default;
173 +
174 + int tempRT = Uniforms._TempRT;
175 + cb.GetTemporaryRT(tempRT, context.width, context.height, 0, FilterMode.Bilinear, fbFormat);
176 + cb.Blit(BuiltinRenderTextureType.CameraTarget, tempRT, blitMaterial, 0);
177 + cb.SetGlobalTexture(Uniforms._MainTex, tempRT);
178 + cb.Blit(tempRT, BuiltinRenderTextureType.CameraTarget, material, 6);
179 + cb.ReleaseTemporaryRT(tempRT);
180 + }
181 +
182 + cb.ReleaseTemporaryRT(rtMask);
183 + }
184 + }
185 +}
1 +fileFormatVersion: 2
2 +guid: c6e33ce72d3776b408121f946283403d
3 +timeCreated: 1467275948
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public sealed class BloomComponent : PostProcessingComponentRenderTexture<BloomModel>
4 + {
5 + static class Uniforms
6 + {
7 + internal static readonly int _AutoExposure = Shader.PropertyToID("_AutoExposure");
8 + internal static readonly int _Threshold = Shader.PropertyToID("_Threshold");
9 + internal static readonly int _Curve = Shader.PropertyToID("_Curve");
10 + internal static readonly int _PrefilterOffs = Shader.PropertyToID("_PrefilterOffs");
11 + internal static readonly int _SampleScale = Shader.PropertyToID("_SampleScale");
12 + internal static readonly int _BaseTex = Shader.PropertyToID("_BaseTex");
13 + internal static readonly int _BloomTex = Shader.PropertyToID("_BloomTex");
14 + internal static readonly int _Bloom_Settings = Shader.PropertyToID("_Bloom_Settings");
15 + internal static readonly int _Bloom_DirtTex = Shader.PropertyToID("_Bloom_DirtTex");
16 + internal static readonly int _Bloom_DirtIntensity = Shader.PropertyToID("_Bloom_DirtIntensity");
17 + }
18 +
19 + const int k_MaxPyramidBlurLevel = 16;
20 + readonly RenderTexture[] m_BlurBuffer1 = new RenderTexture[k_MaxPyramidBlurLevel];
21 + readonly RenderTexture[] m_BlurBuffer2 = new RenderTexture[k_MaxPyramidBlurLevel];
22 +
23 + public override bool active
24 + {
25 + get
26 + {
27 + return model.enabled
28 + && model.settings.bloom.intensity > 0f
29 + && !context.interrupted;
30 + }
31 + }
32 +
33 + public void Prepare(RenderTexture source, Material uberMaterial, Texture autoExposure)
34 + {
35 + var bloom = model.settings.bloom;
36 + var lensDirt = model.settings.lensDirt;
37 + var material = context.materialFactory.Get("Hidden/Post FX/Bloom");
38 + material.shaderKeywords = null;
39 +
40 + // Apply auto exposure before the prefiltering pass
41 + material.SetTexture(Uniforms._AutoExposure, autoExposure);
42 +
43 + // Do bloom on a half-res buffer, full-res doesn't bring much and kills performances on
44 + // fillrate limited platforms
45 + var tw = context.width / 2;
46 + var th = context.height / 2;
47 +
48 + // Blur buffer format
49 + // TODO: Extend the use of RGBM to the whole chain for mobile platforms
50 + var useRGBM = Application.isMobilePlatform;
51 + var rtFormat = useRGBM
52 + ? RenderTextureFormat.Default
53 + : RenderTextureFormat.DefaultHDR;
54 +
55 + // Determine the iteration count
56 + float logh = Mathf.Log(th, 2f) + bloom.radius - 8f;
57 + int logh_i = (int)logh;
58 + int iterations = Mathf.Clamp(logh_i, 1, k_MaxPyramidBlurLevel);
59 +
60 + // Uupdate the shader properties
61 + float lthresh = bloom.thresholdLinear;
62 + material.SetFloat(Uniforms._Threshold, lthresh);
63 +
64 + float knee = lthresh * bloom.softKnee + 1e-5f;
65 + var curve = new Vector3(lthresh - knee, knee * 2f, 0.25f / knee);
66 + material.SetVector(Uniforms._Curve, curve);
67 +
68 + material.SetFloat(Uniforms._PrefilterOffs, bloom.antiFlicker ? -0.5f : 0f);
69 +
70 + float sampleScale = 0.5f + logh - logh_i;
71 + material.SetFloat(Uniforms._SampleScale, sampleScale);
72 +
73 + // TODO: Probably can disable antiFlicker if TAA is enabled - need to do some testing
74 + if (bloom.antiFlicker)
75 + material.EnableKeyword("ANTI_FLICKER");
76 +
77 + // Prefilter pass
78 + var prefiltered = context.renderTextureFactory.Get(tw, th, 0, rtFormat);
79 + Graphics.Blit(source, prefiltered, material, 0);
80 +
81 + // Construct a mip pyramid
82 + var last = prefiltered;
83 +
84 + for (int level = 0; level < iterations; level++)
85 + {
86 + m_BlurBuffer1[level] = context.renderTextureFactory.Get(
87 + last.width / 2, last.height / 2, 0, rtFormat
88 + );
89 +
90 + int pass = (level == 0) ? 1 : 2;
91 + Graphics.Blit(last, m_BlurBuffer1[level], material, pass);
92 +
93 + last = m_BlurBuffer1[level];
94 + }
95 +
96 + // Upsample and combine loop
97 + for (int level = iterations - 2; level >= 0; level--)
98 + {
99 + var baseTex = m_BlurBuffer1[level];
100 + material.SetTexture(Uniforms._BaseTex, baseTex);
101 +
102 + m_BlurBuffer2[level] = context.renderTextureFactory.Get(
103 + baseTex.width, baseTex.height, 0, rtFormat
104 + );
105 +
106 + Graphics.Blit(last, m_BlurBuffer2[level], material, 3);
107 + last = m_BlurBuffer2[level];
108 + }
109 +
110 + var bloomTex = last;
111 +
112 + // Release the temporary buffers
113 + for (int i = 0; i < k_MaxPyramidBlurLevel; i++)
114 + {
115 + if (m_BlurBuffer1[i] != null)
116 + context.renderTextureFactory.Release(m_BlurBuffer1[i]);
117 +
118 + if (m_BlurBuffer2[i] != null && m_BlurBuffer2[i] != bloomTex)
119 + context.renderTextureFactory.Release(m_BlurBuffer2[i]);
120 +
121 + m_BlurBuffer1[i] = null;
122 + m_BlurBuffer2[i] = null;
123 + }
124 +
125 + context.renderTextureFactory.Release(prefiltered);
126 +
127 + // Push everything to the uber material
128 + uberMaterial.SetTexture(Uniforms._BloomTex, bloomTex);
129 + uberMaterial.SetVector(Uniforms._Bloom_Settings, new Vector2(sampleScale, bloom.intensity));
130 +
131 + if (lensDirt.intensity > 0f && lensDirt.texture != null)
132 + {
133 + uberMaterial.SetTexture(Uniforms._Bloom_DirtTex, lensDirt.texture);
134 + uberMaterial.SetFloat(Uniforms._Bloom_DirtIntensity, lensDirt.intensity);
135 + uberMaterial.EnableKeyword("BLOOM_LENS_DIRT");
136 + }
137 + else
138 + {
139 + uberMaterial.EnableKeyword("BLOOM");
140 + }
141 + }
142 + }
143 +}
1 +fileFormatVersion: 2
2 +guid: acd4204a794b09048b928b1e987500c5
3 +timeCreated: 1473089954
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System.Collections.Generic;
2 +using UnityEngine.Rendering;
3 +
4 +namespace UnityEngine.PostProcessing
5 +{
6 + using Mode = BuiltinDebugViewsModel.Mode;
7 +
8 + public sealed class BuiltinDebugViewsComponent : PostProcessingComponentCommandBuffer<BuiltinDebugViewsModel>
9 + {
10 + static class Uniforms
11 + {
12 + internal static readonly int _DepthScale = Shader.PropertyToID("_DepthScale");
13 + internal static readonly int _TempRT = Shader.PropertyToID("_TempRT");
14 + internal static readonly int _Opacity = Shader.PropertyToID("_Opacity");
15 + internal static readonly int _MainTex = Shader.PropertyToID("_MainTex");
16 + internal static readonly int _TempRT2 = Shader.PropertyToID("_TempRT2");
17 + internal static readonly int _Amplitude = Shader.PropertyToID("_Amplitude");
18 + internal static readonly int _Scale = Shader.PropertyToID("_Scale");
19 + }
20 +
21 + const string k_ShaderString = "Hidden/Post FX/Builtin Debug Views";
22 +
23 + enum Pass
24 + {
25 + Depth,
26 + Normals,
27 + MovecOpacity,
28 + MovecImaging,
29 + MovecArrows
30 + }
31 +
32 + ArrowArray m_Arrows;
33 +
34 + class ArrowArray
35 + {
36 + public Mesh mesh { get; private set; }
37 +
38 + public int columnCount { get; private set; }
39 + public int rowCount { get; private set; }
40 +
41 + public void BuildMesh(int columns, int rows)
42 + {
43 + // Base shape
44 + var arrow = new Vector3[6]
45 + {
46 + new Vector3(0f, 0f, 0f),
47 + new Vector3(0f, 1f, 0f),
48 + new Vector3(0f, 1f, 0f),
49 + new Vector3(-1f, 1f, 0f),
50 + new Vector3(0f, 1f, 0f),
51 + new Vector3(1f, 1f, 0f)
52 + };
53 +
54 + // make the vertex array
55 + int vcount = 6 * columns * rows;
56 + var vertices = new List<Vector3>(vcount);
57 + var uvs = new List<Vector2>(vcount);
58 +
59 + for (int iy = 0; iy < rows; iy++)
60 + {
61 + for (int ix = 0; ix < columns; ix++)
62 + {
63 + var uv = new Vector2(
64 + (0.5f + ix) / columns,
65 + (0.5f + iy) / rows
66 + );
67 +
68 + for (int i = 0; i < 6; i++)
69 + {
70 + vertices.Add(arrow[i]);
71 + uvs.Add(uv);
72 + }
73 + }
74 + }
75 +
76 + // make the index array
77 + var indices = new int[vcount];
78 +
79 + for (int i = 0; i < vcount; i++)
80 + indices[i] = i;
81 +
82 + // initialize the mesh object
83 + mesh = new Mesh { hideFlags = HideFlags.DontSave };
84 + mesh.SetVertices(vertices);
85 + mesh.SetUVs(0, uvs);
86 + mesh.SetIndices(indices, MeshTopology.Lines, 0);
87 + mesh.UploadMeshData(true);
88 +
89 + // update the properties
90 + columnCount = columns;
91 + rowCount = rows;
92 + }
93 +
94 + public void Release()
95 + {
96 + GraphicsUtils.Destroy(mesh);
97 + mesh = null;
98 + }
99 + }
100 +
101 + public override bool active
102 + {
103 + get
104 + {
105 + return model.IsModeActive(Mode.Depth)
106 + || model.IsModeActive(Mode.Normals)
107 + || model.IsModeActive(Mode.MotionVectors);
108 + }
109 + }
110 +
111 + public override DepthTextureMode GetCameraFlags()
112 + {
113 + var mode = model.settings.mode;
114 + var flags = DepthTextureMode.None;
115 +
116 + switch (mode)
117 + {
118 + case Mode.Normals:
119 + flags |= DepthTextureMode.DepthNormals;
120 + break;
121 + case Mode.MotionVectors:
122 + flags |= DepthTextureMode.MotionVectors | DepthTextureMode.Depth;
123 + break;
124 + case Mode.Depth:
125 + flags |= DepthTextureMode.Depth;
126 + break;
127 + }
128 +
129 + return flags;
130 + }
131 +
132 + public override CameraEvent GetCameraEvent()
133 + {
134 + return model.settings.mode == Mode.MotionVectors
135 + ? CameraEvent.BeforeImageEffects
136 + : CameraEvent.BeforeImageEffectsOpaque;
137 + }
138 +
139 + public override string GetName()
140 + {
141 + return "Builtin Debug Views";
142 + }
143 +
144 + public override void PopulateCommandBuffer(CommandBuffer cb)
145 + {
146 + var settings = model.settings;
147 + var material = context.materialFactory.Get(k_ShaderString);
148 + material.shaderKeywords = null;
149 +
150 + if (context.isGBufferAvailable)
151 + material.EnableKeyword("SOURCE_GBUFFER");
152 +
153 + switch (settings.mode)
154 + {
155 + case Mode.Depth:
156 + DepthPass(cb);
157 + break;
158 + case Mode.Normals:
159 + DepthNormalsPass(cb);
160 + break;
161 + case Mode.MotionVectors:
162 + MotionVectorsPass(cb);
163 + break;
164 + }
165 +
166 + context.Interrupt();
167 + }
168 +
169 + void DepthPass(CommandBuffer cb)
170 + {
171 + var material = context.materialFactory.Get(k_ShaderString);
172 + var settings = model.settings.depth;
173 +
174 + cb.SetGlobalFloat(Uniforms._DepthScale, 1f / settings.scale);
175 + cb.Blit((Texture)null, BuiltinRenderTextureType.CameraTarget, material, (int)Pass.Depth);
176 + }
177 +
178 + void DepthNormalsPass(CommandBuffer cb)
179 + {
180 + var material = context.materialFactory.Get(k_ShaderString);
181 + cb.Blit((Texture)null, BuiltinRenderTextureType.CameraTarget, material, (int)Pass.Normals);
182 + }
183 +
184 + void MotionVectorsPass(CommandBuffer cb)
185 + {
186 +#if UNITY_EDITOR
187 + // Don't render motion vectors preview when the editor is not playing as it can in some
188 + // cases results in ugly artifacts (i.e. when resizing the game view).
189 + if (!Application.isPlaying)
190 + return;
191 +#endif
192 +
193 + var material = context.materialFactory.Get(k_ShaderString);
194 + var settings = model.settings.motionVectors;
195 +
196 + // Blit the original source image
197 + int tempRT = Uniforms._TempRT;
198 + cb.GetTemporaryRT(tempRT, context.width, context.height, 0, FilterMode.Bilinear);
199 + cb.SetGlobalFloat(Uniforms._Opacity, settings.sourceOpacity);
200 + cb.SetGlobalTexture(Uniforms._MainTex, BuiltinRenderTextureType.CameraTarget);
201 + cb.Blit(BuiltinRenderTextureType.CameraTarget, tempRT, material, (int)Pass.MovecOpacity);
202 +
203 + // Motion vectors (imaging)
204 + if (settings.motionImageOpacity > 0f && settings.motionImageAmplitude > 0f)
205 + {
206 + int tempRT2 = Uniforms._TempRT2;
207 + cb.GetTemporaryRT(tempRT2, context.width, context.height, 0, FilterMode.Bilinear);
208 + cb.SetGlobalFloat(Uniforms._Opacity, settings.motionImageOpacity);
209 + cb.SetGlobalFloat(Uniforms._Amplitude, settings.motionImageAmplitude);
210 + cb.SetGlobalTexture(Uniforms._MainTex, tempRT);
211 + cb.Blit(tempRT, tempRT2, material, (int)Pass.MovecImaging);
212 + cb.ReleaseTemporaryRT(tempRT);
213 + tempRT = tempRT2;
214 + }
215 +
216 + // Motion vectors (arrows)
217 + if (settings.motionVectorsOpacity > 0f && settings.motionVectorsAmplitude > 0f)
218 + {
219 + PrepareArrows();
220 +
221 + float sy = 1f / settings.motionVectorsResolution;
222 + float sx = sy * context.height / context.width;
223 +
224 + cb.SetGlobalVector(Uniforms._Scale, new Vector2(sx, sy));
225 + cb.SetGlobalFloat(Uniforms._Opacity, settings.motionVectorsOpacity);
226 + cb.SetGlobalFloat(Uniforms._Amplitude, settings.motionVectorsAmplitude);
227 + cb.DrawMesh(m_Arrows.mesh, Matrix4x4.identity, material, 0, (int)Pass.MovecArrows);
228 + }
229 +
230 + cb.SetGlobalTexture(Uniforms._MainTex, tempRT);
231 + cb.Blit(tempRT, BuiltinRenderTextureType.CameraTarget);
232 + cb.ReleaseTemporaryRT(tempRT);
233 + }
234 +
235 + void PrepareArrows()
236 + {
237 + int row = model.settings.motionVectors.motionVectorsResolution;
238 + int col = row * Screen.width / Screen.height;
239 +
240 + if (m_Arrows == null)
241 + m_Arrows = new ArrowArray();
242 +
243 + if (m_Arrows.columnCount != col || m_Arrows.rowCount != row)
244 + {
245 + m_Arrows.Release();
246 + m_Arrows.BuildMesh(col, row);
247 + }
248 + }
249 +
250 + public override void OnDisable()
251 + {
252 + if (m_Arrows != null)
253 + m_Arrows.Release();
254 +
255 + m_Arrows = null;
256 + }
257 + }
258 +}
1 +fileFormatVersion: 2
2 +guid: fd834b6165e82e64f9da2d4ed9f4e236
3 +timeCreated: 1473163679
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public sealed class ChromaticAberrationComponent : PostProcessingComponentRenderTexture<ChromaticAberrationModel>
4 + {
5 + static class Uniforms
6 + {
7 + internal static readonly int _ChromaticAberration_Amount = Shader.PropertyToID("_ChromaticAberration_Amount");
8 + internal static readonly int _ChromaticAberration_Spectrum = Shader.PropertyToID("_ChromaticAberration_Spectrum");
9 + }
10 +
11 + Texture2D m_SpectrumLut;
12 +
13 + public override bool active
14 + {
15 + get
16 + {
17 + return model.enabled
18 + && model.settings.intensity > 0f
19 + && !context.interrupted;
20 + }
21 + }
22 +
23 + public override void OnDisable()
24 + {
25 + GraphicsUtils.Destroy(m_SpectrumLut);
26 + m_SpectrumLut = null;
27 + }
28 +
29 + public override void Prepare(Material uberMaterial)
30 + {
31 + var settings = model.settings;
32 + var spectralLut = settings.spectralTexture;
33 +
34 + if (spectralLut == null)
35 + {
36 + if (m_SpectrumLut == null)
37 + {
38 + m_SpectrumLut = new Texture2D(3, 1, TextureFormat.RGB24, false)
39 + {
40 + name = "Chromatic Aberration Spectrum Lookup",
41 + filterMode = FilterMode.Bilinear,
42 + wrapMode = TextureWrapMode.Clamp,
43 + anisoLevel = 0,
44 + hideFlags = HideFlags.DontSave
45 + };
46 +
47 + var pixels = new Color[3];
48 + pixels[0] = new Color(1f, 0f, 0f);
49 + pixels[1] = new Color(0f, 1f, 0f);
50 + pixels[2] = new Color(0f, 0f, 1f);
51 + m_SpectrumLut.SetPixels(pixels);
52 + m_SpectrumLut.Apply();
53 + }
54 +
55 + spectralLut = m_SpectrumLut;
56 + }
57 +
58 + uberMaterial.EnableKeyword("CHROMATIC_ABERRATION");
59 + uberMaterial.SetFloat(Uniforms._ChromaticAberration_Amount, settings.intensity * 0.03f);
60 + uberMaterial.SetTexture(Uniforms._ChromaticAberration_Spectrum, spectralLut);
61 + }
62 + }
63 +}
1 +fileFormatVersion: 2
2 +guid: b9c65642df654a84d84ded1b07448a4c
3 +timeCreated: 1473085971
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + using DebugMode = BuiltinDebugViewsModel.Mode;
4 +
5 + public sealed class ColorGradingComponent : PostProcessingComponentRenderTexture<ColorGradingModel>
6 + {
7 + static class Uniforms
8 + {
9 + internal static readonly int _LutParams = Shader.PropertyToID("_LutParams");
10 + internal static readonly int _NeutralTonemapperParams1 = Shader.PropertyToID("_NeutralTonemapperParams1");
11 + internal static readonly int _NeutralTonemapperParams2 = Shader.PropertyToID("_NeutralTonemapperParams2");
12 + internal static readonly int _HueShift = Shader.PropertyToID("_HueShift");
13 + internal static readonly int _Saturation = Shader.PropertyToID("_Saturation");
14 + internal static readonly int _Contrast = Shader.PropertyToID("_Contrast");
15 + internal static readonly int _Balance = Shader.PropertyToID("_Balance");
16 + internal static readonly int _Lift = Shader.PropertyToID("_Lift");
17 + internal static readonly int _InvGamma = Shader.PropertyToID("_InvGamma");
18 + internal static readonly int _Gain = Shader.PropertyToID("_Gain");
19 + internal static readonly int _Slope = Shader.PropertyToID("_Slope");
20 + internal static readonly int _Power = Shader.PropertyToID("_Power");
21 + internal static readonly int _Offset = Shader.PropertyToID("_Offset");
22 + internal static readonly int _ChannelMixerRed = Shader.PropertyToID("_ChannelMixerRed");
23 + internal static readonly int _ChannelMixerGreen = Shader.PropertyToID("_ChannelMixerGreen");
24 + internal static readonly int _ChannelMixerBlue = Shader.PropertyToID("_ChannelMixerBlue");
25 + internal static readonly int _Curves = Shader.PropertyToID("_Curves");
26 + internal static readonly int _LogLut = Shader.PropertyToID("_LogLut");
27 + internal static readonly int _LogLut_Params = Shader.PropertyToID("_LogLut_Params");
28 + internal static readonly int _ExposureEV = Shader.PropertyToID("_ExposureEV");
29 + }
30 +
31 + const int k_InternalLogLutSize = 32;
32 + const int k_CurvePrecision = 128;
33 + const float k_CurveStep = 1f / k_CurvePrecision;
34 +
35 + Texture2D m_GradingCurves;
36 + Color[] m_pixels = new Color[k_CurvePrecision * 2];
37 +
38 + public override bool active
39 + {
40 + get
41 + {
42 + return model.enabled
43 + && !context.interrupted;
44 + }
45 + }
46 +
47 + // An analytical model of chromaticity of the standard illuminant, by Judd et al.
48 + // http://en.wikipedia.org/wiki/Standard_illuminant#Illuminant_series_D
49 + // Slightly modifed to adjust it with the D65 white point (x=0.31271, y=0.32902).
50 + float StandardIlluminantY(float x)
51 + {
52 + return 2.87f * x - 3f * x * x - 0.27509507f;
53 + }
54 +
55 + // CIE xy chromaticity to CAT02 LMS.
56 + // http://en.wikipedia.org/wiki/LMS_color_space#CAT02
57 + Vector3 CIExyToLMS(float x, float y)
58 + {
59 + float Y = 1f;
60 + float X = Y * x / y;
61 + float Z = Y * (1f - x - y) / y;
62 +
63 + float L = 0.7328f * X + 0.4296f * Y - 0.1624f * Z;
64 + float M = -0.7036f * X + 1.6975f * Y + 0.0061f * Z;
65 + float S = 0.0030f * X + 0.0136f * Y + 0.9834f * Z;
66 +
67 + return new Vector3(L, M, S);
68 + }
69 +
70 + Vector3 CalculateColorBalance(float temperature, float tint)
71 + {
72 + // Range ~[-1.8;1.8] ; using higher ranges is unsafe
73 + float t1 = temperature / 55f;
74 + float t2 = tint / 55f;
75 +
76 + // Get the CIE xy chromaticity of the reference white point.
77 + // Note: 0.31271 = x value on the D65 white point
78 + float x = 0.31271f - t1 * (t1 < 0f ? 0.1f : 0.05f);
79 + float y = StandardIlluminantY(x) + t2 * 0.05f;
80 +
81 + // Calculate the coefficients in the LMS space.
82 + var w1 = new Vector3(0.949237f, 1.03542f, 1.08728f); // D65 white point
83 + var w2 = CIExyToLMS(x, y);
84 + return new Vector3(w1.x / w2.x, w1.y / w2.y, w1.z / w2.z);
85 + }
86 +
87 + static Color NormalizeColor(Color c)
88 + {
89 + float sum = (c.r + c.g + c.b) / 3f;
90 +
91 + if (Mathf.Approximately(sum, 0f))
92 + return new Color(1f, 1f, 1f, c.a);
93 +
94 + return new Color
95 + {
96 + r = c.r / sum,
97 + g = c.g / sum,
98 + b = c.b / sum,
99 + a = c.a
100 + };
101 + }
102 +
103 + static Vector3 ClampVector(Vector3 v, float min, float max)
104 + {
105 + return new Vector3(
106 + Mathf.Clamp(v.x, min, max),
107 + Mathf.Clamp(v.y, min, max),
108 + Mathf.Clamp(v.z, min, max)
109 + );
110 + }
111 +
112 + public static Vector3 GetLiftValue(Color lift)
113 + {
114 + const float kLiftScale = 0.1f;
115 +
116 + var nLift = NormalizeColor(lift);
117 + float avgLift = (nLift.r + nLift.g + nLift.b) / 3f;
118 +
119 + // Getting some artifacts when going into the negatives using a very low offset (lift.a) with non ACES-tonemapping
120 + float liftR = (nLift.r - avgLift) * kLiftScale + lift.a;
121 + float liftG = (nLift.g - avgLift) * kLiftScale + lift.a;
122 + float liftB = (nLift.b - avgLift) * kLiftScale + lift.a;
123 +
124 + return ClampVector(new Vector3(liftR, liftG, liftB), -1f, 1f);
125 + }
126 +
127 + public static Vector3 GetGammaValue(Color gamma)
128 + {
129 + const float kGammaScale = 0.5f;
130 + const float kMinGamma = 0.01f;
131 +
132 + var nGamma = NormalizeColor(gamma);
133 + float avgGamma = (nGamma.r + nGamma.g + nGamma.b) / 3f;
134 +
135 + gamma.a *= gamma.a < 0f ? 0.8f : 5f;
136 + float gammaR = Mathf.Pow(2f, (nGamma.r - avgGamma) * kGammaScale) + gamma.a;
137 + float gammaG = Mathf.Pow(2f, (nGamma.g - avgGamma) * kGammaScale) + gamma.a;
138 + float gammaB = Mathf.Pow(2f, (nGamma.b - avgGamma) * kGammaScale) + gamma.a;
139 +
140 + float invGammaR = 1f / Mathf.Max(kMinGamma, gammaR);
141 + float invGammaG = 1f / Mathf.Max(kMinGamma, gammaG);
142 + float invGammaB = 1f / Mathf.Max(kMinGamma, gammaB);
143 +
144 + return ClampVector(new Vector3(invGammaR, invGammaG, invGammaB), 0f, 5f);
145 + }
146 +
147 + public static Vector3 GetGainValue(Color gain)
148 + {
149 + const float kGainScale = 0.5f;
150 +
151 + var nGain = NormalizeColor(gain);
152 + float avgGain = (nGain.r + nGain.g + nGain.b) / 3f;
153 +
154 + gain.a *= gain.a > 0f ? 3f : 1f;
155 + float gainR = Mathf.Pow(2f, (nGain.r - avgGain) * kGainScale) + gain.a;
156 + float gainG = Mathf.Pow(2f, (nGain.g - avgGain) * kGainScale) + gain.a;
157 + float gainB = Mathf.Pow(2f, (nGain.b - avgGain) * kGainScale) + gain.a;
158 +
159 + return ClampVector(new Vector3(gainR, gainG, gainB), 0f, 4f);
160 + }
161 +
162 + public static void CalculateLiftGammaGain(Color lift, Color gamma, Color gain, out Vector3 outLift, out Vector3 outGamma, out Vector3 outGain)
163 + {
164 + outLift = GetLiftValue(lift);
165 + outGamma = GetGammaValue(gamma);
166 + outGain = GetGainValue(gain);
167 + }
168 +
169 + public static Vector3 GetSlopeValue(Color slope)
170 + {
171 + const float kSlopeScale = 0.1f;
172 +
173 + var nSlope = NormalizeColor(slope);
174 + float avgSlope = (nSlope.r + nSlope.g + nSlope.b) / 3f;
175 +
176 + slope.a *= 0.5f;
177 + float slopeR = (nSlope.r - avgSlope) * kSlopeScale + slope.a + 1f;
178 + float slopeG = (nSlope.g - avgSlope) * kSlopeScale + slope.a + 1f;
179 + float slopeB = (nSlope.b - avgSlope) * kSlopeScale + slope.a + 1f;
180 +
181 + return ClampVector(new Vector3(slopeR, slopeG, slopeB), 0f, 2f);
182 + }
183 +
184 + public static Vector3 GetPowerValue(Color power)
185 + {
186 + const float kPowerScale = 0.1f;
187 + const float minPower = 0.01f;
188 +
189 + var nPower = NormalizeColor(power);
190 + float avgPower = (nPower.r + nPower.g + nPower.b) / 3f;
191 +
192 + power.a *= 0.5f;
193 + float powerR = (nPower.r - avgPower) * kPowerScale + power.a + 1f;
194 + float powerG = (nPower.g - avgPower) * kPowerScale + power.a + 1f;
195 + float powerB = (nPower.b - avgPower) * kPowerScale + power.a + 1f;
196 +
197 + float invPowerR = 1f / Mathf.Max(minPower, powerR);
198 + float invPowerG = 1f / Mathf.Max(minPower, powerG);
199 + float invPowerB = 1f / Mathf.Max(minPower, powerB);
200 +
201 + return ClampVector(new Vector3(invPowerR, invPowerG, invPowerB), 0.5f, 2.5f);
202 + }
203 +
204 + public static Vector3 GetOffsetValue(Color offset)
205 + {
206 + const float kOffsetScale = 0.05f;
207 +
208 + var nOffset = NormalizeColor(offset);
209 + float avgOffset = (nOffset.r + nOffset.g + nOffset.b) / 3f;
210 +
211 + offset.a *= 0.5f;
212 + float offsetR = (nOffset.r - avgOffset) * kOffsetScale + offset.a;
213 + float offsetG = (nOffset.g - avgOffset) * kOffsetScale + offset.a;
214 + float offsetB = (nOffset.b - avgOffset) * kOffsetScale + offset.a;
215 +
216 + return ClampVector(new Vector3(offsetR, offsetG, offsetB), -0.8f, 0.8f);
217 + }
218 +
219 + public static void CalculateSlopePowerOffset(Color slope, Color power, Color offset, out Vector3 outSlope, out Vector3 outPower, out Vector3 outOffset)
220 + {
221 + outSlope = GetSlopeValue(slope);
222 + outPower = GetPowerValue(power);
223 + outOffset = GetOffsetValue(offset);
224 + }
225 +
226 + TextureFormat GetCurveFormat()
227 + {
228 + if (SystemInfo.SupportsTextureFormat(TextureFormat.RGBAHalf))
229 + return TextureFormat.RGBAHalf;
230 +
231 + return TextureFormat.RGBA32;
232 + }
233 +
234 + Texture2D GetCurveTexture()
235 + {
236 + if (m_GradingCurves == null)
237 + {
238 + m_GradingCurves = new Texture2D(k_CurvePrecision, 2, GetCurveFormat(), false, true)
239 + {
240 + name = "Internal Curves Texture",
241 + hideFlags = HideFlags.DontSave,
242 + anisoLevel = 0,
243 + wrapMode = TextureWrapMode.Clamp,
244 + filterMode = FilterMode.Bilinear
245 + };
246 + }
247 +
248 + var curves = model.settings.curves;
249 + curves.hueVShue.Cache();
250 + curves.hueVSsat.Cache();
251 +
252 + for (int i = 0; i < k_CurvePrecision; i++)
253 + {
254 + float t = i * k_CurveStep;
255 +
256 + // HSL
257 + float x = curves.hueVShue.Evaluate(t);
258 + float y = curves.hueVSsat.Evaluate(t);
259 + float z = curves.satVSsat.Evaluate(t);
260 + float w = curves.lumVSsat.Evaluate(t);
261 + m_pixels[i] = new Color(x, y, z, w);
262 +
263 + // YRGB
264 + float m = curves.master.Evaluate(t);
265 + float r = curves.red.Evaluate(t);
266 + float g = curves.green.Evaluate(t);
267 + float b = curves.blue.Evaluate(t);
268 + m_pixels[i + k_CurvePrecision] = new Color(r, g, b, m);
269 + }
270 +
271 + m_GradingCurves.SetPixels(m_pixels);
272 + m_GradingCurves.Apply(false, false);
273 +
274 + return m_GradingCurves;
275 + }
276 +
277 + bool IsLogLutValid(RenderTexture lut)
278 + {
279 + return lut != null && lut.IsCreated() && lut.height == k_InternalLogLutSize;
280 + }
281 +
282 + RenderTextureFormat GetLutFormat()
283 + {
284 + if (SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf))
285 + return RenderTextureFormat.ARGBHalf;
286 +
287 + return RenderTextureFormat.ARGB32;
288 + }
289 +
290 + void GenerateLut()
291 + {
292 + var settings = model.settings;
293 +
294 + if (!IsLogLutValid(model.bakedLut))
295 + {
296 + GraphicsUtils.Destroy(model.bakedLut);
297 +
298 + model.bakedLut = new RenderTexture(k_InternalLogLutSize * k_InternalLogLutSize, k_InternalLogLutSize, 0, GetLutFormat())
299 + {
300 + name = "Color Grading Log LUT",
301 + hideFlags = HideFlags.DontSave,
302 + filterMode = FilterMode.Bilinear,
303 + wrapMode = TextureWrapMode.Clamp,
304 + anisoLevel = 0
305 + };
306 + }
307 +
308 + var lutMaterial = context.materialFactory.Get("Hidden/Post FX/Lut Generator");
309 + lutMaterial.SetVector(Uniforms._LutParams, new Vector4(
310 + k_InternalLogLutSize,
311 + 0.5f / (k_InternalLogLutSize * k_InternalLogLutSize),
312 + 0.5f / k_InternalLogLutSize,
313 + k_InternalLogLutSize / (k_InternalLogLutSize - 1f))
314 + );
315 +
316 + // Tonemapping
317 + lutMaterial.shaderKeywords = null;
318 +
319 + var tonemapping = settings.tonemapping;
320 + switch (tonemapping.tonemapper)
321 + {
322 + case ColorGradingModel.Tonemapper.Neutral:
323 + {
324 + lutMaterial.EnableKeyword("TONEMAPPING_NEUTRAL");
325 +
326 + const float scaleFactor = 20f;
327 + const float scaleFactorHalf = scaleFactor * 0.5f;
328 +
329 + float inBlack = tonemapping.neutralBlackIn * scaleFactor + 1f;
330 + float outBlack = tonemapping.neutralBlackOut * scaleFactorHalf + 1f;
331 + float inWhite = tonemapping.neutralWhiteIn / scaleFactor;
332 + float outWhite = 1f - tonemapping.neutralWhiteOut / scaleFactor;
333 + float blackRatio = inBlack / outBlack;
334 + float whiteRatio = inWhite / outWhite;
335 +
336 + const float a = 0.2f;
337 + float b = Mathf.Max(0f, Mathf.LerpUnclamped(0.57f, 0.37f, blackRatio));
338 + float c = Mathf.LerpUnclamped(0.01f, 0.24f, whiteRatio);
339 + float d = Mathf.Max(0f, Mathf.LerpUnclamped(0.02f, 0.20f, blackRatio));
340 + const float e = 0.02f;
341 + const float f = 0.30f;
342 +
343 + lutMaterial.SetVector(Uniforms._NeutralTonemapperParams1, new Vector4(a, b, c, d));
344 + lutMaterial.SetVector(Uniforms._NeutralTonemapperParams2, new Vector4(e, f, tonemapping.neutralWhiteLevel, tonemapping.neutralWhiteClip / scaleFactorHalf));
345 + break;
346 + }
347 +
348 + case ColorGradingModel.Tonemapper.ACES:
349 + {
350 + lutMaterial.EnableKeyword("TONEMAPPING_FILMIC");
351 + break;
352 + }
353 + }
354 +
355 + // Color balance & basic grading settings
356 + lutMaterial.SetFloat(Uniforms._HueShift, settings.basic.hueShift / 360f);
357 + lutMaterial.SetFloat(Uniforms._Saturation, settings.basic.saturation);
358 + lutMaterial.SetFloat(Uniforms._Contrast, settings.basic.contrast);
359 + lutMaterial.SetVector(Uniforms._Balance, CalculateColorBalance(settings.basic.temperature, settings.basic.tint));
360 +
361 + // Lift / Gamma / Gain
362 + Vector3 lift, gamma, gain;
363 + CalculateLiftGammaGain(
364 + settings.colorWheels.linear.lift,
365 + settings.colorWheels.linear.gamma,
366 + settings.colorWheels.linear.gain,
367 + out lift, out gamma, out gain
368 + );
369 +
370 + lutMaterial.SetVector(Uniforms._Lift, lift);
371 + lutMaterial.SetVector(Uniforms._InvGamma, gamma);
372 + lutMaterial.SetVector(Uniforms._Gain, gain);
373 +
374 + // Slope / Power / Offset
375 + Vector3 slope, power, offset;
376 + CalculateSlopePowerOffset(
377 + settings.colorWheels.log.slope,
378 + settings.colorWheels.log.power,
379 + settings.colorWheels.log.offset,
380 + out slope, out power, out offset
381 + );
382 +
383 + lutMaterial.SetVector(Uniforms._Slope, slope);
384 + lutMaterial.SetVector(Uniforms._Power, power);
385 + lutMaterial.SetVector(Uniforms._Offset, offset);
386 +
387 + // Channel mixer
388 + lutMaterial.SetVector(Uniforms._ChannelMixerRed, settings.channelMixer.red);
389 + lutMaterial.SetVector(Uniforms._ChannelMixerGreen, settings.channelMixer.green);
390 + lutMaterial.SetVector(Uniforms._ChannelMixerBlue, settings.channelMixer.blue);
391 +
392 + // Selective grading & YRGB curves
393 + lutMaterial.SetTexture(Uniforms._Curves, GetCurveTexture());
394 +
395 + // Generate the lut
396 + Graphics.Blit(null, model.bakedLut, lutMaterial, 0);
397 + }
398 +
399 + public override void Prepare(Material uberMaterial)
400 + {
401 + if (model.isDirty || !IsLogLutValid(model.bakedLut))
402 + {
403 + GenerateLut();
404 + model.isDirty = false;
405 + }
406 +
407 + uberMaterial.EnableKeyword(
408 + context.profile.debugViews.IsModeActive(DebugMode.PreGradingLog)
409 + ? "COLOR_GRADING_LOG_VIEW"
410 + : "COLOR_GRADING"
411 + );
412 +
413 + var bakedLut = model.bakedLut;
414 + uberMaterial.SetTexture(Uniforms._LogLut, bakedLut);
415 + uberMaterial.SetVector(Uniforms._LogLut_Params, new Vector3(1f / bakedLut.width, 1f / bakedLut.height, bakedLut.height - 1f));
416 +
417 + float ev = Mathf.Exp(model.settings.basic.postExposure * 0.69314718055994530941723212145818f);
418 + uberMaterial.SetFloat(Uniforms._ExposureEV, ev);
419 + }
420 +
421 + public void OnGUI()
422 + {
423 + var bakedLut = model.bakedLut;
424 + var rect = new Rect(context.viewport.x * Screen.width + 8f, 8f, bakedLut.width, bakedLut.height);
425 + GUI.DrawTexture(rect, bakedLut);
426 + }
427 +
428 + public override void OnDisable()
429 + {
430 + GraphicsUtils.Destroy(m_GradingCurves);
431 + GraphicsUtils.Destroy(model.bakedLut);
432 + m_GradingCurves = null;
433 + model.bakedLut = null;
434 + }
435 + }
436 +}
1 +fileFormatVersion: 2
2 +guid: 9baf73db7c9fc1b478f4a0a1000c86f5
3 +timeCreated: 1473086520
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using UnityEngine.Rendering;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + using DebugMode = BuiltinDebugViewsModel.Mode;
6 +
7 + public sealed class DepthOfFieldComponent : PostProcessingComponentRenderTexture<DepthOfFieldModel>
8 + {
9 + static class Uniforms
10 + {
11 + internal static readonly int _DepthOfFieldTex = Shader.PropertyToID("_DepthOfFieldTex");
12 + internal static readonly int _DepthOfFieldCoCTex = Shader.PropertyToID("_DepthOfFieldCoCTex");
13 + internal static readonly int _Distance = Shader.PropertyToID("_Distance");
14 + internal static readonly int _LensCoeff = Shader.PropertyToID("_LensCoeff");
15 + internal static readonly int _MaxCoC = Shader.PropertyToID("_MaxCoC");
16 + internal static readonly int _RcpMaxCoC = Shader.PropertyToID("_RcpMaxCoC");
17 + internal static readonly int _RcpAspect = Shader.PropertyToID("_RcpAspect");
18 + internal static readonly int _MainTex = Shader.PropertyToID("_MainTex");
19 + internal static readonly int _CoCTex = Shader.PropertyToID("_CoCTex");
20 + internal static readonly int _TaaParams = Shader.PropertyToID("_TaaParams");
21 + internal static readonly int _DepthOfFieldParams = Shader.PropertyToID("_DepthOfFieldParams");
22 + }
23 +
24 + const string k_ShaderString = "Hidden/Post FX/Depth Of Field";
25 +
26 + public override bool active
27 + {
28 + get
29 + {
30 + return model.enabled
31 + && !context.interrupted;
32 + }
33 + }
34 +
35 + public override DepthTextureMode GetCameraFlags()
36 + {
37 + return DepthTextureMode.Depth;
38 + }
39 +
40 + RenderTexture m_CoCHistory;
41 +
42 + // Height of the 35mm full-frame format (36mm x 24mm)
43 + const float k_FilmHeight = 0.024f;
44 +
45 + float CalculateFocalLength()
46 + {
47 + var settings = model.settings;
48 +
49 + if (!settings.useCameraFov)
50 + return settings.focalLength / 1000f;
51 +
52 + float fov = context.camera.fieldOfView * Mathf.Deg2Rad;
53 + return 0.5f * k_FilmHeight / Mathf.Tan(0.5f * fov);
54 + }
55 +
56 + float CalculateMaxCoCRadius(int screenHeight)
57 + {
58 + // Estimate the allowable maximum radius of CoC from the kernel
59 + // size (the equation below was empirically derived).
60 + float radiusInPixels = (float)model.settings.kernelSize * 4f + 6f;
61 +
62 + // Applying a 5% limit to the CoC radius to keep the size of
63 + // TileMax/NeighborMax small enough.
64 + return Mathf.Min(0.05f, radiusInPixels / screenHeight);
65 + }
66 +
67 + bool CheckHistory(int width, int height)
68 + {
69 + return m_CoCHistory != null && m_CoCHistory.IsCreated() &&
70 + m_CoCHistory.width == width && m_CoCHistory.height == height;
71 + }
72 +
73 + RenderTextureFormat SelectFormat(RenderTextureFormat primary, RenderTextureFormat secondary)
74 + {
75 + if (SystemInfo.SupportsRenderTextureFormat(primary)) return primary;
76 + if (SystemInfo.SupportsRenderTextureFormat(secondary)) return secondary;
77 + return RenderTextureFormat.Default;
78 + }
79 +
80 + public void Prepare(RenderTexture source, Material uberMaterial, bool antialiasCoC, Vector2 taaJitter, float taaBlending)
81 + {
82 + var settings = model.settings;
83 + var colorFormat = RenderTextureFormat.DefaultHDR;
84 + var cocFormat = SelectFormat(RenderTextureFormat.R8, RenderTextureFormat.RHalf);
85 +
86 + // Avoid using R8 on OSX with Metal. #896121, https://goo.gl/MgKqu6
87 + #if (UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX) && !UNITY_2017_1_OR_NEWER
88 + if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal)
89 + cocFormat = SelectFormat(RenderTextureFormat.RHalf, RenderTextureFormat.Default);
90 + #endif
91 +
92 + // Material setup
93 + var f = CalculateFocalLength();
94 + var s1 = Mathf.Max(settings.focusDistance, f);
95 + var aspect = (float)source.width / source.height;
96 + var coeff = f * f / (settings.aperture * (s1 - f) * k_FilmHeight * 2);
97 + var maxCoC = CalculateMaxCoCRadius(source.height);
98 +
99 + var material = context.materialFactory.Get(k_ShaderString);
100 + material.SetFloat(Uniforms._Distance, s1);
101 + material.SetFloat(Uniforms._LensCoeff, coeff);
102 + material.SetFloat(Uniforms._MaxCoC, maxCoC);
103 + material.SetFloat(Uniforms._RcpMaxCoC, 1f / maxCoC);
104 + material.SetFloat(Uniforms._RcpAspect, 1f / aspect);
105 +
106 + // CoC calculation pass
107 + var rtCoC = context.renderTextureFactory.Get(context.width, context.height, 0, cocFormat, RenderTextureReadWrite.Linear);
108 + Graphics.Blit(null, rtCoC, material, 0);
109 +
110 + if (antialiasCoC)
111 + {
112 + // CoC temporal filter pass
113 + material.SetTexture(Uniforms._CoCTex, rtCoC);
114 +
115 + var blend = CheckHistory(context.width, context.height) ? taaBlending : 0f;
116 + material.SetVector(Uniforms._TaaParams, new Vector3(taaJitter.x, taaJitter.y, blend));
117 +
118 + var rtFiltered = RenderTexture.GetTemporary(context.width, context.height, 0, cocFormat);
119 + Graphics.Blit(m_CoCHistory, rtFiltered, material, 1);
120 +
121 + context.renderTextureFactory.Release(rtCoC);
122 + if (m_CoCHistory != null) RenderTexture.ReleaseTemporary(m_CoCHistory);
123 +
124 + m_CoCHistory = rtCoC = rtFiltered;
125 + }
126 +
127 + // Downsampling and prefiltering pass
128 + var rt1 = context.renderTextureFactory.Get(context.width / 2, context.height / 2, 0, colorFormat);
129 + material.SetTexture(Uniforms._CoCTex, rtCoC);
130 + Graphics.Blit(source, rt1, material, 2);
131 +
132 + // Bokeh simulation pass
133 + var rt2 = context.renderTextureFactory.Get(context.width / 2, context.height / 2, 0, colorFormat);
134 + Graphics.Blit(rt1, rt2, material, 3 + (int)settings.kernelSize);
135 +
136 + // Postfilter pass
137 + Graphics.Blit(rt2, rt1, material, 7);
138 +
139 + // Give the results to the uber shader.
140 + uberMaterial.SetVector(Uniforms._DepthOfFieldParams, new Vector3(s1, coeff, maxCoC));
141 +
142 + if (context.profile.debugViews.IsModeActive(DebugMode.FocusPlane))
143 + {
144 + uberMaterial.EnableKeyword("DEPTH_OF_FIELD_COC_VIEW");
145 + context.Interrupt();
146 + }
147 + else
148 + {
149 + uberMaterial.SetTexture(Uniforms._DepthOfFieldTex, rt1);
150 + uberMaterial.SetTexture(Uniforms._DepthOfFieldCoCTex, rtCoC);
151 + uberMaterial.EnableKeyword("DEPTH_OF_FIELD");
152 + }
153 +
154 + context.renderTextureFactory.Release(rt2);
155 + }
156 +
157 + public override void OnDisable()
158 + {
159 + if (m_CoCHistory != null)
160 + RenderTexture.ReleaseTemporary(m_CoCHistory);
161 +
162 + m_CoCHistory = null;
163 + }
164 + }
165 +}
1 +fileFormatVersion: 2
2 +guid: d862c8701bf34c342b95cf9058d0b70c
3 +timeCreated: 1468410915
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public sealed class DitheringComponent : PostProcessingComponentRenderTexture<DitheringModel>
4 + {
5 + static class Uniforms
6 + {
7 + internal static readonly int _DitheringTex = Shader.PropertyToID("_DitheringTex");
8 + internal static readonly int _DitheringCoords = Shader.PropertyToID("_DitheringCoords");
9 + }
10 +
11 + public override bool active
12 + {
13 + get
14 + {
15 + return model.enabled
16 + && !context.interrupted;
17 + }
18 + }
19 +
20 + // Holds 64 64x64 Alpha8 textures (256kb total)
21 + Texture2D[] noiseTextures;
22 + int textureIndex = 0;
23 +
24 + const int k_TextureCount = 64;
25 +
26 + public override void OnDisable()
27 + {
28 + noiseTextures = null;
29 + }
30 +
31 + void LoadNoiseTextures()
32 + {
33 + noiseTextures = new Texture2D[k_TextureCount];
34 +
35 + for (int i = 0; i < k_TextureCount; i++)
36 + noiseTextures[i] = Resources.Load<Texture2D>("Bluenoise64/LDR_LLL1_" + i);
37 + }
38 +
39 + public override void Prepare(Material uberMaterial)
40 + {
41 + float rndOffsetX;
42 + float rndOffsetY;
43 +
44 +#if POSTFX_DEBUG_STATIC_DITHERING
45 + textureIndex = 0;
46 + rndOffsetX = 0f;
47 + rndOffsetY = 0f;
48 +#else
49 + if (++textureIndex >= k_TextureCount)
50 + textureIndex = 0;
51 +
52 + rndOffsetX = Random.value;
53 + rndOffsetY = Random.value;
54 +#endif
55 +
56 + if (noiseTextures == null)
57 + LoadNoiseTextures();
58 +
59 + var noiseTex = noiseTextures[textureIndex];
60 +
61 + uberMaterial.EnableKeyword("DITHERING");
62 + uberMaterial.SetTexture(Uniforms._DitheringTex, noiseTex);
63 + uberMaterial.SetVector(Uniforms._DitheringCoords, new Vector4(
64 + (float)context.width / (float)noiseTex.width,
65 + (float)context.height / (float)noiseTex.height,
66 + rndOffsetX,
67 + rndOffsetY
68 + ));
69 + }
70 + }
71 +}
1 +fileFormatVersion: 2
2 +guid: 35ceb4b3cfab56d43a3f0efeb9d68c43
3 +timeCreated: 1485179235
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public sealed class EyeAdaptationComponent : PostProcessingComponentRenderTexture<EyeAdaptationModel>
4 + {
5 + static class Uniforms
6 + {
7 + internal static readonly int _Params = Shader.PropertyToID("_Params");
8 + internal static readonly int _Speed = Shader.PropertyToID("_Speed");
9 + internal static readonly int _ScaleOffsetRes = Shader.PropertyToID("_ScaleOffsetRes");
10 + internal static readonly int _ExposureCompensation = Shader.PropertyToID("_ExposureCompensation");
11 + internal static readonly int _AutoExposure = Shader.PropertyToID("_AutoExposure");
12 + internal static readonly int _DebugWidth = Shader.PropertyToID("_DebugWidth");
13 + }
14 +
15 + ComputeShader m_EyeCompute;
16 + ComputeBuffer m_HistogramBuffer;
17 +
18 + readonly RenderTexture[] m_AutoExposurePool = new RenderTexture[2];
19 + int m_AutoExposurePingPing;
20 + RenderTexture m_CurrentAutoExposure;
21 +
22 + RenderTexture m_DebugHistogram;
23 +
24 + static uint[] s_EmptyHistogramBuffer;
25 +
26 + bool m_FirstFrame = true;
27 +
28 + // Don't forget to update 'EyeAdaptation.cginc' if you change these values !
29 + const int k_HistogramBins = 64;
30 + const int k_HistogramThreadX = 16;
31 + const int k_HistogramThreadY = 16;
32 +
33 + public override bool active
34 + {
35 + get
36 + {
37 + return model.enabled
38 + && SystemInfo.supportsComputeShaders
39 + && !context.interrupted;
40 + }
41 + }
42 +
43 + public void ResetHistory()
44 + {
45 + m_FirstFrame = true;
46 + }
47 +
48 + public override void OnEnable()
49 + {
50 + m_FirstFrame = true;
51 + }
52 +
53 + public override void OnDisable()
54 + {
55 + foreach (var rt in m_AutoExposurePool)
56 + GraphicsUtils.Destroy(rt);
57 +
58 + if (m_HistogramBuffer != null)
59 + m_HistogramBuffer.Release();
60 +
61 + m_HistogramBuffer = null;
62 +
63 + if (m_DebugHistogram != null)
64 + m_DebugHistogram.Release();
65 +
66 + m_DebugHistogram = null;
67 + }
68 +
69 + Vector4 GetHistogramScaleOffsetRes()
70 + {
71 + var settings = model.settings;
72 + float diff = settings.logMax - settings.logMin;
73 + float scale = 1f / diff;
74 + float offset = -settings.logMin * scale;
75 + return new Vector4(scale, offset, Mathf.Floor(context.width / 2f), Mathf.Floor(context.height / 2f));
76 + }
77 +
78 + public Texture Prepare(RenderTexture source, Material uberMaterial)
79 + {
80 + var settings = model.settings;
81 +
82 + // Setup compute
83 + if (m_EyeCompute == null)
84 + m_EyeCompute = Resources.Load<ComputeShader>("Shaders/EyeHistogram");
85 +
86 + var material = context.materialFactory.Get("Hidden/Post FX/Eye Adaptation");
87 + material.shaderKeywords = null;
88 +
89 + if (m_HistogramBuffer == null)
90 + m_HistogramBuffer = new ComputeBuffer(k_HistogramBins, sizeof(uint));
91 +
92 + if (s_EmptyHistogramBuffer == null)
93 + s_EmptyHistogramBuffer = new uint[k_HistogramBins];
94 +
95 + // Downscale the framebuffer, we don't need an absolute precision for auto exposure and it
96 + // helps making it more stable
97 + var scaleOffsetRes = GetHistogramScaleOffsetRes();
98 +
99 + var rt = context.renderTextureFactory.Get((int)scaleOffsetRes.z, (int)scaleOffsetRes.w, 0, source.format);
100 + Graphics.Blit(source, rt);
101 +
102 + if (m_AutoExposurePool[0] == null || !m_AutoExposurePool[0].IsCreated())
103 + m_AutoExposurePool[0] = new RenderTexture(1, 1, 0, RenderTextureFormat.RFloat);
104 +
105 + if (m_AutoExposurePool[1] == null || !m_AutoExposurePool[1].IsCreated())
106 + m_AutoExposurePool[1] = new RenderTexture(1, 1, 0, RenderTextureFormat.RFloat);
107 +
108 + // Clears the buffer on every frame as we use it to accumulate luminance values on each frame
109 + m_HistogramBuffer.SetData(s_EmptyHistogramBuffer);
110 +
111 + // Gets a log histogram
112 + int kernel = m_EyeCompute.FindKernel("KEyeHistogram");
113 + m_EyeCompute.SetBuffer(kernel, "_Histogram", m_HistogramBuffer);
114 + m_EyeCompute.SetTexture(kernel, "_Source", rt);
115 + m_EyeCompute.SetVector("_ScaleOffsetRes", scaleOffsetRes);
116 + m_EyeCompute.Dispatch(kernel, Mathf.CeilToInt(rt.width / (float)k_HistogramThreadX), Mathf.CeilToInt(rt.height / (float)k_HistogramThreadY), 1);
117 +
118 + // Cleanup
119 + context.renderTextureFactory.Release(rt);
120 +
121 + // Make sure filtering values are correct to avoid apocalyptic consequences
122 + const float minDelta = 1e-2f;
123 + settings.highPercent = Mathf.Clamp(settings.highPercent, 1f + minDelta, 99f);
124 + settings.lowPercent = Mathf.Clamp(settings.lowPercent, 1f, settings.highPercent - minDelta);
125 +
126 + // Compute auto exposure
127 + material.SetBuffer("_Histogram", m_HistogramBuffer); // No (int, buffer) overload for SetBuffer ?
128 + material.SetVector(Uniforms._Params, new Vector4(settings.lowPercent * 0.01f, settings.highPercent * 0.01f, Mathf.Exp(settings.minLuminance * 0.69314718055994530941723212145818f), Mathf.Exp(settings.maxLuminance * 0.69314718055994530941723212145818f)));
129 + material.SetVector(Uniforms._Speed, new Vector2(settings.speedDown, settings.speedUp));
130 + material.SetVector(Uniforms._ScaleOffsetRes, scaleOffsetRes);
131 + material.SetFloat(Uniforms._ExposureCompensation, settings.keyValue);
132 +
133 + if (settings.dynamicKeyValue)
134 + material.EnableKeyword("AUTO_KEY_VALUE");
135 +
136 + if (m_FirstFrame || !Application.isPlaying)
137 + {
138 + // We don't want eye adaptation when not in play mode because the GameView isn't
139 + // animated, thus making it harder to tweak. Just use the final audo exposure value.
140 + m_CurrentAutoExposure = m_AutoExposurePool[0];
141 + Graphics.Blit(null, m_CurrentAutoExposure, material, (int)EyeAdaptationModel.EyeAdaptationType.Fixed);
142 +
143 + // Copy current exposure to the other pingpong target to avoid adapting from black
144 + Graphics.Blit(m_AutoExposurePool[0], m_AutoExposurePool[1]);
145 + }
146 + else
147 + {
148 + int pp = m_AutoExposurePingPing;
149 + var src = m_AutoExposurePool[++pp % 2];
150 + var dst = m_AutoExposurePool[++pp % 2];
151 + Graphics.Blit(src, dst, material, (int)settings.adaptationType);
152 + m_AutoExposurePingPing = ++pp % 2;
153 + m_CurrentAutoExposure = dst;
154 + }
155 +
156 + // Generate debug histogram
157 + if (context.profile.debugViews.IsModeActive(BuiltinDebugViewsModel.Mode.EyeAdaptation))
158 + {
159 + if (m_DebugHistogram == null || !m_DebugHistogram.IsCreated())
160 + {
161 + m_DebugHistogram = new RenderTexture(256, 128, 0, RenderTextureFormat.ARGB32)
162 + {
163 + filterMode = FilterMode.Point,
164 + wrapMode = TextureWrapMode.Clamp
165 + };
166 + }
167 +
168 + material.SetFloat(Uniforms._DebugWidth, m_DebugHistogram.width);
169 + Graphics.Blit(null, m_DebugHistogram, material, 2);
170 + }
171 +
172 + m_FirstFrame = false;
173 + return m_CurrentAutoExposure;
174 + }
175 +
176 + public void OnGUI()
177 + {
178 + if (m_DebugHistogram == null || !m_DebugHistogram.IsCreated())
179 + return;
180 +
181 + var rect = new Rect(context.viewport.x * Screen.width + 8f, 8f, m_DebugHistogram.width, m_DebugHistogram.height);
182 + GUI.DrawTexture(rect, m_DebugHistogram);
183 + }
184 + }
185 +}
1 +fileFormatVersion: 2
2 +guid: c227d71a4040d304c943c26e0914bdeb
3 +timeCreated: 1473088756
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using UnityEngine.Rendering;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + public sealed class FogComponent : PostProcessingComponentCommandBuffer<FogModel>
6 + {
7 + static class Uniforms
8 + {
9 + internal static readonly int _FogColor = Shader.PropertyToID("_FogColor");
10 + internal static readonly int _Density = Shader.PropertyToID("_Density");
11 + internal static readonly int _Start = Shader.PropertyToID("_Start");
12 + internal static readonly int _End = Shader.PropertyToID("_End");
13 + internal static readonly int _TempRT = Shader.PropertyToID("_TempRT");
14 + }
15 +
16 + const string k_ShaderString = "Hidden/Post FX/Fog";
17 +
18 + public override bool active
19 + {
20 + get
21 + {
22 + return model.enabled
23 + && context.isGBufferAvailable // In forward fog is already done at shader level
24 + && RenderSettings.fog
25 + && !context.interrupted;
26 + }
27 + }
28 +
29 + public override string GetName()
30 + {
31 + return "Fog";
32 + }
33 +
34 + public override DepthTextureMode GetCameraFlags()
35 + {
36 + return DepthTextureMode.Depth;
37 + }
38 +
39 + public override CameraEvent GetCameraEvent()
40 + {
41 + return CameraEvent.AfterImageEffectsOpaque;
42 + }
43 +
44 + public override void PopulateCommandBuffer(CommandBuffer cb)
45 + {
46 + var settings = model.settings;
47 +
48 + var material = context.materialFactory.Get(k_ShaderString);
49 + material.shaderKeywords = null;
50 + var fogColor = GraphicsUtils.isLinearColorSpace ? RenderSettings.fogColor.linear : RenderSettings.fogColor;
51 + material.SetColor(Uniforms._FogColor, fogColor);
52 + material.SetFloat(Uniforms._Density, RenderSettings.fogDensity);
53 + material.SetFloat(Uniforms._Start, RenderSettings.fogStartDistance);
54 + material.SetFloat(Uniforms._End, RenderSettings.fogEndDistance);
55 +
56 + switch (RenderSettings.fogMode)
57 + {
58 + case FogMode.Linear:
59 + material.EnableKeyword("FOG_LINEAR");
60 + break;
61 + case FogMode.Exponential:
62 + material.EnableKeyword("FOG_EXP");
63 + break;
64 + case FogMode.ExponentialSquared:
65 + material.EnableKeyword("FOG_EXP2");
66 + break;
67 + }
68 +
69 + var fbFormat = context.isHdr
70 + ? RenderTextureFormat.DefaultHDR
71 + : RenderTextureFormat.Default;
72 +
73 + cb.GetTemporaryRT(Uniforms._TempRT, context.width, context.height, 24, FilterMode.Bilinear, fbFormat);
74 + cb.Blit(BuiltinRenderTextureType.CameraTarget, Uniforms._TempRT);
75 + cb.Blit(Uniforms._TempRT, BuiltinRenderTextureType.CameraTarget, material, settings.excludeSkybox ? 1 : 0);
76 + cb.ReleaseTemporaryRT(Uniforms._TempRT);
77 + }
78 + }
79 +}
1 +fileFormatVersion: 2
2 +guid: d0363c1cc7de62b4989190994103f5e2
3 +timeCreated: 1487334918
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public sealed class FxaaComponent : PostProcessingComponentRenderTexture<AntialiasingModel>
4 + {
5 + static class Uniforms
6 + {
7 + internal static readonly int _QualitySettings = Shader.PropertyToID("_QualitySettings");
8 + internal static readonly int _ConsoleSettings = Shader.PropertyToID("_ConsoleSettings");
9 + }
10 +
11 + public override bool active
12 + {
13 + get
14 + {
15 + return model.enabled
16 + && model.settings.method == AntialiasingModel.Method.Fxaa
17 + && !context.interrupted;
18 + }
19 + }
20 +
21 + public void Render(RenderTexture source, RenderTexture destination)
22 + {
23 + var settings = model.settings.fxaaSettings;
24 + var material = context.materialFactory.Get("Hidden/Post FX/FXAA");
25 + var qualitySettings = AntialiasingModel.FxaaQualitySettings.presets[(int)settings.preset];
26 + var consoleSettings = AntialiasingModel.FxaaConsoleSettings.presets[(int)settings.preset];
27 +
28 + material.SetVector(Uniforms._QualitySettings,
29 + new Vector3(
30 + qualitySettings.subpixelAliasingRemovalAmount,
31 + qualitySettings.edgeDetectionThreshold,
32 + qualitySettings.minimumRequiredLuminance
33 + )
34 + );
35 +
36 + material.SetVector(Uniforms._ConsoleSettings,
37 + new Vector4(
38 + consoleSettings.subpixelSpreadAmount,
39 + consoleSettings.edgeSharpnessAmount,
40 + consoleSettings.edgeDetectionThreshold,
41 + consoleSettings.minimumRequiredLuminance
42 + )
43 + );
44 +
45 + Graphics.Blit(source, destination, material, 0);
46 + }
47 + }
48 +}
1 +fileFormatVersion: 2
2 +guid: d4e1109c5030ca04e9a28243a35155ff
3 +timeCreated: 1473088423
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public sealed class GrainComponent : PostProcessingComponentRenderTexture<GrainModel>
4 + {
5 + static class Uniforms
6 + {
7 + internal static readonly int _Grain_Params1 = Shader.PropertyToID("_Grain_Params1");
8 + internal static readonly int _Grain_Params2 = Shader.PropertyToID("_Grain_Params2");
9 + internal static readonly int _GrainTex = Shader.PropertyToID("_GrainTex");
10 + internal static readonly int _Phase = Shader.PropertyToID("_Phase");
11 + }
12 +
13 + public override bool active
14 + {
15 + get
16 + {
17 + return model.enabled
18 + && model.settings.intensity > 0f
19 + && SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf)
20 + && !context.interrupted;
21 + }
22 + }
23 +
24 + RenderTexture m_GrainLookupRT;
25 +
26 + public override void OnDisable()
27 + {
28 + GraphicsUtils.Destroy(m_GrainLookupRT);
29 + m_GrainLookupRT = null;
30 + }
31 +
32 + public override void Prepare(Material uberMaterial)
33 + {
34 + var settings = model.settings;
35 +
36 + uberMaterial.EnableKeyword("GRAIN");
37 +
38 + float rndOffsetX;
39 + float rndOffsetY;
40 +
41 +#if POSTFX_DEBUG_STATIC_GRAIN
42 + // Chosen by a fair dice roll
43 + float time = 4f;
44 + rndOffsetX = 0f;
45 + rndOffsetY = 0f;
46 +#else
47 + float time = Time.realtimeSinceStartup;
48 + rndOffsetX = Random.value;
49 + rndOffsetY = Random.value;
50 +#endif
51 +
52 + // Generate the grain lut for the current frame first
53 + if (m_GrainLookupRT == null || !m_GrainLookupRT.IsCreated())
54 + {
55 + GraphicsUtils.Destroy(m_GrainLookupRT);
56 +
57 + m_GrainLookupRT = new RenderTexture(192, 192, 0, RenderTextureFormat.ARGBHalf)
58 + {
59 + filterMode = FilterMode.Bilinear,
60 + wrapMode = TextureWrapMode.Repeat,
61 + anisoLevel = 0,
62 + name = "Grain Lookup Texture"
63 + };
64 +
65 + m_GrainLookupRT.Create();
66 + }
67 +
68 + var grainMaterial = context.materialFactory.Get("Hidden/Post FX/Grain Generator");
69 + grainMaterial.SetFloat(Uniforms._Phase, time / 20f);
70 +
71 + Graphics.Blit((Texture)null, m_GrainLookupRT, grainMaterial, settings.colored ? 1 : 0);
72 +
73 + // Send everything to the uber shader
74 + uberMaterial.SetTexture(Uniforms._GrainTex, m_GrainLookupRT);
75 + uberMaterial.SetVector(Uniforms._Grain_Params1, new Vector2(settings.luminanceContribution, settings.intensity * 20f));
76 + uberMaterial.SetVector(Uniforms._Grain_Params2, new Vector4((float)context.width / (float)m_GrainLookupRT.width / settings.size, (float)context.height / (float)m_GrainLookupRT.height / settings.size, rndOffsetX, rndOffsetY));
77 + }
78 + }
79 +}
1 +fileFormatVersion: 2
2 +guid: 6ff793ec42153c34799eed059982bac3
3 +timeCreated: 1473084716
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using UnityEngine.Rendering;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + using Settings = MotionBlurModel.Settings;
6 +
7 + public sealed class MotionBlurComponent : PostProcessingComponentCommandBuffer<MotionBlurModel>
8 + {
9 + static class Uniforms
10 + {
11 + internal static readonly int _VelocityScale = Shader.PropertyToID("_VelocityScale");
12 + internal static readonly int _MaxBlurRadius = Shader.PropertyToID("_MaxBlurRadius");
13 + internal static readonly int _RcpMaxBlurRadius = Shader.PropertyToID("_RcpMaxBlurRadius");
14 + internal static readonly int _VelocityTex = Shader.PropertyToID("_VelocityTex");
15 + internal static readonly int _MainTex = Shader.PropertyToID("_MainTex");
16 + internal static readonly int _Tile2RT = Shader.PropertyToID("_Tile2RT");
17 + internal static readonly int _Tile4RT = Shader.PropertyToID("_Tile4RT");
18 + internal static readonly int _Tile8RT = Shader.PropertyToID("_Tile8RT");
19 + internal static readonly int _TileMaxOffs = Shader.PropertyToID("_TileMaxOffs");
20 + internal static readonly int _TileMaxLoop = Shader.PropertyToID("_TileMaxLoop");
21 + internal static readonly int _TileVRT = Shader.PropertyToID("_TileVRT");
22 + internal static readonly int _NeighborMaxTex = Shader.PropertyToID("_NeighborMaxTex");
23 + internal static readonly int _LoopCount = Shader.PropertyToID("_LoopCount");
24 + internal static readonly int _TempRT = Shader.PropertyToID("_TempRT");
25 +
26 + internal static readonly int _History1LumaTex = Shader.PropertyToID("_History1LumaTex");
27 + internal static readonly int _History2LumaTex = Shader.PropertyToID("_History2LumaTex");
28 + internal static readonly int _History3LumaTex = Shader.PropertyToID("_History3LumaTex");
29 + internal static readonly int _History4LumaTex = Shader.PropertyToID("_History4LumaTex");
30 +
31 + internal static readonly int _History1ChromaTex = Shader.PropertyToID("_History1ChromaTex");
32 + internal static readonly int _History2ChromaTex = Shader.PropertyToID("_History2ChromaTex");
33 + internal static readonly int _History3ChromaTex = Shader.PropertyToID("_History3ChromaTex");
34 + internal static readonly int _History4ChromaTex = Shader.PropertyToID("_History4ChromaTex");
35 +
36 + internal static readonly int _History1Weight = Shader.PropertyToID("_History1Weight");
37 + internal static readonly int _History2Weight = Shader.PropertyToID("_History2Weight");
38 + internal static readonly int _History3Weight = Shader.PropertyToID("_History3Weight");
39 + internal static readonly int _History4Weight = Shader.PropertyToID("_History4Weight");
40 + }
41 +
42 + enum Pass
43 + {
44 + VelocitySetup,
45 + TileMax1,
46 + TileMax2,
47 + TileMaxV,
48 + NeighborMax,
49 + Reconstruction,
50 + FrameCompression,
51 + FrameBlendingChroma,
52 + FrameBlendingRaw
53 + }
54 +
55 + public class ReconstructionFilter
56 + {
57 + // Texture format for storing 2D vectors.
58 + RenderTextureFormat m_VectorRTFormat = RenderTextureFormat.RGHalf;
59 +
60 + // Texture format for storing packed velocity/depth.
61 + RenderTextureFormat m_PackedRTFormat = RenderTextureFormat.ARGB2101010;
62 +
63 + public ReconstructionFilter()
64 + {
65 + CheckTextureFormatSupport();
66 + }
67 +
68 + void CheckTextureFormatSupport()
69 + {
70 + // If 2:10:10:10 isn't supported, use ARGB32 instead.
71 + if (!SystemInfo.SupportsRenderTextureFormat(m_PackedRTFormat))
72 + m_PackedRTFormat = RenderTextureFormat.ARGB32;
73 + }
74 +
75 + public bool IsSupported()
76 + {
77 + return SystemInfo.supportsMotionVectors;
78 + }
79 +
80 + public void ProcessImage(PostProcessingContext context, CommandBuffer cb, ref Settings settings, RenderTargetIdentifier source, RenderTargetIdentifier destination, Material material)
81 + {
82 + const float kMaxBlurRadius = 5f;
83 +
84 + // Calculate the maximum blur radius in pixels.
85 + int maxBlurPixels = (int)(kMaxBlurRadius * context.height / 100);
86 +
87 + // Calculate the TileMax size.
88 + // It should be a multiple of 8 and larger than maxBlur.
89 + int tileSize = ((maxBlurPixels - 1) / 8 + 1) * 8;
90 +
91 + // Pass 1 - Velocity/depth packing
92 + var velocityScale = settings.shutterAngle / 360f;
93 + cb.SetGlobalFloat(Uniforms._VelocityScale, velocityScale);
94 + cb.SetGlobalFloat(Uniforms._MaxBlurRadius, maxBlurPixels);
95 + cb.SetGlobalFloat(Uniforms._RcpMaxBlurRadius, 1f / maxBlurPixels);
96 +
97 + int vbuffer = Uniforms._VelocityTex;
98 + cb.GetTemporaryRT(vbuffer, context.width, context.height, 0, FilterMode.Point, m_PackedRTFormat, RenderTextureReadWrite.Linear);
99 + cb.Blit((Texture)null, vbuffer, material, (int)Pass.VelocitySetup);
100 +
101 + // Pass 2 - First TileMax filter (1/2 downsize)
102 + int tile2 = Uniforms._Tile2RT;
103 + cb.GetTemporaryRT(tile2, context.width / 2, context.height / 2, 0, FilterMode.Point, m_VectorRTFormat, RenderTextureReadWrite.Linear);
104 + cb.SetGlobalTexture(Uniforms._MainTex, vbuffer);
105 + cb.Blit(vbuffer, tile2, material, (int)Pass.TileMax1);
106 +
107 + // Pass 3 - Second TileMax filter (1/2 downsize)
108 + int tile4 = Uniforms._Tile4RT;
109 + cb.GetTemporaryRT(tile4, context.width / 4, context.height / 4, 0, FilterMode.Point, m_VectorRTFormat, RenderTextureReadWrite.Linear);
110 + cb.SetGlobalTexture(Uniforms._MainTex, tile2);
111 + cb.Blit(tile2, tile4, material, (int)Pass.TileMax2);
112 + cb.ReleaseTemporaryRT(tile2);
113 +
114 + // Pass 4 - Third TileMax filter (1/2 downsize)
115 + int tile8 = Uniforms._Tile8RT;
116 + cb.GetTemporaryRT(tile8, context.width / 8, context.height / 8, 0, FilterMode.Point, m_VectorRTFormat, RenderTextureReadWrite.Linear);
117 + cb.SetGlobalTexture(Uniforms._MainTex, tile4);
118 + cb.Blit(tile4, tile8, material, (int)Pass.TileMax2);
119 + cb.ReleaseTemporaryRT(tile4);
120 +
121 + // Pass 5 - Fourth TileMax filter (reduce to tileSize)
122 + var tileMaxOffs = Vector2.one * (tileSize / 8f - 1f) * -0.5f;
123 + cb.SetGlobalVector(Uniforms._TileMaxOffs, tileMaxOffs);
124 + cb.SetGlobalFloat(Uniforms._TileMaxLoop, (int)(tileSize / 8f));
125 +
126 + int tile = Uniforms._TileVRT;
127 + cb.GetTemporaryRT(tile, context.width / tileSize, context.height / tileSize, 0, FilterMode.Point, m_VectorRTFormat, RenderTextureReadWrite.Linear);
128 + cb.SetGlobalTexture(Uniforms._MainTex, tile8);
129 + cb.Blit(tile8, tile, material, (int)Pass.TileMaxV);
130 + cb.ReleaseTemporaryRT(tile8);
131 +
132 + // Pass 6 - NeighborMax filter
133 + int neighborMax = Uniforms._NeighborMaxTex;
134 + int neighborMaxWidth = context.width / tileSize;
135 + int neighborMaxHeight = context.height / tileSize;
136 + cb.GetTemporaryRT(neighborMax, neighborMaxWidth, neighborMaxHeight, 0, FilterMode.Point, m_VectorRTFormat, RenderTextureReadWrite.Linear);
137 + cb.SetGlobalTexture(Uniforms._MainTex, tile);
138 + cb.Blit(tile, neighborMax, material, (int)Pass.NeighborMax);
139 + cb.ReleaseTemporaryRT(tile);
140 +
141 + // Pass 7 - Reconstruction pass
142 + cb.SetGlobalFloat(Uniforms._LoopCount, Mathf.Clamp(settings.sampleCount / 2, 1, 64));
143 + cb.SetGlobalTexture(Uniforms._MainTex, source);
144 +
145 + cb.Blit(source, destination, material, (int)Pass.Reconstruction);
146 +
147 + cb.ReleaseTemporaryRT(vbuffer);
148 + cb.ReleaseTemporaryRT(neighborMax);
149 + }
150 + }
151 +
152 + public class FrameBlendingFilter
153 + {
154 + struct Frame
155 + {
156 + public RenderTexture lumaTexture;
157 + public RenderTexture chromaTexture;
158 +
159 + float m_Time;
160 + RenderTargetIdentifier[] m_MRT;
161 +
162 + public float CalculateWeight(float strength, float currentTime)
163 + {
164 + if (Mathf.Approximately(m_Time, 0f))
165 + return 0f;
166 +
167 + var coeff = Mathf.Lerp(80f, 16f, strength);
168 + return Mathf.Exp((m_Time - currentTime) * coeff);
169 + }
170 +
171 + public void Release()
172 + {
173 + if (lumaTexture != null)
174 + RenderTexture.ReleaseTemporary(lumaTexture);
175 +
176 + if (chromaTexture != null)
177 + RenderTexture.ReleaseTemporary(chromaTexture);
178 +
179 + lumaTexture = null;
180 + chromaTexture = null;
181 + }
182 +
183 + public void MakeRecord(CommandBuffer cb, RenderTargetIdentifier source, int width, int height, Material material)
184 + {
185 + Release();
186 +
187 + lumaTexture = RenderTexture.GetTemporary(width, height, 0, RenderTextureFormat.R8, RenderTextureReadWrite.Linear);
188 + chromaTexture = RenderTexture.GetTemporary(width, height, 0, RenderTextureFormat.R8, RenderTextureReadWrite.Linear);
189 +
190 + lumaTexture.filterMode = FilterMode.Point;
191 + chromaTexture.filterMode = FilterMode.Point;
192 +
193 + if (m_MRT == null)
194 + m_MRT = new RenderTargetIdentifier[2];
195 +
196 + m_MRT[0] = lumaTexture;
197 + m_MRT[1] = chromaTexture;
198 +
199 + cb.SetGlobalTexture(Uniforms._MainTex, source);
200 + cb.SetRenderTarget(m_MRT, lumaTexture);
201 + cb.DrawMesh(GraphicsUtils.quad, Matrix4x4.identity, material, 0, (int)Pass.FrameCompression);
202 +
203 + m_Time = Time.time;
204 + }
205 +
206 + public void MakeRecordRaw(CommandBuffer cb, RenderTargetIdentifier source, int width, int height, RenderTextureFormat format)
207 + {
208 + Release();
209 +
210 + lumaTexture = RenderTexture.GetTemporary(width, height, 0, format);
211 + lumaTexture.filterMode = FilterMode.Point;
212 +
213 + cb.SetGlobalTexture(Uniforms._MainTex, source);
214 + cb.Blit(source, lumaTexture);
215 +
216 + m_Time = Time.time;
217 + }
218 + }
219 +
220 + bool m_UseCompression;
221 + RenderTextureFormat m_RawTextureFormat;
222 +
223 + Frame[] m_FrameList;
224 + int m_LastFrameCount;
225 +
226 + public FrameBlendingFilter()
227 + {
228 + m_UseCompression = CheckSupportCompression();
229 + m_RawTextureFormat = GetPreferredRenderTextureFormat();
230 + m_FrameList = new Frame[4];
231 + }
232 +
233 + public void Dispose()
234 + {
235 + foreach (var frame in m_FrameList)
236 + frame.Release();
237 + }
238 +
239 + public void PushFrame(CommandBuffer cb, RenderTargetIdentifier source, int width, int height, Material material)
240 + {
241 + // Push only when actual update (do nothing while pausing)
242 + var frameCount = Time.frameCount;
243 + if (frameCount == m_LastFrameCount) return;
244 +
245 + // Update the frame record.
246 + var index = frameCount % m_FrameList.Length;
247 +
248 + if (m_UseCompression)
249 + m_FrameList[index].MakeRecord(cb, source, width, height, material);
250 + else
251 + m_FrameList[index].MakeRecordRaw(cb, source, width, height, m_RawTextureFormat);
252 +
253 + m_LastFrameCount = frameCount;
254 + }
255 +
256 + public void BlendFrames(CommandBuffer cb, float strength, RenderTargetIdentifier source, RenderTargetIdentifier destination, Material material)
257 + {
258 + var t = Time.time;
259 +
260 + var f1 = GetFrameRelative(-1);
261 + var f2 = GetFrameRelative(-2);
262 + var f3 = GetFrameRelative(-3);
263 + var f4 = GetFrameRelative(-4);
264 +
265 + cb.SetGlobalTexture(Uniforms._History1LumaTex, f1.lumaTexture);
266 + cb.SetGlobalTexture(Uniforms._History2LumaTex, f2.lumaTexture);
267 + cb.SetGlobalTexture(Uniforms._History3LumaTex, f3.lumaTexture);
268 + cb.SetGlobalTexture(Uniforms._History4LumaTex, f4.lumaTexture);
269 +
270 + cb.SetGlobalTexture(Uniforms._History1ChromaTex, f1.chromaTexture);
271 + cb.SetGlobalTexture(Uniforms._History2ChromaTex, f2.chromaTexture);
272 + cb.SetGlobalTexture(Uniforms._History3ChromaTex, f3.chromaTexture);
273 + cb.SetGlobalTexture(Uniforms._History4ChromaTex, f4.chromaTexture);
274 +
275 + cb.SetGlobalFloat(Uniforms._History1Weight, f1.CalculateWeight(strength, t));
276 + cb.SetGlobalFloat(Uniforms._History2Weight, f2.CalculateWeight(strength, t));
277 + cb.SetGlobalFloat(Uniforms._History3Weight, f3.CalculateWeight(strength, t));
278 + cb.SetGlobalFloat(Uniforms._History4Weight, f4.CalculateWeight(strength, t));
279 +
280 + cb.SetGlobalTexture(Uniforms._MainTex, source);
281 + cb.Blit(source, destination, material, m_UseCompression ? (int)Pass.FrameBlendingChroma : (int)Pass.FrameBlendingRaw);
282 + }
283 +
284 + // Check if the platform has the capability of compression.
285 + static bool CheckSupportCompression()
286 + {
287 + return
288 + SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.R8) &&
289 + SystemInfo.supportedRenderTargetCount > 1;
290 + }
291 +
292 + // Determine which 16-bit render texture format is available.
293 + static RenderTextureFormat GetPreferredRenderTextureFormat()
294 + {
295 + RenderTextureFormat[] formats =
296 + {
297 + RenderTextureFormat.RGB565,
298 + RenderTextureFormat.ARGB1555,
299 + RenderTextureFormat.ARGB4444
300 + };
301 +
302 + foreach (var f in formats)
303 + if (SystemInfo.SupportsRenderTextureFormat(f)) return f;
304 +
305 + return RenderTextureFormat.Default;
306 + }
307 +
308 + // Retrieve a frame record with relative indexing.
309 + // Use a negative index to refer to previous frames.
310 + Frame GetFrameRelative(int offset)
311 + {
312 + var index = (Time.frameCount + m_FrameList.Length + offset) % m_FrameList.Length;
313 + return m_FrameList[index];
314 + }
315 + }
316 +
317 + ReconstructionFilter m_ReconstructionFilter;
318 + public ReconstructionFilter reconstructionFilter
319 + {
320 + get
321 + {
322 + if (m_ReconstructionFilter == null)
323 + m_ReconstructionFilter = new ReconstructionFilter();
324 +
325 + return m_ReconstructionFilter;
326 + }
327 + }
328 +
329 + FrameBlendingFilter m_FrameBlendingFilter;
330 + public FrameBlendingFilter frameBlendingFilter
331 + {
332 + get
333 + {
334 + if (m_FrameBlendingFilter == null)
335 + m_FrameBlendingFilter = new FrameBlendingFilter();
336 +
337 + return m_FrameBlendingFilter;
338 + }
339 + }
340 +
341 + bool m_FirstFrame = true;
342 +
343 + public override bool active
344 + {
345 + get
346 + {
347 + var settings = model.settings;
348 + return model.enabled
349 + && ((settings.shutterAngle > 0f && reconstructionFilter.IsSupported()) || settings.frameBlending > 0f)
350 + && SystemInfo.graphicsDeviceType != GraphicsDeviceType.OpenGLES2 // No movecs on GLES2 platforms
351 + && !context.interrupted;
352 + }
353 + }
354 +
355 + public override string GetName()
356 + {
357 + return "Motion Blur";
358 + }
359 +
360 + public void ResetHistory()
361 + {
362 + if (m_FrameBlendingFilter != null)
363 + m_FrameBlendingFilter.Dispose();
364 +
365 + m_FrameBlendingFilter = null;
366 + }
367 +
368 + public override DepthTextureMode GetCameraFlags()
369 + {
370 + return DepthTextureMode.Depth | DepthTextureMode.MotionVectors;
371 + }
372 +
373 + public override CameraEvent GetCameraEvent()
374 + {
375 + return CameraEvent.BeforeImageEffects;
376 + }
377 +
378 + public override void OnEnable()
379 + {
380 + m_FirstFrame = true;
381 + }
382 +
383 + public override void PopulateCommandBuffer(CommandBuffer cb)
384 + {
385 +#if UNITY_EDITOR
386 + // Don't render motion blur preview when the editor is not playing as it can in some
387 + // cases results in ugly artifacts (i.e. when resizing the game view).
388 + if (!Application.isPlaying)
389 + return;
390 +#endif
391 +
392 + // Skip rendering in the first frame as motion vectors won't be abvailable until the
393 + // next one
394 + if (m_FirstFrame)
395 + {
396 + m_FirstFrame = false;
397 + return;
398 + }
399 +
400 + var material = context.materialFactory.Get("Hidden/Post FX/Motion Blur");
401 + var blitMaterial = context.materialFactory.Get("Hidden/Post FX/Blit");
402 + var settings = model.settings;
403 +
404 + var fbFormat = context.isHdr
405 + ? RenderTextureFormat.DefaultHDR
406 + : RenderTextureFormat.Default;
407 +
408 + int tempRT = Uniforms._TempRT;
409 + cb.GetTemporaryRT(tempRT, context.width, context.height, 0, FilterMode.Point, fbFormat);
410 +
411 + if (settings.shutterAngle > 0f && settings.frameBlending > 0f)
412 + {
413 + // Motion blur + frame blending
414 + reconstructionFilter.ProcessImage(context, cb, ref settings, BuiltinRenderTextureType.CameraTarget, tempRT, material);
415 + frameBlendingFilter.BlendFrames(cb, settings.frameBlending, tempRT, BuiltinRenderTextureType.CameraTarget, material);
416 + frameBlendingFilter.PushFrame(cb, tempRT, context.width, context.height, material);
417 + }
418 + else if (settings.shutterAngle > 0f)
419 + {
420 + // No frame blending
421 + cb.SetGlobalTexture(Uniforms._MainTex, BuiltinRenderTextureType.CameraTarget);
422 + cb.Blit(BuiltinRenderTextureType.CameraTarget, tempRT, blitMaterial, 0);
423 + reconstructionFilter.ProcessImage(context, cb, ref settings, tempRT, BuiltinRenderTextureType.CameraTarget, material);
424 + }
425 + else if (settings.frameBlending > 0f)
426 + {
427 + // Frame blending only
428 + cb.SetGlobalTexture(Uniforms._MainTex, BuiltinRenderTextureType.CameraTarget);
429 + cb.Blit(BuiltinRenderTextureType.CameraTarget, tempRT, blitMaterial, 0);
430 + frameBlendingFilter.BlendFrames(cb, settings.frameBlending, tempRT, BuiltinRenderTextureType.CameraTarget, material);
431 + frameBlendingFilter.PushFrame(cb, tempRT, context.width, context.height, material);
432 + }
433 +
434 + // Cleaning up
435 + cb.ReleaseTemporaryRT(tempRT);
436 + }
437 +
438 + public override void OnDisable()
439 + {
440 + if (m_FrameBlendingFilter != null)
441 + m_FrameBlendingFilter.Dispose();
442 + }
443 + }
444 +}
1 +fileFormatVersion: 2
2 +guid: 9a9ae59cbb7c53e40851df7f32805098
3 +timeCreated: 1468325905
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using UnityEngine.Rendering;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + using SSRResolution = ScreenSpaceReflectionModel.SSRResolution;
6 + using SSRReflectionBlendType = ScreenSpaceReflectionModel.SSRReflectionBlendType;
7 +
8 + public sealed class ScreenSpaceReflectionComponent : PostProcessingComponentCommandBuffer<ScreenSpaceReflectionModel>
9 + {
10 + static class Uniforms
11 + {
12 + internal static readonly int _RayStepSize = Shader.PropertyToID("_RayStepSize");
13 + internal static readonly int _AdditiveReflection = Shader.PropertyToID("_AdditiveReflection");
14 + internal static readonly int _BilateralUpsampling = Shader.PropertyToID("_BilateralUpsampling");
15 + internal static readonly int _TreatBackfaceHitAsMiss = Shader.PropertyToID("_TreatBackfaceHitAsMiss");
16 + internal static readonly int _AllowBackwardsRays = Shader.PropertyToID("_AllowBackwardsRays");
17 + internal static readonly int _TraceBehindObjects = Shader.PropertyToID("_TraceBehindObjects");
18 + internal static readonly int _MaxSteps = Shader.PropertyToID("_MaxSteps");
19 + internal static readonly int _FullResolutionFiltering = Shader.PropertyToID("_FullResolutionFiltering");
20 + internal static readonly int _HalfResolution = Shader.PropertyToID("_HalfResolution");
21 + internal static readonly int _HighlightSuppression = Shader.PropertyToID("_HighlightSuppression");
22 + internal static readonly int _PixelsPerMeterAtOneMeter = Shader.PropertyToID("_PixelsPerMeterAtOneMeter");
23 + internal static readonly int _ScreenEdgeFading = Shader.PropertyToID("_ScreenEdgeFading");
24 + internal static readonly int _ReflectionBlur = Shader.PropertyToID("_ReflectionBlur");
25 + internal static readonly int _MaxRayTraceDistance = Shader.PropertyToID("_MaxRayTraceDistance");
26 + internal static readonly int _FadeDistance = Shader.PropertyToID("_FadeDistance");
27 + internal static readonly int _LayerThickness = Shader.PropertyToID("_LayerThickness");
28 + internal static readonly int _SSRMultiplier = Shader.PropertyToID("_SSRMultiplier");
29 + internal static readonly int _FresnelFade = Shader.PropertyToID("_FresnelFade");
30 + internal static readonly int _FresnelFadePower = Shader.PropertyToID("_FresnelFadePower");
31 + internal static readonly int _ReflectionBufferSize = Shader.PropertyToID("_ReflectionBufferSize");
32 + internal static readonly int _ScreenSize = Shader.PropertyToID("_ScreenSize");
33 + internal static readonly int _InvScreenSize = Shader.PropertyToID("_InvScreenSize");
34 + internal static readonly int _ProjInfo = Shader.PropertyToID("_ProjInfo");
35 + internal static readonly int _CameraClipInfo = Shader.PropertyToID("_CameraClipInfo");
36 + internal static readonly int _ProjectToPixelMatrix = Shader.PropertyToID("_ProjectToPixelMatrix");
37 + internal static readonly int _WorldToCameraMatrix = Shader.PropertyToID("_WorldToCameraMatrix");
38 + internal static readonly int _CameraToWorldMatrix = Shader.PropertyToID("_CameraToWorldMatrix");
39 + internal static readonly int _Axis = Shader.PropertyToID("_Axis");
40 + internal static readonly int _CurrentMipLevel = Shader.PropertyToID("_CurrentMipLevel");
41 + internal static readonly int _NormalAndRoughnessTexture = Shader.PropertyToID("_NormalAndRoughnessTexture");
42 + internal static readonly int _HitPointTexture = Shader.PropertyToID("_HitPointTexture");
43 + internal static readonly int _BlurTexture = Shader.PropertyToID("_BlurTexture");
44 + internal static readonly int _FilteredReflections = Shader.PropertyToID("_FilteredReflections");
45 + internal static readonly int _FinalReflectionTexture = Shader.PropertyToID("_FinalReflectionTexture");
46 + internal static readonly int _TempTexture = Shader.PropertyToID("_TempTexture");
47 + }
48 +
49 + // Unexposed variables
50 + bool k_HighlightSuppression = false;
51 + bool k_TraceBehindObjects = true;
52 + bool k_TreatBackfaceHitAsMiss = false;
53 + bool k_BilateralUpsample = true;
54 +
55 + enum PassIndex
56 + {
57 + RayTraceStep = 0,
58 + CompositeFinal = 1,
59 + Blur = 2,
60 + CompositeSSR = 3,
61 + MinMipGeneration = 4,
62 + HitPointToReflections = 5,
63 + BilateralKeyPack = 6,
64 + BlitDepthAsCSZ = 7,
65 + PoissonBlur = 8,
66 + }
67 +
68 + readonly int[] m_ReflectionTextures = new int[5];
69 +
70 + // Not really needed as SSR only works in deferred right now
71 + public override DepthTextureMode GetCameraFlags()
72 + {
73 + return DepthTextureMode.Depth;
74 + }
75 +
76 + public override bool active
77 + {
78 + get
79 + {
80 + return model.enabled
81 + && context.isGBufferAvailable
82 + && !context.interrupted;
83 + }
84 + }
85 +
86 + public override void OnEnable()
87 + {
88 + m_ReflectionTextures[0] = Shader.PropertyToID("_ReflectionTexture0");
89 + m_ReflectionTextures[1] = Shader.PropertyToID("_ReflectionTexture1");
90 + m_ReflectionTextures[2] = Shader.PropertyToID("_ReflectionTexture2");
91 + m_ReflectionTextures[3] = Shader.PropertyToID("_ReflectionTexture3");
92 + m_ReflectionTextures[4] = Shader.PropertyToID("_ReflectionTexture4");
93 + }
94 +
95 + public override string GetName()
96 + {
97 + return "Screen Space Reflection";
98 + }
99 +
100 + public override CameraEvent GetCameraEvent()
101 + {
102 + return CameraEvent.AfterFinalPass;
103 + }
104 +
105 + public override void PopulateCommandBuffer(CommandBuffer cb)
106 + {
107 + var settings = model.settings;
108 + var camera = context.camera;
109 +
110 + // Material setup
111 + int downsampleAmount = (settings.reflection.reflectionQuality == SSRResolution.High) ? 1 : 2;
112 +
113 + var rtW = context.width / downsampleAmount;
114 + var rtH = context.height / downsampleAmount;
115 +
116 + float sWidth = context.width;
117 + float sHeight = context.height;
118 +
119 + float sx = sWidth / 2f;
120 + float sy = sHeight / 2f;
121 +
122 + var material = context.materialFactory.Get("Hidden/Post FX/Screen Space Reflection");
123 +
124 + material.SetInt(Uniforms._RayStepSize, settings.reflection.stepSize);
125 + material.SetInt(Uniforms._AdditiveReflection, settings.reflection.blendType == SSRReflectionBlendType.Additive ? 1 : 0);
126 + material.SetInt(Uniforms._BilateralUpsampling, k_BilateralUpsample ? 1 : 0);
127 + material.SetInt(Uniforms._TreatBackfaceHitAsMiss, k_TreatBackfaceHitAsMiss ? 1 : 0);
128 + material.SetInt(Uniforms._AllowBackwardsRays, settings.reflection.reflectBackfaces ? 1 : 0);
129 + material.SetInt(Uniforms._TraceBehindObjects, k_TraceBehindObjects ? 1 : 0);
130 + material.SetInt(Uniforms._MaxSteps, settings.reflection.iterationCount);
131 + material.SetInt(Uniforms._FullResolutionFiltering, 0);
132 + material.SetInt(Uniforms._HalfResolution, (settings.reflection.reflectionQuality != SSRResolution.High) ? 1 : 0);
133 + material.SetInt(Uniforms._HighlightSuppression, k_HighlightSuppression ? 1 : 0);
134 +
135 + // The height in pixels of a 1m object if viewed from 1m away.
136 + float pixelsPerMeterAtOneMeter = sWidth / (-2f * Mathf.Tan(camera.fieldOfView / 180f * Mathf.PI * 0.5f));
137 +
138 + material.SetFloat(Uniforms._PixelsPerMeterAtOneMeter, pixelsPerMeterAtOneMeter);
139 + material.SetFloat(Uniforms._ScreenEdgeFading, settings.screenEdgeMask.intensity);
140 + material.SetFloat(Uniforms._ReflectionBlur, settings.reflection.reflectionBlur);
141 + material.SetFloat(Uniforms._MaxRayTraceDistance, settings.reflection.maxDistance);
142 + material.SetFloat(Uniforms._FadeDistance, settings.intensity.fadeDistance);
143 + material.SetFloat(Uniforms._LayerThickness, settings.reflection.widthModifier);
144 + material.SetFloat(Uniforms._SSRMultiplier, settings.intensity.reflectionMultiplier);
145 + material.SetFloat(Uniforms._FresnelFade, settings.intensity.fresnelFade);
146 + material.SetFloat(Uniforms._FresnelFadePower, settings.intensity.fresnelFadePower);
147 +
148 + var P = camera.projectionMatrix;
149 + var projInfo = new Vector4(
150 + -2f / (sWidth * P[0]),
151 + -2f / (sHeight * P[5]),
152 + (1f - P[2]) / P[0],
153 + (1f + P[6]) / P[5]
154 + );
155 +
156 + var cameraClipInfo = float.IsPositiveInfinity(camera.farClipPlane) ?
157 + new Vector3(camera.nearClipPlane, -1f, 1f) :
158 + new Vector3(camera.nearClipPlane * camera.farClipPlane, camera.nearClipPlane - camera.farClipPlane, camera.farClipPlane);
159 +
160 + material.SetVector(Uniforms._ReflectionBufferSize, new Vector2(rtW, rtH));
161 + material.SetVector(Uniforms._ScreenSize, new Vector2(sWidth, sHeight));
162 + material.SetVector(Uniforms._InvScreenSize, new Vector2(1f / sWidth, 1f / sHeight));
163 + material.SetVector(Uniforms._ProjInfo, projInfo); // used for unprojection
164 +
165 + material.SetVector(Uniforms._CameraClipInfo, cameraClipInfo);
166 +
167 + var warpToScreenSpaceMatrix = new Matrix4x4();
168 + warpToScreenSpaceMatrix.SetRow(0, new Vector4(sx, 0f, 0f, sx));
169 + warpToScreenSpaceMatrix.SetRow(1, new Vector4(0f, sy, 0f, sy));
170 + warpToScreenSpaceMatrix.SetRow(2, new Vector4(0f, 0f, 1f, 0f));
171 + warpToScreenSpaceMatrix.SetRow(3, new Vector4(0f, 0f, 0f, 1f));
172 +
173 + var projectToPixelMatrix = warpToScreenSpaceMatrix * P;
174 +
175 + material.SetMatrix(Uniforms._ProjectToPixelMatrix, projectToPixelMatrix);
176 + material.SetMatrix(Uniforms._WorldToCameraMatrix, camera.worldToCameraMatrix);
177 + material.SetMatrix(Uniforms._CameraToWorldMatrix, camera.worldToCameraMatrix.inverse);
178 +
179 + // Command buffer setup
180 + var intermediateFormat = context.isHdr ? RenderTextureFormat.ARGBHalf : RenderTextureFormat.ARGB32;
181 + const int maxMip = 5;
182 +
183 + var kNormalAndRoughnessTexture = Uniforms._NormalAndRoughnessTexture;
184 + var kHitPointTexture = Uniforms._HitPointTexture;
185 + var kBlurTexture = Uniforms._BlurTexture;
186 + var kFilteredReflections = Uniforms._FilteredReflections;
187 + var kFinalReflectionTexture = Uniforms._FinalReflectionTexture;
188 + var kTempTexture = Uniforms._TempTexture;
189 +
190 + // RGB: Normals, A: Roughness.
191 + // Has the nice benefit of allowing us to control the filtering mode as well.
192 + cb.GetTemporaryRT(kNormalAndRoughnessTexture, -1, -1, 0, FilterMode.Point, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
193 +
194 + cb.GetTemporaryRT(kHitPointTexture, rtW, rtH, 0, FilterMode.Bilinear, RenderTextureFormat.ARGBHalf, RenderTextureReadWrite.Linear);
195 +
196 + for (int i = 0; i < maxMip; ++i)
197 + {
198 + // We explicitly interpolate during bilateral upsampling.
199 + cb.GetTemporaryRT(m_ReflectionTextures[i], rtW >> i, rtH >> i, 0, FilterMode.Bilinear, intermediateFormat);
200 + }
201 +
202 + cb.GetTemporaryRT(kFilteredReflections, rtW, rtH, 0, k_BilateralUpsample ? FilterMode.Point : FilterMode.Bilinear, intermediateFormat);
203 + cb.GetTemporaryRT(kFinalReflectionTexture, rtW, rtH, 0, FilterMode.Point, intermediateFormat);
204 +
205 + cb.Blit(BuiltinRenderTextureType.CameraTarget, kNormalAndRoughnessTexture, material, (int)PassIndex.BilateralKeyPack);
206 + cb.Blit(BuiltinRenderTextureType.CameraTarget, kHitPointTexture, material, (int)PassIndex.RayTraceStep);
207 + cb.Blit(BuiltinRenderTextureType.CameraTarget, kFilteredReflections, material, (int)PassIndex.HitPointToReflections);
208 + cb.Blit(kFilteredReflections, m_ReflectionTextures[0], material, (int)PassIndex.PoissonBlur);
209 +
210 + for (int i = 1; i < maxMip; ++i)
211 + {
212 + int inputTex = m_ReflectionTextures[i - 1];
213 +
214 + int lowMip = i;
215 +
216 + cb.GetTemporaryRT(kBlurTexture, rtW >> lowMip, rtH >> lowMip, 0, FilterMode.Bilinear, intermediateFormat);
217 + cb.SetGlobalVector(Uniforms._Axis, new Vector4(1.0f, 0.0f, 0.0f, 0.0f));
218 + cb.SetGlobalFloat(Uniforms._CurrentMipLevel, i - 1.0f);
219 +
220 + cb.Blit(inputTex, kBlurTexture, material, (int)PassIndex.Blur);
221 +
222 + cb.SetGlobalVector(Uniforms._Axis, new Vector4(0.0f, 1.0f, 0.0f, 0.0f));
223 +
224 + inputTex = m_ReflectionTextures[i];
225 + cb.Blit(kBlurTexture, inputTex, material, (int)PassIndex.Blur);
226 + cb.ReleaseTemporaryRT(kBlurTexture);
227 + }
228 +
229 + cb.Blit(m_ReflectionTextures[0], kFinalReflectionTexture, material, (int)PassIndex.CompositeSSR);
230 +
231 + cb.GetTemporaryRT(kTempTexture, camera.pixelWidth, camera.pixelHeight, 0, FilterMode.Bilinear, intermediateFormat);
232 +
233 + cb.Blit(BuiltinRenderTextureType.CameraTarget, kTempTexture, material, (int)PassIndex.CompositeFinal);
234 + cb.Blit(kTempTexture, BuiltinRenderTextureType.CameraTarget);
235 +
236 + cb.ReleaseTemporaryRT(kTempTexture);
237 + }
238 + }
239 +}
1 +fileFormatVersion: 2
2 +guid: dd75f795d6a798f44a7801082f6a703f
3 +timeCreated: 1467626205
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + public sealed class TaaComponent : PostProcessingComponentRenderTexture<AntialiasingModel>
6 + {
7 + static class Uniforms
8 + {
9 + internal static int _Jitter = Shader.PropertyToID("_Jitter");
10 + internal static int _SharpenParameters = Shader.PropertyToID("_SharpenParameters");
11 + internal static int _FinalBlendParameters = Shader.PropertyToID("_FinalBlendParameters");
12 + internal static int _HistoryTex = Shader.PropertyToID("_HistoryTex");
13 + internal static int _MainTex = Shader.PropertyToID("_MainTex");
14 + }
15 +
16 + const string k_ShaderString = "Hidden/Post FX/Temporal Anti-aliasing";
17 + const int k_SampleCount = 8;
18 +
19 + readonly RenderBuffer[] m_MRT = new RenderBuffer[2];
20 +
21 + int m_SampleIndex = 0;
22 + bool m_ResetHistory = true;
23 +
24 + RenderTexture m_HistoryTexture;
25 +
26 + public override bool active
27 + {
28 + get
29 + {
30 + return model.enabled
31 + && model.settings.method == AntialiasingModel.Method.Taa
32 + && SystemInfo.supportsMotionVectors
33 + && SystemInfo.supportedRenderTargetCount >= 2
34 + && !context.interrupted;
35 + }
36 + }
37 +
38 + public override DepthTextureMode GetCameraFlags()
39 + {
40 + return DepthTextureMode.Depth | DepthTextureMode.MotionVectors;
41 + }
42 +
43 + public Vector2 jitterVector { get; private set; }
44 +
45 + public void ResetHistory()
46 + {
47 + m_ResetHistory = true;
48 + }
49 +
50 + public void SetProjectionMatrix(Func<Vector2, Matrix4x4> jitteredFunc)
51 + {
52 + var settings = model.settings.taaSettings;
53 +
54 + var jitter = GenerateRandomOffset();
55 + jitter *= settings.jitterSpread;
56 +
57 + context.camera.nonJitteredProjectionMatrix = context.camera.projectionMatrix;
58 +
59 + if (jitteredFunc != null)
60 + {
61 + context.camera.projectionMatrix = jitteredFunc(jitter);
62 + }
63 + else
64 + {
65 + context.camera.projectionMatrix = context.camera.orthographic
66 + ? GetOrthographicProjectionMatrix(jitter)
67 + : GetPerspectiveProjectionMatrix(jitter);
68 + }
69 +
70 +#if UNITY_5_5_OR_NEWER
71 + context.camera.useJitteredProjectionMatrixForTransparentRendering = false;
72 +#endif
73 +
74 + jitter.x /= context.width;
75 + jitter.y /= context.height;
76 +
77 + var material = context.materialFactory.Get(k_ShaderString);
78 + material.SetVector(Uniforms._Jitter, jitter);
79 +
80 + jitterVector = jitter;
81 + }
82 +
83 + public void Render(RenderTexture source, RenderTexture destination)
84 + {
85 + var material = context.materialFactory.Get(k_ShaderString);
86 + material.shaderKeywords = null;
87 +
88 + var settings = model.settings.taaSettings;
89 +
90 + if (m_ResetHistory || m_HistoryTexture == null || m_HistoryTexture.width != source.width || m_HistoryTexture.height != source.height)
91 + {
92 + if (m_HistoryTexture)
93 + RenderTexture.ReleaseTemporary(m_HistoryTexture);
94 +
95 + m_HistoryTexture = RenderTexture.GetTemporary(source.width, source.height, 0, source.format);
96 + m_HistoryTexture.name = "TAA History";
97 +
98 + Graphics.Blit(source, m_HistoryTexture, material, 2);
99 + }
100 +
101 + const float kMotionAmplification = 100f * 60f;
102 + material.SetVector(Uniforms._SharpenParameters, new Vector4(settings.sharpen, 0f, 0f, 0f));
103 + material.SetVector(Uniforms._FinalBlendParameters, new Vector4(settings.stationaryBlending, settings.motionBlending, kMotionAmplification, 0f));
104 + material.SetTexture(Uniforms._MainTex, source);
105 + material.SetTexture(Uniforms._HistoryTex, m_HistoryTexture);
106 +
107 + var tempHistory = RenderTexture.GetTemporary(source.width, source.height, 0, source.format);
108 + tempHistory.name = "TAA History";
109 +
110 + m_MRT[0] = destination.colorBuffer;
111 + m_MRT[1] = tempHistory.colorBuffer;
112 +
113 + Graphics.SetRenderTarget(m_MRT, source.depthBuffer);
114 + GraphicsUtils.Blit(material, context.camera.orthographic ? 1 : 0);
115 +
116 + RenderTexture.ReleaseTemporary(m_HistoryTexture);
117 + m_HistoryTexture = tempHistory;
118 +
119 + m_ResetHistory = false;
120 + }
121 +
122 + float GetHaltonValue(int index, int radix)
123 + {
124 + float result = 0f;
125 + float fraction = 1f / (float)radix;
126 +
127 + while (index > 0)
128 + {
129 + result += (float)(index % radix) * fraction;
130 +
131 + index /= radix;
132 + fraction /= (float)radix;
133 + }
134 +
135 + return result;
136 + }
137 +
138 + Vector2 GenerateRandomOffset()
139 + {
140 + var offset = new Vector2(
141 + GetHaltonValue(m_SampleIndex & 1023, 2),
142 + GetHaltonValue(m_SampleIndex & 1023, 3));
143 +
144 + if (++m_SampleIndex >= k_SampleCount)
145 + m_SampleIndex = 0;
146 +
147 + return offset;
148 + }
149 +
150 + // Adapted heavily from PlayDead's TAA code
151 + // https://github.com/playdeadgames/temporal/blob/master/Assets/Scripts/Extensions.cs
152 + Matrix4x4 GetPerspectiveProjectionMatrix(Vector2 offset)
153 + {
154 + float vertical = Mathf.Tan(0.5f * Mathf.Deg2Rad * context.camera.fieldOfView);
155 + float horizontal = vertical * context.camera.aspect;
156 +
157 + offset.x *= horizontal / (0.5f * context.width);
158 + offset.y *= vertical / (0.5f * context.height);
159 +
160 + float left = (offset.x - horizontal) * context.camera.nearClipPlane;
161 + float right = (offset.x + horizontal) * context.camera.nearClipPlane;
162 + float top = (offset.y + vertical) * context.camera.nearClipPlane;
163 + float bottom = (offset.y - vertical) * context.camera.nearClipPlane;
164 +
165 + var matrix = new Matrix4x4();
166 +
167 + matrix[0, 0] = (2f * context.camera.nearClipPlane) / (right - left);
168 + matrix[0, 1] = 0f;
169 + matrix[0, 2] = (right + left) / (right - left);
170 + matrix[0, 3] = 0f;
171 +
172 + matrix[1, 0] = 0f;
173 + matrix[1, 1] = (2f * context.camera.nearClipPlane) / (top - bottom);
174 + matrix[1, 2] = (top + bottom) / (top - bottom);
175 + matrix[1, 3] = 0f;
176 +
177 + matrix[2, 0] = 0f;
178 + matrix[2, 1] = 0f;
179 + matrix[2, 2] = -(context.camera.farClipPlane + context.camera.nearClipPlane) / (context.camera.farClipPlane - context.camera.nearClipPlane);
180 + matrix[2, 3] = -(2f * context.camera.farClipPlane * context.camera.nearClipPlane) / (context.camera.farClipPlane - context.camera.nearClipPlane);
181 +
182 + matrix[3, 0] = 0f;
183 + matrix[3, 1] = 0f;
184 + matrix[3, 2] = -1f;
185 + matrix[3, 3] = 0f;
186 +
187 + return matrix;
188 + }
189 +
190 + Matrix4x4 GetOrthographicProjectionMatrix(Vector2 offset)
191 + {
192 + float vertical = context.camera.orthographicSize;
193 + float horizontal = vertical * context.camera.aspect;
194 +
195 + offset.x *= horizontal / (0.5f * context.width);
196 + offset.y *= vertical / (0.5f * context.height);
197 +
198 + float left = offset.x - horizontal;
199 + float right = offset.x + horizontal;
200 + float top = offset.y + vertical;
201 + float bottom = offset.y - vertical;
202 +
203 + return Matrix4x4.Ortho(left, right, bottom, top, context.camera.nearClipPlane, context.camera.farClipPlane);
204 + }
205 +
206 + public override void OnDisable()
207 + {
208 + if (m_HistoryTexture != null)
209 + RenderTexture.ReleaseTemporary(m_HistoryTexture);
210 +
211 + m_HistoryTexture = null;
212 + m_SampleIndex = 0;
213 + ResetHistory();
214 + }
215 + }
216 +}
1 +fileFormatVersion: 2
2 +guid: f28703283e17be54180fd04a7c70e1d5
3 +timeCreated: 1472806965
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public sealed class UserLutComponent : PostProcessingComponentRenderTexture<UserLutModel>
4 + {
5 + static class Uniforms
6 + {
7 + internal static readonly int _UserLut = Shader.PropertyToID("_UserLut");
8 + internal static readonly int _UserLut_Params = Shader.PropertyToID("_UserLut_Params");
9 + }
10 +
11 + public override bool active
12 + {
13 + get
14 + {
15 + var settings = model.settings;
16 + return model.enabled
17 + && settings.lut != null
18 + && settings.contribution > 0f
19 + && settings.lut.height == (int)Mathf.Sqrt(settings.lut.width)
20 + && !context.interrupted;
21 + }
22 + }
23 +
24 + public override void Prepare(Material uberMaterial)
25 + {
26 + var settings = model.settings;
27 + uberMaterial.EnableKeyword("USER_LUT");
28 + uberMaterial.SetTexture(Uniforms._UserLut, settings.lut);
29 + uberMaterial.SetVector(Uniforms._UserLut_Params, new Vector4(1f / settings.lut.width, 1f / settings.lut.height, settings.lut.height - 1f, settings.contribution));
30 + }
31 +
32 + public void OnGUI()
33 + {
34 + var settings = model.settings;
35 + var rect = new Rect(context.viewport.x * Screen.width + 8f, 8f, settings.lut.width, settings.lut.height);
36 + GUI.DrawTexture(rect, settings.lut);
37 + }
38 + }
39 +}
1 +fileFormatVersion: 2
2 +guid: 63cb071fb8442a14f85c02e6ddba9b72
3 +timeCreated: 1473086193
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public sealed class VignetteComponent : PostProcessingComponentRenderTexture<VignetteModel>
4 + {
5 + static class Uniforms
6 + {
7 + internal static readonly int _Vignette_Color = Shader.PropertyToID("_Vignette_Color");
8 + internal static readonly int _Vignette_Center = Shader.PropertyToID("_Vignette_Center");
9 + internal static readonly int _Vignette_Settings = Shader.PropertyToID("_Vignette_Settings");
10 + internal static readonly int _Vignette_Mask = Shader.PropertyToID("_Vignette_Mask");
11 + internal static readonly int _Vignette_Opacity = Shader.PropertyToID("_Vignette_Opacity");
12 + }
13 +
14 + public override bool active
15 + {
16 + get
17 + {
18 + return model.enabled
19 + && !context.interrupted;
20 + }
21 + }
22 +
23 + public override void Prepare(Material uberMaterial)
24 + {
25 + var settings = model.settings;
26 + uberMaterial.SetColor(Uniforms._Vignette_Color, settings.color);
27 +
28 + if (settings.mode == VignetteModel.Mode.Classic)
29 + {
30 + uberMaterial.SetVector(Uniforms._Vignette_Center, settings.center);
31 + uberMaterial.EnableKeyword("VIGNETTE_CLASSIC");
32 + float roundness = (1f - settings.roundness) * 6f + settings.roundness;
33 + uberMaterial.SetVector(Uniforms._Vignette_Settings, new Vector4(settings.intensity * 3f, settings.smoothness * 5f, roundness, settings.rounded ? 1f : 0f));
34 + }
35 + else if (settings.mode == VignetteModel.Mode.Masked)
36 + {
37 + if (settings.mask != null && settings.opacity > 0f)
38 + {
39 + uberMaterial.EnableKeyword("VIGNETTE_MASKED");
40 + uberMaterial.SetTexture(Uniforms._Vignette_Mask, settings.mask);
41 + uberMaterial.SetFloat(Uniforms._Vignette_Opacity, settings.opacity);
42 + }
43 + }
44 + }
45 + }
46 +}
1 +fileFormatVersion: 2
2 +guid: 39074aa97f4be23438147346f081c7f3
3 +timeCreated: 1473083872
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 8d5a699332eb8a9499077fa4bcd4e0a0
3 +folderAsset: yes
4 +timeCreated: 1459757852
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class AmbientOcclusionModel : PostProcessingModel
7 + {
8 + public enum SampleCount
9 + {
10 + Lowest = 3,
11 + Low = 6,
12 + Medium = 10,
13 + High = 16
14 + }
15 +
16 + [Serializable]
17 + public struct Settings
18 + {
19 + [Range(0, 4), Tooltip("Degree of darkness produced by the effect.")]
20 + public float intensity;
21 +
22 + [Min(1e-4f), Tooltip("Radius of sample points, which affects extent of darkened areas.")]
23 + public float radius;
24 +
25 + [Tooltip("Number of sample points, which affects quality and performance.")]
26 + public SampleCount sampleCount;
27 +
28 + [Tooltip("Halves the resolution of the effect to increase performance at the cost of visual quality.")]
29 + public bool downsampling;
30 +
31 + [Tooltip("Forces compatibility with Forward rendered objects when working with the Deferred rendering path.")]
32 + public bool forceForwardCompatibility;
33 +
34 + [Tooltip("Enables the ambient-only mode in that the effect only affects ambient lighting. This mode is only available with the Deferred rendering path and HDR rendering.")]
35 + public bool ambientOnly;
36 +
37 + [Tooltip("Toggles the use of a higher precision depth texture with the forward rendering path (may impact performances). Has no effect with the deferred rendering path.")]
38 + public bool highPrecision;
39 +
40 + public static Settings defaultSettings
41 + {
42 + get
43 + {
44 + return new Settings
45 + {
46 + intensity = 1f,
47 + radius = 0.3f,
48 + sampleCount = SampleCount.Medium,
49 + downsampling = true,
50 + forceForwardCompatibility = false,
51 + ambientOnly = false,
52 + highPrecision = false
53 + };
54 + }
55 + }
56 + }
57 +
58 + [SerializeField]
59 + Settings m_Settings = Settings.defaultSettings;
60 + public Settings settings
61 + {
62 + get { return m_Settings; }
63 + set { m_Settings = value; }
64 + }
65 +
66 + public override void Reset()
67 + {
68 + m_Settings = Settings.defaultSettings;
69 + }
70 + }
71 +}
1 +fileFormatVersion: 2
2 +guid: 564228afc5cbd5f49beb80038b4b7af2
3 +timeCreated: 1462280796
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class AntialiasingModel : PostProcessingModel
7 + {
8 + public enum Method
9 + {
10 + Fxaa,
11 + Taa
12 + }
13 +
14 + // Most settings aren't exposed to the user anymore, presets are enough. Still, I'm leaving
15 + // the tooltip attributes in case an user wants to customize each preset.
16 +
17 + #region FXAA Settings
18 + public enum FxaaPreset
19 + {
20 + ExtremePerformance,
21 + Performance,
22 + Default,
23 + Quality,
24 + ExtremeQuality
25 + }
26 +
27 + [Serializable]
28 + public struct FxaaQualitySettings
29 + {
30 + [Tooltip("The amount of desired sub-pixel aliasing removal. Effects the sharpeness of the output.")]
31 + [Range(0f, 1f)]
32 + public float subpixelAliasingRemovalAmount;
33 +
34 + [Tooltip("The minimum amount of local contrast required to qualify a region as containing an edge.")]
35 + [Range(0.063f, 0.333f)]
36 + public float edgeDetectionThreshold;
37 +
38 + [Tooltip("Local contrast adaptation value to disallow the algorithm from executing on the darker regions.")]
39 + [Range(0f, 0.0833f)]
40 + public float minimumRequiredLuminance;
41 +
42 + public static FxaaQualitySettings[] presets =
43 + {
44 + // ExtremePerformance
45 + new FxaaQualitySettings
46 + {
47 + subpixelAliasingRemovalAmount = 0f,
48 + edgeDetectionThreshold = 0.333f,
49 + minimumRequiredLuminance = 0.0833f
50 + },
51 +
52 + // Performance
53 + new FxaaQualitySettings
54 + {
55 + subpixelAliasingRemovalAmount = 0.25f,
56 + edgeDetectionThreshold = 0.25f,
57 + minimumRequiredLuminance = 0.0833f
58 + },
59 +
60 + // Default
61 + new FxaaQualitySettings
62 + {
63 + subpixelAliasingRemovalAmount = 0.75f,
64 + edgeDetectionThreshold = 0.166f,
65 + minimumRequiredLuminance = 0.0833f
66 + },
67 +
68 + // Quality
69 + new FxaaQualitySettings
70 + {
71 + subpixelAliasingRemovalAmount = 1f,
72 + edgeDetectionThreshold = 0.125f,
73 + minimumRequiredLuminance = 0.0625f
74 + },
75 +
76 + // ExtremeQuality
77 + new FxaaQualitySettings
78 + {
79 + subpixelAliasingRemovalAmount = 1f,
80 + edgeDetectionThreshold = 0.063f,
81 + minimumRequiredLuminance = 0.0312f
82 + }
83 + };
84 + }
85 +
86 + [Serializable]
87 + public struct FxaaConsoleSettings
88 + {
89 + [Tooltip("The amount of spread applied to the sampling coordinates while sampling for subpixel information.")]
90 + [Range(0.33f, 0.5f)]
91 + public float subpixelSpreadAmount;
92 +
93 + [Tooltip("This value dictates how sharp the edges in the image are kept; a higher value implies sharper edges.")]
94 + [Range(2f, 8f)]
95 + public float edgeSharpnessAmount;
96 +
97 + [Tooltip("The minimum amount of local contrast required to qualify a region as containing an edge.")]
98 + [Range(0.125f, 0.25f)]
99 + public float edgeDetectionThreshold;
100 +
101 + [Tooltip("Local contrast adaptation value to disallow the algorithm from executing on the darker regions.")]
102 + [Range(0.04f, 0.06f)]
103 + public float minimumRequiredLuminance;
104 +
105 + public static FxaaConsoleSettings[] presets =
106 + {
107 + // ExtremePerformance
108 + new FxaaConsoleSettings
109 + {
110 + subpixelSpreadAmount = 0.33f,
111 + edgeSharpnessAmount = 8f,
112 + edgeDetectionThreshold = 0.25f,
113 + minimumRequiredLuminance = 0.06f
114 + },
115 +
116 + // Performance
117 + new FxaaConsoleSettings
118 + {
119 + subpixelSpreadAmount = 0.33f,
120 + edgeSharpnessAmount = 8f,
121 + edgeDetectionThreshold = 0.125f,
122 + minimumRequiredLuminance = 0.06f
123 + },
124 +
125 + // Default
126 + new FxaaConsoleSettings
127 + {
128 + subpixelSpreadAmount = 0.5f,
129 + edgeSharpnessAmount = 8f,
130 + edgeDetectionThreshold = 0.125f,
131 + minimumRequiredLuminance = 0.05f
132 + },
133 +
134 + // Quality
135 + new FxaaConsoleSettings
136 + {
137 + subpixelSpreadAmount = 0.5f,
138 + edgeSharpnessAmount = 4f,
139 + edgeDetectionThreshold = 0.125f,
140 + minimumRequiredLuminance = 0.04f
141 + },
142 +
143 + // ExtremeQuality
144 + new FxaaConsoleSettings
145 + {
146 + subpixelSpreadAmount = 0.5f,
147 + edgeSharpnessAmount = 2f,
148 + edgeDetectionThreshold = 0.125f,
149 + minimumRequiredLuminance = 0.04f
150 + }
151 + };
152 + }
153 +
154 + [Serializable]
155 + public struct FxaaSettings
156 + {
157 + public FxaaPreset preset;
158 +
159 + public static FxaaSettings defaultSettings
160 + {
161 + get
162 + {
163 + return new FxaaSettings
164 + {
165 + preset = FxaaPreset.Default
166 + };
167 + }
168 + }
169 + }
170 + #endregion
171 +
172 + #region TAA Settings
173 + [Serializable]
174 + public struct TaaSettings
175 + {
176 + [Tooltip("The diameter (in texels) inside which jitter samples are spread. Smaller values result in crisper but more aliased output, while larger values result in more stable but blurrier output.")]
177 + [Range(0.1f, 1f)]
178 + public float jitterSpread;
179 +
180 + [Tooltip("Controls the amount of sharpening applied to the color buffer.")]
181 + [Range(0f, 3f)]
182 + public float sharpen;
183 +
184 + [Tooltip("The blend coefficient for a stationary fragment. Controls the percentage of history sample blended into the final color.")]
185 + [Range(0f, 0.99f)]
186 + public float stationaryBlending;
187 +
188 + [Tooltip("The blend coefficient for a fragment with significant motion. Controls the percentage of history sample blended into the final color.")]
189 + [Range(0f, 0.99f)]
190 + public float motionBlending;
191 +
192 + public static TaaSettings defaultSettings
193 + {
194 + get
195 + {
196 + return new TaaSettings
197 + {
198 + jitterSpread = 0.75f,
199 + sharpen = 0.3f,
200 + stationaryBlending = 0.95f,
201 + motionBlending = 0.85f
202 + };
203 + }
204 + }
205 + }
206 + #endregion
207 +
208 + [Serializable]
209 + public struct Settings
210 + {
211 + public Method method;
212 + public FxaaSettings fxaaSettings;
213 + public TaaSettings taaSettings;
214 +
215 + public static Settings defaultSettings
216 + {
217 + get
218 + {
219 + return new Settings
220 + {
221 + method = Method.Fxaa,
222 + fxaaSettings = FxaaSettings.defaultSettings,
223 + taaSettings = TaaSettings.defaultSettings
224 + };
225 + }
226 + }
227 + }
228 +
229 + [SerializeField]
230 + Settings m_Settings = Settings.defaultSettings;
231 + public Settings settings
232 + {
233 + get { return m_Settings; }
234 + set { m_Settings = value; }
235 + }
236 +
237 + public override void Reset()
238 + {
239 + m_Settings = Settings.defaultSettings;
240 + }
241 + }
242 +}
1 +fileFormatVersion: 2
2 +guid: cb9a239ec5f20ca4cb5d0391441588de
3 +timeCreated: 1467126855
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class BloomModel : PostProcessingModel
7 + {
8 + [Serializable]
9 + public struct BloomSettings
10 + {
11 + [Min(0f), Tooltip("Strength of the bloom filter.")]
12 + public float intensity;
13 +
14 + [Min(0f), Tooltip("Filters out pixels under this level of brightness.")]
15 + public float threshold;
16 +
17 + public float thresholdLinear
18 + {
19 + set { threshold = Mathf.LinearToGammaSpace(value); }
20 + get { return Mathf.GammaToLinearSpace(threshold); }
21 + }
22 +
23 + [Range(0f, 1f), Tooltip("Makes transition between under/over-threshold gradual (0 = hard threshold, 1 = soft threshold).")]
24 + public float softKnee;
25 +
26 + [Range(1f, 7f), Tooltip("Changes extent of veiling effects in a screen resolution-independent fashion.")]
27 + public float radius;
28 +
29 + [Tooltip("Reduces flashing noise with an additional filter.")]
30 + public bool antiFlicker;
31 +
32 + public static BloomSettings defaultSettings
33 + {
34 + get
35 + {
36 + return new BloomSettings
37 + {
38 + intensity = 0.5f,
39 + threshold = 1.1f,
40 + softKnee = 0.5f,
41 + radius = 4f,
42 + antiFlicker = false,
43 + };
44 + }
45 + }
46 + }
47 +
48 + [Serializable]
49 + public struct LensDirtSettings
50 + {
51 + [Tooltip("Dirtiness texture to add smudges or dust to the lens.")]
52 + public Texture texture;
53 +
54 + [Min(0f), Tooltip("Amount of lens dirtiness.")]
55 + public float intensity;
56 +
57 + public static LensDirtSettings defaultSettings
58 + {
59 + get
60 + {
61 + return new LensDirtSettings
62 + {
63 + texture = null,
64 + intensity = 3f
65 + };
66 + }
67 + }
68 + }
69 +
70 + [Serializable]
71 + public struct Settings
72 + {
73 + public BloomSettings bloom;
74 + public LensDirtSettings lensDirt;
75 +
76 + public static Settings defaultSettings
77 + {
78 + get
79 + {
80 + return new Settings
81 + {
82 + bloom = BloomSettings.defaultSettings,
83 + lensDirt = LensDirtSettings.defaultSettings
84 + };
85 + }
86 + }
87 + }
88 +
89 + [SerializeField]
90 + Settings m_Settings = Settings.defaultSettings;
91 + public Settings settings
92 + {
93 + get { return m_Settings; }
94 + set { m_Settings = value; }
95 + }
96 +
97 + public override void Reset()
98 + {
99 + m_Settings = Settings.defaultSettings;
100 + }
101 + }
102 +}
1 +fileFormatVersion: 2
2 +guid: e215a6ec29d100f489c186f289526f06
3 +timeCreated: 1467126855
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class BuiltinDebugViewsModel : PostProcessingModel
7 + {
8 + [Serializable]
9 + public struct DepthSettings
10 + {
11 + [Range(0f, 1f), Tooltip("Scales the camera far plane before displaying the depth map.")]
12 + public float scale;
13 +
14 + public static DepthSettings defaultSettings
15 + {
16 + get
17 + {
18 + return new DepthSettings
19 + {
20 + scale = 1f
21 + };
22 + }
23 + }
24 + }
25 +
26 + [Serializable]
27 + public struct MotionVectorsSettings
28 + {
29 + [Range(0f, 1f), Tooltip("Opacity of the source render.")]
30 + public float sourceOpacity;
31 +
32 + [Range(0f, 1f), Tooltip("Opacity of the per-pixel motion vector colors.")]
33 + public float motionImageOpacity;
34 +
35 + [Min(0f), Tooltip("Because motion vectors are mainly very small vectors, you can use this setting to make them more visible.")]
36 + public float motionImageAmplitude;
37 +
38 + [Range(0f, 1f), Tooltip("Opacity for the motion vector arrows.")]
39 + public float motionVectorsOpacity;
40 +
41 + [Range(8, 64), Tooltip("The arrow density on screen.")]
42 + public int motionVectorsResolution;
43 +
44 + [Min(0f), Tooltip("Tweaks the arrows length.")]
45 + public float motionVectorsAmplitude;
46 +
47 + public static MotionVectorsSettings defaultSettings
48 + {
49 + get
50 + {
51 + return new MotionVectorsSettings
52 + {
53 + sourceOpacity = 1f,
54 +
55 + motionImageOpacity = 0f,
56 + motionImageAmplitude = 16f,
57 +
58 + motionVectorsOpacity = 1f,
59 + motionVectorsResolution = 24,
60 + motionVectorsAmplitude = 64f
61 + };
62 + }
63 + }
64 + }
65 +
66 + public enum Mode
67 + {
68 + None,
69 +
70 + Depth,
71 + Normals,
72 + MotionVectors,
73 +
74 + AmbientOcclusion,
75 + EyeAdaptation,
76 + FocusPlane,
77 + PreGradingLog,
78 + LogLut,
79 + UserLut
80 + }
81 +
82 + [Serializable]
83 + public struct Settings
84 + {
85 + public Mode mode;
86 + public DepthSettings depth;
87 + public MotionVectorsSettings motionVectors;
88 +
89 + public static Settings defaultSettings
90 + {
91 + get
92 + {
93 + return new Settings
94 + {
95 + mode = Mode.None,
96 + depth = DepthSettings.defaultSettings,
97 + motionVectors = MotionVectorsSettings.defaultSettings
98 + };
99 + }
100 + }
101 + }
102 +
103 + [SerializeField]
104 + Settings m_Settings = Settings.defaultSettings;
105 + public Settings settings
106 + {
107 + get { return m_Settings; }
108 + set { m_Settings = value; }
109 + }
110 +
111 + public bool willInterrupt
112 + {
113 + get
114 + {
115 + return !IsModeActive(Mode.None)
116 + && !IsModeActive(Mode.EyeAdaptation)
117 + && !IsModeActive(Mode.PreGradingLog)
118 + && !IsModeActive(Mode.LogLut)
119 + && !IsModeActive(Mode.UserLut);
120 + }
121 + }
122 +
123 + public override void Reset()
124 + {
125 + settings = Settings.defaultSettings;
126 + }
127 +
128 + public bool IsModeActive(Mode mode)
129 + {
130 + return m_Settings.mode == mode;
131 + }
132 + }
133 +}
1 +fileFormatVersion: 2
2 +guid: 33d6d1a4b7b3dec40819019a25605191
3 +timeCreated: 1467970684
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class ChromaticAberrationModel : PostProcessingModel
7 + {
8 + [Serializable]
9 + public struct Settings
10 + {
11 + [Tooltip("Shift the hue of chromatic aberrations.")]
12 + public Texture2D spectralTexture;
13 +
14 + [Range(0f, 1f), Tooltip("Amount of tangential distortion.")]
15 + public float intensity;
16 +
17 + public static Settings defaultSettings
18 + {
19 + get
20 + {
21 + return new Settings
22 + {
23 + spectralTexture = null,
24 + intensity = 0.1f
25 + };
26 + }
27 + }
28 + }
29 +
30 + [SerializeField]
31 + Settings m_Settings = Settings.defaultSettings;
32 + public Settings settings
33 + {
34 + get { return m_Settings; }
35 + set { m_Settings = value; }
36 + }
37 +
38 + public override void Reset()
39 + {
40 + m_Settings = Settings.defaultSettings;
41 + }
42 + }
43 +}
1 +fileFormatVersion: 2
2 +guid: 8da01668697617e43879715e835a2367
3 +timeCreated: 1467126855
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class ColorGradingModel : PostProcessingModel
7 + {
8 + public enum Tonemapper
9 + {
10 + None,
11 +
12 + /// <summary>
13 + /// ACES Filmic reference tonemapper.
14 + /// </summary>
15 + ACES,
16 +
17 + /// <summary>
18 + /// Neutral tonemapper (based off John Hable's & Jim Hejl's work).
19 + /// </summary>
20 + Neutral
21 + }
22 +
23 + [Serializable]
24 + public struct TonemappingSettings
25 + {
26 + [Tooltip("Tonemapping algorithm to use at the end of the color grading process. Use \"Neutral\" if you need a customizable tonemapper or \"Filmic\" to give a standard filmic look to your scenes.")]
27 + public Tonemapper tonemapper;
28 +
29 + // Neutral settings
30 + [Range(-0.1f, 0.1f)]
31 + public float neutralBlackIn;
32 +
33 + [Range(1f, 20f)]
34 + public float neutralWhiteIn;
35 +
36 + [Range(-0.09f, 0.1f)]
37 + public float neutralBlackOut;
38 +
39 + [Range(1f, 19f)]
40 + public float neutralWhiteOut;
41 +
42 + [Range(0.1f, 20f)]
43 + public float neutralWhiteLevel;
44 +
45 + [Range(1f, 10f)]
46 + public float neutralWhiteClip;
47 +
48 + public static TonemappingSettings defaultSettings
49 + {
50 + get
51 + {
52 + return new TonemappingSettings
53 + {
54 + tonemapper = Tonemapper.Neutral,
55 +
56 + neutralBlackIn = 0.02f,
57 + neutralWhiteIn = 10f,
58 + neutralBlackOut = 0f,
59 + neutralWhiteOut = 10f,
60 + neutralWhiteLevel = 5.3f,
61 + neutralWhiteClip = 10f
62 + };
63 + }
64 + }
65 + }
66 +
67 + [Serializable]
68 + public struct BasicSettings
69 + {
70 + [Tooltip("Adjusts the overall exposure of the scene in EV units. This is applied after HDR effect and right before tonemapping so it won't affect previous effects in the chain.")]
71 + public float postExposure;
72 +
73 + [Range(-100f, 100f), Tooltip("Sets the white balance to a custom color temperature.")]
74 + public float temperature;
75 +
76 + [Range(-100f, 100f), Tooltip("Sets the white balance to compensate for a green or magenta tint.")]
77 + public float tint;
78 +
79 + [Range(-180f, 180f), Tooltip("Shift the hue of all colors.")]
80 + public float hueShift;
81 +
82 + [Range(0f, 2f), Tooltip("Pushes the intensity of all colors.")]
83 + public float saturation;
84 +
85 + [Range(0f, 2f), Tooltip("Expands or shrinks the overall range of tonal values.")]
86 + public float contrast;
87 +
88 + public static BasicSettings defaultSettings
89 + {
90 + get
91 + {
92 + return new BasicSettings
93 + {
94 + postExposure = 0f,
95 +
96 + temperature = 0f,
97 + tint = 0f,
98 +
99 + hueShift = 0f,
100 + saturation = 1f,
101 + contrast = 1f,
102 + };
103 + }
104 + }
105 + }
106 +
107 + [Serializable]
108 + public struct ChannelMixerSettings
109 + {
110 + public Vector3 red;
111 + public Vector3 green;
112 + public Vector3 blue;
113 +
114 + [HideInInspector]
115 + public int currentEditingChannel; // Used only in the editor
116 +
117 + public static ChannelMixerSettings defaultSettings
118 + {
119 + get
120 + {
121 + return new ChannelMixerSettings
122 + {
123 + red = new Vector3(1f, 0f, 0f),
124 + green = new Vector3(0f, 1f, 0f),
125 + blue = new Vector3(0f, 0f, 1f),
126 + currentEditingChannel = 0
127 + };
128 + }
129 + }
130 + }
131 +
132 + [Serializable]
133 + public struct LogWheelsSettings
134 + {
135 + [Trackball("GetSlopeValue")]
136 + public Color slope;
137 +
138 + [Trackball("GetPowerValue")]
139 + public Color power;
140 +
141 + [Trackball("GetOffsetValue")]
142 + public Color offset;
143 +
144 + public static LogWheelsSettings defaultSettings
145 + {
146 + get
147 + {
148 + return new LogWheelsSettings
149 + {
150 + slope = Color.clear,
151 + power = Color.clear,
152 + offset = Color.clear
153 + };
154 + }
155 + }
156 + }
157 +
158 + [Serializable]
159 + public struct LinearWheelsSettings
160 + {
161 + [Trackball("GetLiftValue")]
162 + public Color lift;
163 +
164 + [Trackball("GetGammaValue")]
165 + public Color gamma;
166 +
167 + [Trackball("GetGainValue")]
168 + public Color gain;
169 +
170 + public static LinearWheelsSettings defaultSettings
171 + {
172 + get
173 + {
174 + return new LinearWheelsSettings
175 + {
176 + lift = Color.clear,
177 + gamma = Color.clear,
178 + gain = Color.clear
179 + };
180 + }
181 + }
182 + }
183 +
184 + public enum ColorWheelMode
185 + {
186 + Linear,
187 + Log
188 + }
189 +
190 + [Serializable]
191 + public struct ColorWheelsSettings
192 + {
193 + public ColorWheelMode mode;
194 +
195 + [TrackballGroup]
196 + public LogWheelsSettings log;
197 +
198 + [TrackballGroup]
199 + public LinearWheelsSettings linear;
200 +
201 + public static ColorWheelsSettings defaultSettings
202 + {
203 + get
204 + {
205 + return new ColorWheelsSettings
206 + {
207 + mode = ColorWheelMode.Log,
208 + log = LogWheelsSettings.defaultSettings,
209 + linear = LinearWheelsSettings.defaultSettings
210 + };
211 + }
212 + }
213 + }
214 +
215 + [Serializable]
216 + public struct CurvesSettings
217 + {
218 + public ColorGradingCurve master;
219 + public ColorGradingCurve red;
220 + public ColorGradingCurve green;
221 + public ColorGradingCurve blue;
222 + public ColorGradingCurve hueVShue;
223 + public ColorGradingCurve hueVSsat;
224 + public ColorGradingCurve satVSsat;
225 + public ColorGradingCurve lumVSsat;
226 +
227 + // Used only in the editor
228 + [HideInInspector] public int e_CurrentEditingCurve;
229 + [HideInInspector] public bool e_CurveY;
230 + [HideInInspector] public bool e_CurveR;
231 + [HideInInspector] public bool e_CurveG;
232 + [HideInInspector] public bool e_CurveB;
233 +
234 + public static CurvesSettings defaultSettings
235 + {
236 + get
237 + {
238 + return new CurvesSettings
239 + {
240 + master = new ColorGradingCurve(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)),
241 + red = new ColorGradingCurve(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)),
242 + green = new ColorGradingCurve(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)),
243 + blue = new ColorGradingCurve(new AnimationCurve(new Keyframe(0f, 0f, 1f, 1f), new Keyframe(1f, 1f, 1f, 1f)), 0f, false, new Vector2(0f, 1f)),
244 +
245 + hueVShue = new ColorGradingCurve(new AnimationCurve(), 0.5f, true, new Vector2(0f, 1f)),
246 + hueVSsat = new ColorGradingCurve(new AnimationCurve(), 0.5f, true, new Vector2(0f, 1f)),
247 + satVSsat = new ColorGradingCurve(new AnimationCurve(), 0.5f, false, new Vector2(0f, 1f)),
248 + lumVSsat = new ColorGradingCurve(new AnimationCurve(), 0.5f, false, new Vector2(0f, 1f)),
249 +
250 + e_CurrentEditingCurve = 0,
251 + e_CurveY = true,
252 + e_CurveR = false,
253 + e_CurveG = false,
254 + e_CurveB = false
255 + };
256 + }
257 + }
258 + }
259 +
260 + [Serializable]
261 + public struct Settings
262 + {
263 + public TonemappingSettings tonemapping;
264 + public BasicSettings basic;
265 + public ChannelMixerSettings channelMixer;
266 + public ColorWheelsSettings colorWheels;
267 + public CurvesSettings curves;
268 +
269 + public static Settings defaultSettings
270 + {
271 + get
272 + {
273 + return new Settings
274 + {
275 + tonemapping = TonemappingSettings.defaultSettings,
276 + basic = BasicSettings.defaultSettings,
277 + channelMixer = ChannelMixerSettings.defaultSettings,
278 + colorWheels = ColorWheelsSettings.defaultSettings,
279 + curves = CurvesSettings.defaultSettings
280 + };
281 + }
282 + }
283 + }
284 +
285 + [SerializeField]
286 + Settings m_Settings = Settings.defaultSettings;
287 + public Settings settings
288 + {
289 + get { return m_Settings; }
290 + set
291 + {
292 + m_Settings = value;
293 + OnValidate();
294 + }
295 + }
296 +
297 + public bool isDirty { get; internal set; }
298 + public RenderTexture bakedLut { get; internal set; }
299 +
300 + public override void Reset()
301 + {
302 + m_Settings = Settings.defaultSettings;
303 + OnValidate();
304 + }
305 +
306 + public override void OnValidate()
307 + {
308 + isDirty = true;
309 + }
310 + }
311 +}
1 +fileFormatVersion: 2
2 +guid: fe146bcdc1fb8ae4ab7dd803982d3489
3 +timeCreated: 1467126855
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class DepthOfFieldModel : PostProcessingModel
7 + {
8 + public enum KernelSize
9 + {
10 + Small,
11 + Medium,
12 + Large,
13 + VeryLarge
14 + }
15 +
16 + [Serializable]
17 + public struct Settings
18 + {
19 + [Min(0.1f), Tooltip("Distance to the point of focus.")]
20 + public float focusDistance;
21 +
22 + [Range(0.05f, 32f), Tooltip("Ratio of aperture (known as f-stop or f-number). The smaller the value is, the shallower the depth of field is.")]
23 + public float aperture;
24 +
25 + [Range(1f, 300f), Tooltip("Distance between the lens and the film. The larger the value is, the shallower the depth of field is.")]
26 + public float focalLength;
27 +
28 + [Tooltip("Calculate the focal length automatically from the field-of-view value set on the camera. Using this setting isn't recommended.")]
29 + public bool useCameraFov;
30 +
31 + [Tooltip("Convolution kernel size of the bokeh filter, which determines the maximum radius of bokeh. It also affects the performance (the larger the kernel is, the longer the GPU time is required).")]
32 + public KernelSize kernelSize;
33 +
34 + public static Settings defaultSettings
35 + {
36 + get
37 + {
38 + return new Settings
39 + {
40 + focusDistance = 10f,
41 + aperture = 5.6f,
42 + focalLength = 50f,
43 + useCameraFov = false,
44 + kernelSize = KernelSize.Medium
45 + };
46 + }
47 + }
48 + }
49 +
50 + [SerializeField]
51 + Settings m_Settings = Settings.defaultSettings;
52 + public Settings settings
53 + {
54 + get { return m_Settings; }
55 + set { m_Settings = value; }
56 + }
57 +
58 + public override void Reset()
59 + {
60 + m_Settings = Settings.defaultSettings;
61 + }
62 + }
63 +}
1 +fileFormatVersion: 2
2 +guid: 2626b17c595c71e43811d654eb28d30d
3 +timeCreated: 1467126855
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class DitheringModel : PostProcessingModel
7 + {
8 + [Serializable]
9 + public struct Settings
10 + {
11 + public static Settings defaultSettings
12 + {
13 + get { return new Settings(); }
14 + }
15 + }
16 +
17 + [SerializeField]
18 + Settings m_Settings = Settings.defaultSettings;
19 + public Settings settings
20 + {
21 + get { return m_Settings; }
22 + set { m_Settings = value; }
23 + }
24 +
25 + public override void Reset()
26 + {
27 + m_Settings = Settings.defaultSettings;
28 + }
29 + }
30 +}
1 +fileFormatVersion: 2
2 +guid: 41209882cdbcf31429d2a457a2164801
3 +timeCreated: 1485179235
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class EyeAdaptationModel : PostProcessingModel
7 + {
8 + public enum EyeAdaptationType
9 + {
10 + Progressive,
11 + Fixed
12 + }
13 +
14 + [Serializable]
15 + public struct Settings
16 + {
17 + [Range(1f, 99f), Tooltip("Filters the dark part of the histogram when computing the average luminance to avoid very dark pixels from contributing to the auto exposure. Unit is in percent.")]
18 + public float lowPercent;
19 +
20 + [Range(1f, 99f), Tooltip("Filters the bright part of the histogram when computing the average luminance to avoid very dark pixels from contributing to the auto exposure. Unit is in percent.")]
21 + public float highPercent;
22 +
23 + [Tooltip("Minimum average luminance to consider for auto exposure (in EV).")]
24 + public float minLuminance;
25 +
26 + [Tooltip("Maximum average luminance to consider for auto exposure (in EV).")]
27 + public float maxLuminance;
28 +
29 + [Min(0f), Tooltip("Exposure bias. Use this to offset the global exposure of the scene.")]
30 + public float keyValue;
31 +
32 + [Tooltip("Set this to true to let Unity handle the key value automatically based on average luminance.")]
33 + public bool dynamicKeyValue;
34 +
35 + [Tooltip("Use \"Progressive\" if you want the auto exposure to be animated. Use \"Fixed\" otherwise.")]
36 + public EyeAdaptationType adaptationType;
37 +
38 + [Min(0f), Tooltip("Adaptation speed from a dark to a light environment.")]
39 + public float speedUp;
40 +
41 + [Min(0f), Tooltip("Adaptation speed from a light to a dark environment.")]
42 + public float speedDown;
43 +
44 + [Range(-16, -1), Tooltip("Lower bound for the brightness range of the generated histogram (in EV). The bigger the spread between min & max, the lower the precision will be.")]
45 + public int logMin;
46 +
47 + [Range(1, 16), Tooltip("Upper bound for the brightness range of the generated histogram (in EV). The bigger the spread between min & max, the lower the precision will be.")]
48 + public int logMax;
49 +
50 + public static Settings defaultSettings
51 + {
52 + get
53 + {
54 + return new Settings
55 + {
56 + lowPercent = 45f,
57 + highPercent = 95f,
58 +
59 + minLuminance = -5f,
60 + maxLuminance = 1f,
61 + keyValue = 0.25f,
62 + dynamicKeyValue = true,
63 +
64 + adaptationType = EyeAdaptationType.Progressive,
65 + speedUp = 2f,
66 + speedDown = 1f,
67 +
68 + logMin = -8,
69 + logMax = 4
70 + };
71 + }
72 + }
73 + }
74 +
75 + [SerializeField]
76 + Settings m_Settings = Settings.defaultSettings;
77 + public Settings settings
78 + {
79 + get { return m_Settings; }
80 + set { m_Settings = value; }
81 + }
82 +
83 + public override void Reset()
84 + {
85 + m_Settings = Settings.defaultSettings;
86 + }
87 + }
88 +}
1 +fileFormatVersion: 2
2 +guid: edf6d216ca4b60942a0c533c14f26d53
3 +timeCreated: 1467126855
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class FogModel : PostProcessingModel
7 + {
8 + [Serializable]
9 + public struct Settings
10 + {
11 + [Tooltip("Should the fog affect the skybox?")]
12 + public bool excludeSkybox;
13 +
14 + public static Settings defaultSettings
15 + {
16 + get
17 + {
18 + return new Settings
19 + {
20 + excludeSkybox = true
21 + };
22 + }
23 + }
24 + }
25 +
26 + [SerializeField]
27 + Settings m_Settings = Settings.defaultSettings;
28 + public Settings settings
29 + {
30 + get { return m_Settings; }
31 + set { m_Settings = value; }
32 + }
33 +
34 + public override void Reset()
35 + {
36 + m_Settings = Settings.defaultSettings;
37 + }
38 + }
39 +}
1 +fileFormatVersion: 2
2 +guid: 1e20e66aa2deb7943993c444137d9acd
3 +timeCreated: 1487328709
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class GrainModel : PostProcessingModel
7 + {
8 + [Serializable]
9 + public struct Settings
10 + {
11 + [Tooltip("Enable the use of colored grain.")]
12 + public bool colored;
13 +
14 + [Range(0f, 1f), Tooltip("Grain strength. Higher means more visible grain.")]
15 + public float intensity;
16 +
17 + [Range(0.3f, 3f), Tooltip("Grain particle size.")]
18 + public float size;
19 +
20 + [Range(0f, 1f), Tooltip("Controls the noisiness response curve based on scene luminance. Lower values mean less noise in dark areas.")]
21 + public float luminanceContribution;
22 +
23 + public static Settings defaultSettings
24 + {
25 + get
26 + {
27 + return new Settings
28 + {
29 + colored = true,
30 + intensity = 0.5f,
31 + size = 1f,
32 + luminanceContribution = 0.8f
33 + };
34 + }
35 + }
36 + }
37 +
38 + [SerializeField]
39 + Settings m_Settings = Settings.defaultSettings;
40 + public Settings settings
41 + {
42 + get { return m_Settings; }
43 + set { m_Settings = value; }
44 + }
45 +
46 + public override void Reset()
47 + {
48 + m_Settings = Settings.defaultSettings;
49 + }
50 + }
51 +}
1 +fileFormatVersion: 2
2 +guid: f4fbcdb7f7a3c76489f32ffea74e6bb3
3 +timeCreated: 1467126855
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class MotionBlurModel : PostProcessingModel
7 + {
8 + [Serializable]
9 + public struct Settings
10 + {
11 + [Range(0f, 360f), Tooltip("The angle of rotary shutter. Larger values give longer exposure.")]
12 + public float shutterAngle;
13 +
14 + [Range(4, 32), Tooltip("The amount of sample points, which affects quality and performances.")]
15 + public int sampleCount;
16 +
17 + [Range(0f, 1f), Tooltip("The strength of multiple frame blending. The opacity of preceding frames are determined from this coefficient and time differences.")]
18 + public float frameBlending;
19 +
20 + public static Settings defaultSettings
21 + {
22 + get
23 + {
24 + return new Settings
25 + {
26 + shutterAngle = 270f,
27 + sampleCount = 10,
28 + frameBlending = 0f
29 + };
30 + }
31 + }
32 + }
33 +
34 + [SerializeField]
35 + Settings m_Settings = Settings.defaultSettings;
36 + public Settings settings
37 + {
38 + get { return m_Settings; }
39 + set { m_Settings = value; }
40 + }
41 +
42 + public override void Reset()
43 + {
44 + m_Settings = Settings.defaultSettings;
45 + }
46 + }
47 +}
1 +fileFormatVersion: 2
2 +guid: bb4df227c906dd342bd34767914d292c
3 +timeCreated: 1468325392
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class ScreenSpaceReflectionModel : PostProcessingModel
7 + {
8 + public enum SSRResolution
9 + {
10 + High = 0,
11 + Low = 2
12 + }
13 +
14 + public enum SSRReflectionBlendType
15 + {
16 + PhysicallyBased,
17 + Additive
18 + }
19 +
20 + [Serializable]
21 + public struct IntensitySettings
22 + {
23 + [Tooltip("Nonphysical multiplier for the SSR reflections. 1.0 is physically based.")]
24 + [Range(0.0f, 2.0f)]
25 + public float reflectionMultiplier;
26 +
27 + [Tooltip("How far away from the maxDistance to begin fading SSR.")]
28 + [Range(0.0f, 1000.0f)]
29 + public float fadeDistance;
30 +
31 + [Tooltip("Amplify Fresnel fade out. Increase if floor reflections look good close to the surface and bad farther 'under' the floor.")]
32 + [Range(0.0f, 1.0f)]
33 + public float fresnelFade;
34 +
35 + [Tooltip("Higher values correspond to a faster Fresnel fade as the reflection changes from the grazing angle.")]
36 + [Range(0.1f, 10.0f)]
37 + public float fresnelFadePower;
38 + }
39 +
40 + [Serializable]
41 + public struct ReflectionSettings
42 + {
43 + // When enabled, we just add our reflections on top of the existing ones. This is physically incorrect, but several
44 + // popular demos and games have taken this approach, and it does hide some artifacts.
45 + [Tooltip("How the reflections are blended into the render.")]
46 + public SSRReflectionBlendType blendType;
47 +
48 + [Tooltip("Half resolution SSRR is much faster, but less accurate.")]
49 + public SSRResolution reflectionQuality;
50 +
51 + [Tooltip("Maximum reflection distance in world units.")]
52 + [Range(0.1f, 300.0f)]
53 + public float maxDistance;
54 +
55 + /// REFLECTIONS
56 + [Tooltip("Max raytracing length.")]
57 + [Range(16, 1024)]
58 + public int iterationCount;
59 +
60 + [Tooltip("Log base 2 of ray tracing coarse step size. Higher traces farther, lower gives better quality silhouettes.")]
61 + [Range(1, 16)]
62 + public int stepSize;
63 +
64 + [Tooltip("Typical thickness of columns, walls, furniture, and other objects that reflection rays might pass behind.")]
65 + [Range(0.01f, 10.0f)]
66 + public float widthModifier;
67 +
68 + [Tooltip("Blurriness of reflections.")]
69 + [Range(0.1f, 8.0f)]
70 + public float reflectionBlur;
71 +
72 + [Tooltip("Disable for a performance gain in scenes where most glossy objects are horizontal, like floors, water, and tables. Leave on for scenes with glossy vertical objects.")]
73 + public bool reflectBackfaces;
74 + }
75 +
76 + [Serializable]
77 + public struct ScreenEdgeMask
78 + {
79 + [Tooltip("Higher = fade out SSRR near the edge of the screen so that reflections don't pop under camera motion.")]
80 + [Range(0.0f, 1.0f)]
81 + public float intensity;
82 + }
83 +
84 + [Serializable]
85 + public struct Settings
86 + {
87 + public ReflectionSettings reflection;
88 + public IntensitySettings intensity;
89 + public ScreenEdgeMask screenEdgeMask;
90 +
91 + public static Settings defaultSettings
92 + {
93 + get
94 + {
95 + return new Settings
96 + {
97 + reflection = new ReflectionSettings
98 + {
99 + blendType = SSRReflectionBlendType.PhysicallyBased,
100 + reflectionQuality = SSRResolution.Low,
101 + maxDistance = 100f,
102 + iterationCount = 256,
103 + stepSize = 3,
104 + widthModifier = 0.5f,
105 + reflectionBlur = 1f,
106 + reflectBackfaces = false
107 + },
108 +
109 + intensity = new IntensitySettings
110 + {
111 + reflectionMultiplier = 1f,
112 + fadeDistance = 100f,
113 +
114 + fresnelFade = 1f,
115 + fresnelFadePower = 1f,
116 + },
117 +
118 + screenEdgeMask = new ScreenEdgeMask
119 + {
120 + intensity = 0.03f
121 + }
122 + };
123 + }
124 + }
125 + }
126 +
127 + [SerializeField]
128 + Settings m_Settings = Settings.defaultSettings;
129 + public Settings settings
130 + {
131 + get { return m_Settings; }
132 + set { m_Settings = value; }
133 + }
134 +
135 + public override void Reset()
136 + {
137 + m_Settings = Settings.defaultSettings;
138 + }
139 + }
140 +}
1 +fileFormatVersion: 2
2 +guid: e841012229e57cd408a146561435e90d
3 +timeCreated: 1467126855
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class UserLutModel : PostProcessingModel
7 + {
8 + [Serializable]
9 + public struct Settings
10 + {
11 + [Tooltip("Custom lookup texture (strip format, e.g. 256x16).")]
12 + public Texture2D lut;
13 +
14 + [Range(0f, 1f), Tooltip("Blending factor.")]
15 + public float contribution;
16 +
17 + public static Settings defaultSettings
18 + {
19 + get
20 + {
21 + return new Settings
22 + {
23 + lut = null,
24 + contribution = 1f
25 + };
26 + }
27 + }
28 + }
29 +
30 + [SerializeField]
31 + Settings m_Settings = Settings.defaultSettings;
32 + public Settings settings
33 + {
34 + get { return m_Settings; }
35 + set { m_Settings = value; }
36 + }
37 +
38 + public override void Reset()
39 + {
40 + m_Settings = Settings.defaultSettings;
41 + }
42 + }
43 +}
1 +fileFormatVersion: 2
2 +guid: 3a7afd753a89c4140b80c855e15f69d6
3 +timeCreated: 1467126855
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public class VignetteModel : PostProcessingModel
7 + {
8 + public enum Mode
9 + {
10 + Classic,
11 + Masked
12 + }
13 +
14 + [Serializable]
15 + public struct Settings
16 + {
17 + [Tooltip("Use the \"Classic\" mode for parametric controls. Use the \"Masked\" mode to use your own texture mask.")]
18 + public Mode mode;
19 +
20 + [ColorUsage(false)]
21 + [Tooltip("Vignette color. Use the alpha channel for transparency.")]
22 + public Color color;
23 +
24 + [Tooltip("Sets the vignette center point (screen center is [0.5,0.5]).")]
25 + public Vector2 center;
26 +
27 + [Range(0f, 1f), Tooltip("Amount of vignetting on screen.")]
28 + public float intensity;
29 +
30 + [Range(0.01f, 1f), Tooltip("Smoothness of the vignette borders.")]
31 + public float smoothness;
32 +
33 + [Range(0f, 1f), Tooltip("Lower values will make a square-ish vignette.")]
34 + public float roundness;
35 +
36 + [Tooltip("A black and white mask to use as a vignette.")]
37 + public Texture mask;
38 +
39 + [Range(0f, 1f), Tooltip("Mask opacity.")]
40 + public float opacity;
41 +
42 + [Tooltip("Should the vignette be perfectly round or be dependent on the current aspect ratio?")]
43 + public bool rounded;
44 +
45 + public static Settings defaultSettings
46 + {
47 + get
48 + {
49 + return new Settings
50 + {
51 + mode = Mode.Classic,
52 + color = new Color(0f, 0f, 0f, 1f),
53 + center = new Vector2(0.5f, 0.5f),
54 + intensity = 0.45f,
55 + smoothness = 0.2f,
56 + roundness = 1f,
57 + mask = null,
58 + opacity = 1f,
59 + rounded = false
60 + };
61 + }
62 + }
63 + }
64 +
65 + [SerializeField]
66 + Settings m_Settings = Settings.defaultSettings;
67 + public Settings settings
68 + {
69 + get { return m_Settings; }
70 + set { m_Settings = value; }
71 + }
72 +
73 + public override void Reset()
74 + {
75 + m_Settings = Settings.defaultSettings;
76 + }
77 + }
78 +}
1 +fileFormatVersion: 2
2 +guid: d7aa967ba692363448f1b25d0728b9bd
3 +timeCreated: 1467126855
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +using System.Collections.Generic;
3 +using UnityEngine.Rendering;
4 +
5 +namespace UnityEngine.PostProcessing
6 +{
7 + using DebugMode = BuiltinDebugViewsModel.Mode;
8 +
9 +#if UNITY_5_4_OR_NEWER
10 + [ImageEffectAllowedInSceneView]
11 +#endif
12 + [RequireComponent(typeof(Camera)), DisallowMultipleComponent, ExecuteInEditMode]
13 + [AddComponentMenu("Effects/Post-Processing Behaviour", -1)]
14 + public class PostProcessingBehaviour : MonoBehaviour
15 + {
16 + // Inspector fields
17 + public PostProcessingProfile profile;
18 +
19 + public Func<Vector2, Matrix4x4> jitteredMatrixFunc;
20 +
21 + // Internal helpers
22 + Dictionary<Type, KeyValuePair<CameraEvent, CommandBuffer>> m_CommandBuffers;
23 + List<PostProcessingComponentBase> m_Components;
24 + Dictionary<PostProcessingComponentBase, bool> m_ComponentStates;
25 +
26 + MaterialFactory m_MaterialFactory;
27 + RenderTextureFactory m_RenderTextureFactory;
28 + PostProcessingContext m_Context;
29 + Camera m_Camera;
30 + PostProcessingProfile m_PreviousProfile;
31 +
32 + bool m_RenderingInSceneView = false;
33 +
34 + // Effect components
35 + BuiltinDebugViewsComponent m_DebugViews;
36 + AmbientOcclusionComponent m_AmbientOcclusion;
37 + ScreenSpaceReflectionComponent m_ScreenSpaceReflection;
38 + FogComponent m_FogComponent;
39 + MotionBlurComponent m_MotionBlur;
40 + TaaComponent m_Taa;
41 + EyeAdaptationComponent m_EyeAdaptation;
42 + DepthOfFieldComponent m_DepthOfField;
43 + BloomComponent m_Bloom;
44 + ChromaticAberrationComponent m_ChromaticAberration;
45 + ColorGradingComponent m_ColorGrading;
46 + UserLutComponent m_UserLut;
47 + GrainComponent m_Grain;
48 + VignetteComponent m_Vignette;
49 + DitheringComponent m_Dithering;
50 + FxaaComponent m_Fxaa;
51 +
52 + void OnEnable()
53 + {
54 + m_CommandBuffers = new Dictionary<Type, KeyValuePair<CameraEvent, CommandBuffer>>();
55 + m_MaterialFactory = new MaterialFactory();
56 + m_RenderTextureFactory = new RenderTextureFactory();
57 + m_Context = new PostProcessingContext();
58 +
59 + // Keep a list of all post-fx for automation purposes
60 + m_Components = new List<PostProcessingComponentBase>();
61 +
62 + // Component list
63 + m_DebugViews = AddComponent(new BuiltinDebugViewsComponent());
64 + m_AmbientOcclusion = AddComponent(new AmbientOcclusionComponent());
65 + m_ScreenSpaceReflection = AddComponent(new ScreenSpaceReflectionComponent());
66 + m_FogComponent = AddComponent(new FogComponent());
67 + m_MotionBlur = AddComponent(new MotionBlurComponent());
68 + m_Taa = AddComponent(new TaaComponent());
69 + m_EyeAdaptation = AddComponent(new EyeAdaptationComponent());
70 + m_DepthOfField = AddComponent(new DepthOfFieldComponent());
71 + m_Bloom = AddComponent(new BloomComponent());
72 + m_ChromaticAberration = AddComponent(new ChromaticAberrationComponent());
73 + m_ColorGrading = AddComponent(new ColorGradingComponent());
74 + m_UserLut = AddComponent(new UserLutComponent());
75 + m_Grain = AddComponent(new GrainComponent());
76 + m_Vignette = AddComponent(new VignetteComponent());
77 + m_Dithering = AddComponent(new DitheringComponent());
78 + m_Fxaa = AddComponent(new FxaaComponent());
79 +
80 + // Prepare state observers
81 + m_ComponentStates = new Dictionary<PostProcessingComponentBase, bool>();
82 +
83 + foreach (var component in m_Components)
84 + m_ComponentStates.Add(component, false);
85 +
86 + useGUILayout = false;
87 + }
88 +
89 + void OnPreCull()
90 + {
91 + // All the per-frame initialization logic has to be done in OnPreCull instead of Update
92 + // because [ImageEffectAllowedInSceneView] doesn't trigger Update events...
93 +
94 + m_Camera = GetComponent<Camera>();
95 +
96 + if (profile == null || m_Camera == null)
97 + return;
98 +
99 +#if UNITY_EDITOR
100 + // Track the scene view camera to disable some effects we don't want to see in the
101 + // scene view
102 + // Currently disabled effects :
103 + // - Temporal Antialiasing
104 + // - Depth of Field
105 + // - Motion blur
106 + m_RenderingInSceneView = UnityEditor.SceneView.currentDrawingSceneView != null
107 + && UnityEditor.SceneView.currentDrawingSceneView.camera == m_Camera;
108 +#endif
109 +
110 + // Prepare context
111 + var context = m_Context.Reset();
112 + context.profile = profile;
113 + context.renderTextureFactory = m_RenderTextureFactory;
114 + context.materialFactory = m_MaterialFactory;
115 + context.camera = m_Camera;
116 +
117 + // Prepare components
118 + m_DebugViews.Init(context, profile.debugViews);
119 + m_AmbientOcclusion.Init(context, profile.ambientOcclusion);
120 + m_ScreenSpaceReflection.Init(context, profile.screenSpaceReflection);
121 + m_FogComponent.Init(context, profile.fog);
122 + m_MotionBlur.Init(context, profile.motionBlur);
123 + m_Taa.Init(context, profile.antialiasing);
124 + m_EyeAdaptation.Init(context, profile.eyeAdaptation);
125 + m_DepthOfField.Init(context, profile.depthOfField);
126 + m_Bloom.Init(context, profile.bloom);
127 + m_ChromaticAberration.Init(context, profile.chromaticAberration);
128 + m_ColorGrading.Init(context, profile.colorGrading);
129 + m_UserLut.Init(context, profile.userLut);
130 + m_Grain.Init(context, profile.grain);
131 + m_Vignette.Init(context, profile.vignette);
132 + m_Dithering.Init(context, profile.dithering);
133 + m_Fxaa.Init(context, profile.antialiasing);
134 +
135 + // Handles profile change and 'enable' state observers
136 + if (m_PreviousProfile != profile)
137 + {
138 + DisableComponents();
139 + m_PreviousProfile = profile;
140 + }
141 +
142 + CheckObservers();
143 +
144 + // Find out which camera flags are needed before rendering begins
145 + // Note that motion vectors will only be available one frame after being enabled
146 + var flags = context.camera.depthTextureMode;
147 + foreach (var component in m_Components)
148 + {
149 + if (component.active)
150 + flags |= component.GetCameraFlags();
151 + }
152 +
153 + context.camera.depthTextureMode = flags;
154 +
155 + // Temporal antialiasing jittering, needs to happen before culling
156 + if (!m_RenderingInSceneView && m_Taa.active && !profile.debugViews.willInterrupt)
157 + m_Taa.SetProjectionMatrix(jitteredMatrixFunc);
158 + }
159 +
160 + void OnPreRender()
161 + {
162 + if (profile == null)
163 + return;
164 +
165 + // Command buffer-based effects should be set-up here
166 + TryExecuteCommandBuffer(m_DebugViews);
167 + TryExecuteCommandBuffer(m_AmbientOcclusion);
168 + TryExecuteCommandBuffer(m_ScreenSpaceReflection);
169 + TryExecuteCommandBuffer(m_FogComponent);
170 +
171 + if (!m_RenderingInSceneView)
172 + TryExecuteCommandBuffer(m_MotionBlur);
173 + }
174 +
175 + void OnPostRender()
176 + {
177 + if (profile == null || m_Camera == null)
178 + return;
179 +
180 + if (!m_RenderingInSceneView && m_Taa.active && !profile.debugViews.willInterrupt)
181 + m_Context.camera.ResetProjectionMatrix();
182 + }
183 +
184 + // Classic render target pipeline for RT-based effects
185 + void OnRenderImage(RenderTexture source, RenderTexture destination)
186 + {
187 + if (profile == null || m_Camera == null)
188 + {
189 + Graphics.Blit(source, destination);
190 + return;
191 + }
192 +
193 + // Uber shader setup
194 + bool uberActive = false;
195 + bool fxaaActive = m_Fxaa.active;
196 + bool taaActive = m_Taa.active && !m_RenderingInSceneView;
197 + bool dofActive = m_DepthOfField.active && !m_RenderingInSceneView;
198 +
199 + var uberMaterial = m_MaterialFactory.Get("Hidden/Post FX/Uber Shader");
200 + uberMaterial.shaderKeywords = null;
201 +
202 + var src = source;
203 + var dst = destination;
204 +
205 + if (taaActive)
206 + {
207 + var tempRT = m_RenderTextureFactory.Get(src);
208 + m_Taa.Render(src, tempRT);
209 + src = tempRT;
210 + }
211 +
212 +#if UNITY_EDITOR
213 + // Render to a dedicated target when monitors are enabled so they can show information
214 + // about the final render.
215 + // At runtime the output will always be the backbuffer or whatever render target is
216 + // currently set on the camera.
217 + if (profile.monitors.onFrameEndEditorOnly != null)
218 + dst = m_RenderTextureFactory.Get(src);
219 +#endif
220 +
221 + Texture autoExposure = GraphicsUtils.whiteTexture;
222 + if (m_EyeAdaptation.active)
223 + {
224 + uberActive = true;
225 + autoExposure = m_EyeAdaptation.Prepare(src, uberMaterial);
226 + }
227 +
228 + uberMaterial.SetTexture("_AutoExposure", autoExposure);
229 +
230 + if (dofActive)
231 + {
232 + uberActive = true;
233 + m_DepthOfField.Prepare(src, uberMaterial, taaActive, m_Taa.jitterVector, m_Taa.model.settings.taaSettings.motionBlending);
234 + }
235 +
236 + if (m_Bloom.active)
237 + {
238 + uberActive = true;
239 + m_Bloom.Prepare(src, uberMaterial, autoExposure);
240 + }
241 +
242 + uberActive |= TryPrepareUberImageEffect(m_ChromaticAberration, uberMaterial);
243 + uberActive |= TryPrepareUberImageEffect(m_ColorGrading, uberMaterial);
244 + uberActive |= TryPrepareUberImageEffect(m_Vignette, uberMaterial);
245 + uberActive |= TryPrepareUberImageEffect(m_UserLut, uberMaterial);
246 +
247 + var fxaaMaterial = fxaaActive
248 + ? m_MaterialFactory.Get("Hidden/Post FX/FXAA")
249 + : null;
250 +
251 + if (fxaaActive)
252 + {
253 + fxaaMaterial.shaderKeywords = null;
254 + TryPrepareUberImageEffect(m_Grain, fxaaMaterial);
255 + TryPrepareUberImageEffect(m_Dithering, fxaaMaterial);
256 +
257 + if (uberActive)
258 + {
259 + var output = m_RenderTextureFactory.Get(src);
260 + Graphics.Blit(src, output, uberMaterial, 0);
261 + src = output;
262 + }
263 +
264 + m_Fxaa.Render(src, dst);
265 + }
266 + else
267 + {
268 + uberActive |= TryPrepareUberImageEffect(m_Grain, uberMaterial);
269 + uberActive |= TryPrepareUberImageEffect(m_Dithering, uberMaterial);
270 +
271 + if (uberActive)
272 + {
273 + if (!GraphicsUtils.isLinearColorSpace)
274 + uberMaterial.EnableKeyword("UNITY_COLORSPACE_GAMMA");
275 +
276 + Graphics.Blit(src, dst, uberMaterial, 0);
277 + }
278 + }
279 +
280 + if (!uberActive && !fxaaActive)
281 + Graphics.Blit(src, dst);
282 +
283 +#if UNITY_EDITOR
284 + if (profile.monitors.onFrameEndEditorOnly != null)
285 + {
286 + Graphics.Blit(dst, destination);
287 +
288 + var oldRt = RenderTexture.active;
289 + profile.monitors.onFrameEndEditorOnly(dst);
290 + RenderTexture.active = oldRt;
291 + }
292 +#endif
293 +
294 + m_RenderTextureFactory.ReleaseAll();
295 + }
296 +
297 + void OnGUI()
298 + {
299 + if (Event.current.type != EventType.Repaint)
300 + return;
301 +
302 + if (profile == null || m_Camera == null)
303 + return;
304 +
305 + if (m_EyeAdaptation.active && profile.debugViews.IsModeActive(DebugMode.EyeAdaptation))
306 + m_EyeAdaptation.OnGUI();
307 + else if (m_ColorGrading.active && profile.debugViews.IsModeActive(DebugMode.LogLut))
308 + m_ColorGrading.OnGUI();
309 + else if (m_UserLut.active && profile.debugViews.IsModeActive(DebugMode.UserLut))
310 + m_UserLut.OnGUI();
311 + }
312 +
313 + void OnDisable()
314 + {
315 + // Clear command buffers
316 + foreach (var cb in m_CommandBuffers.Values)
317 + {
318 + m_Camera.RemoveCommandBuffer(cb.Key, cb.Value);
319 + cb.Value.Dispose();
320 + }
321 +
322 + m_CommandBuffers.Clear();
323 +
324 + // Clear components
325 + if (profile != null)
326 + DisableComponents();
327 +
328 + m_Components.Clear();
329 +
330 + // Factories
331 + m_MaterialFactory.Dispose();
332 + m_RenderTextureFactory.Dispose();
333 + GraphicsUtils.Dispose();
334 + }
335 +
336 + public void ResetTemporalEffects()
337 + {
338 + m_Taa.ResetHistory();
339 + m_MotionBlur.ResetHistory();
340 + m_EyeAdaptation.ResetHistory();
341 + }
342 +
343 + #region State management
344 +
345 + List<PostProcessingComponentBase> m_ComponentsToEnable = new List<PostProcessingComponentBase>();
346 + List<PostProcessingComponentBase> m_ComponentsToDisable = new List<PostProcessingComponentBase>();
347 +
348 + void CheckObservers()
349 + {
350 + foreach (var cs in m_ComponentStates)
351 + {
352 + var component = cs.Key;
353 + var state = component.GetModel().enabled;
354 +
355 + if (state != cs.Value)
356 + {
357 + if (state) m_ComponentsToEnable.Add(component);
358 + else m_ComponentsToDisable.Add(component);
359 + }
360 + }
361 +
362 + for (int i = 0; i < m_ComponentsToDisable.Count; i++)
363 + {
364 + var c = m_ComponentsToDisable[i];
365 + m_ComponentStates[c] = false;
366 + c.OnDisable();
367 + }
368 +
369 + for (int i = 0; i < m_ComponentsToEnable.Count; i++)
370 + {
371 + var c = m_ComponentsToEnable[i];
372 + m_ComponentStates[c] = true;
373 + c.OnEnable();
374 + }
375 +
376 + m_ComponentsToDisable.Clear();
377 + m_ComponentsToEnable.Clear();
378 + }
379 +
380 + void DisableComponents()
381 + {
382 + foreach (var component in m_Components)
383 + {
384 + var model = component.GetModel();
385 + if (model != null && model.enabled)
386 + component.OnDisable();
387 + }
388 + }
389 +
390 + #endregion
391 +
392 + #region Command buffer handling & rendering helpers
393 + // Placeholders before the upcoming Scriptable Render Loop as command buffers will be
394 + // executed on the go so we won't need of all that stuff
395 + CommandBuffer AddCommandBuffer<T>(CameraEvent evt, string name)
396 + where T : PostProcessingModel
397 + {
398 + var cb = new CommandBuffer { name = name };
399 + var kvp = new KeyValuePair<CameraEvent, CommandBuffer>(evt, cb);
400 + m_CommandBuffers.Add(typeof(T), kvp);
401 + m_Camera.AddCommandBuffer(evt, kvp.Value);
402 + return kvp.Value;
403 + }
404 +
405 + void RemoveCommandBuffer<T>()
406 + where T : PostProcessingModel
407 + {
408 + KeyValuePair<CameraEvent, CommandBuffer> kvp;
409 + var type = typeof(T);
410 +
411 + if (!m_CommandBuffers.TryGetValue(type, out kvp))
412 + return;
413 +
414 + m_Camera.RemoveCommandBuffer(kvp.Key, kvp.Value);
415 + m_CommandBuffers.Remove(type);
416 + kvp.Value.Dispose();
417 + }
418 +
419 + CommandBuffer GetCommandBuffer<T>(CameraEvent evt, string name)
420 + where T : PostProcessingModel
421 + {
422 + CommandBuffer cb;
423 + KeyValuePair<CameraEvent, CommandBuffer> kvp;
424 +
425 + if (!m_CommandBuffers.TryGetValue(typeof(T), out kvp))
426 + {
427 + cb = AddCommandBuffer<T>(evt, name);
428 + }
429 + else if (kvp.Key != evt)
430 + {
431 + RemoveCommandBuffer<T>();
432 + cb = AddCommandBuffer<T>(evt, name);
433 + }
434 + else cb = kvp.Value;
435 +
436 + return cb;
437 + }
438 +
439 + void TryExecuteCommandBuffer<T>(PostProcessingComponentCommandBuffer<T> component)
440 + where T : PostProcessingModel
441 + {
442 + if (component.active)
443 + {
444 + var cb = GetCommandBuffer<T>(component.GetCameraEvent(), component.GetName());
445 + cb.Clear();
446 + component.PopulateCommandBuffer(cb);
447 + }
448 + else RemoveCommandBuffer<T>();
449 + }
450 +
451 + bool TryPrepareUberImageEffect<T>(PostProcessingComponentRenderTexture<T> component, Material material)
452 + where T : PostProcessingModel
453 + {
454 + if (!component.active)
455 + return false;
456 +
457 + component.Prepare(material);
458 + return true;
459 + }
460 +
461 + T AddComponent<T>(T component)
462 + where T : PostProcessingComponentBase
463 + {
464 + m_Components.Add(component);
465 + return component;
466 + }
467 +
468 + #endregion
469 + }
470 +}
1 +fileFormatVersion: 2
2 +guid: ff26db721962cdf4a8edcdfa9a767d2a
3 +timeCreated: 1459757354
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using UnityEngine.Rendering;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + public abstract class PostProcessingComponentBase
6 + {
7 + public PostProcessingContext context;
8 +
9 + public virtual DepthTextureMode GetCameraFlags()
10 + {
11 + return DepthTextureMode.None;
12 + }
13 +
14 + public abstract bool active { get; }
15 +
16 + public virtual void OnEnable()
17 + {}
18 +
19 + public virtual void OnDisable()
20 + {}
21 +
22 + public abstract PostProcessingModel GetModel();
23 + }
24 +
25 + public abstract class PostProcessingComponent<T> : PostProcessingComponentBase
26 + where T : PostProcessingModel
27 + {
28 + public T model { get; internal set; }
29 +
30 + public virtual void Init(PostProcessingContext pcontext, T pmodel)
31 + {
32 + context = pcontext;
33 + model = pmodel;
34 + }
35 +
36 + public override PostProcessingModel GetModel()
37 + {
38 + return model;
39 + }
40 + }
41 +
42 + public abstract class PostProcessingComponentCommandBuffer<T> : PostProcessingComponent<T>
43 + where T : PostProcessingModel
44 + {
45 + public abstract CameraEvent GetCameraEvent();
46 +
47 + public abstract string GetName();
48 +
49 + public abstract void PopulateCommandBuffer(CommandBuffer cb);
50 + }
51 +
52 + public abstract class PostProcessingComponentRenderTexture<T> : PostProcessingComponent<T>
53 + where T : PostProcessingModel
54 + {
55 + public virtual void Prepare(Material material)
56 + {}
57 + }
58 +}
1 +fileFormatVersion: 2
2 +guid: ef3277e9c14f78546a1ecaab0d293b77
3 +timeCreated: 1473009349
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + public class PostProcessingContext
4 + {
5 + public PostProcessingProfile profile;
6 + public Camera camera;
7 +
8 + public MaterialFactory materialFactory;
9 + public RenderTextureFactory renderTextureFactory;
10 +
11 + public bool interrupted { get; private set; }
12 +
13 + public void Interrupt()
14 + {
15 + interrupted = true;
16 + }
17 +
18 + public PostProcessingContext Reset()
19 + {
20 + profile = null;
21 + camera = null;
22 + materialFactory = null;
23 + renderTextureFactory = null;
24 + interrupted = false;
25 + return this;
26 + }
27 +
28 + #region Helpers
29 + public bool isGBufferAvailable
30 + {
31 + get { return camera.actualRenderingPath == RenderingPath.DeferredShading; }
32 + }
33 +
34 + public bool isHdr
35 + {
36 + // No UNITY_5_6_OR_NEWER defined in early betas of 5.6
37 +#if UNITY_5_6 || UNITY_5_6_OR_NEWER
38 + get { return camera.allowHDR; }
39 +#else
40 + get { return camera.hdr; }
41 +#endif
42 + }
43 +
44 + public int width
45 + {
46 + get { return camera.pixelWidth; }
47 + }
48 +
49 + public int height
50 + {
51 + get { return camera.pixelHeight; }
52 + }
53 +
54 + public Rect viewport
55 + {
56 + get { return camera.rect; } // Normalized coordinates
57 + }
58 + #endregion
59 + }
60 +}
1 +fileFormatVersion: 2
2 +guid: 63da4b6536f11834fa026e327087bd7b
3 +timeCreated: 1467630780
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + [Serializable]
6 + public abstract class PostProcessingModel
7 + {
8 + [SerializeField, GetSet("enabled")]
9 + bool m_Enabled;
10 + public bool enabled
11 + {
12 + get { return m_Enabled; }
13 + set
14 + {
15 + m_Enabled = value;
16 +
17 + if (value)
18 + OnValidate();
19 + }
20 + }
21 +
22 + public abstract void Reset();
23 +
24 + public virtual void OnValidate()
25 + {}
26 + }
27 +}
1 +fileFormatVersion: 2
2 +guid: 28413153a26e53342baf1a7b2c3711c3
3 +timeCreated: 1466586474
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + public class PostProcessingProfile : ScriptableObject
6 + {
7 + #pragma warning disable 0169 // "field x is never used"
8 +
9 + public BuiltinDebugViewsModel debugViews = new BuiltinDebugViewsModel();
10 + public FogModel fog = new FogModel();
11 + public AntialiasingModel antialiasing = new AntialiasingModel();
12 + public AmbientOcclusionModel ambientOcclusion = new AmbientOcclusionModel();
13 + public ScreenSpaceReflectionModel screenSpaceReflection = new ScreenSpaceReflectionModel();
14 + public DepthOfFieldModel depthOfField = new DepthOfFieldModel();
15 + public MotionBlurModel motionBlur = new MotionBlurModel();
16 + public EyeAdaptationModel eyeAdaptation = new EyeAdaptationModel();
17 + public BloomModel bloom = new BloomModel();
18 + public ColorGradingModel colorGrading = new ColorGradingModel();
19 + public UserLutModel userLut = new UserLutModel();
20 + public ChromaticAberrationModel chromaticAberration = new ChromaticAberrationModel();
21 + public GrainModel grain = new GrainModel();
22 + public VignetteModel vignette = new VignetteModel();
23 + public DitheringModel dithering = new DitheringModel();
24 +
25 +#if UNITY_EDITOR
26 + // Monitor settings
27 + [Serializable]
28 + public class MonitorSettings
29 + {
30 + // Callback used in the editor to grab the rendered frame and sent it to monitors
31 + public Action<RenderTexture> onFrameEndEditorOnly;
32 +
33 + // Global
34 + public int currentMonitorID = 0;
35 + public bool refreshOnPlay = false;
36 +
37 + // Histogram
38 + public enum HistogramMode
39 + {
40 + Red = 0,
41 + Green = 1,
42 + Blue = 2,
43 + Luminance = 3,
44 + RGBMerged,
45 + RGBSplit
46 + }
47 +
48 + public HistogramMode histogramMode = HistogramMode.Luminance;
49 +
50 + // Waveform
51 + public float waveformExposure = 0.12f;
52 + public bool waveformY = false;
53 + public bool waveformR = true;
54 + public bool waveformG = true;
55 + public bool waveformB = true;
56 +
57 + // Parade
58 + public float paradeExposure = 0.12f;
59 +
60 + // Vectorscope
61 + public float vectorscopeExposure = 0.12f;
62 + public bool vectorscopeShowBackground = true;
63 + }
64 +
65 + public MonitorSettings monitors = new MonitorSettings();
66 +#endif
67 + }
68 +}
1 +fileFormatVersion: 2
2 +guid: 8a3bdb2cd68f901469e7cc149151eb49
3 +timeCreated: 1459756301
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 18fb6a6b698945843a16c2d0111a7af2
3 +folderAsset: yes
4 +timeCreated: 1459945070
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +using System;
2 +
3 +namespace UnityEngine.PostProcessing
4 +{
5 + // Small wrapper on top of AnimationCurve to handle zero-key curves and keyframe looping
6 +
7 + [Serializable]
8 + public sealed class ColorGradingCurve
9 + {
10 + public AnimationCurve curve;
11 +
12 + [SerializeField]
13 + bool m_Loop;
14 +
15 + [SerializeField]
16 + float m_ZeroValue;
17 +
18 + [SerializeField]
19 + float m_Range;
20 +
21 + AnimationCurve m_InternalLoopingCurve;
22 +
23 + public ColorGradingCurve(AnimationCurve curve, float zeroValue, bool loop, Vector2 bounds)
24 + {
25 + this.curve = curve;
26 + m_ZeroValue = zeroValue;
27 + m_Loop = loop;
28 + m_Range = bounds.magnitude;
29 + }
30 +
31 + public void Cache()
32 + {
33 + if (!m_Loop)
34 + return;
35 +
36 + var length = curve.length;
37 +
38 + if (length < 2)
39 + return;
40 +
41 + if (m_InternalLoopingCurve == null)
42 + m_InternalLoopingCurve = new AnimationCurve();
43 +
44 + var prev = curve[length - 1];
45 + prev.time -= m_Range;
46 + var next = curve[0];
47 + next.time += m_Range;
48 + m_InternalLoopingCurve.keys = curve.keys;
49 + m_InternalLoopingCurve.AddKey(prev);
50 + m_InternalLoopingCurve.AddKey(next);
51 + }
52 +
53 + public float Evaluate(float t)
54 + {
55 + if (curve.length == 0)
56 + return m_ZeroValue;
57 +
58 + if (!m_Loop || curve.length == 1)
59 + return curve.Evaluate(t);
60 +
61 + return m_InternalLoopingCurve.Evaluate(t);
62 + }
63 + }
64 +}
1 +fileFormatVersion: 2
2 +guid: 1bb6f2275f7eff940b6f0d72681e7877
3 +timeCreated: 1473847739
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +namespace UnityEngine.PostProcessing
2 +{
3 + using UnityObject = Object;
4 +
5 + public static class GraphicsUtils
6 + {
7 + public static bool isLinearColorSpace
8 + {
9 + get { return QualitySettings.activeColorSpace == ColorSpace.Linear; }
10 + }
11 +
12 + public static bool supportsDX11
13 + {
14 +#if UNITY_WEBGL
15 + get { return false; }
16 +#else
17 + get { return SystemInfo.graphicsShaderLevel >= 50 && SystemInfo.supportsComputeShaders; }
18 +#endif
19 + }
20 +
21 + static Texture2D s_WhiteTexture;
22 + public static Texture2D whiteTexture
23 + {
24 + get
25 + {
26 + if (s_WhiteTexture != null)
27 + return s_WhiteTexture;
28 +
29 + s_WhiteTexture = new Texture2D(1, 1, TextureFormat.ARGB32, false);
30 + s_WhiteTexture.SetPixel(0, 0, new Color(1f, 1f, 1f, 1f));
31 + s_WhiteTexture.Apply();
32 +
33 + return s_WhiteTexture;
34 + }
35 + }
36 +
37 + static Mesh s_Quad;
38 + public static Mesh quad
39 + {
40 + get
41 + {
42 + if (s_Quad != null)
43 + return s_Quad;
44 +
45 + var vertices = new[]
46 + {
47 + new Vector3(-1f, -1f, 0f),
48 + new Vector3( 1f, 1f, 0f),
49 + new Vector3( 1f, -1f, 0f),
50 + new Vector3(-1f, 1f, 0f)
51 + };
52 +
53 + var uvs = new[]
54 + {
55 + new Vector2(0f, 0f),
56 + new Vector2(1f, 1f),
57 + new Vector2(1f, 0f),
58 + new Vector2(0f, 1f)
59 + };
60 +
61 + var indices = new[] { 0, 1, 2, 1, 0, 3 };
62 +
63 + s_Quad = new Mesh
64 + {
65 + vertices = vertices,
66 + uv = uvs,
67 + triangles = indices
68 + };
69 + s_Quad.RecalculateNormals();
70 + s_Quad.RecalculateBounds();
71 +
72 + return s_Quad;
73 + }
74 + }
75 +
76 + // Useful when rendering to MRT
77 + public static void Blit(Material material, int pass)
78 + {
79 + GL.PushMatrix();
80 + {
81 + GL.LoadOrtho();
82 +
83 + material.SetPass(pass);
84 +
85 + GL.Begin(GL.TRIANGLE_STRIP);
86 + {
87 + GL.TexCoord2(0f, 0f); GL.Vertex3(0f, 0f, 0.1f);
88 + GL.TexCoord2(1f, 0f); GL.Vertex3(1f, 0f, 0.1f);
89 + GL.TexCoord2(0f, 1f); GL.Vertex3(0f, 1f, 0.1f);
90 + GL.TexCoord2(1f, 1f); GL.Vertex3(1f, 1f, 0.1f);
91 + }
92 + GL.End();
93 + }
94 + GL.PopMatrix();
95 + }
96 +
97 + public static void ClearAndBlit(Texture source, RenderTexture destination, Material material, int pass, bool clearColor = true, bool clearDepth = false)
98 + {
99 + var oldRT = RenderTexture.active;
100 + RenderTexture.active = destination;
101 +
102 + GL.Clear(false, clearColor, Color.clear);
103 + GL.PushMatrix();
104 + {
105 + GL.LoadOrtho();
106 +
107 + material.SetTexture("_MainTex", source);
108 + material.SetPass(pass);
109 +
110 + GL.Begin(GL.TRIANGLE_STRIP);
111 + {
112 + GL.TexCoord2(0f, 0f); GL.Vertex3(0f, 0f, 0.1f);
113 + GL.TexCoord2(1f, 0f); GL.Vertex3(1f, 0f, 0.1f);
114 + GL.TexCoord2(0f, 1f); GL.Vertex3(0f, 1f, 0.1f);
115 + GL.TexCoord2(1f, 1f); GL.Vertex3(1f, 1f, 0.1f);
116 + }
117 + GL.End();
118 + }
119 + GL.PopMatrix();
120 +
121 + RenderTexture.active = oldRT;
122 + }
123 +
124 + public static void Destroy(UnityObject obj)
125 + {
126 + if (obj != null)
127 + {
128 +#if UNITY_EDITOR
129 + if (Application.isPlaying)
130 + UnityObject.Destroy(obj);
131 + else
132 + UnityObject.DestroyImmediate(obj);
133 +#else
134 + UnityObject.Destroy(obj);
135 +#endif
136 + }
137 + }
138 +
139 + public static void Dispose()
140 + {
141 + Destroy(s_Quad);
142 + }
143 + }
144 +}
1 +fileFormatVersion: 2
2 +guid: f40f0a1acf6ce2f419f2b71c667e8973
3 +timeCreated: 1467635425
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +using System.Collections.Generic;
3 +
4 +namespace UnityEngine.PostProcessing
5 +{
6 + using UnityObject = Object;
7 +
8 + public sealed class MaterialFactory : IDisposable
9 + {
10 + Dictionary<string, Material> m_Materials;
11 +
12 + public MaterialFactory()
13 + {
14 + m_Materials = new Dictionary<string, Material>();
15 + }
16 +
17 + public Material Get(string shaderName)
18 + {
19 + Material material;
20 +
21 + if (!m_Materials.TryGetValue(shaderName, out material))
22 + {
23 + var shader = Shader.Find(shaderName);
24 +
25 + if (shader == null)
26 + throw new ArgumentException(string.Format("Shader not found ({0})", shaderName));
27 +
28 + material = new Material(shader)
29 + {
30 + name = string.Format("PostFX - {0}", shaderName.Substring(shaderName.LastIndexOf("/") + 1)),
31 + hideFlags = HideFlags.DontSave
32 + };
33 +
34 + m_Materials.Add(shaderName, material);
35 + }
36 +
37 + return material;
38 + }
39 +
40 + public void Dispose()
41 + {
42 + var enumerator = m_Materials.GetEnumerator();
43 + while (enumerator.MoveNext())
44 + {
45 + var material = enumerator.Current.Value;
46 + GraphicsUtils.Destroy(material);
47 + }
48 +
49 + m_Materials.Clear();
50 + }
51 + }
52 +}
1 +fileFormatVersion: 2
2 +guid: 594fad000c373f746864717c588e1815
3 +timeCreated: 1466586851
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +using System;
2 +using System.Collections.Generic;
3 +
4 +namespace UnityEngine.PostProcessing
5 +{
6 + public sealed class RenderTextureFactory : IDisposable
7 + {
8 + HashSet<RenderTexture> m_TemporaryRTs;
9 +
10 + public RenderTextureFactory()
11 + {
12 + m_TemporaryRTs = new HashSet<RenderTexture>();
13 + }
14 +
15 + public RenderTexture Get(RenderTexture baseRenderTexture)
16 + {
17 + return Get(
18 + baseRenderTexture.width,
19 + baseRenderTexture.height,
20 + baseRenderTexture.depth,
21 + baseRenderTexture.format,
22 + baseRenderTexture.sRGB ? RenderTextureReadWrite.sRGB : RenderTextureReadWrite.Linear,
23 + baseRenderTexture.filterMode,
24 + baseRenderTexture.wrapMode
25 + );
26 + }
27 +
28 + public RenderTexture Get(int width, int height, int depthBuffer = 0, RenderTextureFormat format = RenderTextureFormat.ARGBHalf, RenderTextureReadWrite rw = RenderTextureReadWrite.Default, FilterMode filterMode = FilterMode.Bilinear, TextureWrapMode wrapMode = TextureWrapMode.Clamp, string name = "FactoryTempTexture")
29 + {
30 + var rt = RenderTexture.GetTemporary(width, height, depthBuffer, format, rw); // add forgotten param rw
31 + rt.filterMode = filterMode;
32 + rt.wrapMode = wrapMode;
33 + rt.name = name;
34 + m_TemporaryRTs.Add(rt);
35 + return rt;
36 + }
37 +
38 + public void Release(RenderTexture rt)
39 + {
40 + if (rt == null)
41 + return;
42 +
43 + if (!m_TemporaryRTs.Contains(rt))
44 + throw new ArgumentException(string.Format("Attempting to remove a RenderTexture that was not allocated: {0}", rt));
45 +
46 + m_TemporaryRTs.Remove(rt);
47 + RenderTexture.ReleaseTemporary(rt);
48 + }
49 +
50 + public void ReleaseAll()
51 + {
52 + var enumerator = m_TemporaryRTs.GetEnumerator();
53 + while (enumerator.MoveNext())
54 + RenderTexture.ReleaseTemporary(enumerator.Current);
55 +
56 + m_TemporaryRTs.Clear();
57 + }
58 +
59 + public void Dispose()
60 + {
61 + ReleaseAll();
62 + }
63 + }
64 +}
1 +fileFormatVersion: 2
2 +guid: aec5694806c4d75449e231cfae69c329
3 +timeCreated: 1467361102
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: e15c29a7abfa52743a8cb7714389c3c7
3 +folderAsset: yes
4 +timeCreated: 1466585230
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 499867e2df2e54e4aad0b9333221f875
3 +folderAsset: yes
4 +timeCreated: 1473255405
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: e45483e270a314c4bbc6e317771d56ab
3 +timeCreated: 1463066524
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: 3
30 + maxTextureSize: 2048
31 + textureSettings:
32 + filterMode: -1
33 + aniso: 0
34 + mipBias: -1
35 + wrapMode: -1
36 + nPOTScale: 1
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: 0
49 + textureType: 5
50 + buildTargetSettings: []
51 + spriteSheet:
52 + sprites: []
53 + outline: []
54 + spritePackingTag:
55 + userData:
56 + assetBundleName:
57 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 4f98e9c96c8a48541b5eb704e92d99b8
3 +timeCreated: 1463066534
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: 3
30 + maxTextureSize: 2048
31 + textureSettings:
32 + filterMode: -1
33 + aniso: 0
34 + mipBias: -1
35 + wrapMode: -1
36 + nPOTScale: 1
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: 0
49 + textureType: 5
50 + buildTargetSettings: []
51 + spriteSheet:
52 + sprites: []
53 + outline: []
54 + spritePackingTag:
55 + userData:
56 + assetBundleName:
57 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 705e7922061713741885ae52a3e0bea4
3 +folderAsset: yes
4 +timeCreated: 1472737148
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 69e847bbff1cf5449a4ee0bbd045dbc9
3 +timeCreated: 1472572785
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 1
12 + linearTexture: 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 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 4096
29 + textureSettings:
30 + filterMode: -1
31 + aniso: 0
32 + mipBias: -1
33 + wrapMode: 1
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 1
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 0
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 1024
55 + textureFormat: -1
56 + textureCompression: 1
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 1024
63 + textureFormat: -1
64 + textureCompression: 1
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 3884f7a2d04ffe8409ad9200b275896f
3 +timeCreated: 1472551546
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 1
12 + linearTexture: 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 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 4096
29 + textureSettings:
30 + filterMode: -1
31 + aniso: 0
32 + mipBias: -1
33 + wrapMode: 1
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 1
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 0
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 1024
55 + textureFormat: -1
56 + textureCompression: 1
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 1024
63 + textureFormat: -1
64 + textureCompression: 1
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: a2960ffde020f27409e070d92fb2e00b
3 +timeCreated: 1472632371
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 1
12 + linearTexture: 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 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 4096
29 + textureSettings:
30 + filterMode: -1
31 + aniso: 0
32 + mipBias: -1
33 + wrapMode: 1
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 1
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 0
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 1024
55 + textureFormat: -1
56 + textureCompression: 1
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 1024
63 + textureFormat: -1
64 + textureCompression: 1
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 7a051dbda2d7bc447bee412427cd311e
3 +timeCreated: 1472641925
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 1
12 + linearTexture: 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 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 4096
29 + textureSettings:
30 + filterMode: -1
31 + aniso: 0
32 + mipBias: -1
33 + wrapMode: 1
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 1
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 0
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 1024
55 + textureFormat: -1
56 + textureCompression: 1
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 1024
63 + textureFormat: -1
64 + textureCompression: 1
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 67d9249960fda4c41b0a23a65573a8a2
3 +folderAsset: yes
4 +timeCreated: 1473255405
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 318cbcd94840f1d48aca4d86234dc2e7
3 +timeCreated: 1473255656
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 2
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + linearTexture: 0
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: -3
30 + maxTextureSize: 32
31 + textureSettings:
32 + filterMode: 1
33 + aniso: 0
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: 0
49 + spriteTessellationDetail: -1
50 + textureType: 5
51 + buildTargetSettings: []
52 + spriteSheet:
53 + serializedVersion: 2
54 + sprites: []
55 + outline: []
56 + spritePackingTag:
57 + userData:
58 + assetBundleName:
59 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 4a8f054acfbd08043a931cd22760758d
3 +timeCreated: 1473255985
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 2
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + linearTexture: 0
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: -3
30 + maxTextureSize: 32
31 + textureSettings:
32 + filterMode: 1
33 + aniso: 0
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: 0
49 + spriteTessellationDetail: -1
50 + textureType: 5
51 + buildTargetSettings: []
52 + spriteSheet:
53 + serializedVersion: 2
54 + sprites: []
55 + outline: []
56 + spritePackingTag:
57 + userData:
58 + assetBundleName:
59 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 42183971d24cfe443a346e7ec6e83bbb
3 +timeCreated: 1473256088
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 2
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + linearTexture: 0
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: -3
30 + maxTextureSize: 32
31 + textureSettings:
32 + filterMode: 1
33 + aniso: 0
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: 0
49 + spriteTessellationDetail: -1
50 + textureType: 5
51 + buildTargetSettings: []
52 + spriteSheet:
53 + serializedVersion: 2
54 + sprites: []
55 + outline: []
56 + spritePackingTag:
57 + userData:
58 + assetBundleName:
59 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: ff5f3317371838d4fa16ac6c2acf2040
3 +timeCreated: 1473255656
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 2
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + linearTexture: 0
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: -3
30 + maxTextureSize: 32
31 + textureSettings:
32 + filterMode: 1
33 + aniso: 0
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: 0
49 + spriteTessellationDetail: -1
50 + textureType: 5
51 + buildTargetSettings: []
52 + spriteSheet:
53 + serializedVersion: 2
54 + sprites: []
55 + outline: []
56 + spritePackingTag:
57 + userData:
58 + assetBundleName:
59 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 478d405e757b044f2bd9c4b777026b7e
3 +folderAsset: yes
4 +timeCreated: 1487339997
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 5b271143f6e834d6bb7a4309f2c781f2
3 +folderAsset: yes
4 +timeCreated: 1487339997
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
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: CustomMotionVectorDebugProfile
13 + m_EditorClassIdentifier:
14 + debugViews:
15 + m_Enabled: 1
16 + m_Settings:
17 + mode: 3
18 + depth:
19 + scale: 1
20 + motionVectors:
21 + sourceOpacity: 1
22 + motionImageOpacity: 0
23 + motionImageAmplitude: 16
24 + motionVectorsOpacity: 1
25 + motionVectorsResolution: 48
26 + motionVectorsAmplitude: 64
27 + fog:
28 + m_Enabled: 0
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: 0
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: 0
73 + m_Settings:
74 + focusDistance: 10
75 + aperture: 5.6
76 + focalLength: 50
77 + useCameraFov: 0
78 + kernelSize: 1
79 + motionBlur:
80 + m_Enabled: 1
81 + m_Settings:
82 + shutterAngle: 270
83 + sampleCount: 10
84 + frameBlending: 0
85 + eyeAdaptation:
86 + m_Enabled: 0
87 + m_Settings:
88 + lowPercent: 65
89 + highPercent: 95
90 + minLuminance: 0.03
91 + maxLuminance: 2
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: 0
101 + m_Settings:
102 + bloom:
103 + intensity: 0.5
104 + threshold: 1.1
105 + softKnee: 0.5
106 + radius: 4
107 + antiFlicker: 0
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: 0
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
1 +fileFormatVersion: 2
2 +guid: d982e879ff67b4d3fb6522d08c3cd5af
3 +timeCreated: 1487341088
4 +licenseType: Store
5 +NativeFormatImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!29 &1
4 +OcclusionCullingSettings:
5 + m_ObjectHideFlags: 0
6 + serializedVersion: 2
7 + m_OcclusionBakeSettings:
8 + smallestOccluder: 5
9 + smallestHole: 0.25
10 + backfaceThreshold: 100
11 + m_SceneGUID: 00000000000000000000000000000000
12 + m_OcclusionCullingData: {fileID: 0}
13 +--- !u!104 &2
14 +RenderSettings:
15 + m_ObjectHideFlags: 0
16 + serializedVersion: 8
17 + m_Fog: 0
18 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
19 + m_FogMode: 3
20 + m_FogDensity: 0.01
21 + m_LinearFogStart: 0
22 + m_LinearFogEnd: 300
23 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
24 + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
25 + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
26 + m_AmbientIntensity: 1
27 + m_AmbientMode: 0
28 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
29 + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
30 + m_HaloStrength: 0.5
31 + m_FlareStrength: 1
32 + m_FlareFadeSpeed: 3
33 + m_HaloTexture: {fileID: 0}
34 + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
35 + m_DefaultReflectionMode: 0
36 + m_DefaultReflectionResolution: 128
37 + m_ReflectionBounces: 1
38 + m_ReflectionIntensity: 1
39 + m_CustomReflection: {fileID: 0}
40 + m_Sun: {fileID: 0}
41 + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
42 +--- !u!157 &3
43 +LightmapSettings:
44 + m_ObjectHideFlags: 0
45 + serializedVersion: 11
46 + m_GIWorkflowMode: 0
47 + m_GISettings:
48 + serializedVersion: 2
49 + m_BounceScale: 1
50 + m_IndirectOutputScale: 1
51 + m_AlbedoBoost: 1
52 + m_TemporalCoherenceThreshold: 1
53 + m_EnvironmentLightingMode: 0
54 + m_EnableBakedLightmaps: 1
55 + m_EnableRealtimeLightmaps: 1
56 + m_LightmapEditorSettings:
57 + serializedVersion: 9
58 + m_Resolution: 2
59 + m_BakeResolution: 40
60 + m_TextureWidth: 1024
61 + m_TextureHeight: 1024
62 + m_AO: 0
63 + m_AOMaxDistance: 1
64 + m_CompAOExponent: 1
65 + m_CompAOExponentDirect: 0
66 + m_Padding: 2
67 + m_LightmapParameters: {fileID: 0}
68 + m_LightmapsBakeMode: 1
69 + m_TextureCompression: 1
70 + m_FinalGather: 0
71 + m_FinalGatherFiltering: 1
72 + m_FinalGatherRayCount: 256
73 + m_ReflectionCompression: 2
74 + m_MixedBakeMode: 1
75 + m_BakeBackend: 0
76 + m_PVRSampling: 1
77 + m_PVRDirectSampleCount: 32
78 + m_PVRSampleCount: 500
79 + m_PVRBounces: 2
80 + m_PVRFilterTypeDirect: 0
81 + m_PVRFilterTypeIndirect: 0
82 + m_PVRFilterTypeAO: 0
83 + m_PVRFilteringMode: 0
84 + m_PVRCulling: 1
85 + m_PVRFilteringGaussRadiusDirect: 1
86 + m_PVRFilteringGaussRadiusIndirect: 5
87 + m_PVRFilteringGaussRadiusAO: 2
88 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5
89 + m_PVRFilteringAtrousPositionSigmaIndirect: 2
90 + m_PVRFilteringAtrousPositionSigmaAO: 1
91 + m_ShowResolutionOverlay: 1
92 + m_LightingDataAsset: {fileID: 0}
93 + m_UseShadowmask: 0
94 +--- !u!196 &4
95 +NavMeshSettings:
96 + serializedVersion: 2
97 + m_ObjectHideFlags: 0
98 + m_BuildSettings:
99 + serializedVersion: 2
100 + agentTypeID: 0
101 + agentRadius: 0.5
102 + agentHeight: 2
103 + agentSlope: 45
104 + agentClimb: 0.4
105 + ledgeDropHeight: 0
106 + maxJumpAcrossDistance: 0
107 + minRegionArea: 2
108 + manualCellSize: 0
109 + cellSize: 0.16666667
110 + manualTileSize: 0
111 + tileSize: 256
112 + accuratePlacement: 0
113 + debug:
114 + m_Flags: 0
115 + m_NavMeshData: {fileID: 0}
116 +--- !u!1 &159053895
117 +GameObject:
118 + m_ObjectHideFlags: 0
119 + m_PrefabParentObject: {fileID: 100000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
120 + m_PrefabInternal: {fileID: 0}
121 + serializedVersion: 5
122 + m_Component:
123 + - component: {fileID: 159053896}
124 + m_Layer: 0
125 + m_Name: CustomMotionVectorTexture
126 + m_TagString: Untagged
127 + m_Icon: {fileID: 0}
128 + m_NavMeshLayer: 0
129 + m_StaticEditorFlags: 0
130 + m_IsActive: 1
131 +--- !u!4 &159053896
132 +Transform:
133 + m_ObjectHideFlags: 0
134 + m_PrefabParentObject: {fileID: 400000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
135 + m_PrefabInternal: {fileID: 0}
136 + m_GameObject: {fileID: 159053895}
137 + m_LocalRotation: {x: -0, y: 0.17364816, z: -0, w: 0.9848078}
138 + m_LocalPosition: {x: 0, y: -0.211, z: -0.65}
139 + m_LocalScale: {x: 40, y: 40, z: 40}
140 + m_Children:
141 + - {fileID: 1356308505}
142 + - {fileID: 860688641}
143 + m_Father: {fileID: 0}
144 + m_RootOrder: 2
145 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
146 +--- !u!1 &483713897
147 +GameObject:
148 + m_ObjectHideFlags: 0
149 + m_PrefabParentObject: {fileID: 0}
150 + m_PrefabInternal: {fileID: 0}
151 + serializedVersion: 5
152 + m_Component:
153 + - component: {fileID: 483713898}
154 + - component: {fileID: 483713900}
155 + - component: {fileID: 483713899}
156 + m_Layer: 5
157 + m_Name: Text (2)
158 + m_TagString: Untagged
159 + m_Icon: {fileID: 0}
160 + m_NavMeshLayer: 0
161 + m_StaticEditorFlags: 0
162 + m_IsActive: 1
163 +--- !u!224 &483713898
164 +RectTransform:
165 + m_ObjectHideFlags: 0
166 + m_PrefabParentObject: {fileID: 0}
167 + m_PrefabInternal: {fileID: 0}
168 + m_GameObject: {fileID: 483713897}
169 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
170 + m_LocalPosition: {x: 0, y: 0, z: 0}
171 + m_LocalScale: {x: 1, y: 1, z: 1}
172 + m_Children: []
173 + m_Father: {fileID: 1670569530}
174 + m_RootOrder: 2
175 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
176 + m_AnchorMin: {x: 0.5, y: 0.5}
177 + m_AnchorMax: {x: 0.5, y: 0.5}
178 + m_AnchoredPosition: {x: 0, y: -115}
179 + m_SizeDelta: {x: 160, y: 70.5}
180 + m_Pivot: {x: 0.5, y: 0.5}
181 +--- !u!114 &483713899
182 +MonoBehaviour:
183 + m_ObjectHideFlags: 0
184 + m_PrefabParentObject: {fileID: 0}
185 + m_PrefabInternal: {fileID: 0}
186 + m_GameObject: {fileID: 483713897}
187 + m_Enabled: 1
188 + m_EditorHideFlags: 0
189 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
190 + m_Name:
191 + m_EditorClassIdentifier:
192 + m_Material: {fileID: 0}
193 + m_Color: {r: 1, g: 1, b: 1, a: 1}
194 + m_RaycastTarget: 1
195 + m_OnCullStateChanged:
196 + m_PersistentCalls:
197 + m_Calls: []
198 + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
199 + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
200 + m_FontData:
201 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
202 + m_FontSize: 14
203 + m_FontStyle: 0
204 + m_BestFit: 0
205 + m_MinSize: 10
206 + m_MaxSize: 40
207 + m_Alignment: 4
208 + m_AlignByGeometry: 0
209 + m_RichText: 1
210 + m_HorizontalOverflow: 0
211 + m_VerticalOverflow: 0
212 + m_LineSpacing: 1
213 + m_Text: 'Controls:
214 +
215 +
216 + UpArrow - Forward
217 +
218 + DownArrow - Reverse'
219 +--- !u!222 &483713900
220 +CanvasRenderer:
221 + m_ObjectHideFlags: 0
222 + m_PrefabParentObject: {fileID: 0}
223 + m_PrefabInternal: {fileID: 0}
224 + m_GameObject: {fileID: 483713897}
225 +--- !u!1 &687590844
226 +GameObject:
227 + m_ObjectHideFlags: 0
228 + m_PrefabParentObject: {fileID: 100000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
229 + m_PrefabInternal: {fileID: 0}
230 + serializedVersion: 5
231 + m_Component:
232 + - component: {fileID: 687590849}
233 + - component: {fileID: 687590848}
234 + - component: {fileID: 687590847}
235 + - component: {fileID: 687590846}
236 + - component: {fileID: 687590845}
237 + m_Layer: 0
238 + m_Name: Wheel
239 + m_TagString: Untagged
240 + m_Icon: {fileID: 0}
241 + m_NavMeshLayer: 0
242 + m_StaticEditorFlags: 0
243 + m_IsActive: 1
244 +--- !u!54 &687590845
245 +Rigidbody:
246 + m_ObjectHideFlags: 0
247 + m_PrefabParentObject: {fileID: 0}
248 + m_PrefabInternal: {fileID: 0}
249 + m_GameObject: {fileID: 687590844}
250 + serializedVersion: 2
251 + m_Mass: 0.1
252 + m_Drag: 0
253 + m_AngularDrag: 0.05
254 + m_UseGravity: 0
255 + m_IsKinematic: 0
256 + m_Interpolate: 0
257 + m_Constraints: 0
258 + m_CollisionDetection: 0
259 +--- !u!114 &687590846
260 +MonoBehaviour:
261 + m_ObjectHideFlags: 0
262 + m_PrefabParentObject: {fileID: 0}
263 + m_PrefabInternal: {fileID: 0}
264 + m_GameObject: {fileID: 687590844}
265 + m_Enabled: 1
266 + m_EditorHideFlags: 0
267 + m_Script: {fileID: 11500000, guid: 840c928746809454cb5b9309b640dbd7, type: 3}
268 + m_Name:
269 + m_EditorClassIdentifier:
270 + acceleration: 10
271 + motionVectorRenderer: {fileID: 0}
272 +--- !u!23 &687590847
273 +MeshRenderer:
274 + m_ObjectHideFlags: 0
275 + m_PrefabParentObject: {fileID: 2300000, guid: c4abfbff3b9d442f4b435849d2d2124c,
276 + type: 3}
277 + m_PrefabInternal: {fileID: 0}
278 + m_GameObject: {fileID: 687590844}
279 + m_Enabled: 1
280 + m_CastShadows: 1
281 + m_ReceiveShadows: 1
282 + m_DynamicOccludee: 1
283 + m_MotionVectors: 1
284 + m_LightProbeUsage: 1
285 + m_ReflectionProbeUsage: 1
286 + m_Materials:
287 + - {fileID: 2100000, guid: 944463113244f4bf8b05c1757cd838a4, type: 2}
288 + m_StaticBatchInfo:
289 + firstSubMesh: 0
290 + subMeshCount: 0
291 + m_StaticBatchRoot: {fileID: 0}
292 + m_ProbeAnchor: {fileID: 0}
293 + m_LightProbeVolumeOverride: {fileID: 0}
294 + m_ScaleInLightmap: 1
295 + m_PreserveUVs: 0
296 + m_IgnoreNormalsForChartDetection: 0
297 + m_ImportantGI: 0
298 + m_StitchLightmapSeams: 0
299 + m_SelectedEditorRenderState: 3
300 + m_MinimumChartSize: 4
301 + m_AutoUVMaxDistance: 0.5
302 + m_AutoUVMaxAngle: 89
303 + m_LightmapParameters: {fileID: 0}
304 + m_SortingLayerID: 0
305 + m_SortingLayer: 0
306 + m_SortingOrder: 0
307 +--- !u!33 &687590848
308 +MeshFilter:
309 + m_ObjectHideFlags: 0
310 + m_PrefabParentObject: {fileID: 3300000, guid: c4abfbff3b9d442f4b435849d2d2124c,
311 + type: 3}
312 + m_PrefabInternal: {fileID: 0}
313 + m_GameObject: {fileID: 687590844}
314 + m_Mesh: {fileID: 4300000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
315 +--- !u!4 &687590849
316 +Transform:
317 + m_ObjectHideFlags: 0
318 + m_PrefabParentObject: {fileID: 400000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
319 + m_PrefabInternal: {fileID: 0}
320 + m_GameObject: {fileID: 687590844}
321 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
322 + m_LocalPosition: {x: 0, y: 0, z: 0}
323 + m_LocalScale: {x: 1, y: 1, z: 1}
324 + m_Children: []
325 + m_Father: {fileID: 732169372}
326 + m_RootOrder: 0
327 + m_LocalEulerAnglesHint: {x: 0, y: -20, z: 0}
328 +--- !u!1 &732169371
329 +GameObject:
330 + m_ObjectHideFlags: 0
331 + m_PrefabParentObject: {fileID: 100000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
332 + m_PrefabInternal: {fileID: 0}
333 + serializedVersion: 5
334 + m_Component:
335 + - component: {fileID: 732169372}
336 + m_Layer: 0
337 + m_Name: RegularMotionVectors
338 + m_TagString: Untagged
339 + m_Icon: {fileID: 0}
340 + m_NavMeshLayer: 0
341 + m_StaticEditorFlags: 0
342 + m_IsActive: 1
343 +--- !u!4 &732169372
344 +Transform:
345 + m_ObjectHideFlags: 0
346 + m_PrefabParentObject: {fileID: 400000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
347 + m_PrefabInternal: {fileID: 0}
348 + m_GameObject: {fileID: 732169371}
349 + m_LocalRotation: {x: 0, y: -0.17364825, z: 0, w: 0.9848078}
350 + m_LocalPosition: {x: -0, y: -0.211, z: 0.65}
351 + m_LocalScale: {x: 40, y: 40, z: 40}
352 + m_Children:
353 + - {fileID: 687590849}
354 + m_Father: {fileID: 0}
355 + m_RootOrder: 3
356 + m_LocalEulerAnglesHint: {x: 0, y: -20, z: 0}
357 +--- !u!1 &860688640
358 +GameObject:
359 + m_ObjectHideFlags: 0
360 + m_PrefabParentObject: {fileID: 100000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
361 + m_PrefabInternal: {fileID: 0}
362 + serializedVersion: 5
363 + m_Component:
364 + - component: {fileID: 860688641}
365 + - component: {fileID: 860688644}
366 + - component: {fileID: 860688643}
367 + m_Layer: 0
368 + m_Name: MotionVectorRenderer
369 + m_TagString: Untagged
370 + m_Icon: {fileID: 0}
371 + m_NavMeshLayer: 0
372 + m_StaticEditorFlags: 0
373 + m_IsActive: 1
374 +--- !u!4 &860688641
375 +Transform:
376 + m_ObjectHideFlags: 0
377 + m_PrefabParentObject: {fileID: 400000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
378 + m_PrefabInternal: {fileID: 0}
379 + m_GameObject: {fileID: 860688640}
380 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
381 + m_LocalPosition: {x: 0, y: 0, z: 0}
382 + m_LocalScale: {x: 1.01, y: 1.01, z: 1.01}
383 + m_Children: []
384 + m_Father: {fileID: 159053896}
385 + m_RootOrder: 1
386 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
387 +--- !u!23 &860688643
388 +MeshRenderer:
389 + m_ObjectHideFlags: 0
390 + m_PrefabParentObject: {fileID: 2300000, guid: c4abfbff3b9d442f4b435849d2d2124c,
391 + type: 3}
392 + m_PrefabInternal: {fileID: 0}
393 + m_GameObject: {fileID: 860688640}
394 + m_Enabled: 1
395 + m_CastShadows: 1
396 + m_ReceiveShadows: 1
397 + m_DynamicOccludee: 1
398 + m_MotionVectors: 1
399 + m_LightProbeUsage: 1
400 + m_ReflectionProbeUsage: 1
401 + m_Materials:
402 + - {fileID: 2100000, guid: 055f7217f136349d9b68e82b9e987dae, type: 2}
403 + m_StaticBatchInfo:
404 + firstSubMesh: 0
405 + subMeshCount: 0
406 + m_StaticBatchRoot: {fileID: 0}
407 + m_ProbeAnchor: {fileID: 0}
408 + m_LightProbeVolumeOverride: {fileID: 0}
409 + m_ScaleInLightmap: 1
410 + m_PreserveUVs: 0
411 + m_IgnoreNormalsForChartDetection: 0
412 + m_ImportantGI: 0
413 + m_StitchLightmapSeams: 0
414 + m_SelectedEditorRenderState: 3
415 + m_MinimumChartSize: 4
416 + m_AutoUVMaxDistance: 0.5
417 + m_AutoUVMaxAngle: 89
418 + m_LightmapParameters: {fileID: 0}
419 + m_SortingLayerID: 0
420 + m_SortingLayer: 0
421 + m_SortingOrder: 0
422 +--- !u!33 &860688644
423 +MeshFilter:
424 + m_ObjectHideFlags: 0
425 + m_PrefabParentObject: {fileID: 3300000, guid: c4abfbff3b9d442f4b435849d2d2124c,
426 + type: 3}
427 + m_PrefabInternal: {fileID: 0}
428 + m_GameObject: {fileID: 860688640}
429 + m_Mesh: {fileID: 4300000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
430 +--- !u!1 &902023479
431 +GameObject:
432 + m_ObjectHideFlags: 0
433 + m_PrefabParentObject: {fileID: 0}
434 + m_PrefabInternal: {fileID: 0}
435 + serializedVersion: 5
436 + m_Component:
437 + - component: {fileID: 902023480}
438 + - component: {fileID: 902023482}
439 + - component: {fileID: 902023481}
440 + m_Layer: 5
441 + m_Name: Text (3)
442 + m_TagString: Untagged
443 + m_Icon: {fileID: 0}
444 + m_NavMeshLayer: 0
445 + m_StaticEditorFlags: 0
446 + m_IsActive: 1
447 +--- !u!224 &902023480
448 +RectTransform:
449 + m_ObjectHideFlags: 0
450 + m_PrefabParentObject: {fileID: 0}
451 + m_PrefabInternal: {fileID: 0}
452 + m_GameObject: {fileID: 902023479}
453 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
454 + m_LocalPosition: {x: 0, y: 0, z: 0}
455 + m_LocalScale: {x: 1, y: 1, z: 1}
456 + m_Children: []
457 + m_Father: {fileID: 1670569530}
458 + m_RootOrder: 3
459 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
460 + m_AnchorMin: {x: 0.5, y: 0.5}
461 + m_AnchorMax: {x: 0.5, y: 0.5}
462 + m_AnchoredPosition: {x: 0, y: 146}
463 + m_SizeDelta: {x: 160, y: 30}
464 + m_Pivot: {x: 0.5, y: 0.5}
465 +--- !u!114 &902023481
466 +MonoBehaviour:
467 + m_ObjectHideFlags: 0
468 + m_PrefabParentObject: {fileID: 0}
469 + m_PrefabInternal: {fileID: 0}
470 + m_GameObject: {fileID: 902023479}
471 + m_Enabled: 1
472 + m_EditorHideFlags: 0
473 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
474 + m_Name:
475 + m_EditorClassIdentifier:
476 + m_Material: {fileID: 0}
477 + m_Color: {r: 1, g: 1, b: 1, a: 1}
478 + m_RaycastTarget: 1
479 + m_OnCullStateChanged:
480 + m_PersistentCalls:
481 + m_Calls: []
482 + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
483 + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
484 + m_FontData:
485 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
486 + m_FontSize: 14
487 + m_FontStyle: 0
488 + m_BestFit: 0
489 + m_MinSize: 10
490 + m_MaxSize: 40
491 + m_Alignment: 4
492 + m_AlignByGeometry: 0
493 + m_RichText: 1
494 + m_HorizontalOverflow: 0
495 + m_VerticalOverflow: 0
496 + m_LineSpacing: 1
497 + m_Text: Debug Texture
498 +--- !u!222 &902023482
499 +CanvasRenderer:
500 + m_ObjectHideFlags: 0
501 + m_PrefabParentObject: {fileID: 0}
502 + m_PrefabInternal: {fileID: 0}
503 + m_GameObject: {fileID: 902023479}
504 +--- !u!1 &1216344938
505 +GameObject:
506 + m_ObjectHideFlags: 0
507 + m_PrefabParentObject: {fileID: 0}
508 + m_PrefabInternal: {fileID: 0}
509 + serializedVersion: 5
510 + m_Component:
511 + - component: {fileID: 1216344942}
512 + - component: {fileID: 1216344941}
513 + - component: {fileID: 1216344940}
514 + - component: {fileID: 1216344939}
515 + m_Layer: 0
516 + m_Name: MotionVectorRenderer
517 + m_TagString: Untagged
518 + m_Icon: {fileID: 0}
519 + m_NavMeshLayer: 0
520 + m_StaticEditorFlags: 0
521 + m_IsActive: 1
522 +--- !u!23 &1216344939
523 +MeshRenderer:
524 + m_ObjectHideFlags: 0
525 + m_PrefabParentObject: {fileID: 0}
526 + m_PrefabInternal: {fileID: 0}
527 + m_GameObject: {fileID: 1216344938}
528 + m_Enabled: 1
529 + m_CastShadows: 1
530 + m_ReceiveShadows: 1
531 + m_DynamicOccludee: 1
532 + m_MotionVectors: 1
533 + m_LightProbeUsage: 1
534 + m_ReflectionProbeUsage: 1
535 + m_Materials:
536 + - {fileID: 2100000, guid: d7daeefbca4f14360bac0e1df1bdacd4, type: 2}
537 + m_StaticBatchInfo:
538 + firstSubMesh: 0
539 + subMeshCount: 0
540 + m_StaticBatchRoot: {fileID: 0}
541 + m_ProbeAnchor: {fileID: 0}
542 + m_LightProbeVolumeOverride: {fileID: 0}
543 + m_ScaleInLightmap: 1
544 + m_PreserveUVs: 1
545 + m_IgnoreNormalsForChartDetection: 0
546 + m_ImportantGI: 0
547 + m_StitchLightmapSeams: 0
548 + m_SelectedEditorRenderState: 3
549 + m_MinimumChartSize: 4
550 + m_AutoUVMaxDistance: 0.5
551 + m_AutoUVMaxAngle: 89
552 + m_LightmapParameters: {fileID: 0}
553 + m_SortingLayerID: 0
554 + m_SortingLayer: 0
555 + m_SortingOrder: 0
556 +--- !u!64 &1216344940
557 +MeshCollider:
558 + m_ObjectHideFlags: 0
559 + m_PrefabParentObject: {fileID: 0}
560 + m_PrefabInternal: {fileID: 0}
561 + m_GameObject: {fileID: 1216344938}
562 + m_Material: {fileID: 0}
563 + m_IsTrigger: 0
564 + m_Enabled: 1
565 + serializedVersion: 3
566 + m_Convex: 0
567 + m_CookingOptions: 14
568 + m_SkinWidth: 0.01
569 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
570 +--- !u!33 &1216344941
571 +MeshFilter:
572 + m_ObjectHideFlags: 0
573 + m_PrefabParentObject: {fileID: 0}
574 + m_PrefabInternal: {fileID: 0}
575 + m_GameObject: {fileID: 1216344938}
576 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
577 +--- !u!4 &1216344942
578 +Transform:
579 + m_ObjectHideFlags: 0
580 + m_PrefabParentObject: {fileID: 0}
581 + m_PrefabInternal: {fileID: 0}
582 + m_GameObject: {fileID: 1216344938}
583 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
584 + m_LocalPosition: {x: 0, y: 0, z: 0}
585 + m_LocalScale: {x: 1, y: 1, z: 1}
586 + m_Children: []
587 + m_Father: {fileID: 1695974773}
588 + m_RootOrder: 0
589 + m_LocalEulerAnglesHint: {x: 0, y: -90.382, z: 0}
590 +--- !u!1 &1356308501
591 +GameObject:
592 + m_ObjectHideFlags: 0
593 + m_PrefabParentObject: {fileID: 100000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
594 + m_PrefabInternal: {fileID: 0}
595 + serializedVersion: 5
596 + m_Component:
597 + - component: {fileID: 1356308505}
598 + - component: {fileID: 1356308504}
599 + - component: {fileID: 1356308503}
600 + - component: {fileID: 1356308506}
601 + - component: {fileID: 1356308502}
602 + m_Layer: 0
603 + m_Name: Wheel
604 + m_TagString: Untagged
605 + m_Icon: {fileID: 0}
606 + m_NavMeshLayer: 0
607 + m_StaticEditorFlags: 0
608 + m_IsActive: 1
609 +--- !u!54 &1356308502
610 +Rigidbody:
611 + m_ObjectHideFlags: 0
612 + m_PrefabParentObject: {fileID: 0}
613 + m_PrefabInternal: {fileID: 0}
614 + m_GameObject: {fileID: 1356308501}
615 + serializedVersion: 2
616 + m_Mass: 0.1
617 + m_Drag: 0
618 + m_AngularDrag: 0.05
619 + m_UseGravity: 0
620 + m_IsKinematic: 0
621 + m_Interpolate: 0
622 + m_Constraints: 0
623 + m_CollisionDetection: 0
624 +--- !u!23 &1356308503
625 +MeshRenderer:
626 + m_ObjectHideFlags: 0
627 + m_PrefabParentObject: {fileID: 2300000, guid: c4abfbff3b9d442f4b435849d2d2124c,
628 + type: 3}
629 + m_PrefabInternal: {fileID: 0}
630 + m_GameObject: {fileID: 1356308501}
631 + m_Enabled: 1
632 + m_CastShadows: 1
633 + m_ReceiveShadows: 1
634 + m_DynamicOccludee: 1
635 + m_MotionVectors: 1
636 + m_LightProbeUsage: 1
637 + m_ReflectionProbeUsage: 1
638 + m_Materials:
639 + - {fileID: 2100000, guid: 944463113244f4bf8b05c1757cd838a4, type: 2}
640 + m_StaticBatchInfo:
641 + firstSubMesh: 0
642 + subMeshCount: 0
643 + m_StaticBatchRoot: {fileID: 0}
644 + m_ProbeAnchor: {fileID: 0}
645 + m_LightProbeVolumeOverride: {fileID: 0}
646 + m_ScaleInLightmap: 1
647 + m_PreserveUVs: 0
648 + m_IgnoreNormalsForChartDetection: 0
649 + m_ImportantGI: 0
650 + m_StitchLightmapSeams: 0
651 + m_SelectedEditorRenderState: 3
652 + m_MinimumChartSize: 4
653 + m_AutoUVMaxDistance: 0.5
654 + m_AutoUVMaxAngle: 89
655 + m_LightmapParameters: {fileID: 0}
656 + m_SortingLayerID: 0
657 + m_SortingLayer: 0
658 + m_SortingOrder: 0
659 +--- !u!33 &1356308504
660 +MeshFilter:
661 + m_ObjectHideFlags: 0
662 + m_PrefabParentObject: {fileID: 3300000, guid: c4abfbff3b9d442f4b435849d2d2124c,
663 + type: 3}
664 + m_PrefabInternal: {fileID: 0}
665 + m_GameObject: {fileID: 1356308501}
666 + m_Mesh: {fileID: 4300000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
667 +--- !u!4 &1356308505
668 +Transform:
669 + m_ObjectHideFlags: 0
670 + m_PrefabParentObject: {fileID: 400000, guid: c4abfbff3b9d442f4b435849d2d2124c, type: 3}
671 + m_PrefabInternal: {fileID: 0}
672 + m_GameObject: {fileID: 1356308501}
673 + m_LocalRotation: {x: -0, y: -0, z: 0, w: 1}
674 + m_LocalPosition: {x: 0, y: 0, z: 0}
675 + m_LocalScale: {x: 1, y: 1, z: 1}
676 + m_Children: []
677 + m_Father: {fileID: 159053896}
678 + m_RootOrder: 0
679 + m_LocalEulerAnglesHint: {x: 0, y: 20, z: 0}
680 +--- !u!114 &1356308506
681 +MonoBehaviour:
682 + m_ObjectHideFlags: 0
683 + m_PrefabParentObject: {fileID: 0}
684 + m_PrefabInternal: {fileID: 0}
685 + m_GameObject: {fileID: 1356308501}
686 + m_Enabled: 1
687 + m_EditorHideFlags: 0
688 + m_Script: {fileID: 11500000, guid: 840c928746809454cb5b9309b640dbd7, type: 3}
689 + m_Name:
690 + m_EditorClassIdentifier:
691 + acceleration: 10
692 + motionVectorRenderer: {fileID: 860688643}
693 +--- !u!1 &1427819714
694 +GameObject:
695 + m_ObjectHideFlags: 0
696 + m_PrefabParentObject: {fileID: 0}
697 + m_PrefabInternal: {fileID: 0}
698 + serializedVersion: 5
699 + m_Component:
700 + - component: {fileID: 1427819715}
701 + - component: {fileID: 1427819717}
702 + - component: {fileID: 1427819716}
703 + m_Layer: 5
704 + m_Name: Text (1)
705 + m_TagString: Untagged
706 + m_Icon: {fileID: 0}
707 + m_NavMeshLayer: 0
708 + m_StaticEditorFlags: 0
709 + m_IsActive: 1
710 +--- !u!224 &1427819715
711 +RectTransform:
712 + m_ObjectHideFlags: 0
713 + m_PrefabParentObject: {fileID: 0}
714 + m_PrefabInternal: {fileID: 0}
715 + m_GameObject: {fileID: 1427819714}
716 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
717 + m_LocalPosition: {x: 0, y: 0, z: 0}
718 + m_LocalScale: {x: 1, y: 1, z: 1}
719 + m_Children: []
720 + m_Father: {fileID: 1670569530}
721 + m_RootOrder: 1
722 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
723 + m_AnchorMin: {x: 0.5, y: 0.5}
724 + m_AnchorMax: {x: 0.5, y: 0.5}
725 + m_AnchoredPosition: {x: 160, y: 68}
726 + m_SizeDelta: {x: 160, y: 30}
727 + m_Pivot: {x: 0.5, y: 0.5}
728 +--- !u!114 &1427819716
729 +MonoBehaviour:
730 + m_ObjectHideFlags: 0
731 + m_PrefabParentObject: {fileID: 0}
732 + m_PrefabInternal: {fileID: 0}
733 + m_GameObject: {fileID: 1427819714}
734 + m_Enabled: 1
735 + m_EditorHideFlags: 0
736 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
737 + m_Name:
738 + m_EditorClassIdentifier:
739 + m_Material: {fileID: 0}
740 + m_Color: {r: 1, g: 1, b: 1, a: 1}
741 + m_RaycastTarget: 1
742 + m_OnCullStateChanged:
743 + m_PersistentCalls:
744 + m_Calls: []
745 + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
746 + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
747 + m_FontData:
748 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
749 + m_FontSize: 14
750 + m_FontStyle: 0
751 + m_BestFit: 0
752 + m_MinSize: 10
753 + m_MaxSize: 40
754 + m_Alignment: 4
755 + m_AlignByGeometry: 0
756 + m_RichText: 1
757 + m_HorizontalOverflow: 0
758 + m_VerticalOverflow: 0
759 + m_LineSpacing: 1
760 + m_Text: Regular Motion Vectors
761 +--- !u!222 &1427819717
762 +CanvasRenderer:
763 + m_ObjectHideFlags: 0
764 + m_PrefabParentObject: {fileID: 0}
765 + m_PrefabInternal: {fileID: 0}
766 + m_GameObject: {fileID: 1427819714}
767 +--- !u!1 &1489478929
768 +GameObject:
769 + m_ObjectHideFlags: 0
770 + m_PrefabParentObject: {fileID: 0}
771 + m_PrefabInternal: {fileID: 0}
772 + serializedVersion: 5
773 + m_Component:
774 + - component: {fileID: 1489478934}
775 + - component: {fileID: 1489478933}
776 + - component: {fileID: 1489478932}
777 + - component: {fileID: 1489478931}
778 + - component: {fileID: 1489478930}
779 + - component: {fileID: 1489478935}
780 + m_Layer: 0
781 + m_Name: Main Camera
782 + m_TagString: MainCamera
783 + m_Icon: {fileID: 0}
784 + m_NavMeshLayer: 0
785 + m_StaticEditorFlags: 0
786 + m_IsActive: 1
787 +--- !u!81 &1489478930
788 +AudioListener:
789 + m_ObjectHideFlags: 0
790 + m_PrefabParentObject: {fileID: 0}
791 + m_PrefabInternal: {fileID: 0}
792 + m_GameObject: {fileID: 1489478929}
793 + m_Enabled: 1
794 +--- !u!124 &1489478931
795 +Behaviour:
796 + m_ObjectHideFlags: 0
797 + m_PrefabParentObject: {fileID: 0}
798 + m_PrefabInternal: {fileID: 0}
799 + m_GameObject: {fileID: 1489478929}
800 + m_Enabled: 1
801 +--- !u!92 &1489478932
802 +Behaviour:
803 + m_ObjectHideFlags: 0
804 + m_PrefabParentObject: {fileID: 0}
805 + m_PrefabInternal: {fileID: 0}
806 + m_GameObject: {fileID: 1489478929}
807 + m_Enabled: 1
808 +--- !u!20 &1489478933
809 +Camera:
810 + m_ObjectHideFlags: 0
811 + m_PrefabParentObject: {fileID: 0}
812 + m_PrefabInternal: {fileID: 0}
813 + m_GameObject: {fileID: 1489478929}
814 + m_Enabled: 1
815 + serializedVersion: 2
816 + m_ClearFlags: 2
817 + m_BackGroundColor: {r: 0.23529412, g: 0.23529412, b: 0.23529412, a: 0}
818 + m_NormalizedViewPortRect:
819 + serializedVersion: 2
820 + x: 0
821 + y: 0
822 + width: 1
823 + height: 1
824 + near clip plane: 0.3
825 + far clip plane: 1000
826 + field of view: 60
827 + orthographic: 0
828 + orthographic size: 5
829 + m_Depth: -1
830 + m_CullingMask:
831 + serializedVersion: 2
832 + m_Bits: 4294967295
833 + m_RenderingPath: 3
834 + m_TargetTexture: {fileID: 0}
835 + m_TargetDisplay: 0
836 + m_TargetEye: 3
837 + m_HDR: 1
838 + m_AllowMSAA: 1
839 + m_AllowDynamicResolution: 0
840 + m_ForceIntoRT: 0
841 + m_OcclusionCulling: 1
842 + m_StereoConvergence: 10
843 + m_StereoSeparation: 0.022
844 +--- !u!4 &1489478934
845 +Transform:
846 + m_ObjectHideFlags: 0
847 + m_PrefabParentObject: {fileID: 0}
848 + m_PrefabInternal: {fileID: 0}
849 + m_GameObject: {fileID: 1489478929}
850 + m_LocalRotation: {x: 0.111127794, y: -0.69831985, z: 0.111127794, w: 0.69831985}
851 + m_LocalPosition: {x: 1.02, y: 0.3286136, z: 0}
852 + m_LocalScale: {x: 1, y: 1, z: 1}
853 + m_Children: []
854 + m_Father: {fileID: 0}
855 + m_RootOrder: 0
856 + m_LocalEulerAnglesHint: {x: 18.084002, y: -90, z: 0}
857 +--- !u!114 &1489478935
858 +MonoBehaviour:
859 + m_ObjectHideFlags: 0
860 + m_PrefabParentObject: {fileID: 0}
861 + m_PrefabInternal: {fileID: 0}
862 + m_GameObject: {fileID: 1489478929}
863 + m_Enabled: 1
864 + m_EditorHideFlags: 0
865 + m_Script: {fileID: 11500000, guid: ff26db721962cdf4a8edcdfa9a767d2a, type: 3}
866 + m_Name:
867 + m_EditorClassIdentifier:
868 + profile: {fileID: 11400000, guid: d982e879ff67b4d3fb6522d08c3cd5af, type: 2}
869 +--- !u!1 &1563286491
870 +GameObject:
871 + m_ObjectHideFlags: 0
872 + m_PrefabParentObject: {fileID: 0}
873 + m_PrefabInternal: {fileID: 0}
874 + serializedVersion: 5
875 + m_Component:
876 + - component: {fileID: 1563286492}
877 + - component: {fileID: 1563286494}
878 + - component: {fileID: 1563286493}
879 + m_Layer: 5
880 + m_Name: Text
881 + m_TagString: Untagged
882 + m_Icon: {fileID: 0}
883 + m_NavMeshLayer: 0
884 + m_StaticEditorFlags: 0
885 + m_IsActive: 1
886 +--- !u!224 &1563286492
887 +RectTransform:
888 + m_ObjectHideFlags: 0
889 + m_PrefabParentObject: {fileID: 0}
890 + m_PrefabInternal: {fileID: 0}
891 + m_GameObject: {fileID: 1563286491}
892 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
893 + m_LocalPosition: {x: 0, y: 0, z: 0}
894 + m_LocalScale: {x: 1, y: 1, z: 1}
895 + m_Children: []
896 + m_Father: {fileID: 1670569530}
897 + m_RootOrder: 0
898 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
899 + m_AnchorMin: {x: 0.5, y: 0.5}
900 + m_AnchorMax: {x: 0.5, y: 0.5}
901 + m_AnchoredPosition: {x: -160, y: 68}
902 + m_SizeDelta: {x: 160, y: 30}
903 + m_Pivot: {x: 0.5, y: 0.5}
904 +--- !u!114 &1563286493
905 +MonoBehaviour:
906 + m_ObjectHideFlags: 0
907 + m_PrefabParentObject: {fileID: 0}
908 + m_PrefabInternal: {fileID: 0}
909 + m_GameObject: {fileID: 1563286491}
910 + m_Enabled: 1
911 + m_EditorHideFlags: 0
912 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
913 + m_Name:
914 + m_EditorClassIdentifier:
915 + m_Material: {fileID: 0}
916 + m_Color: {r: 1, g: 1, b: 1, a: 1}
917 + m_RaycastTarget: 1
918 + m_OnCullStateChanged:
919 + m_PersistentCalls:
920 + m_Calls: []
921 + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
922 + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
923 + m_FontData:
924 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
925 + m_FontSize: 14
926 + m_FontStyle: 0
927 + m_BestFit: 0
928 + m_MinSize: 10
929 + m_MaxSize: 40
930 + m_Alignment: 4
931 + m_AlignByGeometry: 0
932 + m_RichText: 1
933 + m_HorizontalOverflow: 0
934 + m_VerticalOverflow: 0
935 + m_LineSpacing: 1
936 + m_Text: Custom Motion Vectors
937 +--- !u!222 &1563286494
938 +CanvasRenderer:
939 + m_ObjectHideFlags: 0
940 + m_PrefabParentObject: {fileID: 0}
941 + m_PrefabInternal: {fileID: 0}
942 + m_GameObject: {fileID: 1563286491}
943 +--- !u!1 &1670569526
944 +GameObject:
945 + m_ObjectHideFlags: 0
946 + m_PrefabParentObject: {fileID: 0}
947 + m_PrefabInternal: {fileID: 0}
948 + serializedVersion: 5
949 + m_Component:
950 + - component: {fileID: 1670569530}
951 + - component: {fileID: 1670569529}
952 + - component: {fileID: 1670569528}
953 + - component: {fileID: 1670569527}
954 + m_Layer: 5
955 + m_Name: Canvas
956 + m_TagString: Untagged
957 + m_Icon: {fileID: 0}
958 + m_NavMeshLayer: 0
959 + m_StaticEditorFlags: 0
960 + m_IsActive: 1
961 +--- !u!114 &1670569527
962 +MonoBehaviour:
963 + m_ObjectHideFlags: 0
964 + m_PrefabParentObject: {fileID: 0}
965 + m_PrefabInternal: {fileID: 0}
966 + m_GameObject: {fileID: 1670569526}
967 + m_Enabled: 1
968 + m_EditorHideFlags: 0
969 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
970 + m_Name:
971 + m_EditorClassIdentifier:
972 + m_IgnoreReversedGraphics: 1
973 + m_BlockingObjects: 0
974 + m_BlockingMask:
975 + serializedVersion: 2
976 + m_Bits: 4294967295
977 +--- !u!114 &1670569528
978 +MonoBehaviour:
979 + m_ObjectHideFlags: 0
980 + m_PrefabParentObject: {fileID: 0}
981 + m_PrefabInternal: {fileID: 0}
982 + m_GameObject: {fileID: 1670569526}
983 + m_Enabled: 1
984 + m_EditorHideFlags: 0
985 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
986 + m_Name:
987 + m_EditorClassIdentifier:
988 + m_UiScaleMode: 0
989 + m_ReferencePixelsPerUnit: 100
990 + m_ScaleFactor: 1
991 + m_ReferenceResolution: {x: 800, y: 600}
992 + m_ScreenMatchMode: 0
993 + m_MatchWidthOrHeight: 0
994 + m_PhysicalUnit: 3
995 + m_FallbackScreenDPI: 96
996 + m_DefaultSpriteDPI: 96
997 + m_DynamicPixelsPerUnit: 1
998 +--- !u!223 &1670569529
999 +Canvas:
1000 + m_ObjectHideFlags: 0
1001 + m_PrefabParentObject: {fileID: 0}
1002 + m_PrefabInternal: {fileID: 0}
1003 + m_GameObject: {fileID: 1670569526}
1004 + m_Enabled: 1
1005 + serializedVersion: 3
1006 + m_RenderMode: 0
1007 + m_Camera: {fileID: 0}
1008 + m_PlaneDistance: 100
1009 + m_PixelPerfect: 0
1010 + m_ReceivesEvents: 1
1011 + m_OverrideSorting: 0
1012 + m_OverridePixelPerfect: 0
1013 + m_SortingBucketNormalizedSize: 0
1014 + m_AdditionalShaderChannelsFlag: 25
1015 + m_SortingLayerID: 0
1016 + m_SortingOrder: 0
1017 + m_TargetDisplay: 0
1018 +--- !u!224 &1670569530
1019 +RectTransform:
1020 + m_ObjectHideFlags: 0
1021 + m_PrefabParentObject: {fileID: 0}
1022 + m_PrefabInternal: {fileID: 0}
1023 + m_GameObject: {fileID: 1670569526}
1024 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
1025 + m_LocalPosition: {x: 0, y: 0, z: 0}
1026 + m_LocalScale: {x: 0, y: 0, z: 0}
1027 + m_Children:
1028 + - {fileID: 1563286492}
1029 + - {fileID: 1427819715}
1030 + - {fileID: 483713898}
1031 + - {fileID: 902023480}
1032 + m_Father: {fileID: 0}
1033 + m_RootOrder: 5
1034 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1035 + m_AnchorMin: {x: 0, y: 0}
1036 + m_AnchorMax: {x: 0, y: 0}
1037 + m_AnchoredPosition: {x: 0, y: 0}
1038 + m_SizeDelta: {x: 0, y: 0}
1039 + m_Pivot: {x: 0, y: 0}
1040 +--- !u!1 &1695974769
1041 +GameObject:
1042 + m_ObjectHideFlags: 0
1043 + m_PrefabParentObject: {fileID: 0}
1044 + m_PrefabInternal: {fileID: 0}
1045 + serializedVersion: 5
1046 + m_Component:
1047 + - component: {fileID: 1695974773}
1048 + - component: {fileID: 1695974772}
1049 + - component: {fileID: 1695974771}
1050 + - component: {fileID: 1695974770}
1051 + m_Layer: 0
1052 + m_Name: DebugQuad
1053 + m_TagString: Untagged
1054 + m_Icon: {fileID: 0}
1055 + m_NavMeshLayer: 0
1056 + m_StaticEditorFlags: 0
1057 + m_IsActive: 1
1058 +--- !u!23 &1695974770
1059 +MeshRenderer:
1060 + m_ObjectHideFlags: 0
1061 + m_PrefabParentObject: {fileID: 0}
1062 + m_PrefabInternal: {fileID: 0}
1063 + m_GameObject: {fileID: 1695974769}
1064 + m_Enabled: 1
1065 + m_CastShadows: 1
1066 + m_ReceiveShadows: 1
1067 + m_DynamicOccludee: 1
1068 + m_MotionVectors: 1
1069 + m_LightProbeUsage: 1
1070 + m_ReflectionProbeUsage: 1
1071 + m_Materials:
1072 + - {fileID: 2100000, guid: 3c40c8fdc50a841579d7cb15882ac9d9, type: 2}
1073 + m_StaticBatchInfo:
1074 + firstSubMesh: 0
1075 + subMeshCount: 0
1076 + m_StaticBatchRoot: {fileID: 0}
1077 + m_ProbeAnchor: {fileID: 0}
1078 + m_LightProbeVolumeOverride: {fileID: 0}
1079 + m_ScaleInLightmap: 1
1080 + m_PreserveUVs: 1
1081 + m_IgnoreNormalsForChartDetection: 0
1082 + m_ImportantGI: 0
1083 + m_StitchLightmapSeams: 0
1084 + m_SelectedEditorRenderState: 3
1085 + m_MinimumChartSize: 4
1086 + m_AutoUVMaxDistance: 0.5
1087 + m_AutoUVMaxAngle: 89
1088 + m_LightmapParameters: {fileID: 0}
1089 + m_SortingLayerID: 0
1090 + m_SortingLayer: 0
1091 + m_SortingOrder: 0
1092 +--- !u!64 &1695974771
1093 +MeshCollider:
1094 + m_ObjectHideFlags: 0
1095 + m_PrefabParentObject: {fileID: 0}
1096 + m_PrefabInternal: {fileID: 0}
1097 + m_GameObject: {fileID: 1695974769}
1098 + m_Material: {fileID: 0}
1099 + m_IsTrigger: 0
1100 + m_Enabled: 1
1101 + serializedVersion: 3
1102 + m_Convex: 0
1103 + m_CookingOptions: 14
1104 + m_SkinWidth: 0.01
1105 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
1106 +--- !u!33 &1695974772
1107 +MeshFilter:
1108 + m_ObjectHideFlags: 0
1109 + m_PrefabParentObject: {fileID: 0}
1110 + m_PrefabInternal: {fileID: 0}
1111 + m_GameObject: {fileID: 1695974769}
1112 + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
1113 +--- !u!4 &1695974773
1114 +Transform:
1115 + m_ObjectHideFlags: 0
1116 + m_PrefabParentObject: {fileID: 0}
1117 + m_PrefabInternal: {fileID: 0}
1118 + m_GameObject: {fileID: 1695974769}
1119 + m_LocalRotation: {x: -0, y: -0.7094573, z: -0, w: 0.7047485}
1120 + m_LocalPosition: {x: 0, y: 0.284, z: 0}
1121 + m_LocalScale: {x: 0.25, y: 0.25, z: 0.25}
1122 + m_Children:
1123 + - {fileID: 1216344942}
1124 + m_Father: {fileID: 0}
1125 + m_RootOrder: 4
1126 + m_LocalEulerAnglesHint: {x: 0, y: -90.382, z: 0}
1127 +--- !u!1 &1940873752
1128 +GameObject:
1129 + m_ObjectHideFlags: 0
1130 + m_PrefabParentObject: {fileID: 0}
1131 + m_PrefabInternal: {fileID: 0}
1132 + serializedVersion: 5
1133 + m_Component:
1134 + - component: {fileID: 1940873755}
1135 + - component: {fileID: 1940873754}
1136 + - component: {fileID: 1940873753}
1137 + m_Layer: 0
1138 + m_Name: EventSystem
1139 + m_TagString: Untagged
1140 + m_Icon: {fileID: 0}
1141 + m_NavMeshLayer: 0
1142 + m_StaticEditorFlags: 0
1143 + m_IsActive: 1
1144 +--- !u!114 &1940873753
1145 +MonoBehaviour:
1146 + m_ObjectHideFlags: 0
1147 + m_PrefabParentObject: {fileID: 0}
1148 + m_PrefabInternal: {fileID: 0}
1149 + m_GameObject: {fileID: 1940873752}
1150 + m_Enabled: 1
1151 + m_EditorHideFlags: 0
1152 + m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
1153 + m_Name:
1154 + m_EditorClassIdentifier:
1155 + m_HorizontalAxis: Horizontal
1156 + m_VerticalAxis: Vertical
1157 + m_SubmitButton: Submit
1158 + m_CancelButton: Cancel
1159 + m_InputActionsPerSecond: 10
1160 + m_RepeatDelay: 0.5
1161 + m_ForceModuleActive: 0
1162 +--- !u!114 &1940873754
1163 +MonoBehaviour:
1164 + m_ObjectHideFlags: 0
1165 + m_PrefabParentObject: {fileID: 0}
1166 + m_PrefabInternal: {fileID: 0}
1167 + m_GameObject: {fileID: 1940873752}
1168 + m_Enabled: 1
1169 + m_EditorHideFlags: 0
1170 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
1171 + m_Name:
1172 + m_EditorClassIdentifier:
1173 + m_FirstSelected: {fileID: 0}
1174 + m_sendNavigationEvents: 1
1175 + m_DragThreshold: 5
1176 +--- !u!4 &1940873755
1177 +Transform:
1178 + m_ObjectHideFlags: 0
1179 + m_PrefabParentObject: {fileID: 0}
1180 + m_PrefabInternal: {fileID: 0}
1181 + m_GameObject: {fileID: 1940873752}
1182 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
1183 + m_LocalPosition: {x: 0, y: 0, z: 0}
1184 + m_LocalScale: {x: 1, y: 1, z: 1}
1185 + m_Children: []
1186 + m_Father: {fileID: 0}
1187 + m_RootOrder: 6
1188 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1189 +--- !u!1 &2138017022
1190 +GameObject:
1191 + m_ObjectHideFlags: 0
1192 + m_PrefabParentObject: {fileID: 0}
1193 + m_PrefabInternal: {fileID: 0}
1194 + serializedVersion: 5
1195 + m_Component:
1196 + - component: {fileID: 2138017024}
1197 + - component: {fileID: 2138017023}
1198 + m_Layer: 0
1199 + m_Name: Directional Light
1200 + m_TagString: Untagged
1201 + m_Icon: {fileID: 0}
1202 + m_NavMeshLayer: 0
1203 + m_StaticEditorFlags: 0
1204 + m_IsActive: 1
1205 +--- !u!108 &2138017023
1206 +Light:
1207 + m_ObjectHideFlags: 0
1208 + m_PrefabParentObject: {fileID: 0}
1209 + m_PrefabInternal: {fileID: 0}
1210 + m_GameObject: {fileID: 2138017022}
1211 + m_Enabled: 1
1212 + serializedVersion: 8
1213 + m_Type: 1
1214 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
1215 + m_Intensity: 1
1216 + m_Range: 10
1217 + m_SpotAngle: 30
1218 + m_CookieSize: 10
1219 + m_Shadows:
1220 + m_Type: 2
1221 + m_Resolution: -1
1222 + m_CustomResolution: -1
1223 + m_Strength: 1
1224 + m_Bias: 0.05
1225 + m_NormalBias: 0.4
1226 + m_NearPlane: 0.2
1227 + m_Cookie: {fileID: 0}
1228 + m_DrawHalo: 0
1229 + m_Flare: {fileID: 0}
1230 + m_RenderMode: 0
1231 + m_CullingMask:
1232 + serializedVersion: 2
1233 + m_Bits: 4294967295
1234 + m_Lightmapping: 4
1235 + m_AreaSize: {x: 1, y: 1}
1236 + m_BounceIntensity: 1
1237 + m_ColorTemperature: 6570
1238 + m_UseColorTemperature: 0
1239 + m_ShadowRadius: 0
1240 + m_ShadowAngle: 0
1241 +--- !u!4 &2138017024
1242 +Transform:
1243 + m_ObjectHideFlags: 0
1244 + m_PrefabParentObject: {fileID: 0}
1245 + m_PrefabInternal: {fileID: 0}
1246 + m_GameObject: {fileID: 2138017022}
1247 + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
1248 + m_LocalPosition: {x: 0, y: 3, z: 0}
1249 + m_LocalScale: {x: 1, y: 1, z: 1}
1250 + m_Children: []
1251 + m_Father: {fileID: 0}
1252 + m_RootOrder: 1
1253 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
1 +fileFormatVersion: 2
2 +guid: ed3a9f41209f84f6db99e07013da9628
3 +timeCreated: 1487347827
4 +licenseType: Store
5 +DefaultImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
1 +using UnityEngine;
2 +
3 +public class ExampleWheelController : MonoBehaviour
4 +{
5 + public float acceleration;
6 + public Renderer motionVectorRenderer; // Reference to the custom motion vector renderer
7 +
8 + Rigidbody m_Rigidbody;
9 +
10 + static class Uniforms
11 + {
12 + internal static readonly int _MotionAmount = Shader.PropertyToID("_MotionAmount");
13 + }
14 +
15 + void Start()
16 + {
17 + m_Rigidbody = GetComponent<Rigidbody>(); // Get reference to rigidbody
18 + m_Rigidbody.maxAngularVelocity = 100; // Set max velocity for rigidbody
19 + }
20 +
21 + void Update()
22 + {
23 + if (Input.GetKey (KeyCode.UpArrow)) // Rotate forward
24 + m_Rigidbody.AddRelativeTorque(new Vector3(-1 * acceleration, 0, 0), ForceMode.Acceleration); // Add forward torque to mesh
25 + else if (Input.GetKey (KeyCode.DownArrow)) // Rotate backward
26 + m_Rigidbody.AddRelativeTorque(new Vector3(1 * acceleration, 0, 0), ForceMode.Acceleration); // Add backward torque to mesh
27 +
28 + float m = -m_Rigidbody.angularVelocity.x / 100; // Calculate multiplier for motion vector texture
29 +
30 + if (motionVectorRenderer) // If the custom motion vector texture renderer exists
31 + motionVectorRenderer.material.SetFloat(Uniforms._MotionAmount, Mathf.Clamp(m, -0.25f, 0.25f)); // Set the multiplier on the renderer's material
32 + }
33 +}
1 +fileFormatVersion: 2
2 +guid: 840c928746809454cb5b9309b640dbd7
3 +timeCreated: 1479836093
4 +licenseType: Store
5 +MonoImporter:
6 + serializedVersion: 2
7 + defaultReferences: []
8 + executionOrder: 0
9 + icon: {instanceID: 0}
10 + userData:
11 + assetBundleName:
12 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: c4b2008f2662a41e587c4351609053c4
3 +folderAsset: yes
4 +timeCreated: 1487340121
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!21 &2100000
4 +Material:
5 + serializedVersion: 6
6 + m_ObjectHideFlags: 0
7 + m_PrefabParentObject: {fileID: 0}
8 + m_PrefabInternal: {fileID: 0}
9 + m_Name: DebugMotionVectors
10 + m_Shader: {fileID: 4800000, guid: 9189229324e2342b8b69f7c1904dceba, type: 3}
11 + m_ShaderKeywords: _EMISSION
12 + m_LightmapFlags: 1
13 + m_EnableInstancingVariants: 0
14 + m_DoubleSidedGI: 0
15 + m_CustomRenderQueue: -1
16 + stringTagMap: {}
17 + disabledShaderPasses: []
18 + m_SavedProperties:
19 + serializedVersion: 3
20 + m_TexEnvs:
21 + - _BumpMap:
22 + m_Texture: {fileID: 0}
23 + m_Scale: {x: 1, y: 1}
24 + m_Offset: {x: 0, y: 0}
25 + - _DetailAlbedoMap:
26 + m_Texture: {fileID: 0}
27 + m_Scale: {x: 1, y: 1}
28 + m_Offset: {x: 0, y: 0}
29 + - _DetailMask:
30 + m_Texture: {fileID: 0}
31 + m_Scale: {x: 1, y: 1}
32 + m_Offset: {x: 0, y: 0}
33 + - _DetailNormalMap:
34 + m_Texture: {fileID: 0}
35 + m_Scale: {x: 1, y: 1}
36 + m_Offset: {x: 0, y: 0}
37 + - _EmissionMap:
38 + m_Texture: {fileID: 0}
39 + m_Scale: {x: 1, y: 1}
40 + m_Offset: {x: 0, y: 0}
41 + - _MainTex:
42 + m_Texture: {fileID: 2800000, guid: 3aac3087967ea4fae858ec0494fd24d9, type: 3}
43 + m_Scale: {x: 1, y: 1}
44 + m_Offset: {x: 0, y: 0}
45 + - _MetallicGlossMap:
46 + m_Texture: {fileID: 0}
47 + m_Scale: {x: 1, y: 1}
48 + m_Offset: {x: 0, y: 0}
49 + - _MotionTex:
50 + m_Texture: {fileID: 2800000, guid: 3aac3087967ea4fae858ec0494fd24d9, type: 3}
51 + m_Scale: {x: 1, y: 1}
52 + m_Offset: {x: 0, y: 0}
53 + - _OcclusionMap:
54 + m_Texture: {fileID: 0}
55 + m_Scale: {x: 1, y: 1}
56 + m_Offset: {x: 0, y: 0}
57 + - _ParallaxMap:
58 + m_Texture: {fileID: 0}
59 + m_Scale: {x: 1, y: 1}
60 + m_Offset: {x: 0, y: 0}
61 + m_Floats:
62 + - _BumpScale: 1
63 + - _Cutoff: 0.5
64 + - _DetailNormalMapScale: 1
65 + - _DstBlend: 0
66 + - _GlossMapScale: 1
67 + - _Glossiness: 0.5
68 + - _GlossyReflections: 1
69 + - _Metallic: 0
70 + - _Mode: 0
71 + - _MotionAmount: 0.1
72 + - _OcclusionStrength: 1
73 + - _Parallax: 0.02
74 + - _SmoothnessTextureChannel: 0
75 + - _SpecularHighlights: 1
76 + - _SrcBlend: 1
77 + - _UVSec: 0
78 + - _ZWrite: 1
79 + m_Colors:
80 + - _Color: {r: 1, g: 1, b: 1, a: 1}
81 + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
1 +fileFormatVersion: 2
2 +guid: d7daeefbca4f14360bac0e1df1bdacd4
3 +timeCreated: 1479896287
4 +licenseType: Store
5 +NativeFormatImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!21 &2100000
4 +Material:
5 + serializedVersion: 6
6 + m_ObjectHideFlags: 0
7 + m_PrefabParentObject: {fileID: 0}
8 + m_PrefabInternal: {fileID: 0}
9 + m_Name: DebugQuad
10 + m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0}
11 + m_ShaderKeywords: _EMISSION
12 + m_LightmapFlags: 1
13 + m_EnableInstancingVariants: 0
14 + m_DoubleSidedGI: 0
15 + m_CustomRenderQueue: -1
16 + stringTagMap: {}
17 + disabledShaderPasses: []
18 + m_SavedProperties:
19 + serializedVersion: 3
20 + m_TexEnvs:
21 + - _BumpMap:
22 + m_Texture: {fileID: 0}
23 + m_Scale: {x: 1, y: 1}
24 + m_Offset: {x: 0, y: 0}
25 + - _DetailAlbedoMap:
26 + m_Texture: {fileID: 0}
27 + m_Scale: {x: 1, y: 1}
28 + m_Offset: {x: 0, y: 0}
29 + - _DetailMask:
30 + m_Texture: {fileID: 0}
31 + m_Scale: {x: 1, y: 1}
32 + m_Offset: {x: 0, y: 0}
33 + - _DetailNormalMap:
34 + m_Texture: {fileID: 0}
35 + m_Scale: {x: 1, y: 1}
36 + m_Offset: {x: 0, y: 0}
37 + - _EmissionMap:
38 + m_Texture: {fileID: 0}
39 + m_Scale: {x: 1, y: 1}
40 + m_Offset: {x: 0, y: 0}
41 + - _MainTex:
42 + m_Texture: {fileID: 2800000, guid: 3aac3087967ea4fae858ec0494fd24d9, type: 3}
43 + m_Scale: {x: 1, y: 1}
44 + m_Offset: {x: 0, y: 0}
45 + - _MetallicGlossMap:
46 + m_Texture: {fileID: 0}
47 + m_Scale: {x: 1, y: 1}
48 + m_Offset: {x: 0, y: 0}
49 + - _MotionTex:
50 + m_Texture: {fileID: 2800000, guid: 3aac3087967ea4fae858ec0494fd24d9, type: 3}
51 + m_Scale: {x: 1, y: 1}
52 + m_Offset: {x: 0, y: 0}
53 + - _OcclusionMap:
54 + m_Texture: {fileID: 0}
55 + m_Scale: {x: 1, y: 1}
56 + m_Offset: {x: 0, y: 0}
57 + - _ParallaxMap:
58 + m_Texture: {fileID: 0}
59 + m_Scale: {x: 1, y: 1}
60 + m_Offset: {x: 0, y: 0}
61 + m_Floats:
62 + - _BumpScale: 1
63 + - _Cutoff: 0.5
64 + - _DetailNormalMapScale: 1
65 + - _DstBlend: 0
66 + - _GlossMapScale: 1
67 + - _Glossiness: 0.5
68 + - _GlossyReflections: 1
69 + - _Metallic: 0
70 + - _Mode: 0
71 + - _MotionAmount: 0.26
72 + - _OcclusionStrength: 1
73 + - _Parallax: 0.02
74 + - _SmoothnessTextureChannel: 0
75 + - _SpecularHighlights: 1
76 + - _SrcBlend: 1
77 + - _UVSec: 0
78 + - _ZWrite: 1
79 + m_Colors:
80 + - _Color: {r: 1, g: 1, b: 1, a: 1}
81 + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
1 +fileFormatVersion: 2
2 +guid: 3c40c8fdc50a841579d7cb15882ac9d9
3 +timeCreated: 1479896287
4 +licenseType: Store
5 +NativeFormatImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!21 &2100000
4 +Material:
5 + serializedVersion: 6
6 + m_ObjectHideFlags: 0
7 + m_PrefabParentObject: {fileID: 0}
8 + m_PrefabInternal: {fileID: 0}
9 + m_Name: UVChecker
10 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
11 + m_ShaderKeywords: _EMISSION
12 + m_LightmapFlags: 1
13 + m_EnableInstancingVariants: 0
14 + m_DoubleSidedGI: 0
15 + m_CustomRenderQueue: -1
16 + stringTagMap: {}
17 + disabledShaderPasses: []
18 + m_SavedProperties:
19 + serializedVersion: 3
20 + m_TexEnvs:
21 + - _BumpMap:
22 + m_Texture: {fileID: 0}
23 + m_Scale: {x: 1, y: 1}
24 + m_Offset: {x: 0, y: 0}
25 + - _DetailAlbedoMap:
26 + m_Texture: {fileID: 0}
27 + m_Scale: {x: 1, y: 1}
28 + m_Offset: {x: 0, y: 0}
29 + - _DetailMask:
30 + m_Texture: {fileID: 0}
31 + m_Scale: {x: 1, y: 1}
32 + m_Offset: {x: 0, y: 0}
33 + - _DetailNormalMap:
34 + m_Texture: {fileID: 0}
35 + m_Scale: {x: 1, y: 1}
36 + m_Offset: {x: 0, y: 0}
37 + - _EmissionMap:
38 + m_Texture: {fileID: 0}
39 + m_Scale: {x: 1, y: 1}
40 + m_Offset: {x: 0, y: 0}
41 + - _MainTex:
42 + m_Texture: {fileID: 2800000, guid: a08960dd6e8274e7f8fca616e09c48ed, type: 3}
43 + m_Scale: {x: 1, y: 1}
44 + m_Offset: {x: 0, y: 0}
45 + - _MetallicGlossMap:
46 + m_Texture: {fileID: 0}
47 + m_Scale: {x: 1, y: 1}
48 + m_Offset: {x: 0, y: 0}
49 + - _OcclusionMap:
50 + m_Texture: {fileID: 0}
51 + m_Scale: {x: 1, y: 1}
52 + m_Offset: {x: 0, y: 0}
53 + - _ParallaxMap:
54 + m_Texture: {fileID: 0}
55 + m_Scale: {x: 1, y: 1}
56 + m_Offset: {x: 0, y: 0}
57 + m_Floats:
58 + - _BumpScale: 1
59 + - _Cutoff: 0.5
60 + - _DetailNormalMapScale: 1
61 + - _DstBlend: 0
62 + - _GlossMapScale: 1
63 + - _Glossiness: 0.5
64 + - _GlossyReflections: 1
65 + - _Metallic: 0
66 + - _Mode: 0
67 + - _OcclusionStrength: 1
68 + - _Parallax: 0.02
69 + - _SmoothnessTextureChannel: 0
70 + - _SpecularHighlights: 1
71 + - _SrcBlend: 1
72 + - _UVSec: 0
73 + - _ZWrite: 1
74 + m_Colors:
75 + - _Color: {r: 1, g: 1, b: 1, a: 1}
76 + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
1 +fileFormatVersion: 2
2 +guid: 944463113244f4bf8b05c1757cd838a4
3 +timeCreated: 1487340121
4 +licenseType: Store
5 +NativeFormatImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!21 &2100000
4 +Material:
5 + serializedVersion: 6
6 + m_ObjectHideFlags: 0
7 + m_PrefabParentObject: {fileID: 0}
8 + m_PrefabInternal: {fileID: 0}
9 + m_Name: WheelMotionVectors
10 + m_Shader: {fileID: 4800000, guid: 9189229324e2342b8b69f7c1904dceba, type: 3}
11 + m_ShaderKeywords: _EMISSION
12 + m_LightmapFlags: 1
13 + m_EnableInstancingVariants: 0
14 + m_DoubleSidedGI: 0
15 + m_CustomRenderQueue: -1
16 + stringTagMap: {}
17 + disabledShaderPasses: []
18 + m_SavedProperties:
19 + serializedVersion: 3
20 + m_TexEnvs:
21 + - _BumpMap:
22 + m_Texture: {fileID: 0}
23 + m_Scale: {x: 1, y: 1}
24 + m_Offset: {x: 0, y: 0}
25 + - _DetailAlbedoMap:
26 + m_Texture: {fileID: 0}
27 + m_Scale: {x: 1, y: 1}
28 + m_Offset: {x: 0, y: 0}
29 + - _DetailMask:
30 + m_Texture: {fileID: 0}
31 + m_Scale: {x: 1, y: 1}
32 + m_Offset: {x: 0, y: 0}
33 + - _DetailNormalMap:
34 + m_Texture: {fileID: 0}
35 + m_Scale: {x: 1, y: 1}
36 + m_Offset: {x: 0, y: 0}
37 + - _EmissionMap:
38 + m_Texture: {fileID: 0}
39 + m_Scale: {x: 1, y: 1}
40 + m_Offset: {x: 0, y: 0}
41 + - _MainTex:
42 + m_Texture: {fileID: 0}
43 + m_Scale: {x: 1, y: 1}
44 + m_Offset: {x: 0, y: 0}
45 + - _MetallicGlossMap:
46 + m_Texture: {fileID: 0}
47 + m_Scale: {x: 1, y: 1}
48 + m_Offset: {x: 0, y: 0}
49 + - _MotionTex:
50 + m_Texture: {fileID: 2800000, guid: d1cc06458fe724df8837423c0a2f8f93, type: 3}
51 + m_Scale: {x: 1, y: 1}
52 + m_Offset: {x: 0, y: 0}
53 + - _OcclusionMap:
54 + m_Texture: {fileID: 0}
55 + m_Scale: {x: 1, y: 1}
56 + m_Offset: {x: 0, y: 0}
57 + - _ParallaxMap:
58 + m_Texture: {fileID: 0}
59 + m_Scale: {x: 1, y: 1}
60 + m_Offset: {x: 0, y: 0}
61 + m_Floats:
62 + - _BumpScale: 1
63 + - _Cutoff: 0.5
64 + - _DetailNormalMapScale: 1
65 + - _DstBlend: 0
66 + - _GlossMapScale: 1
67 + - _Glossiness: 0.5
68 + - _GlossyReflections: 1
69 + - _Metallic: 0
70 + - _Mode: 0
71 + - _MotionAmount: 0
72 + - _OcclusionStrength: 1
73 + - _Parallax: 0.02
74 + - _SmoothnessTextureChannel: 0
75 + - _SpecularHighlights: 1
76 + - _SrcBlend: 1
77 + - _UVSec: 0
78 + - _ZWrite: 1
79 + m_Colors:
80 + - _Color: {r: 1, g: 1, b: 1, a: 1}
81 + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
1 +fileFormatVersion: 2
2 +guid: 055f7217f136349d9b68e82b9e987dae
3 +timeCreated: 1479896287
4 +licenseType: Store
5 +NativeFormatImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: ef5ce588de3614b39b5ba7b0613cbe43
3 +folderAsset: yes
4 +timeCreated: 1487348152
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: c4abfbff3b9d442f4b435849d2d2124c
3 +timeCreated: 1479895866
4 +licenseType: Store
5 +ModelImporter:
6 + serializedVersion: 19
7 + fileIDToRecycleName:
8 + 100000: //RootNode
9 + 400000: //RootNode
10 + 2300000: //RootNode
11 + 3300000: //RootNode
12 + 4300000: Object
13 + 9500000: //RootNode
14 + materials:
15 + importMaterials: 0
16 + materialName: 0
17 + materialSearch: 1
18 + animations:
19 + legacyGenerateAnimations: 4
20 + bakeSimulation: 0
21 + resampleCurves: 1
22 + optimizeGameObjects: 0
23 + motionNodeName:
24 + animationImportErrors:
25 + animationImportWarnings:
26 + animationRetargetingWarnings:
27 + animationDoRetargetingWarnings: 0
28 + animationCompression: 1
29 + animationRotationError: 0.5
30 + animationPositionError: 0.5
31 + animationScaleError: 0.5
32 + animationWrapMode: 0
33 + extraExposedTransformPaths: []
34 + clipAnimations: []
35 + isReadable: 0
36 + meshes:
37 + lODScreenPercentages: []
38 + globalScale: 1
39 + meshCompression: 0
40 + addColliders: 0
41 + importBlendShapes: 0
42 + swapUVChannels: 0
43 + generateSecondaryUV: 0
44 + useFileUnits: 1
45 + optimizeMeshForGPU: 1
46 + keepQuads: 0
47 + weldVertices: 1
48 + secondaryUVAngleDistortion: 8
49 + secondaryUVAreaDistortion: 15.000001
50 + secondaryUVHardAngle: 88
51 + secondaryUVPackMargin: 4
52 + useFileScale: 1
53 + tangentSpace:
54 + normalSmoothAngle: 60
55 + normalImportMode: 0
56 + tangentImportMode: 3
57 + importAnimation: 1
58 + copyAvatar: 0
59 + humanDescription:
60 + serializedVersion: 2
61 + human: []
62 + skeleton: []
63 + armTwist: 0.5
64 + foreArmTwist: 0.5
65 + upperLegTwist: 0.5
66 + legTwist: 0.5
67 + armStretch: 0.05
68 + legStretch: 0.05
69 + feetSpacing: 0
70 + rootMotionBoneName:
71 + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
72 + hasTranslationDoF: 0
73 + hasExtraRoot: 0
74 + skeletonHasParents: 1
75 + lastHumanDescriptionAvatarSource: {instanceID: 0}
76 + animationType: 2
77 + humanoidOversampling: 1
78 + additionalBone: 0
79 + userData:
80 + assetBundleName:
81 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 8e565c240745c49628f96f0573adfa76
3 +folderAsset: yes
4 +timeCreated: 1487348368
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +Shader "Post Processing/Custom Motion Vector Texture"
2 +{
3 + Properties
4 + {
5 + _MotionTex ("Motion Vector Texture", 2D) = "black" {}
6 + _MotionAmount ("Motion Vector Multiplier", range (-0.25, 0.25)) = 0
7 + }
8 + SubShader
9 + {
10 + Pass
11 + {
12 + Name "Motion Vectors"
13 + Tags { "LightMode" = "MotionVectors" }
14 +
15 + ZTest LEqual Cull Back ZWrite On
16 +
17 + CGPROGRAM
18 +
19 + #pragma vertex vert
20 + #pragma fragment FragMotionVectors
21 + #include "UnityCG.cginc"
22 +
23 + float4 _MotionValue;
24 + sampler2D _MotionTex;
25 + float4 _MotionTex_ST;
26 + float _MotionAmount;
27 +
28 + struct appdata
29 + {
30 + float4 vertex : POSITION;
31 + float2 uv : TEXCOORD0;
32 + float3 normal : NORMAL;
33 + float4 tangent : TANGENT;
34 + };
35 +
36 + struct v2f
37 + {
38 + float2 uv : TEXCOORD0;
39 + float4 vertex : SV_POSITION;
40 + float3 normal : NORMAL;
41 + float4 tangent : TANGENT;
42 + float4 transposedTangent : TEXCOORD1;
43 + };
44 +
45 + v2f vert (appdata v)
46 + {
47 + v2f o;
48 + o.vertex = UnityObjectToClipPos(v.vertex);
49 + o.uv = TRANSFORM_TEX(v.uv, _MotionTex);
50 + o.normal = UnityObjectToClipPos(v.normal);
51 + o.normal = o.normal * 0.5 + 0.5;
52 + o.tangent = mul(UNITY_MATRIX_MV, v.tangent);
53 + o.transposedTangent = (mul(UNITY_MATRIX_IT_MV, v.tangent)) * 0.5 + 0.5;
54 + return o;
55 + }
56 +
57 + float4 FragMotionVectors(v2f i) : SV_Target
58 + {
59 + half4 c = tex2D(_MotionTex, i.uv);
60 + c.rg = (c.rg * 2.0 - 1.0) * _MotionAmount; // Using color texture so need to make 0.5 neutral
61 + half4 t1 = i.tangent * 0.005; // Sides of tire
62 + half4 t2 = c * float4(i.transposedTangent.r * 2.0, i.transposedTangent.g * 2.0, 0.0, 1.0); // Front of tire
63 + half4 t3 = lerp(t2, t1, c.b); // Lerp between front and side of tire
64 + return t3 * _MotionAmount;
65 + }
66 +
67 + ENDCG
68 + }
69 + }
70 +}
1 +fileFormatVersion: 2
2 +guid: 9189229324e2342b8b69f7c1904dceba
3 +timeCreated: 1479826273
4 +licenseType: Store
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 92c42dce939f844cea2248583e06bd55
3 +folderAsset: yes
4 +timeCreated: 1487348131
5 +licenseType: Store
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 3aac3087967ea4fae858ec0494fd24d9
3 +timeCreated: 1479828550
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 0
11 + sRGBTexture: 0
12 + linearTexture: 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: 1
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 1
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 0
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 2048
55 + textureFormat: -1
56 + textureCompression: 1
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + - buildTarget: Standalone
62 + maxTextureSize: 2048
63 + textureFormat: -1
64 + textureCompression: 1
65 + compressionQuality: 50
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + spriteSheet:
70 + serializedVersion: 2
71 + sprites: []
72 + outline: []
73 + spritePackingTag:
74 + userData:
75 + assetBundleName:
76 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: a08960dd6e8274e7f8fca616e09c48ed
3 +timeCreated: 1487340672
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 1
11 + sRGBTexture: 1
12 + linearTexture: 0
13 + fadeOut: 0
14 + borderMipMap: 0
15 + 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 1
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 0
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 2048
55 + textureFormat: -1
56 + textureCompression: 1
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + spriteSheet:
62 + serializedVersion: 2
63 + sprites: []
64 + outline: []
65 + spritePackingTag:
66 + userData:
67 + assetBundleName:
68 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: d1cc06458fe724df8837423c0a2f8f93
3 +timeCreated: 1487348028
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 4
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 1
11 + sRGBTexture: 1
12 + linearTexture: 0
13 + fadeOut: 0
14 + borderMipMap: 0
15 + 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: 6
25 + cubemapConvolution: 0
26 + seamlessCubemap: 0
27 + textureFormat: 1
28 + maxTextureSize: 2048
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + compressionQuality: 50
37 + spriteMode: 0
38 + spriteExtrude: 1
39 + spriteMeshType: 1
40 + alignment: 0
41 + spritePivot: {x: 0.5, y: 0.5}
42 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
43 + spritePixelsToUnits: 100
44 + alphaUsage: 1
45 + alphaIsTransparency: 0
46 + spriteTessellationDetail: -1
47 + textureType: 0
48 + textureShape: 1
49 + maxTextureSizeSet: 0
50 + compressionQualitySet: 0
51 + textureFormatSet: 0
52 + platformSettings:
53 + - buildTarget: DefaultTexturePlatform
54 + maxTextureSize: 2048
55 + textureFormat: -1
56 + textureCompression: 1
57 + compressionQuality: 50
58 + crunchedCompression: 0
59 + allowsAlphaSplitting: 0
60 + overridden: 0
61 + spriteSheet:
62 + serializedVersion: 2
63 + sprites: []
64 + outline: []
65 + spritePackingTag:
66 + userData:
67 + assetBundleName:
68 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: e1ff7e8eb594e4562a056a2fd57ca178
3 +folderAsset: yes
4 +timeCreated: 1516852132
5 +licenseType: Pro
6 +DefaultImporter:
7 + externalObjects: {}
8 + userData:
9 + assetBundleName:
10 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 79161d44a86b5d74cad6139c88ae20e3
3 +folderAsset: yes
4 +timeCreated: 1504673511
5 +licenseType: Free
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 774190ad23e67b649a54e6b703edced5
3 +folderAsset: yes
4 +timeCreated: 1504673511
5 +licenseType: Free
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 54d0b503307147f48970774ce70df79f
3 +folderAsset: yes
4 +timeCreated: 1504673511
5 +licenseType: Free
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 1c021810026b8b3498c9e63497fc78c3
3 +timeCreated: 1471968408
4 +licenseType: Free
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + serializedVersion: 2
8 + mipmaps:
9 + mipMapMode: 0
10 + enableMipMap: 1
11 + linearTexture: 0
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: 1
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: 0
49 + spriteTessellationDetail: -1
50 + textureType: -1
51 + buildTargetSettings: []
52 + spriteSheet:
53 + serializedVersion: 2
54 + sprites: []
55 + outline: []
56 + spritePackingTag:
57 + userData:
58 + assetBundleName:
59 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: ef5c51cfa2ce46043a41a376b560c525
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 2
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + linearTexture: 0
10 + correctGamma: 0
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 1
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 0
17 + externalNormalMap: 0
18 + heightScale: .25
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 0
23 + cubemapConvolution: 0
24 + cubemapConvolutionSteps: 8
25 + cubemapConvolutionExponent: 1.5
26 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 1024
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + rGBM: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: .5, y: .5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaIsTransparency: 0
46 + textureType: -1
47 + buildTargetSettings:
48 + - buildTarget: iPhone
49 + maxTextureSize: 256
50 + textureFormat: -1
51 + compressionQuality: 50
52 + - buildTarget: Android
53 + maxTextureSize: 256
54 + textureFormat: -1
55 + compressionQuality: 50
56 + - buildTarget: BlackBerry
57 + maxTextureSize: 256
58 + textureFormat: -1
59 + compressionQuality: 50
60 + - buildTarget: WP8
61 + maxTextureSize: 256
62 + textureFormat: -1
63 + compressionQuality: 50
64 + spriteSheet:
65 + sprites: []
66 + spritePackingTag:
67 + userData:
68 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: 2dd3788f8589b40bf82a92d76ffc5091
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 4
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + sRGBTexture: 0
10 + linearTexture: 1
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 2
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 1
17 + externalNormalMap: 1
18 + heightScale: 0.01645161
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 6
23 + cubemapConvolution: 0
24 + seamlessCubemap: 0
25 + textureFormat: -1
26 + maxTextureSize: 512
27 + textureSettings:
28 + filterMode: 1
29 + aniso: 3
30 + mipBias: 0
31 + wrapMode: 0
32 + nPOTScale: 1
33 + lightmap: 0
34 + compressionQuality: 50
35 + spriteMode: 0
36 + spriteExtrude: 1
37 + spriteMeshType: 1
38 + alignment: 0
39 + spritePivot: {x: 0.5, y: 0.5}
40 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
41 + spritePixelsToUnits: 100
42 + alphaUsage: 1
43 + alphaIsTransparency: 0
44 + spriteTessellationDetail: -1
45 + textureType: 1
46 + textureShape: 1
47 + maxTextureSizeSet: 0
48 + compressionQualitySet: 0
49 + textureFormatSet: 0
50 + platformSettings:
51 + - buildTarget: DefaultTexturePlatform
52 + maxTextureSize: 512
53 + textureFormat: -1
54 + textureCompression: 0
55 + compressionQuality: 50
56 + crunchedCompression: 0
57 + allowsAlphaSplitting: 0
58 + overridden: 0
59 + - buildTarget: Standalone
60 + maxTextureSize: 512
61 + textureFormat: -1
62 + textureCompression: 0
63 + compressionQuality: 50
64 + crunchedCompression: 0
65 + allowsAlphaSplitting: 0
66 + overridden: 0
67 + - buildTarget: iPhone
68 + maxTextureSize: 512
69 + textureFormat: -1
70 + textureCompression: 0
71 + compressionQuality: 50
72 + crunchedCompression: 0
73 + allowsAlphaSplitting: 0
74 + overridden: 0
75 + - buildTarget: Android
76 + maxTextureSize: 512
77 + textureFormat: -1
78 + textureCompression: 0
79 + compressionQuality: 50
80 + crunchedCompression: 0
81 + allowsAlphaSplitting: 0
82 + overridden: 0
83 + spriteSheet:
84 + serializedVersion: 2
85 + sprites: []
86 + outline: []
87 + spritePackingTag:
88 + userData:
89 + assetBundleName:
90 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: d7ea5a218770df14895b81e3602e420f
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: d5bbfe17fd61a7f45ad1932a5dd14b56
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
1 +Shader "Particles/Priority Additive" {
2 +Properties {
3 + _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
4 + _MainTex ("Particle Texture", 2D) = "white" {}
5 + _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0
6 +}
7 +
8 +Category {
9 + Tags { "Queue"="Transparent+1" "IgnoreProjector"="True" "RenderType"="Transparent" }
10 + Blend SrcAlpha One
11 + AlphaTest Greater .01
12 + ColorMask RGB
13 + Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) }
14 + BindChannels {
15 + Bind "Color", color
16 + Bind "Vertex", vertex
17 + Bind "TexCoord", texcoord
18 + }
19 +
20 + // ---- Fragment program cards
21 + SubShader {
22 + Pass {
23 +
24 + CGPROGRAM
25 + #pragma vertex vert
26 + #pragma fragment frag
27 + #pragma fragmentoption ARB_precision_hint_fastest
28 + #pragma multi_compile_particles
29 +
30 + #include "UnityCG.cginc"
31 +
32 + sampler2D _MainTex;
33 + fixed4 _TintColor;
34 +
35 + struct appdata_t {
36 + float4 vertex : POSITION;
37 + fixed4 color : COLOR;
38 + float2 texcoord : TEXCOORD0;
39 + };
40 +
41 + struct v2f {
42 + float4 vertex : POSITION;
43 + fixed4 color : COLOR;
44 + float2 texcoord : TEXCOORD0;
45 + #ifdef SOFTPARTICLES_ON
46 + float4 projPos : TEXCOORD1;
47 + #endif
48 + };
49 +
50 + float4 _MainTex_ST;
51 +
52 + v2f vert (appdata_t v)
53 + {
54 + v2f o;
55 + o.vertex = UnityObjectToClipPos(v.vertex);
56 + #ifdef SOFTPARTICLES_ON
57 + o.projPos = ComputeScreenPos (o.vertex);
58 + COMPUTE_EYEDEPTH(o.projPos.z);
59 + #endif
60 + o.color = v.color;
61 + o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
62 + return o;
63 + }
64 +
65 + sampler2D _CameraDepthTexture;
66 + float _InvFade;
67 +
68 + fixed4 frag (v2f i) : COLOR
69 + {
70 + #ifdef SOFTPARTICLES_ON
71 + float sceneZ = LinearEyeDepth (UNITY_SAMPLE_DEPTH(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))));
72 + float partZ = i.projPos.z;
73 + float fade = saturate (_InvFade * (sceneZ-partZ));
74 + i.color.a *= fade;
75 + #endif
76 +
77 + return 2.0f * i.color * _TintColor * tex2D(_MainTex, i.texcoord);
78 + }
79 + ENDCG
80 + }
81 + }
82 +
83 + // ---- Dual texture cards
84 + SubShader {
85 + Pass {
86 + SetTexture [_MainTex] {
87 + constantColor [_TintColor]
88 + combine constant * primary
89 + }
90 + SetTexture [_MainTex] {
91 + combine texture * previous DOUBLE
92 + }
93 + }
94 + }
95 +
96 + // ---- Single texture cards (does not do color tint)
97 + SubShader {
98 + Pass {
99 + SetTexture [_MainTex] {
100 + combine texture * primary
101 + }
102 + }
103 + }
104 +}
105 +}
1 +fileFormatVersion: 2
2 +guid: 5cd052ce7ea5a2f438f599e02de6a390
3 +ShaderImporter:
4 + defaultTextures: []
5 + userData:
6 + assetBundleName:
1 +Shader "Particles/Priority Additive (Soft)" {
2 +Properties {
3 + _MainTex ("Particle Texture", 2D) = "white" {}
4 + _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0
5 +}
6 +
7 +Category {
8 + Tags { "Queue"="Transparent+1" "IgnoreProjector"="True" "RenderType"="Transparent" }
9 + Blend One OneMinusSrcColor
10 + ColorMask RGB
11 + Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) }
12 + BindChannels {
13 + Bind "Color", color
14 + Bind "Vertex", vertex
15 + Bind "TexCoord", texcoord
16 + }
17 +
18 + // ---- Fragment program cards
19 + SubShader {
20 + Pass {
21 +
22 + CGPROGRAM
23 + #pragma vertex vert
24 + #pragma fragment frag
25 + #pragma fragmentoption ARB_precision_hint_fastest
26 + #pragma multi_compile_particles
27 +
28 + #include "UnityCG.cginc"
29 +
30 + sampler2D _MainTex;
31 + fixed4 _TintColor;
32 +
33 + struct appdata_t {
34 + float4 vertex : POSITION;
35 + fixed4 color : COLOR;
36 + float2 texcoord : TEXCOORD0;
37 + };
38 +
39 + struct v2f {
40 + float4 vertex : POSITION;
41 + fixed4 color : COLOR;
42 + float2 texcoord : TEXCOORD0;
43 + #ifdef SOFTPARTICLES_ON
44 + float4 projPos : TEXCOORD1;
45 + #endif
46 + };
47 +
48 + float4 _MainTex_ST;
49 +
50 + v2f vert (appdata_t v)
51 + {
52 + v2f o;
53 + o.vertex = UnityObjectToClipPos(v.vertex);
54 + #ifdef SOFTPARTICLES_ON
55 + o.projPos = ComputeScreenPos (o.vertex);
56 + COMPUTE_EYEDEPTH(o.projPos.z);
57 + #endif
58 + o.color = v.color;
59 + o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
60 + return o;
61 + }
62 +
63 + sampler2D _CameraDepthTexture;
64 + float _InvFade;
65 +
66 + fixed4 frag (v2f i) : COLOR
67 + {
68 + #ifdef SOFTPARTICLES_ON
69 + float sceneZ = LinearEyeDepth (UNITY_SAMPLE_DEPTH(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))));
70 + float partZ = i.projPos.z;
71 + float fade = saturate (_InvFade * (sceneZ-partZ));
72 + i.color.a *= fade;
73 + #endif
74 +
75 + half4 prev = i.color * tex2D(_MainTex, i.texcoord);
76 + prev.rgb *= prev.a;
77 + return prev;
78 + }
79 + ENDCG
80 + }
81 + }
82 +
83 + // ---- Dual texture cards
84 + SubShader {
85 + Pass {
86 + SetTexture [_MainTex] {
87 + combine texture * primary
88 + }
89 + SetTexture [_MainTex] {
90 + combine previous * previous alpha, previous
91 + }
92 + }
93 + }
94 +
95 + // ---- Single texture cards (does not do particle colors)
96 + SubShader {
97 + Pass {
98 + SetTexture [_MainTex] {
99 + combine texture * texture alpha, texture
100 + }
101 + }
102 + }
103 +}
104 +}
...\ No newline at end of file ...\ No newline at end of file
1 +fileFormatVersion: 2
2 +guid: 694eef9939f180440a9d0891272eddba
3 +ShaderImporter:
4 + defaultTextures: []
5 + userData:
6 + assetBundleName:
1 +Shader "Particles/Priority Alpha Blended" {
2 +Properties {
3 + _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
4 + _MainTex ("Particle Texture", 2D) = "white" {}
5 + _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0
6 +}
7 +
8 +Category {
9 + Tags { "Queue"="Transparent+1" "IgnoreProjector"="True" "RenderType"="Transparent" }
10 + Blend SrcAlpha OneMinusSrcAlpha
11 + AlphaTest Greater .01
12 + ColorMask RGB
13 + Cull Off Lighting Off ZWrite Off
14 + BindChannels {
15 + Bind "Color", color
16 + Bind "Vertex", vertex
17 + Bind "TexCoord", texcoord
18 + }
19 +
20 + // ---- Fragment program cards
21 + SubShader {
22 + Pass {
23 +
24 + CGPROGRAM
25 + #pragma vertex vert
26 + #pragma fragment frag
27 + #pragma fragmentoption ARB_precision_hint_fastest
28 + #pragma multi_compile_particles
29 +
30 + #include "UnityCG.cginc"
31 +
32 + sampler2D _MainTex;
33 + fixed4 _TintColor;
34 +
35 + struct appdata_t {
36 + float4 vertex : POSITION;
37 + fixed4 color : COLOR;
38 + float2 texcoord : TEXCOORD0;
39 + };
40 +
41 + struct v2f {
42 + float4 vertex : POSITION;
43 + fixed4 color : COLOR;
44 + float2 texcoord : TEXCOORD0;
45 + #ifdef SOFTPARTICLES_ON
46 + float4 projPos : TEXCOORD1;
47 + #endif
48 + };
49 +
50 + float4 _MainTex_ST;
51 +
52 + v2f vert (appdata_t v)
53 + {
54 + v2f o;
55 + o.vertex = UnityObjectToClipPos(v.vertex);
56 + #ifdef SOFTPARTICLES_ON
57 + o.projPos = ComputeScreenPos (o.vertex);
58 + COMPUTE_EYEDEPTH(o.projPos.z);
59 + #endif
60 + o.color = v.color;
61 + o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex);
62 + return o;
63 + }
64 +
65 + sampler2D _CameraDepthTexture;
66 + float _InvFade;
67 +
68 + fixed4 frag (v2f i) : COLOR
69 + {
70 + #ifdef SOFTPARTICLES_ON
71 + float sceneZ = LinearEyeDepth (UNITY_SAMPLE_DEPTH(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))));
72 + float partZ = i.projPos.z;
73 + float fade = saturate (_InvFade * (sceneZ-partZ));
74 + i.color.a *= fade;
75 + #endif
76 +
77 + return 2.0f * i.color * _TintColor * tex2D(_MainTex, i.texcoord);
78 + }
79 + ENDCG
80 + }
81 + }
82 +
83 + // ---- Dual texture cards
84 + SubShader {
85 + Pass {
86 + SetTexture [_MainTex] {
87 + constantColor [_TintColor]
88 + combine constant * primary
89 + }
90 + SetTexture [_MainTex] {
91 + combine texture * previous DOUBLE
92 + }
93 + }
94 + }
95 +
96 + // ---- Single texture cards (does not do color tint)
97 + SubShader {
98 + Pass {
99 + SetTexture [_MainTex] {
100 + combine texture * primary
101 + }
102 + }
103 + }
104 +}
105 +}
1 +fileFormatVersion: 2
2 +guid: cc4347574b823934ba11785e25895920
3 +ShaderImporter:
4 + defaultTextures: []
5 + userData:
6 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: b7795aea484b54afbb2011addaa251af
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: 732e2eebfe574ca47ba46cc3a67965fd
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 2
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + linearTexture: 0
10 + correctGamma: 0
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 1
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 0
17 + externalNormalMap: 0
18 + heightScale: .25
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 0
23 + cubemapConvolution: 0
24 + cubemapConvolutionSteps: 8
25 + cubemapConvolutionExponent: 1.5
26 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 1024
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + rGBM: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: .5, y: .5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaIsTransparency: 0
46 + textureType: -1
47 + buildTargetSettings:
48 + - buildTarget: iPhone
49 + maxTextureSize: 64
50 + textureFormat: -1
51 + compressionQuality: 50
52 + - buildTarget: Android
53 + maxTextureSize: 64
54 + textureFormat: -1
55 + compressionQuality: 50
56 + - buildTarget: BlackBerry
57 + maxTextureSize: 64
58 + textureFormat: -1
59 + compressionQuality: 50
60 + - buildTarget: WP8
61 + maxTextureSize: 64
62 + textureFormat: -1
63 + compressionQuality: 50
64 + spriteSheet:
65 + sprites: []
66 + spritePackingTag:
67 + userData:
68 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: 830884c18cf5e7a4895ee02c2dcd8e12
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 2
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + linearTexture: 0
10 + correctGamma: 0
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 1
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 0
17 + externalNormalMap: 0
18 + heightScale: .25
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 0
23 + cubemapConvolution: 0
24 + cubemapConvolutionSteps: 8
25 + cubemapConvolutionExponent: 1.5
26 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 1024
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + rGBM: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: .5, y: .5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaIsTransparency: 0
46 + textureType: -1
47 + buildTargetSettings:
48 + - buildTarget: iPhone
49 + maxTextureSize: 128
50 + textureFormat: -1
51 + compressionQuality: 50
52 + - buildTarget: Android
53 + maxTextureSize: 128
54 + textureFormat: -1
55 + compressionQuality: 50
56 + - buildTarget: BlackBerry
57 + maxTextureSize: 128
58 + textureFormat: -1
59 + compressionQuality: 50
60 + - buildTarget: WP8
61 + maxTextureSize: 128
62 + textureFormat: -1
63 + compressionQuality: 50
64 + spriteSheet:
65 + sprites: []
66 + spritePackingTag:
67 + userData:
68 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: 5b303ff28ad9368468a2edd759cf458d
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 2
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + linearTexture: 0
10 + correctGamma: 0
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 1
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 0
17 + externalNormalMap: 0
18 + heightScale: .25
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 0
23 + cubemapConvolution: 0
24 + cubemapConvolutionSteps: 8
25 + cubemapConvolutionExponent: 1.5
26 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 1024
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + rGBM: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: .5, y: .5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaIsTransparency: 0
46 + textureType: -1
47 + buildTargetSettings: []
48 + spriteSheet:
49 + sprites: []
50 + spritePackingTag:
51 + userData:
52 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: 87be4190eae46cf459ae6177b8698f03
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 2
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + linearTexture: 0
10 + correctGamma: 0
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 1
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 0
17 + externalNormalMap: 0
18 + heightScale: .25
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 0
23 + cubemapConvolution: 0
24 + cubemapConvolutionSteps: 8
25 + cubemapConvolutionExponent: 1.5
26 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 1024
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + rGBM: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: .5, y: .5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaIsTransparency: 0
46 + textureType: -1
47 + buildTargetSettings: []
48 + spriteSheet:
49 + sprites: []
50 + spritePackingTag:
51 + userData:
52 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: c3d66a8056f9db345b1ea380aa7e815d
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 2
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + linearTexture: 0
10 + correctGamma: 0
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 1
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 0
17 + externalNormalMap: 0
18 + heightScale: .25
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 0
23 + cubemapConvolution: 0
24 + cubemapConvolutionSteps: 8
25 + cubemapConvolutionExponent: 1.5
26 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 1024
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + rGBM: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: .5, y: .5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaIsTransparency: 0
46 + textureType: -1
47 + buildTargetSettings:
48 + - buildTarget: iPhone
49 + maxTextureSize: 128
50 + textureFormat: -1
51 + compressionQuality: 50
52 + - buildTarget: Android
53 + maxTextureSize: 128
54 + textureFormat: -1
55 + compressionQuality: 50
56 + - buildTarget: BlackBerry
57 + maxTextureSize: 128
58 + textureFormat: -1
59 + compressionQuality: 50
60 + - buildTarget: WP8
61 + maxTextureSize: 128
62 + textureFormat: -1
63 + compressionQuality: 50
64 + spriteSheet:
65 + sprites: []
66 + spritePackingTag:
67 + userData:
68 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: 3587b30505d00a44c87d9c3b9d8bc35c
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 2
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + linearTexture: 0
10 + correctGamma: 0
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 1
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 0
17 + externalNormalMap: 0
18 + heightScale: .25
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 0
23 + cubemapConvolution: 0
24 + cubemapConvolutionSteps: 8
25 + cubemapConvolutionExponent: 1.5
26 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 1024
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + rGBM: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: .5, y: .5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaIsTransparency: 0
46 + textureType: -1
47 + buildTargetSettings: []
48 + spriteSheet:
49 + sprites: []
50 + spritePackingTag:
51 + userData:
52 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: 4e505ad81f5b19c4cb6f445d36463955
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 2
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + linearTexture: 0
10 + correctGamma: 0
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 1
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 0
17 + externalNormalMap: 0
18 + heightScale: .25
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 0
23 + cubemapConvolution: 0
24 + cubemapConvolutionSteps: 8
25 + cubemapConvolutionExponent: 1.5
26 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 1024
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + rGBM: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: .5, y: .5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaIsTransparency: 0
46 + textureType: -1
47 + buildTargetSettings:
48 + - buildTarget: iPhone
49 + maxTextureSize: 512
50 + textureFormat: -1
51 + compressionQuality: 50
52 + - buildTarget: Android
53 + maxTextureSize: 512
54 + textureFormat: -1
55 + compressionQuality: 50
56 + - buildTarget: BlackBerry
57 + maxTextureSize: 512
58 + textureFormat: -1
59 + compressionQuality: 50
60 + - buildTarget: WP8
61 + maxTextureSize: 512
62 + textureFormat: -1
63 + compressionQuality: 50
64 + spriteSheet:
65 + sprites: []
66 + spritePackingTag:
67 + userData:
68 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: 76b24fa8a46a2c14f9a7df1e975dc4b9
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 2
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + linearTexture: 0
10 + correctGamma: 0
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 1
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 0
17 + externalNormalMap: 0
18 + heightScale: .25
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 0
23 + cubemapConvolution: 0
24 + cubemapConvolutionSteps: 8
25 + cubemapConvolutionExponent: 1.5
26 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 1024
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + rGBM: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: .5, y: .5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaIsTransparency: 0
46 + textureType: -1
47 + buildTargetSettings: []
48 + spriteSheet:
49 + sprites: []
50 + spritePackingTag:
51 + userData:
52 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: 269490de66e33a34dad45a50e3d4c168
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 2
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + linearTexture: 0
10 + correctGamma: 0
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 1
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 0
17 + externalNormalMap: 0
18 + heightScale: .25
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 0
23 + cubemapConvolution: 0
24 + cubemapConvolutionSteps: 8
25 + cubemapConvolutionExponent: 1.5
26 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 1024
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + rGBM: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: .5, y: .5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaIsTransparency: 0
46 + textureType: -1
47 + buildTargetSettings: []
48 + spriteSheet:
49 + sprites: []
50 + spritePackingTag:
51 + userData:
52 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: 8e44fe896458128418bff33ed3981421
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 2
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + linearTexture: 0
10 + correctGamma: 0
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 1
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 0
17 + externalNormalMap: 0
18 + heightScale: .25
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 0
23 + cubemapConvolution: 0
24 + cubemapConvolutionSteps: 8
25 + cubemapConvolutionExponent: 1.5
26 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 1024
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + rGBM: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: .5, y: .5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaIsTransparency: 0
46 + textureType: -1
47 + buildTargetSettings:
48 + - buildTarget: iPhone
49 + maxTextureSize: 128
50 + textureFormat: -1
51 + compressionQuality: 50
52 + - buildTarget: Android
53 + maxTextureSize: 128
54 + textureFormat: -1
55 + compressionQuality: 50
56 + - buildTarget: BlackBerry
57 + maxTextureSize: 128
58 + textureFormat: -1
59 + compressionQuality: 50
60 + - buildTarget: WP8
61 + maxTextureSize: 128
62 + textureFormat: -1
63 + compressionQuality: 50
64 + spriteSheet:
65 + sprites: []
66 + spritePackingTag:
67 + userData:
68 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: 832dc5a2501052b4d8f685a7cda3b30b
3 +TextureImporter:
4 + fileIDToRecycleName: {}
5 + serializedVersion: 2
6 + mipmaps:
7 + mipMapMode: 0
8 + enableMipMap: 1
9 + linearTexture: 0
10 + correctGamma: 0
11 + fadeOut: 0
12 + borderMipMap: 0
13 + mipMapFadeDistanceStart: 1
14 + mipMapFadeDistanceEnd: 3
15 + bumpmap:
16 + convertToNormalMap: 0
17 + externalNormalMap: 0
18 + heightScale: .25
19 + normalMapFilter: 0
20 + isReadable: 0
21 + grayScaleToAlpha: 0
22 + generateCubemap: 0
23 + cubemapConvolution: 0
24 + cubemapConvolutionSteps: 8
25 + cubemapConvolutionExponent: 1.5
26 + seamlessCubemap: 0
27 + textureFormat: -1
28 + maxTextureSize: 1024
29 + textureSettings:
30 + filterMode: -1
31 + aniso: -1
32 + mipBias: -1
33 + wrapMode: -1
34 + nPOTScale: 1
35 + lightmap: 0
36 + rGBM: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: .5, y: .5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaIsTransparency: 0
46 + textureType: -1
47 + buildTargetSettings:
48 + - buildTarget: iPhone
49 + maxTextureSize: 128
50 + textureFormat: -1
51 + compressionQuality: 50
52 + - buildTarget: Android
53 + maxTextureSize: 128
54 + textureFormat: -1
55 + compressionQuality: 50
56 + - buildTarget: BlackBerry
57 + maxTextureSize: 128
58 + textureFormat: -1
59 + compressionQuality: 50
60 + - buildTarget: WP8
61 + maxTextureSize: 128
62 + textureFormat: -1
63 + compressionQuality: 50
64 + spriteSheet:
65 + sprites: []
66 + spritePackingTag:
67 + userData:
68 + assetBundleName:
1 +fileFormatVersion: 2
2 +guid: 5f30f5b567590459a9dd6e10b273a889
3 +timeCreated: 1516852272
4 +licenseType: Pro
5 +TextureImporter:
6 + fileIDToRecycleName: {}
7 + externalObjects: {}
8 + serializedVersion: 4
9 + mipmaps:
10 + mipMapMode: 0
11 + enableMipMap: 1
12 + sRGBTexture: 0
13 + linearTexture: 0
14 + fadeOut: 0
15 + borderMipMap: 0
16 + mipMapsPreserveCoverage: 0
17 + alphaTestReferenceValue: 0.5
18 + mipMapFadeDistanceStart: 1
19 + mipMapFadeDistanceEnd: 3
20 + bumpmap:
21 + convertToNormalMap: 0
22 + externalNormalMap: 0
23 + heightScale: 0.25
24 + normalMapFilter: 0
25 + isReadable: 0
26 + grayScaleToAlpha: 0
27 + generateCubemap: 6
28 + cubemapConvolution: 0
29 + seamlessCubemap: 0
30 + textureFormat: 1
31 + maxTextureSize: 2048
32 + textureSettings:
33 + serializedVersion: 2
34 + filterMode: -1
35 + aniso: -1
36 + mipBias: -1
37 + wrapU: -1
38 + wrapV: -1
39 + wrapW: -1
40 + nPOTScale: 1
41 + lightmap: 0
42 + compressionQuality: 50
43 + spriteMode: 0
44 + spriteExtrude: 1
45 + spriteMeshType: 1
46 + alignment: 0
47 + spritePivot: {x: 0.5, y: 0.5}
48 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
49 + spritePixelsToUnits: 100
50 + alphaUsage: 1
51 + alphaIsTransparency: 0
52 + spriteTessellationDetail: -1
53 + textureType: 0
54 + textureShape: 1
55 + maxTextureSizeSet: 0
56 + compressionQualitySet: 0
57 + textureFormatSet: 0
58 + platformSettings:
59 + - buildTarget: DefaultTexturePlatform
60 + maxTextureSize: 2048
61 + resizeAlgorithm: 0
62 + textureFormat: -1
63 + textureCompression: 1
64 + compressionQuality: 50
65 + crunchedCompression: 0
66 + allowsAlphaSplitting: 0
67 + overridden: 0
68 + androidETC2FallbackOverride: 0
69 + - buildTarget: Standalone
70 + maxTextureSize: 2048
71 + resizeAlgorithm: 0
72 + textureFormat: -1
73 + textureCompression: 1
74 + compressionQuality: 50
75 + crunchedCompression: 0
76 + allowsAlphaSplitting: 0
77 + overridden: 0
78 + androidETC2FallbackOverride: 0
79 + - buildTarget: iPhone
80 + maxTextureSize: 2048
81 + resizeAlgorithm: 0
82 + textureFormat: -1
83 + textureCompression: 1
84 + compressionQuality: 50
85 + crunchedCompression: 0
86 + allowsAlphaSplitting: 0
87 + overridden: 0
88 + androidETC2FallbackOverride: 0
89 + - buildTarget: Android
90 + maxTextureSize: 2048
91 + resizeAlgorithm: 0
92 + textureFormat: -1
93 + textureCompression: 1
94 + compressionQuality: 50
95 + crunchedCompression: 0
96 + allowsAlphaSplitting: 0
97 + overridden: 0
98 + androidETC2FallbackOverride: 0
99 + - buildTarget: WebGL
100 + maxTextureSize: 2048
101 + resizeAlgorithm: 0
102 + textureFormat: -1
103 + textureCompression: 1
104 + compressionQuality: 50
105 + crunchedCompression: 0
106 + allowsAlphaSplitting: 0
107 + overridden: 0
108 + androidETC2FallbackOverride: 0
109 + spriteSheet:
110 + serializedVersion: 2
111 + sprites: []
112 + outline: []
113 + physicsShape: []
114 + spritePackingTag:
115 + userData:
116 + assetBundleName:
117 + assetBundleVariant:
This file is too large to display.
1 +fileFormatVersion: 2
2 +guid: 656a59a5ff93c46498416d97e5c16b66
3 +timeCreated: 1461295459
4 +licenseType: Store
5 +TextureImporter:
6 + fileIDToRecycleName:
7 + 8900000: generatedCubemap
8 + serializedVersion: 4
9 + mipmaps:
10 + mipMapMode: 0
11 + enableMipMap: 1
12 + sRGBTexture: 1
13 + linearTexture: 0
14 + fadeOut: 0
15 + borderMipMap: 0
16 + mipMapFadeDistanceStart: 1
17 + mipMapFadeDistanceEnd: 3
18 + bumpmap:
19 + convertToNormalMap: 0
20 + externalNormalMap: 0
21 + heightScale: 0.25
22 + normalMapFilter: 0
23 + isReadable: 0
24 + grayScaleToAlpha: 0
25 + generateCubemap: 6
26 + cubemapConvolution: 0
27 + seamlessCubemap: 0
28 + textureFormat: -1
29 + maxTextureSize: 4096
30 + textureSettings:
31 + filterMode: -1
32 + aniso: -1
33 + mipBias: -1
34 + wrapMode: 1
35 + nPOTScale: 1
36 + lightmap: 0
37 + compressionQuality: 50
38 + spriteMode: 0
39 + spriteExtrude: 1
40 + spriteMeshType: 1
41 + alignment: 0
42 + spritePivot: {x: 0.5, y: 0.5}
43 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
44 + spritePixelsToUnits: 100
45 + alphaUsage: 1
46 + alphaIsTransparency: 0
47 + spriteTessellationDetail: -1
48 + textureType: 0
49 + textureShape: 2
50 + maxTextureSizeSet: 0
51 + compressionQualitySet: 0
52 + textureFormatSet: 0
53 + platformSettings:
54 + - buildTarget: DefaultTexturePlatform
55 + maxTextureSize: 4096
56 + textureFormat: -1
57 + textureCompression: 1
58 + compressionQuality: 50
59 + crunchedCompression: 0
60 + allowsAlphaSplitting: 0
61 + overridden: 0
62 + - buildTarget: Standalone
63 + maxTextureSize: 4096
64 + textureFormat: -1
65 + textureCompression: 1
66 + compressionQuality: 50
67 + crunchedCompression: 0
68 + allowsAlphaSplitting: 0
69 + overridden: 0
70 + - buildTarget: Android
71 + maxTextureSize: 4096
72 + textureFormat: -1
73 + textureCompression: 1
74 + compressionQuality: 50
75 + crunchedCompression: 0
76 + allowsAlphaSplitting: 0
77 + overridden: 0
78 + spriteSheet:
79 + serializedVersion: 2
80 + sprites: []
81 + outline: []
82 + spritePackingTag:
83 + userData:
84 + assetBundleName:
85 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 57deff53e28e84503aeffb54a2b5e61b
3 +folderAsset: yes
4 +timeCreated: 1516852405
5 +licenseType: Pro
6 +DefaultImporter:
7 + externalObjects: {}
8 + userData:
9 + assetBundleName:
10 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 5ef4d4d8fbb9b4da583c4978be16fcb0
3 +folderAsset: yes
4 +timeCreated: 1516852488
5 +licenseType: Pro
6 +DefaultImporter:
7 + externalObjects: {}
8 + userData:
9 + assetBundleName:
10 + assetBundleVariant:
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!21 &2100000
4 +Material:
5 + serializedVersion: 6
6 + m_ObjectHideFlags: 0
7 + m_PrefabParentObject: {fileID: 0}
8 + m_PrefabInternal: {fileID: 0}
9 + m_Name: Water Complete
10 + m_Shader: {fileID: 4800000, guid: f44f1319a1310164f84318244a2eca08, type: 3}
11 + m_ShaderKeywords: _EMISSION
12 + m_LightmapFlags: 1
13 + m_EnableInstancingVariants: 0
14 + m_DoubleSidedGI: 0
15 + m_CustomRenderQueue: -1
16 + stringTagMap: {}
17 + disabledShaderPasses: []
18 + m_SavedProperties:
19 + serializedVersion: 3
20 + m_TexEnvs:
21 + - _BumpMap:
22 + m_Texture: {fileID: 0}
23 + m_Scale: {x: 1, y: 1}
24 + m_Offset: {x: 0, y: 0}
25 + - _Bumpmap:
26 + m_Texture: {fileID: 2800000, guid: 2dd3788f8589b40bf82a92d76ffc5091, type: 3}
27 + m_Scale: {x: 1, y: 1}
28 + m_Offset: {x: 0, y: 0}
29 + - _Cube:
30 + m_Texture: {fileID: 8900000, guid: 656a59a5ff93c46498416d97e5c16b66, type: 3}
31 + m_Scale: {x: 1, y: 1}
32 + m_Offset: {x: 0, y: 0}
33 + - _DetailAlbedoMap:
34 + m_Texture: {fileID: 0}
35 + m_Scale: {x: 1, y: 1}
36 + m_Offset: {x: 0, y: 0}
37 + - _DetailMask:
38 + m_Texture: {fileID: 0}
39 + m_Scale: {x: 1, y: 1}
40 + m_Offset: {x: 0, y: 0}
41 + - _DetailNormalMap:
42 + m_Texture: {fileID: 0}
43 + m_Scale: {x: 1, y: 1}
44 + m_Offset: {x: 0, y: 0}
45 + - _EmissionMap:
46 + m_Texture: {fileID: 0}
47 + m_Scale: {x: 1, y: 1}
48 + m_Offset: {x: 0, y: 0}
49 + - _MainTex:
50 + m_Texture: {fileID: 0}
51 + m_Scale: {x: 1, y: 1}
52 + m_Offset: {x: 0, y: 0}
53 + - _MetallicGlossMap:
54 + m_Texture: {fileID: 0}
55 + m_Scale: {x: 1, y: 1}
56 + m_Offset: {x: 0, y: 0}
57 + - _OcclusionMap:
58 + m_Texture: {fileID: 0}
59 + m_Scale: {x: 1, y: 1}
60 + m_Offset: {x: 0, y: 0}
61 + - _ParallaxMap:
62 + m_Texture: {fileID: 0}
63 + m_Scale: {x: 1, y: 1}
64 + m_Offset: {x: 0, y: 0}
65 + m_Floats:
66 + - _BumpScale: 1
67 + - _Cutoff: 0.5
68 + - _DetailNormalMapScale: 1
69 + - _DstBlend: 0
70 + - _GlossMapScale: 1
71 + - _Glossiness: 0.5
72 + - _GlossyReflections: 1
73 + - _Metallic: 0
74 + - _Mode: 0
75 + - _OcclusionStrength: 1
76 + - _Parallax: 0.02
77 + - _Refract: 0.0444
78 + - _SPMulti: 3
79 + - _SPPower: 150
80 + - _SmoothnessTextureChannel: 0
81 + - _SpecularHighlights: 1
82 + - _SrcBlend: 1
83 + - _UVSec: 0
84 + - _WaveH: 0.1
85 + - _WaveL: 12
86 + - _WaveT: 1
87 + - _ZWrite: 1
88 + m_Colors:
89 + - _Color: {r: 1, g: 1, b: 1, a: 1}
90 + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
91 + - _SPColor: {r: 1, g: 1, b: 1, a: 1}
1 +fileFormatVersion: 2
2 +guid: ab92e9c0e68c9374d8156a68b56e57e3
3 +timeCreated: 1487231179
4 +licenseType: Free
5 +NativeFormatImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 50824156ce8ce45d7971392908adb35e
3 +folderAsset: yes
4 +timeCreated: 1516853370
5 +licenseType: Pro
6 +DefaultImporter:
7 + externalObjects: {}
8 + userData:
9 + assetBundleName:
10 + assetBundleVariant:
1 +Shader "Custom/WaterComplete" {
2 + Properties {
3 + _Bumpmap ("NormalMap", 2D) = "bump" {}
4 + _Cube ("Cube", Cube) = "" {}
5 + _SPColor("Specular Color", color) = (1,1,1,1)
6 + _SPPower("Specular Power", Range(50,300)) = 150
7 + _SPMulti("Specular Multiply",Range(1,10)) = 3
8 + _WaveH("Wave Height", Range(0,0.5)) = 0.1
9 + _WaveL("Wave Length", Range(5,20)) = 12
10 + _WaveT("Wave Timeing", Range(0,10)) = 1
11 + _Refract("Refract Strength" , Range(0,0.2)) = 0.1
12 + }
13 + SubShader {
14 +// Tags { "RenderType"="Transparent" "Queue"="Transparent"}
15 + Tags { "RenderType"="Opaque" }
16 +
17 + GrabPass{}
18 +
19 + CGPROGRAM
20 + #pragma surface surf WaterSpecular vertex:vert
21 +
22 + samplerCUBE _Cube;
23 + sampler2D _Bumpmap;
24 + sampler2D _GrabTexture;
25 + float4 _SPColor;
26 + float _SPPower;
27 + float _SPMulti;
28 + float _WaveH;
29 + float _WaveL;
30 + float _WaveT;
31 + float _Refract;
32 +
33 + void vert(inout appdata_full v){
34 + float movement;
35 + movement = sin(abs((v.texcoord.x*2-1)*_WaveL)+_Time.y* _WaveT)*_WaveH;
36 + movement += sin(abs((v.texcoord.y*2-1)*_WaveL)+_Time.y* _WaveT)*_WaveH;
37 + v.vertex.y += movement/2;
38 + }
39 +
40 + struct Input {
41 + float2 uv_Bumpmap;
42 + float3 worldRefl;
43 + float3 viewDir;
44 + float4 screenPos;
45 + INTERNAL_DATA
46 + };
47 +
48 + void surf (Input IN, inout SurfaceOutput o) {
49 + float3 normal1 = UnpackNormal(tex2D(_Bumpmap,IN.uv_Bumpmap+_Time.x*0.1));
50 + float3 normal2 = UnpackNormal(tex2D(_Bumpmap,IN.uv_Bumpmap-_Time.x*0.1));
51 + o.Normal = (normal1 + normal2)/2;
52 +
53 + float3 refcolor = texCUBE(_Cube, WorldReflectionVector(IN,o.Normal));
54 +
55 + //refraction term
56 + float3 screenUV = IN.screenPos.rgb / IN.screenPos.a;
57 + float3 refraction = tex2D(_GrabTexture,(screenUV.xy + o.Normal.xy*_Refract));
58 +
59 + //rim term
60 + float rim = saturate(dot(o.Normal,IN.viewDir));
61 + rim = pow(1-rim,1.5);
62 +
63 + o.Emission = (refcolor * rim + refraction) * 0.5;
64 +// o.Alpha = saturate(rim+0.5) ;
65 + o.Alpha = 1;
66 + }
67 +
68 + float4 LightingWaterSpecular(SurfaceOutput s,float3 lightDir, float3 viewDir, float atten){
69 +
70 + //specular term
71 + float3 H = normalize(lightDir + viewDir);
72 + float spec = saturate(dot(H,s.Normal));
73 + spec = pow(spec,_SPPower);
74 +
75 + //final term
76 + float4 finalColor;
77 + finalColor.rgb = spec * _SPColor.rgb * _SPMulti;
78 + finalColor.a = s.Alpha ;//+ spec ;
79 +
80 + return finalColor;
81 + }
82 + ENDCG
83 + }
84 + FallBack "Legacy Shaders/Transparent/Vertexlit"
85 +}
1 +fileFormatVersion: 2
2 +guid: f44f1319a1310164f84318244a2eca08
3 +timeCreated: 1487231169
4 +licenseType: Free
5 +ShaderImporter:
6 + defaultTextures: []
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
This diff could not be displayed because it is too large.
1 +fileFormatVersion: 2
2 +guid: 91a489a670c2f4d4bb8af550e681cd81
3 +timeCreated: 1504673057
4 +licenseType: Free
5 +DefaultImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 4265c24994d8a49d9b7609b2d7442fe7
3 +timeCreated: 1516853370
4 +licenseType: Pro
5 +NativeFormatImporter:
6 + externalObjects: {}
7 + mainObjectFileID: 25800000
8 + userData:
9 + assetBundleName:
10 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 385ef0ae5d67f466ca3564401bd2dcf6
3 +timeCreated: 1516853370
4 +licenseType: Pro
5 +TextureImporter:
6 + fileIDToRecycleName:
7 + 8900000: generatedCubemap
8 + externalObjects: {}
9 + serializedVersion: 4
10 + mipmaps:
11 + mipMapMode: 0
12 + enableMipMap: 1
13 + sRGBTexture: 1
14 + linearTexture: 0
15 + fadeOut: 0
16 + borderMipMap: 0
17 + mipMapsPreserveCoverage: 0
18 + alphaTestReferenceValue: 0.5
19 + mipMapFadeDistanceStart: 1
20 + mipMapFadeDistanceEnd: 3
21 + bumpmap:
22 + convertToNormalMap: 0
23 + externalNormalMap: 0
24 + heightScale: 0.25
25 + normalMapFilter: 0
26 + isReadable: 0
27 + grayScaleToAlpha: 0
28 + generateCubemap: 6
29 + cubemapConvolution: 1
30 + seamlessCubemap: 1
31 + textureFormat: 1
32 + maxTextureSize: 2048
33 + textureSettings:
34 + serializedVersion: 2
35 + filterMode: 2
36 + aniso: 0
37 + mipBias: 0
38 + wrapU: 1
39 + wrapV: 1
40 + wrapW: 1
41 + nPOTScale: 1
42 + lightmap: 0
43 + compressionQuality: 50
44 + spriteMode: 0
45 + spriteExtrude: 1
46 + spriteMeshType: 1
47 + alignment: 0
48 + spritePivot: {x: 0.5, y: 0.5}
49 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 + spritePixelsToUnits: 100
51 + alphaUsage: 1
52 + alphaIsTransparency: 0
53 + spriteTessellationDetail: -1
54 + textureType: 0
55 + textureShape: 2
56 + maxTextureSizeSet: 0
57 + compressionQualitySet: 0
58 + textureFormatSet: 0
59 + platformSettings:
60 + - buildTarget: DefaultTexturePlatform
61 + maxTextureSize: 2048
62 + resizeAlgorithm: 0
63 + textureFormat: -1
64 + textureCompression: 1
65 + compressionQuality: 100
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + androidETC2FallbackOverride: 0
70 + spriteSheet:
71 + serializedVersion: 2
72 + sprites: []
73 + outline: []
74 + physicsShape: []
75 + spritePackingTag:
76 + userData:
77 + assetBundleName:
78 + assetBundleVariant:
No preview for this file type
1 +fileFormatVersion: 2
2 +guid: c7f2845d6c97ce944a11fab809c8b5ff
3 +timeCreated: 1487229339
4 +licenseType: Free
5 +NativeFormatImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
1 +%YAML 1.1
2 +%TAG !u! tag:unity3d.com,2011:
3 +--- !u!21 &2100000
4 +Material:
5 + serializedVersion: 6
6 + m_ObjectHideFlags: 0
7 + m_PrefabParentObject: {fileID: 0}
8 + m_PrefabInternal: {fileID: 0}
9 + m_Name: Water
10 + m_Shader: {fileID: 4800000, guid: 800c847533a604bfc92dd8e0c6aa60d4, type: 3}
11 + m_ShaderKeywords: _EMISSION
12 + m_LightmapFlags: 1
13 + m_EnableInstancingVariants: 0
14 + m_DoubleSidedGI: 0
15 + m_CustomRenderQueue: -1
16 + stringTagMap: {}
17 + disabledShaderPasses: []
18 + m_SavedProperties:
19 + serializedVersion: 3
20 + m_TexEnvs:
21 + - _BumpMap:
22 + m_Texture: {fileID: 0}
23 + m_Scale: {x: 1, y: 1}
24 + m_Offset: {x: 0, y: 0}
25 + - _Bumpmap:
26 + m_Texture: {fileID: 2800000, guid: 2dd3788f8589b40bf82a92d76ffc5091, type: 3}
27 + m_Scale: {x: 1, y: 1}
28 + m_Offset: {x: 0, y: 0}
29 + - _Cube:
30 + m_Texture: {fileID: 8900000, guid: 656a59a5ff93c46498416d97e5c16b66, type: 3}
31 + m_Scale: {x: 1, y: 1}
32 + m_Offset: {x: 0, y: 0}
33 + - _DetailAlbedoMap:
34 + m_Texture: {fileID: 0}
35 + m_Scale: {x: 1, y: 1}
36 + m_Offset: {x: 0, y: 0}
37 + - _DetailMask:
38 + m_Texture: {fileID: 0}
39 + m_Scale: {x: 1, y: 1}
40 + m_Offset: {x: 0, y: 0}
41 + - _DetailNormalMap:
42 + m_Texture: {fileID: 0}
43 + m_Scale: {x: 1, y: 1}
44 + m_Offset: {x: 0, y: 0}
45 + - _EmissionMap:
46 + m_Texture: {fileID: 0}
47 + m_Scale: {x: 1, y: 1}
48 + m_Offset: {x: 0, y: 0}
49 + - _MainTex:
50 + m_Texture: {fileID: 0}
51 + m_Scale: {x: 1, y: 1}
52 + m_Offset: {x: 0, y: 0}
53 + - _MetallicGlossMap:
54 + m_Texture: {fileID: 0}
55 + m_Scale: {x: 1, y: 1}
56 + m_Offset: {x: 0, y: 0}
57 + - _OcclusionMap:
58 + m_Texture: {fileID: 0}
59 + m_Scale: {x: 1, y: 1}
60 + m_Offset: {x: 0, y: 0}
61 + - _ParallaxMap:
62 + m_Texture: {fileID: 0}
63 + m_Scale: {x: 1, y: 1}
64 + m_Offset: {x: 0, y: 0}
65 + m_Floats:
66 + - _BumpScale: 1
67 + - _Cutoff: 0.5
68 + - _DetailNormalMapScale: 1
69 + - _DstBlend: 0
70 + - _GlossMapScale: 1
71 + - _Glossiness: 0.5
72 + - _GlossyReflections: 1
73 + - _Metallic: 0
74 + - _Mode: 0
75 + - _OcclusionStrength: 1
76 + - _Parallax: 0.02
77 + - _Refract: 0.0444
78 + - _SPMulti: 3
79 + - _SPPower: 150
80 + - _SmoothnessTextureChannel: 0
81 + - _SpecularHighlights: 1
82 + - _SrcBlend: 1
83 + - _UVSec: 0
84 + - _WaveH: 0.1
85 + - _WaveL: 12
86 + - _WaveT: 1
87 + - _ZWrite: 1
88 + m_Colors:
89 + - _Color: {r: 1, g: 1, b: 1, a: 1}
90 + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
91 + - _SPColor: {r: 1, g: 1, b: 1, a: 1}
1 +fileFormatVersion: 2
2 +guid: 090f4e2bbd83641449975980c46306eb
3 +timeCreated: 1487231179
4 +licenseType: Free
5 +NativeFormatImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 65fad16ae02504d379da643c63edcf83
3 +folderAsset: yes
4 +timeCreated: 1516852739
5 +licenseType: Pro
6 +DefaultImporter:
7 + externalObjects: {}
8 + userData:
9 + assetBundleName:
10 + assetBundleVariant:
1 +Shader "Custom/Water" {
2 + Properties {
3 + _Color ("Color", Color) = (1,1,1,1)
4 + _MainTex ("Albedo (RGB)", 2D) = "white" {}
5 + _Glossiness ("Smoothness", Range(0,1)) = 0.5
6 + _Metallic ("Metallic", Range(0,1)) = 0.0
7 + }
8 + SubShader {
9 + Tags { "RenderType"="Opaque" }
10 + LOD 200
11 +
12 + CGPROGRAM
13 + // Physically based Standard lighting model, and enable shadows on all light types
14 + #pragma surface surf Standard fullforwardshadows
15 +
16 + // Use shader model 3.0 target, to get nicer looking lighting
17 + #pragma target 3.0
18 +
19 + sampler2D _MainTex;
20 +
21 + struct Input {
22 + float2 uv_MainTex;
23 + };
24 +
25 + half _Glossiness;
26 + half _Metallic;
27 + fixed4 _Color;
28 +
29 + // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
30 + // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
31 + // #pragma instancing_options assumeuniformscaling
32 + UNITY_INSTANCING_BUFFER_START(Props)
33 + // put more per-instance properties here
34 + UNITY_INSTANCING_BUFFER_END(Props)
35 +
36 + void surf (Input IN, inout SurfaceOutputStandard o) {
37 + // Albedo comes from a texture tinted by color
38 + fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
39 + o.Albedo = c.rgb;
40 + // Metallic and smoothness come from slider variables
41 + o.Metallic = _Metallic;
42 + o.Smoothness = _Glossiness;
43 + o.Alpha = c.a;
44 + }
45 + ENDCG
46 + }
47 + FallBack "Diffuse"
48 +}
1 +fileFormatVersion: 2
2 +guid: 800c847533a604bfc92dd8e0c6aa60d4
3 +timeCreated: 1516852730
4 +licenseType: Pro
5 +ShaderImporter:
6 + externalObjects: {}
7 + defaultTextures: []
8 + userData:
9 + assetBundleName:
10 + assetBundleVariant:
This diff could not be displayed because it is too large.
1 +fileFormatVersion: 2
2 +guid: 28358a3edd18f4f9da046a8255fb7b72
3 +timeCreated: 1504673057
4 +licenseType: Free
5 +DefaultImporter:
6 + userData:
7 + assetBundleName:
8 + assetBundleVariant:
No preview for this file type
1 +fileFormatVersion: 2
2 +guid: 2eb6b779029dd413f9d3e450ce211303
3 +timeCreated: 1516852739
4 +licenseType: Pro
5 +NativeFormatImporter:
6 + externalObjects: {}
7 + mainObjectFileID: 25800000
8 + userData:
9 + assetBundleName:
10 + assetBundleVariant:
No preview for this file type
1 +fileFormatVersion: 2
2 +guid: 52ee62e513986484d9303604dd111bb5
3 +timeCreated: 1516852739
4 +licenseType: Pro
5 +TextureImporter:
6 + fileIDToRecycleName:
7 + 8900000: generatedCubemap
8 + externalObjects: {}
9 + serializedVersion: 4
10 + mipmaps:
11 + mipMapMode: 0
12 + enableMipMap: 1
13 + sRGBTexture: 1
14 + linearTexture: 0
15 + fadeOut: 0
16 + borderMipMap: 0
17 + mipMapsPreserveCoverage: 0
18 + alphaTestReferenceValue: 0.5
19 + mipMapFadeDistanceStart: 1
20 + mipMapFadeDistanceEnd: 3
21 + bumpmap:
22 + convertToNormalMap: 0
23 + externalNormalMap: 0
24 + heightScale: 0.25
25 + normalMapFilter: 0
26 + isReadable: 0
27 + grayScaleToAlpha: 0
28 + generateCubemap: 6
29 + cubemapConvolution: 1
30 + seamlessCubemap: 1
31 + textureFormat: 1
32 + maxTextureSize: 2048
33 + textureSettings:
34 + serializedVersion: 2
35 + filterMode: 2
36 + aniso: 0
37 + mipBias: 0
38 + wrapU: 1
39 + wrapV: 1
40 + wrapW: 1
41 + nPOTScale: 1
42 + lightmap: 0
43 + compressionQuality: 50
44 + spriteMode: 0
45 + spriteExtrude: 1
46 + spriteMeshType: 1
47 + alignment: 0
48 + spritePivot: {x: 0.5, y: 0.5}
49 + spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 + spritePixelsToUnits: 100
51 + alphaUsage: 1
52 + alphaIsTransparency: 0
53 + spriteTessellationDetail: -1
54 + textureType: 0
55 + textureShape: 2
56 + maxTextureSizeSet: 0
57 + compressionQualitySet: 0
58 + textureFormatSet: 0
59 + platformSettings:
60 + - buildTarget: DefaultTexturePlatform
61 + maxTextureSize: 2048
62 + resizeAlgorithm: 0
63 + textureFormat: -1
64 + textureCompression: 1
65 + compressionQuality: 100
66 + crunchedCompression: 0
67 + allowsAlphaSplitting: 0
68 + overridden: 0
69 + androidETC2FallbackOverride: 0
70 + spriteSheet:
71 + serializedVersion: 2
72 + sprites: []
73 + outline: []
74 + physicsShape: []
75 + spritePackingTag:
76 + userData:
77 + assetBundleName:
78 + assetBundleVariant:
...@@ -174,18 +174,4 @@ QualitySettings: ...@@ -174,18 +174,4 @@ QualitySettings:
174 asyncUploadBufferSize: 4 174 asyncUploadBufferSize: 4
175 resolutionScalingFixedDPIFactor: 1 175 resolutionScalingFixedDPIFactor: 1
176 excludedTargetPlatforms: [] 176 excludedTargetPlatforms: []
177 - m_PerPlatformDefaultQuality: 177 + m_PerPlatformDefaultQuality: {}
178 - Android: 2
179 - Nintendo 3DS: 5
180 - Nintendo Switch: 5
181 - PS4: 5
182 - PSM: 5
183 - PSP2: 2
184 - Standalone: 5
185 - Tizen: 2
186 - WebGL: 3
187 - WiiU: 5
188 - Windows Store Apps: 5
189 - XboxOne: 5
190 - iPhone: 2
191 - tvOS: 2
......