Browse Source

conversion lockin: cleans out eroneous editor refs to specmap and specularmap in favor of the desired PBRConfigMap var name for the combined (smooth,ao,metalness) map used throughout

AzaezelX 5 years ago
parent
commit
60d2b0a0f6

+ 1 - 1
Engine/source/materials/materialDefinition.cpp

@@ -304,7 +304,7 @@ void Material::initPersistFields()
       addField("invertSmoothness", TypeBool, Offset(mInvertSmoothness, Material), MAX_STAGES,
          "Treat Smoothness as Roughness");
 
-      addField( "specularMap", TypeImageFilename, Offset(mPBRConfigMapFilename, Material), MAX_STAGES,
+      addField( "PBRConfigMap", TypeImageFilename, Offset(mPBRConfigMapFilename, Material), MAX_STAGES,
          "Prepacked specular map texture. The RGB channels of this texture provide per-pixel reference values for: "
          "smoothness (R), Ambient Occlusion (G), and metalness(B)");
 

+ 3 - 3
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs

@@ -385,10 +385,10 @@ function AssetBrowser::importMaterialAsset(%this, %assetItem)
          %file.writeline("   AOMap[0] = \"" @ %assetItem.AOImageAsset.filePath @"\";");
          %file.writeline("   AOMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.AOImageAsset.assetName @"\";");
       }
-      if(%assetItem.compositeImageAsset)
+      if(%assetItem.PBRConfigMapImageAsset)
       {
-         %file.writeline("   CompositeMap[0] = \"" @ %assetItem.compositeImageAsset.filePath @"\";");
-         %file.writeline("   CompositeMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.compositeImageAsset.assetName @"\";");
+         %file.writeline("   PBRConfigMap[0] = \"" @ %assetItem.compositeImageAsset.filePath @"\";");
+         %file.writeline("   PBRConfigMapAsset[0] = \"" @ %moduleName @ ":" @ %assetItem.compositeImageAsset.assetName @"\";");
       }
       %file.writeline("};");
       %file.writeline("//--- OBJECT WRITE END ---");

+ 7 - 7
Templates/BaseGame/game/tools/materialEditor/gui/guiMaterialPropertiesWindow.ed.gui

@@ -731,7 +731,7 @@
                            HorizSizing = "right";
                            VertSizing = "bottom";
                            position = "70 2";
-                           Extent = "57 16";
+                           Extent = "107 16";
                            MinExtent = "8 2";
                            canSave = "1";
                            Visible = "1";
@@ -772,7 +772,7 @@
                         
                         new GuiBitmapCtrl() {
                            canSaveDynamicFields = "0";
-                           internalName = "specMapDisplayBitmap";
+                           internalName = "PBRConfigMapDisplayBitmap";
                            Enabled = "1";
                            isContainer = "0";
                            Profile = "ToolsGuiDefaultProfile";
@@ -806,7 +806,7 @@
                            AnchorBottom = "0";
                            AnchorLeft = "1";
                            AnchorRight = "0";
-                           text = "Composite Map";
+                           text = "PBR Config Map";
                            maxLength = "1024";
                         };
                         new GuiBitmapButtonCtrl() {
@@ -821,7 +821,7 @@
                            MinExtent = "8 2";
                            canSave = "1";
                            Visible = "1";
-                           Command = "MaterialEditorGui.updateSpecMap(1);";
+                           Command = "MaterialEditorGui.updatePBRConfigMap(1);";
                            tooltipprofile = "ToolsGuiDefaultProfile";
                            ToolTip = "Change the packed spec map for this layer. \n Smoothness (R), Ambient Occlusion (G), and Metalness(B))";
                            hovertime = "1000";
@@ -832,7 +832,7 @@
                         };
                         new GuiTextCtrl() {
                            canSaveDynamicFields = "0";
-                           internalName = "specMapNameText";
+                           internalName = "PBRConfigMapNameText";
                            Enabled = "1";
                            isContainer = "0";
                            Profile = "ToolsGuiTextProfile";
@@ -861,7 +861,7 @@
                            position = "134 34";
                            Extent = "40 16";
                            buttonType = "PushButton";
-                           command="MaterialEditorGui.updateSpecMap(1);";
+                           command="MaterialEditorGui.updatePBRConfigMap(1);";
                         };
                         new GuiBitmapButtonCtrl() {
                            canSaveDynamicFields = "0";
@@ -875,7 +875,7 @@
                            MinExtent = "8 2";
                            canSave = "1";
                            Visible = "1";
-                           Command = "MaterialEditorGui.updateSpecMap(0);";
+                           Command = "MaterialEditorGui.updatePBRConfigMap(0);";
                            hovertime = "1000";
                            groupNum = "-1";
                            buttonType = "PushButton";

+ 17 - 17
Templates/BaseGame/game/tools/materialEditor/scripts/materialEditor.ed.cs

@@ -589,9 +589,9 @@ function MaterialEditorGui::convertTextureFields(%this)
    
    for(%specI = 0; %specI < 4; %specI++)
    {
-      %specMap = MaterialEditorGui.currentMaterial.specularMap[%specI];      
-      %specMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %specMap);
-      MaterialEditorGui.currentMaterial.specularMap[%specI] = %specMap;
+      %PBRConfigMap = MaterialEditorGui.currentMaterial.PBRConfigMap[%specI];      
+      %PBRConfigMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %PBRConfigMap);
+      MaterialEditorGui.currentMaterial.PBRConfigMap[%specI] = %PBRConfigMap;
    }
    
    for(%roughI = 0; %roughI < 4; %roughI++)
