|
|
|
|
|
|
|
|
|
|
var localIndex = 0; |
|
|
|
foreach (var field in fields) |
|
|
|
{ |
|
|
|
// Note: One field can have multiple name. This is to allow to have different debug view mode for the same field
|
|
|
|
// like for example display normal in world space or in view space. Same field but two different modes.
|
|
|
|
List<String> displayNames = new List<string>(); |
|
|
|
{ |
|
|
|
// Note: One field can have multiple name. This is to allow to have different debug view mode for the same field
|
|
|
|
// like for example display normal in world space or in view space. Same field but two different modes.
|
|
|
|
List<String> displayNames = new List<string>(); |
|
|
|
displayNames.Add(field.Name); |
|
|
|
|
|
|
|
// Check if the display name have been override by the users
|
|
|
|
|
|
|
if (propertyAttr[0].displayNames.Length > 0 && propertyAttr[0].displayNames[0] != "") |
|
|
|
{ |
|
|
|
displayNames.Clear(); |
|
|
|
{ |
|
|
|
displayNames.Clear(); |
|
|
|
|
|
|
|
|
|
|
|
foreach (string fieldName in displayNames) |
|
|
|
{ |
|
|
|
debugViewMaterialStringsList.Add(new GUIContent(className + fieldName)); |
|
|
|
|
|
|
materialItems.Add(item); |
|
|
|
} |
|
|
|
|
|
|
|
// Init list
|
|
|
|
List<GUIContent> debugViewMaterialStringsList = new List<GUIContent>(); |
|
|
|
// Init list
|
|
|
|
List<GUIContent> debugViewMaterialStringsList = new List<GUIContent>(); |
|
|
|
List<int> debugViewMaterialValuesList = new List<int>(); |
|
|
|
List<GUIContent> debugViewEngineStringsList = new List<GUIContent>(); |
|
|
|
List<int> debugViewEngineValuesList = new List<int>(); |
|
|
|
|
|
|
|
|
|
|
// First element is a reserved location and should not be used (allow to track error)
|
|
|
|
// Special case for None since it cannot be inferred from SurfaceData/BuiltinData
|
|
|
|
debugViewMaterialStringsList.Add(new GUIContent("None")); |
|
|
|
debugViewMaterialStringsList.Add(new GUIContent("None")); |
|
|
|
debugViewMaterialValuesList.Add(0); |
|
|
|
|
|
|
|
foreach (MaterialItem item in materialItems) |
|
|
|
|
|
|
// Engine properties debug
|
|
|
|
// First element is a reserved location and should not be used (allow to track error)
|
|
|
|
// Special case for None since it cannot be inferred from SurfaceData/BuiltinData
|
|
|
|
debugViewEngineStringsList.Add(new GUIContent("None")); |
|
|
|
debugViewEngineValuesList.Add(0); |
|
|
|
debugViewEngineStringsList.Add(new GUIContent("None")); |
|
|
|
debugViewEngineValuesList.Add(0); |
|
|
|
|
|
|
|
// For the following, no need to reserve the 0 case as it is handled in the Enum
|
|
|
|
|
|
|
|
// For the following, no need to reserve the 0 case as it is handled in the Enum
|
|
|
|
|
|
|
|
// Attributes debug
|
|
|
|
FillWithPropertiesEnum(typeof(Attributes.DebugViewVarying), ref debugViewMaterialVaryingStringsList, ref debugViewMaterialVaryingValuesList, ""); |
|
|
|
|
|
|
FillWithProperties(typeof(Lit.BSDFData), ref debugViewMaterialGBufferStringsList, ref debugViewMaterialGBufferValuesList, ""); |
|
|
|
|
|
|
|
// Convert to array for UI
|
|
|
|
debugViewMaterialStrings = debugViewMaterialStringsList.ToArray(); |
|
|
|
debugViewMaterialValues = debugViewMaterialValuesList.ToArray(); |
|
|
|
|
|
|
|
debugViewEngineStrings = debugViewEngineStringsList.ToArray(); |
|
|
|
debugViewMaterialStrings = debugViewMaterialStringsList.ToArray(); |
|
|
|
debugViewMaterialValues = debugViewMaterialValuesList.ToArray(); |
|
|
|
|
|
|
|
debugViewEngineStrings = debugViewEngineStringsList.ToArray(); |
|
|
|
debugViewMaterialVaryingStrings = debugViewMaterialVaryingStringsList.ToArray(); |
|
|
|
debugViewMaterialVaryingStrings = debugViewMaterialVaryingStringsList.ToArray(); |
|
|
|
debugViewMaterialPropertiesStrings = debugViewMaterialPropertiesStringsList.ToArray(); |
|
|
|
debugViewMaterialPropertiesStrings = debugViewMaterialPropertiesStringsList.ToArray(); |
|
|
|
debugViewMaterialTextureStrings = debugViewMaterialTextureStringsList.ToArray(); |
|
|
|
debugViewMaterialTextureStrings = debugViewMaterialTextureStringsList.ToArray(); |
|
|
|
debugViewMaterialGBufferStrings = debugViewMaterialGBufferStringsList.ToArray(); |
|
|
|
debugViewMaterialGBufferValues = debugViewMaterialGBufferValuesList.ToArray(); |
|
|
|
debugViewMaterialGBufferStrings = debugViewMaterialGBufferStringsList.ToArray(); |
|
|
|
debugViewMaterialGBufferValues = debugViewMaterialGBufferValuesList.ToArray(); |
|
|
|
|
|
|
|
isDebugViewMaterialInit = true; |
|
|
|
} |
|
|
|