mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-10 07:04:36 +00:00
Add and load custom pbr diffuse and specular cube maps
This commit is contained in:
parent
b1e32dbb48
commit
6c8fac8bc1
9 changed files with 91 additions and 37 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -169,8 +169,11 @@ namespace Switch_Toolbox.Library
|
|||
case "BotwGamePath":
|
||||
Runtime.BotwGamePath = node.InnerText;
|
||||
break;
|
||||
case "CubeMapPath":
|
||||
Runtime.PBR.CubeMapPath = node.InnerText;
|
||||
case "SpecularCubeMapPath":
|
||||
Runtime.PBR.SpecularCubeMapPath = node.InnerText;
|
||||
break;
|
||||
case "DiffuseCubeMapPath":
|
||||
Runtime.PBR.DiffuseCubeMapPath = node.InnerText;
|
||||
break;
|
||||
case "renderBoundingBoxes":
|
||||
bool.TryParse(node.InnerText, out Runtime.renderBoundingBoxes);
|
||||
|
@ -343,7 +346,8 @@ namespace Switch_Toolbox.Library
|
|||
PathsNode.AppendChild(createNode(doc, "Mk8dGamePath", Runtime.Mk8dGamePath.ToString()));
|
||||
PathsNode.AppendChild(createNode(doc, "TpGamePath", Runtime.TpGamePath.ToString()));
|
||||
PathsNode.AppendChild(createNode(doc, "BotwGamePath", Runtime.BotwGamePath.ToString()));
|
||||
PathsNode.AppendChild(createNode(doc, "CubeMapPath", Runtime.PBR.CubeMapPath.ToString()));
|
||||
PathsNode.AppendChild(createNode(doc, "SpecularCubeMapPath", Runtime.PBR.SpecularCubeMapPath.ToString()));
|
||||
PathsNode.AppendChild(createNode(doc, "DiffuseCubeMapPath", Runtime.PBR.DiffuseCubeMapPath.ToString()));
|
||||
}
|
||||
private static void AppenPBRSettings(XmlDocument doc, XmlNode parentNode)
|
||||
{
|
||||
|
|
|
@ -136,12 +136,10 @@ namespace Switch_Toolbox.Library
|
|||
var xyzLnes = new DrawableXyzLines();
|
||||
scene.staticObjects.Add(xyzLnes);
|
||||
|
||||
bool UseSkybox = false;
|
||||
|
||||
if (UseSkybox)
|
||||
if (Runtime.PBR.UseSkybox)
|
||||
{
|
||||
var skybox = new DrawableSkybox();
|
||||
// scene.staticObjects.Add(skybox);
|
||||
scene.staticObjects.Add(skybox);
|
||||
}
|
||||
else if (Runtime.renderBackGround)
|
||||
{
|
||||
|
|
|
@ -50,8 +50,16 @@ namespace Switch_Toolbox.Library
|
|||
{
|
||||
if (diffusepbr == null)
|
||||
{
|
||||
DDS diffuseSdr = new DDS(Properties.Resources.diffuseSDR);
|
||||
diffusepbr = DDS.CreateGLCubeMap(diffuseSdr);
|
||||
if (System.IO.File.Exists(Runtime.PBR.SpecularCubeMapPath))
|
||||
{
|
||||
DDS diffuseSdr = new DDS(Runtime.PBR.DiffuseCubeMapPath);
|
||||
diffusepbr = DDS.CreateGLCubeMap(diffuseSdr);
|
||||
}
|
||||
else
|
||||
{
|
||||
DDS diffuseSdr = new DDS(Properties.Resources.diffuseSDR);
|
||||
diffusepbr = DDS.CreateGLCubeMap(diffuseSdr);
|
||||
}
|
||||
}
|
||||
return diffusepbr;
|
||||
}
|
||||
|
@ -67,8 +75,16 @@ namespace Switch_Toolbox.Library
|
|||
{
|
||||
if (specularpbr == null)
|
||||
{
|
||||
DDS specularSdr = new DDS(Properties.Resources.specularSDR);
|
||||
specularpbr = DDS.CreateGLCubeMap(specularSdr);
|
||||
if (System.IO.File.Exists(Runtime.PBR.SpecularCubeMapPath))
|
||||
{
|
||||
DDS specularSdr = new DDS(Runtime.PBR.SpecularCubeMapPath);
|
||||
specularpbr = DDS.CreateGLCubeMap(specularSdr);
|
||||
}
|
||||
else
|
||||
{
|
||||
DDS specularSdr = new DDS(Properties.Resources.specularSDR);
|
||||
specularpbr = DDS.CreateGLCubeMap(specularSdr);
|
||||
}
|
||||
}
|
||||
return specularpbr;
|
||||
}
|
||||
|
|
|
@ -91,7 +91,9 @@ namespace Switch_Toolbox.Library
|
|||
public class PBR
|
||||
{
|
||||
public static bool UseSkybox = false;
|
||||
public static string CubeMapPath = "";
|
||||
public static string DiffuseCubeMapPath = "";
|
||||
public static string SpecularCubeMapPath = "";
|
||||
public static string BRSFMapPath = "";
|
||||
}
|
||||
|
||||
public static GridSettings gridSettings = new GridSettings();
|
||||
|
|
68
Toolbox/GUI/Settings.Designer.cs
generated
68
Toolbox/GUI/Settings.Designer.cs
generated
|
@ -101,9 +101,11 @@
|
|||
this.stLabel10 = new Switch_Toolbox.Library.Forms.STLabel();
|
||||
this.mk8PathTB = new Switch_Toolbox.Library.Forms.STTextBox();
|
||||
this.tabPage4 = new System.Windows.Forms.TabPage();
|
||||
this.cubemapPathTB = new Switch_Toolbox.Library.Forms.STTextBox();
|
||||
this.stLabel15 = new Switch_Toolbox.Library.Forms.STLabel();
|
||||
this.chkUseSkyobx = new Switch_Toolbox.Library.Forms.STCheckBox();
|
||||
this.stLabel15 = new Switch_Toolbox.Library.Forms.STLabel();
|
||||
this.specularCubemapPathTB = new Switch_Toolbox.Library.Forms.STTextBox();
|
||||
this.stLabel16 = new Switch_Toolbox.Library.Forms.STLabel();
|
||||
this.diffuseCubemapPathTB = new Switch_Toolbox.Library.Forms.STTextBox();
|
||||
this.contentContainer.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cameraMaxSpeedUD)).BeginInit();
|
||||
|
@ -1054,9 +1056,11 @@
|
|||
//
|
||||
// tabPage4
|
||||
//
|
||||
this.tabPage4.Controls.Add(this.stLabel16);
|
||||
this.tabPage4.Controls.Add(this.diffuseCubemapPathTB);
|
||||
this.tabPage4.Controls.Add(this.chkUseSkyobx);
|
||||
this.tabPage4.Controls.Add(this.stLabel15);
|
||||
this.tabPage4.Controls.Add(this.cubemapPathTB);
|
||||
this.tabPage4.Controls.Add(this.specularCubemapPathTB);
|
||||
this.tabPage4.Location = new System.Drawing.Point(4, 25);
|
||||
this.tabPage4.Name = "tabPage4";
|
||||
this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
|
||||
|
@ -1065,24 +1069,6 @@
|
|||
this.tabPage4.Text = "PBR";
|
||||
this.tabPage4.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cubemapPathTB
|
||||
//
|
||||
this.cubemapPathTB.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.cubemapPathTB.Location = new System.Drawing.Point(115, 41);
|
||||
this.cubemapPathTB.Name = "cubemapPathTB";
|
||||
this.cubemapPathTB.Size = new System.Drawing.Size(166, 20);
|
||||
this.cubemapPathTB.TabIndex = 0;
|
||||
this.cubemapPathTB.TextChanged += new System.EventHandler(this.cubemapPathTB_TextChanged);
|
||||
//
|
||||
// stLabel15
|
||||
//
|
||||
this.stLabel15.AutoSize = true;
|
||||
this.stLabel15.Location = new System.Drawing.Point(16, 43);
|
||||
this.stLabel15.Name = "stLabel15";
|
||||
this.stLabel15.Size = new System.Drawing.Size(93, 13);
|
||||
this.stLabel15.TabIndex = 1;
|
||||
this.stLabel15.Text = "Custom Cubemap:";
|
||||
//
|
||||
// chkUseSkyobx
|
||||
//
|
||||
this.chkUseSkyobx.AutoSize = true;
|
||||
|
@ -1094,6 +1080,42 @@
|
|||
this.chkUseSkyobx.UseVisualStyleBackColor = true;
|
||||
this.chkUseSkyobx.CheckedChanged += new System.EventHandler(this.chkUseSkyobx_CheckedChanged);
|
||||
//
|
||||
// stLabel15
|
||||
//
|
||||
this.stLabel15.AutoSize = true;
|
||||
this.stLabel15.Location = new System.Drawing.Point(16, 43);
|
||||
this.stLabel15.Name = "stLabel15";
|
||||
this.stLabel15.Size = new System.Drawing.Size(138, 13);
|
||||
this.stLabel15.TabIndex = 1;
|
||||
this.stLabel15.Text = "Custom Specular Cubemap:";
|
||||
//
|
||||
// specularCubemapPathTB
|
||||
//
|
||||
this.specularCubemapPathTB.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.specularCubemapPathTB.Location = new System.Drawing.Point(160, 41);
|
||||
this.specularCubemapPathTB.Name = "specularCubemapPathTB";
|
||||
this.specularCubemapPathTB.Size = new System.Drawing.Size(197, 20);
|
||||
this.specularCubemapPathTB.TabIndex = 0;
|
||||
this.specularCubemapPathTB.TextChanged += new System.EventHandler(this.cubemapPathTB_TextChanged);
|
||||
//
|
||||
// stLabel16
|
||||
//
|
||||
this.stLabel16.AutoSize = true;
|
||||
this.stLabel16.Location = new System.Drawing.Point(16, 69);
|
||||
this.stLabel16.Name = "stLabel16";
|
||||
this.stLabel16.Size = new System.Drawing.Size(129, 13);
|
||||
this.stLabel16.TabIndex = 4;
|
||||
this.stLabel16.Text = "Custom Diffuse Cubemap:";
|
||||
//
|
||||
// diffuseCubemapPathTB
|
||||
//
|
||||
this.diffuseCubemapPathTB.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.diffuseCubemapPathTB.Location = new System.Drawing.Point(160, 67);
|
||||
this.diffuseCubemapPathTB.Name = "diffuseCubemapPathTB";
|
||||
this.diffuseCubemapPathTB.Size = new System.Drawing.Size(197, 20);
|
||||
this.diffuseCubemapPathTB.TabIndex = 3;
|
||||
this.diffuseCubemapPathTB.TextChanged += new System.EventHandler(this.diffuseCubemapPathTB_TextChanged);
|
||||
//
|
||||
// Settings
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@ -1211,6 +1233,8 @@
|
|||
private System.Windows.Forms.TabPage tabPage4;
|
||||
private Switch_Toolbox.Library.Forms.STCheckBox chkUseSkyobx;
|
||||
private Switch_Toolbox.Library.Forms.STLabel stLabel15;
|
||||
private Switch_Toolbox.Library.Forms.STTextBox cubemapPathTB;
|
||||
private Switch_Toolbox.Library.Forms.STTextBox specularCubemapPathTB;
|
||||
private Switch_Toolbox.Library.Forms.STLabel stLabel16;
|
||||
private Switch_Toolbox.Library.Forms.STTextBox diffuseCubemapPathTB;
|
||||
}
|
||||
}
|
|
@ -75,7 +75,8 @@ namespace Toolbox
|
|||
botwGamePathTB.Text = Runtime.BotwGamePath;
|
||||
tpGamePathTB.Text = Runtime.TpGamePath;
|
||||
modelLoadArchive.Checked = Runtime.ObjectEditor.OpenModelsOnOpen;
|
||||
cubemapPathTB.Text = Runtime.PBR.CubeMapPath;
|
||||
specularCubemapPathTB.Text = Runtime.PBR.SpecularCubeMapPath;
|
||||
diffuseCubemapPathTB.Text = Runtime.PBR.DiffuseCubeMapPath;
|
||||
chkUseSkyobx.Checked = Runtime.PBR.UseSkybox;
|
||||
|
||||
displayBoundingBoxeChk.Checked = Runtime.renderBoundingBoxes;
|
||||
|
@ -445,13 +446,22 @@ namespace Toolbox
|
|||
FolderSelectDialog sfd = new FolderSelectDialog();
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
cubemapPathTB.Text = sfd.SelectedPath;
|
||||
Runtime.PBR.CubeMapPath = cubemapPathTB.Text;
|
||||
specularCubemapPathTB.Text = sfd.SelectedPath;
|
||||
Runtime.PBR.SpecularCubeMapPath = specularCubemapPathTB.Text;
|
||||
}
|
||||
}
|
||||
|
||||
private void chkUseSkyobx_CheckedChanged(object sender, EventArgs e) {
|
||||
Runtime.PBR.UseSkybox = chkUseSkyobx.Checked;
|
||||
}
|
||||
|
||||
private void diffuseCubemapPathTB_TextChanged(object sender, EventArgs e) {
|
||||
FolderSelectDialog sfd = new FolderSelectDialog();
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
specularCubemapPathTB.Text = sfd.SelectedPath;
|
||||
Runtime.PBR.DiffuseCubeMapPath = diffuseCubemapPathTB.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue