浏览代码

Merge pull request #930 from Azaezel/alpha402/fixORMChanMap

fix orm vs single channel mapping
Brian Roberts 2 年之前
父节点
当前提交
a304198abb

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

@@ -129,10 +129,10 @@ Material::Material()
       mMetalness[i] = 0.0f;
 
       mIsSRGb[i] = false;
-      mInvertRoughness[i] = false;
 
-      mRoughnessChan[i] = 0;
-      mAOChan[i] = 1;
+      mAOChan[i] = 0;
+      mInvertRoughness[i] = false;
+      mRoughnessChan[i] = 1;
       mMetalChan[i] = 2;
 
       mAccuEnabled[i] = false;

+ 4 - 4
Engine/source/materials/materialDefinition.h

@@ -230,15 +230,15 @@ public:
    DECLARE_IMAGEASSET_ARRAY_SETGET(Material, ORMConfigMap);
 
    bool     mIsSRGb[MAX_STAGES];
+   DECLARE_IMAGEASSET_ARRAY(Material, AOMap, MAX_STAGES);
+   DECLARE_IMAGEASSET_ARRAY_SETGET(Material, AOMap);
+   F32      mAOChan[MAX_STAGES];
+
    DECLARE_IMAGEASSET_ARRAY(Material, RoughMap, MAX_STAGES);
    DECLARE_IMAGEASSET_ARRAY_SETGET(Material, RoughMap);
-
    bool     mInvertRoughness[MAX_STAGES];
    F32      mRoughnessChan[MAX_STAGES];
-   DECLARE_IMAGEASSET_ARRAY(Material, AOMap, MAX_STAGES);
-   DECLARE_IMAGEASSET_ARRAY_SETGET(Material, AOMap);
 
-   F32      mAOChan[MAX_STAGES];
    DECLARE_IMAGEASSET_ARRAY(Material, MetalMap, MAX_STAGES);
    DECLARE_IMAGEASSET_ARRAY_SETGET(Material, MetalMap);
 

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

@@ -967,8 +967,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 					  isContainer = "0";
 					  canSave = "1";
 					  canSaveDynamicFields = "0";
