shift pbrconfig to ORM

This commit is contained in:
AzaezelX 2020-09-30 13:51:12 -05:00
parent 22b0785c73
commit 0c7811bd1a
54 changed files with 879 additions and 680 deletions

View file

@ -579,7 +579,7 @@
VertSizing = "bottom";
position = "9 4";
Extent = "72 16";
text = "Smoothness";
text = "Roughness";
Profile = "ToolsGuiTextProfile";
};
@ -599,7 +599,7 @@
new GuiSliderCtrl() {
canSaveDynamicFields = "0";
internalName = "SmoothnessSlider";
internalName = "RoughnessSlider";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiSliderProfile";
@ -610,10 +610,10 @@
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updateActiveMaterial(\"Smoothness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, true);";
AltCommand = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"Smoothness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, false);";
Command = "MaterialEditorGui.updateActiveMaterial(\"Roughness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, true);";
AltCommand = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"Roughness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue(), true, false);";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "Sets Smoothness.";
ToolTip = "Sets Roughness.";
hovertime = "1000";
range = "0 1";
ticks = "0";
@ -621,7 +621,7 @@
};
new GuiTextEditCtrl() {
canSaveDynamicFields = "0";
internalName = "SmoothnessTextEdit";
internalName = "RoughnessTextEdit";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiTextEditProfile";
@ -632,7 +632,7 @@
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"Smoothness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue());";
Command = "$ThisControl.getParent().updateFromChild($ThisControl); MaterialEditorGui.updateActiveMaterial(\"Roughness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue());";
hovertime = "1000";
AnchorTop = "1";
AnchorBottom = "0";
@ -724,7 +724,7 @@
};
new GuiCheckBoxCtrl() {
canSaveDynamicFields = "0";
internalName = "invertSmoothnessCheckbox";
internalName = "invertRoughnessCheckbox";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiCheckBoxProfile";
@ -735,11 +735,11 @@
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updateActiveMaterial(\"invertSmoothness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue());";
Command = "MaterialEditorGui.updateActiveMaterial(\"invertRoughness[\" @ MaterialEditorGui.currentLayer @ \"]\", $ThisControl.getValue());";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "Treat as Roughest = 1.0, not 0.0";
hovertime = "1000";
text = "Invert Smoothness";
text = "Invert Roughness";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
@ -772,7 +772,7 @@
new GuiBitmapCtrl() {
canSaveDynamicFields = "0";
internalName = "PBRConfigMapDisplayBitmap";
internalName = "ORMConfigMapDisplayBitmap";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiDefaultProfile";
@ -806,7 +806,7 @@
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "PBR Config Map";
text = "ORM(Config)Map";
maxLength = "1024";
};
new GuiBitmapButtonCtrl() {
@ -821,9 +821,9 @@
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updatePBRConfigMap(1);";
Command = "MaterialEditorGui.updateORMConfigMap(1);";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "Change the packed spec map for this layer. \n Smoothness (R), Ambient Occlusion (G), and Metalness(B))";
ToolTip = "Change the packed spec map for this layer. \n Roughness (R), Ambient Occlusion (G), and Metalness(B))";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
@ -832,7 +832,7 @@
};
new GuiTextCtrl() {
canSaveDynamicFields = "0";
internalName = "PBRConfigMapNameText";
internalName = "ORMConfigMapNameText";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiTextProfile";
@ -861,7 +861,7 @@
position = "134 34";
Extent = "40 16";
buttonType = "PushButton";
command="MaterialEditorGui.updatePBRConfigMap(1);";
command="MaterialEditorGui.updateORMConfigMap(1);";
};
new GuiBitmapButtonCtrl() {
canSaveDynamicFields = "0";
@ -875,7 +875,7 @@
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updatePBRConfigMap(0);";
Command = "MaterialEditorGui.updateORMConfigMap(0);";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
@ -1010,7 +1010,7 @@
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Smoothness";
text = "Roughness";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
@ -1051,7 +1051,7 @@
active = "1";
command = "MaterialEditorGui.updateroughMap(1);";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Change the Smoothness map for this layer.";
tooltip = "Change the Roughness map for this layer.";
hovertime = "1000";
isContainer = "0";
canSave = "1";

View file

@ -590,9 +590,9 @@ function MaterialEditorGui::convertTextureFields(%this)
for(%specI = 0; %specI < 4; %specI++)
{
%PBRConfigMap = MaterialEditorGui.currentMaterial.PBRConfigMap[%specI];
%PBRConfigMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %PBRConfigMap);
MaterialEditorGui.currentMaterial.PBRConfigMap[%specI] = %PBRConfigMap;
%ORMConfigMap = MaterialEditorGui.currentMaterial.ORMConfigMap[%specI];
%ORMConfigMap = MaterialEditorGui.searchForTexture(MaterialEditorGui.currentMaterial, %ORMConfigMap);
MaterialEditorGui.currentMaterial.ORMConfigMap[%specI] = %ORMConfigMap;
}
for(%roughI = 0; %roughI < 4; %roughI++)
@ -914,17 +914,17 @@ function MaterialEditorGui::guiSync( %this, %material )
MaterialEditorPropertiesWindow-->toneMapDisplayBitmap.setBitmap( (%material).toneMap[%layer] );
}
MaterialEditorPropertiesWindow-->isSRGBCheckbox.setValue((%material).isSRGB[%layer]);
MaterialEditorPropertiesWindow-->invertSmoothnessCheckbox.setValue((%material).invertSmoothness[%layer]);
MaterialEditorPropertiesWindow-->invertRoughnessCheckbox.setValue((%material).invertRoughness[%layer]);
if((%material).PBRConfigMap[%layer] $= "")
if((%material).ORMConfigMap[%layer] $= "")
{
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( "None" );
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( "tools/materialEditor/gui/unknownImage" );
}
else
{
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText( (%material).PBRConfigMap[%layer] );
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap( (%material).PBRConfigMap[%layer] );
MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText( (%material).ORMConfigMap[%layer] );
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap( (%material).ORMConfigMap[%layer] );
}
if((%material).roughMap[%layer] $= "")
@ -988,8 +988,8 @@ function MaterialEditorGui::guiSync( %this, %material )
MaterialEditorPropertiesWindow-->colorTintSwatch.color = (%material).diffuseColor[%layer];
MaterialEditorPropertiesWindow-->specularColorSwatch.color = (%material).specular[%layer];
MaterialEditorPropertiesWindow-->SmoothnessTextEdit.setText((%material).Smoothness[%layer]);
MaterialEditorPropertiesWindow-->SmoothnessSlider.setValue((%material).Smoothness[%layer]);
MaterialEditorPropertiesWindow-->RoughnessTextEdit.setText((%material).Roughness[%layer]);
MaterialEditorPropertiesWindow-->RoughnessSlider.setValue((%material).Roughness[%layer]);
MaterialEditorPropertiesWindow-->MetalnessTextEdit.setText((%material).Metalness[%layer]);
MaterialEditorPropertiesWindow-->MetalnessSlider.setValue((%material).Metalness[%layer]);
MaterialEditorPropertiesWindow-->glowMulTextEdit.setText((%material).glowMul[%layer]);
@ -1065,7 +1065,7 @@ function MaterialEditorGui::guiSync( %this, %material )
MaterialEditorPropertiesWindow-->accuCheckbox.setValue((%material).accuEnabled[%layer]);
%this.getRoughChan((%material).SmoothnessChan[%layer]);
%this.getRoughChan((%material).RoughnessChan[%layer]);
%this.getAOChan((%material).AOChan[%layer]);
%this.getMetalChan((%material).metalChan[%layer]);
%this.getGlowChan((%material).glowChan[%layer]);
@ -1276,7 +1276,7 @@ function MaterialEditorGui::updateDetailNormalStrength(%this,%newStrength)
MaterialEditorGui.updateActiveMaterial("detailNormalMapStrength[" @ %layer @ "]", %detailStrength);
}
function MaterialEditorGui::updatePBRConfigMap(%this,%action)
function MaterialEditorGui::updateORMConfigMap(%this,%action)
{
%layer = MaterialEditorGui.currentLayer;
@ -1287,20 +1287,20 @@ function MaterialEditorGui::updatePBRConfigMap(%this,%action)
{
MaterialEditorGui.updateActiveMaterial("pixelSpecular[" @ MaterialEditorGui.currentLayer @ "]", 0);
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap(%texture);
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap(%texture);
%bitmap = MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.bitmap;
%bitmap = MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.bitmap;
%bitmap = strreplace(%bitmap,"tools/materialEditor/scripts/","");
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap(%bitmap);
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText(%bitmap);
MaterialEditorGui.updateActiveMaterial("PBRConfigMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap(%bitmap);
MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText(%bitmap);
MaterialEditorGui.updateActiveMaterial("ORMConfigMap[" @ %layer @ "]","\"" @ %bitmap @ "\"");
}
}
else
{
MaterialEditorPropertiesWindow-->PBRConfigMapNameText.setText("None");
MaterialEditorPropertiesWindow-->PBRConfigMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage");
MaterialEditorGui.updateActiveMaterial("PBRConfigMap[" @ %layer @ "]","");
MaterialEditorPropertiesWindow-->ORMConfigMapNameText.setText("None");
MaterialEditorPropertiesWindow-->ORMConfigMapDisplayBitmap.setBitmap("tools/materialEditor/gui/unknownImage");
MaterialEditorGui.updateActiveMaterial("ORMConfigMap[" @ %layer @ "]","");
}
MaterialEditorGui.guiSync( materialEd_previewMaterial );
@ -2524,7 +2524,7 @@ function MaterialEditorGui::updateAccuCheckbox(%this, %value)
// channel in selectors
function MaterialEditorGui::setRoughChan(%this, %value)
{
MaterialEditorGui.updateActiveMaterial("SmoothnessChan[" @ MaterialEditorGui.currentLayer @ "]", %value);
MaterialEditorGui.updateActiveMaterial("RoughnessChan[" @ MaterialEditorGui.currentLayer @ "]", %value);
MaterialEditorGui.guiSync( materialEd_previewMaterial );
}
@ -2573,13 +2573,12 @@ function MaterialEditorGui::saveCompositeMap(%this)
%metalMap = %material.metalMap[%layer];
%glowMap = %material.glowMap[%layer];
%smooth = %material.SmoothnessChan[%layer];
%roughness = %material.RoughnessChan[%layer];
%ao = %material.AOChan[%layer];
%metal = %material.metalChan[%layer];
%glow = %material.glowChan[%layer];
%channelKey = %smooth SPC %ao SPC %metal SPC %glow;
%channelKey = %roughness SPC %ao SPC %metal SPC 0;
error("Storing: \"" @ %roughMap @"\" \""@ %aoMap @"\" \""@ %metalMap @"\" \""@ %channelKey @"\" \""@ %saveAs @"\"");
saveCompositeTexture(%roughMap,%aoMap,%metalMap,%glowMap,%channelKey, %saveAs);
saveCompositeTexture(%roughMap,%aoMap,%metalMap,"",%channelKey, %saveAs);
%dlg.delete();
}