@@ -48,7 +48,14 @@ private class Styles
48
48
public readonly GUIContent tileLightLoopDebugMode = new GUIContent ( "Enable Debug mode" , "Toggle overheat map mode" ) ;
49
49
public readonly GUIContent directIndirectSinglePass = new GUIContent ( "Enable direct and indirect lighting in single pass" , "Toggle" ) ;
50
50
public readonly GUIContent bigTilePrepass = new GUIContent ( "Enable big tile prepass" , "Toggle" ) ;
51
- public readonly GUIContent clustered = new GUIContent ( "Enable clusted" , "Toggle" ) ;
51
+ public readonly GUIContent clustered = new GUIContent ( "Enable clustered" , "Toggle" ) ;
52
+
53
+
54
+ public readonly GUIContent textureSettings = new GUIContent ( "texture Settings" ) ;
55
+
56
+ public readonly GUIContent spotCookieSize = new GUIContent ( "spotCookie Size" ) ;
57
+ public readonly GUIContent pointCookieSize = new GUIContent ( "pointCookie Size" ) ;
58
+ public readonly GUIContent reflectionCubemapSize = new GUIContent ( "reflectionCubemap Size" ) ;
52
59
}
53
60
54
61
private static Styles s_Styles = null ;
@@ -164,7 +171,7 @@ public override void OnInspectorGUI()
164
171
FillWithProperties ( typeof ( Builtin . BuiltinData ) , styles . debugViewMaterialStrings , styles . debugViewMaterialValues , false , GetSubNameSpaceName ( typeof ( Lit . SurfaceData ) ) , ref index ) ;
165
172
FillWithProperties ( typeof ( Lit . SurfaceData ) , styles . debugViewMaterialStrings , styles . debugViewMaterialValues , false , GetSubNameSpaceName ( typeof ( Lit . SurfaceData ) ) , ref index ) ;
166
173
FillWithProperties ( typeof ( Builtin . BuiltinData ) , styles . debugViewMaterialStrings , styles . debugViewMaterialValues , false , GetSubNameSpaceName ( typeof ( Unlit . SurfaceData ) ) , ref index ) ;
167
- FillWithProperties ( typeof ( Unlit . SurfaceData ) , styles . debugViewMaterialStrings , styles . debugViewMaterialValues , false , GetSubNameSpaceName ( typeof ( Unlit . SurfaceData ) ) , ref index ) ;
174
+ FillWithProperties ( typeof ( Unlit . SurfaceData ) , styles . debugViewMaterialStrings , styles . debugViewMaterialValues , false , GetSubNameSpaceName ( typeof ( Unlit . SurfaceData ) ) , ref index ) ;
168
175
169
176
// Engine
170
177
FillWithPropertiesEnum ( typeof ( Attributes . DebugViewGbuffer ) , styles . debugViewMaterialStrings , styles . debugViewMaterialValues , "" , true , ref index ) ;
@@ -183,9 +190,9 @@ public override void OnInspectorGUI()
183
190
EditorGUILayout . Space ( ) ;
184
191
debugParameters . displayOpaqueObjects = EditorGUILayout . Toggle ( styles . displayOpaqueObjects , debugParameters . displayOpaqueObjects ) ;
185
192
debugParameters . displayTransparentObjects = EditorGUILayout . Toggle ( styles . displayTransparentObjects , debugParameters . displayTransparentObjects ) ;
186
- debugParameters . useForwardRenderingOnly = EditorGUILayout . Toggle ( styles . useForwardRenderingOnly , debugParameters . useForwardRenderingOnly ) ;
193
+ debugParameters . useForwardRenderingOnly = EditorGUILayout . Toggle ( styles . useForwardRenderingOnly , debugParameters . useForwardRenderingOnly ) ;
187
194
debugParameters . useDepthPrepass = EditorGUILayout . Toggle ( styles . useDepthPrepass , debugParameters . useDepthPrepass ) ;
188
- debugParameters . useSinglePassLightLoop = EditorGUILayout . Toggle ( styles . useSinglePassLightLoop , debugParameters . useSinglePassLightLoop ) ;
195
+ debugParameters . useSinglePassLightLoop = EditorGUILayout . Toggle ( styles . useSinglePassLightLoop , debugParameters . useSinglePassLightLoop ) ;
189
196
190
197
if ( EditorGUI . EndChangeCheck ( ) )
191
198
{
@@ -220,41 +227,64 @@ public override void OnInspectorGUI()
220
227
EditorGUI . indentLevel ++ ;
221
228
EditorGUI . BeginChangeCheck ( ) ;
222
229
223
-
224
230
shadowParameters . enabled = EditorGUILayout . Toggle ( styles . shadowsEnabled , shadowParameters . enabled ) ;
225
231
shadowParameters . shadowAtlasWidth = Mathf . Max ( 0 , EditorGUILayout . IntField ( styles . shadowsAtlasWidth , shadowParameters . shadowAtlasWidth ) ) ;
226
232
shadowParameters . shadowAtlasHeight = Mathf . Max ( 0 , EditorGUILayout . IntField ( styles . shadowsAtlasHeight , shadowParameters . shadowAtlasHeight ) ) ;
227
233
shadowParameters . maxShadowDistance = Mathf . Max ( 0 , EditorGUILayout . FloatField ( styles . shadowsMaxShadowDistance , shadowParameters . maxShadowDistance ) ) ;
228
234
shadowParameters . directionalLightCascadeCount = EditorGUILayout . IntPopup ( styles . shadowsDirectionalLightCascadeCount , shadowParameters . directionalLightCascadeCount , styles . shadowsCascadeCounts , styles . shadowsCascadeCountValues ) ;
229
235
230
236
EditorGUI . indentLevel ++ ;
231
- for ( int i = 0 ; i < shadowParameters . directionalLightCascadeCount - 1 ; i ++ )
237
+ for ( int i = 0 ; i < shadowParameters . directionalLightCascadeCount - 1 ; i ++ )
232
238
{
233
239
shadowParameters . directionalLightCascades [ i ] = Mathf . Max ( 0 , EditorGUILayout . FloatField ( shadowParameters . directionalLightCascades [ i ] ) ) ;
234
240
}
235
241
EditorGUI . indentLevel -- ;
236
-
237
242
if ( EditorGUI . EndChangeCheck ( ) )
238
243
{
239
244
EditorUtility . SetDirty ( renderLoop ) ; // Repaint
240
245
}
241
246
EditorGUI . indentLevel -- ;
242
247
243
248
EditorGUILayout . Space ( ) ;
244
- EditorGUILayout . LabelField ( styles . tileLightLoopSettings ) ;
249
+ var textureParameters = renderLoop . textureSettings ;
250
+
251
+ EditorGUILayout . LabelField ( styles . textureSettings ) ;
245
252
EditorGUI . indentLevel ++ ;
246
253
EditorGUI . BeginChangeCheck ( ) ;
247
254
248
- renderLoop . tilePassLightLoop . debugViewTilesFlags = ( TilePass . DebugViewTilesFlags ) EditorGUILayout . EnumMaskField ( "DebugView Tiles" , renderLoop . tilePassLightLoop . debugViewTilesFlags ) ;
249
- renderLoop . tilePassLightLoop . enableDirectIndirectSinglePass = EditorGUILayout . Toggle ( styles . directIndirectSinglePass , renderLoop . tilePassLightLoop . enableDirectIndirectSinglePass ) ;
250
- renderLoop . tilePassLightLoop . enableBigTilePrepass = EditorGUILayout . Toggle ( styles . bigTilePrepass , renderLoop . tilePassLightLoop . enableBigTilePrepass ) ;
251
- renderLoop . tilePassLightLoop . enableClustered = EditorGUILayout . Toggle ( styles . clustered , renderLoop . tilePassLightLoop . enableClustered ) ;
255
+ textureParameters . spotCookieSize = Mathf . NextPowerOfTwo ( Mathf . Clamp ( EditorGUILayout . IntField ( styles . spotCookieSize , textureParameters . spotCookieSize ) , 16 , 1024 ) ) ;
256
+ textureParameters . pointCookieSize = Mathf . NextPowerOfTwo ( Mathf . Clamp ( EditorGUILayout . IntField ( styles . pointCookieSize , textureParameters . pointCookieSize ) , 16 , 1024 ) ) ;
257
+ textureParameters . reflectionCubemapSize = Mathf . NextPowerOfTwo ( Mathf . Clamp ( EditorGUILayout . IntField ( styles . reflectionCubemapSize , textureParameters . reflectionCubemapSize ) , 64 , 1024 ) ) ;
252
258
253
259
if ( EditorGUI . EndChangeCheck ( ) )
254
260
{
255
261
EditorUtility . SetDirty ( renderLoop ) ; // Repaint
256
262
}
257
263
EditorGUI . indentLevel -- ;
264
+
265
+
266
+ EditorGUILayout . Space ( ) ;
267
+
268
+ if ( renderLoop . tilePassLightLoop != null )
269
+ {
270
+ EditorGUILayout . LabelField ( styles . tileLightLoopSettings ) ;
271
+ EditorGUI . indentLevel ++ ;
272
+ EditorGUI . BeginChangeCheck ( ) ;
273
+
274
+ renderLoop . tilePassLightLoop . debugViewTilesFlags = ( TilePass . DebugViewTilesFlags ) EditorGUILayout . EnumMaskField ( "DebugView Tiles" , renderLoop . tilePassLightLoop . debugViewTilesFlags ) ;
275
+ renderLoop . tilePassLightLoop . enableDirectIndirectSinglePass = EditorGUILayout . Toggle ( styles . directIndirectSinglePass , renderLoop . tilePassLightLoop . enableDirectIndirectSinglePass ) ;
276
+ renderLoop . tilePassLightLoop . enableBigTilePrepass = EditorGUILayout . Toggle ( styles . bigTilePrepass , renderLoop . tilePassLightLoop . enableBigTilePrepass ) ;
277
+ renderLoop . tilePassLightLoop . enableClustered = EditorGUILayout . Toggle ( styles . clustered , renderLoop . tilePassLightLoop . enableClustered ) ;
278
+
279
+ if ( EditorGUI . EndChangeCheck ( ) )
280
+ {
281
+ EditorUtility . SetDirty ( renderLoop ) ; // Repaint
282
+
283
+ // If something is chanage on tilePassLightLoop we need to force a OnValidate() OnHDRenderLoop, else change Rebuild() will not be call
284
+ renderLoop . OnValidate ( ) ;
285
+ }
286
+ EditorGUI . indentLevel -- ;
287
+ }
258
288
}
259
289
}
260
290
}
0 commit comments