-				   };
-				   new GuiContainer() {
+				   };				   new GuiContainer() {
 					  margin = "0 0 0 0";
 					  padding = "0 0 0 0";
 					  anchorTop = "1";
@@ -988,7 +987,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 					  isContainer = "1";
 					  canSave = "1";
 					  canSaveDynamicFields = "0";
-					  className = "materialEditorRoughnessMapContainer";
+					  className = "materialEditorAOMapContainer";
 
 					  new GuiBitmapCtrl() {
 						 bitmapAsset = "ToolsModule:unknownImage_image";
@@ -1004,12 +1003,12 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
-						 internalName = "roughMapDisplayBitmap";
+						 internalName = "aoMapDisplayBitmap";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 					  };
 					  new GuiTextCtrl() {
-						 text = "Roughness";
+						 text = "ao";
 						 maxLength = "1024";
 						 margin = "0 0 0 0";
 						 padding = "0 0 0 0";
@@ -1048,9 +1047,9 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 active = "1";
-						 Command = "MaterialEditorGui.updateTextureMap(\"rough\",1);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"ao\",1);";
 						 tooltipProfile = "GuiToolTipProfile";
-						 tooltip = "Change the Roughness map for this layer.";
+						 tooltip = "Change the AO map for this layer.";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 canSave = "1";
@@ -1076,7 +1075,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
-						 internalName = "roughMapNameText";
+						 internalName = "aoMapNameText";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 					  };
@@ -1093,7 +1092,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 active = "1";
-						 Command = "MaterialEditorGui.updateTextureMap(\"rough\",1);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"ao\",1);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
@@ -1117,16 +1116,16 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 active = "1";
-						 Command = "MaterialEditorGui.updateTextureMap(\"rough\",0);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"ao\",0);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 					  };
-					  new GuiRadioCtrl(roughChanBtn0) {
+					  new GuiRadioCtrl(aoChanBtn0) {
 						 text = "R";
-						 groupNum = "1";
+						 groupNum = "2";
 						 buttonType = "RadioButton";
 						 useMouseEvents = "0";
 						 position = "100 5";
@@ -1137,16 +1136,16 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiRadioProfile";
 						 visible = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.setRoughChan(0);";
+						 command = "MaterialEditorGui.setAOChan(0);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 					  };
-					  new GuiRadioCtrl(roughChanBtn1) {
+					  new GuiRadioCtrl(aoChanBtn1) {
 						 text = "G";
-						 groupNum = "1";
+						 groupNum = "2";
 						 buttonType = "RadioButton";
 						 useMouseEvents = "0";
 						 position = "121 5";
@@ -1157,16 +1156,16 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiRadioProfile";
 						 visible = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.setRoughChan(1);";
+						 command = "MaterialEditorGui.setAOChan(1);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 					  };
-					  new GuiRadioCtrl(roughChanBtn2) {
+					  new GuiRadioCtrl(aoChanBtn2) {
 						 text = "B";
-						 groupNum = "1";
+						 groupNum = "2";
 						 buttonType = "RadioButton";
 						 useMouseEvents = "0";
 						 position = "142 5";
@@ -1177,16 +1176,16 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiRadioProfile";
 						 visible = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.setRoughChan(2);";
+						 command = "MaterialEditorGui.setAOChan(2);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 					  };
-					  new GuiRadioCtrl(roughChanBtn3) {
+					  new GuiRadioCtrl(aoChanBtn3) {
 						 text = "A";
-						 groupNum = "1";
+						 groupNum = "2";
 						 buttonType = "RadioButton";
 						 useMouseEvents = "0";
 						 position = "163 5";
@@ -1197,7 +1196,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiRadioProfile";
 						 visible = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.setRoughChan(3);";
+						 command = "MaterialEditorGui.setAOChan(3);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
@@ -1225,7 +1224,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 					  isContainer = "1";
 					  canSave = "1";
 					  canSaveDynamicFields = "0";
-					  className = "materialEditorAOMapContainer";
+					  className = "materialEditorRoughnessMapContainer";
 
 					  new GuiBitmapCtrl() {
 						 bitmapAsset = "ToolsModule:unknownImage_image";
@@ -1241,12 +1240,12 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
-						 internalName = "aoMapDisplayBitmap";
+						 internalName = "roughMapDisplayBitmap";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 					  };
 					  new GuiTextCtrl() {
-						 text = "ao";
+						 text = "Roughness";
 						 maxLength = "1024";
 						 margin = "0 0 0 0";
 						 padding = "0 0 0 0";
@@ -1285,9 +1284,9 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 active = "1";
-						 Command = "MaterialEditorGui.updateTextureMap(\"ao\",1);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"rough\",1);";
 						 tooltipProfile = "GuiToolTipProfile";
-						 tooltip = "Change the AO map for this layer.";
+						 tooltip = "Change the Roughness map for this layer.";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 canSave = "1";
@@ -1313,7 +1312,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
-						 internalName = "aoMapNameText";
+						 internalName = "roughMapNameText";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 					  };
@@ -1330,7 +1329,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 active = "1";
-						 Command = "MaterialEditorGui.updateTextureMap(\"ao\",1);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"rough\",1);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
@@ -1354,16 +1353,16 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiButtonProfile";
 						 visible = "1";
 						 active = "1";
-						 Command = "MaterialEditorGui.updateTextureMap(\"ao\",0);";
+						 Command = "MaterialEditorGui.updateTextureMap(\"rough\",0);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 					  };
-					  new GuiRadioCtrl(aoChanBtn0) {
+					  new GuiRadioCtrl(roughChanBtn0) {
 						 text = "R";
-						 groupNum = "2";
+						 groupNum = "1";
 						 buttonType = "RadioButton";
 						 useMouseEvents = "0";
 						 position = "100 5";
@@ -1374,16 +1373,16 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiRadioProfile";
 						 visible = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.setAOChan(0);";
+						 command = "MaterialEditorGui.setRoughChan(0);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 					  };
-					  new GuiRadioCtrl(aoChanBtn1) {
+					  new GuiRadioCtrl(roughChanBtn1) {
 						 text = "G";
-						 groupNum = "2";
+						 groupNum = "1";
 						 buttonType = "RadioButton";
 						 useMouseEvents = "0";
 						 position = "121 5";
@@ -1394,16 +1393,16 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiRadioProfile";
 						 visible = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.setAOChan(1);";
+						 command = "MaterialEditorGui.setRoughChan(1);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 					  };
-					  new GuiRadioCtrl(aoChanBtn2) {
+					  new GuiRadioCtrl(roughChanBtn2) {
 						 text = "B";
-						 groupNum = "2";
+						 groupNum = "1";
 						 buttonType = "RadioButton";
 						 useMouseEvents = "0";
 						 position = "142 5";
@@ -1414,16 +1413,16 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiRadioProfile";
 						 visible = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.setAOChan(2);";
+						 command = "MaterialEditorGui.setRoughChan(2);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";
 						 canSave = "1";
 						 canSaveDynamicFields = "0";
 					  };
-					  new GuiRadioCtrl(aoChanBtn3) {
+					  new GuiRadioCtrl(roughChanBtn3) {
 						 text = "A";
-						 groupNum = "2";
+						 groupNum = "1";
 						 buttonType = "RadioButton";
 						 useMouseEvents = "0";
 						 position = "163 5";
@@ -1434,7 +1433,7 @@ $guiContent = new GuiControl(MaterialEditorGui,EditorGuiGroup) {
 						 profile = "ToolsGuiRadioProfile";
 						 visible = "1";
 						 active = "1";
-						 command = "MaterialEditorGui.setAOChan(3);";
+						 command = "MaterialEditorGui.setRoughChan(3);";
 						 tooltipProfile = "GuiToolTipProfile";
 						 hovertime = "1000";
 						 isContainer = "0";