@@ -906,15 +906,15 @@ function MaterialEditorGui::guiSync( %this, %material )
    MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
    MaterialEditorPropertiesWindow-->invertSmoothnessCheckbox.setValue((%material).invertSmoothness[%layer]);
       
-   if((%material).specularMap[%layer] $= "") 
+   if((%material).PBRConfigMap[%layer] $= "") 
    {
-      MaterialEditorPropertiesWindow-->specMapNameText.setText( "None" );
-      MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
+      MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText( "None" );
+      MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
    }
    else
    {
-      MaterialEditorPropertiesWindow-->specMapNameText.setText( (%material).specularMap[%layer] );
-      MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap( (%material).specularMap[%layer] );
+      MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText( (%material).PBRConfigMap[%layer] );
+      MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap( (%material).PBRConfigMap[%layer] );
    }
    
    if((%material).roughMap[%layer] $= "") 
@@ -1266,7 +1266,7 @@ function MaterialEditorGui::updateDetailNormalStrength(%this,%newStrength)
    MaterialEditorGui.updateActiveMaterial("detailNormalMapStrength[" @ %layer @ "]", %detailStrength);
 }
 
-function MaterialEditorGui::updateSpecMap(%this,%action)
+function MaterialEditorGui::updatePBRConfigMap(%this,%action)
 {
    %layer = MaterialEditorGui.currentLayer;
    
@@ -1277,20 +1277,20 @@ function MaterialEditorGui::updateSpecMap(%this,%action)
       {
          MaterialEditorGui.updateActiveMaterial("pixelSpecular[" @ MaterialEditorGui.currentLayer @ "]", 0);
          
-         MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap(%texture);
+         MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap(%texture);
       
-         %bitmap = MaterialEditorPropertiesWindow-->specMapDisplayBitmap.bitmap;
+         %bitmap = MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.bitmap;
          %bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
-         MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap(%bitmap);
-         MaterialEditorPropertiesWindow-->specMapNameText.setText(%bitmap);
-         MaterialEditorGui.updateActiveMaterial("specularMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
+         MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap(%bitmap);
+         MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText(%bitmap);
+         MaterialEditorGui.updateActiveMaterial("PBRConfigMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
       }
    }
    else
    {
-      MaterialEditorPropertiesWindow-->specMapNameText.setText("None");
-      MaterialEditorPropertiesWindow-->specMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage");
-      MaterialEditorGui.updateActiveMaterial("specularMap[" @ %layer @ "]","");
+      MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText("None");
+      MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage");
+      MaterialEditorGui.updateActiveMaterial("PBRConfigMap[" @ %layer @ "]","");
    }
    
    MaterialEditorGui.guiSync( materialEd_previewMaterial );