diff --git a/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs b/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs index a541802..58d7095 100644 --- a/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs +++ b/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs @@ -2118,7 +2118,7 @@ namespace CodeWalker.GameFiles var dd = db as Drawable; var fd = db as FragDrawable; var skel = db.Skeleton; - LightAttributes_s[] lightAttrs = null; + LightAttributes[] lightAttrs = null; Bounds b = null; if (dd != null) { @@ -2246,7 +2246,7 @@ namespace CodeWalker.GameFiles [TypeConverter(typeof(ExpandableObjectConverter))] public class LightInstance { - public LightAttributes_s Attributes { get; set; } //just for display purposes! + public LightAttributes Attributes { get; set; } //just for display purposes! public uint Hash { get; set; } public Vector3 Position { get; set; } public Vector3 Direction { get; set; } diff --git a/CodeWalker.Core/GameFiles/Resources/Drawable.cs b/CodeWalker.Core/GameFiles/Resources/Drawable.cs index 1863220..fa9123d 100644 --- a/CodeWalker.Core/GameFiles/Resources/Drawable.cs +++ b/CodeWalker.Core/GameFiles/Resources/Drawable.cs @@ -4493,8 +4493,13 @@ namespace CodeWalker.GameFiles Capsule = 4, } - [TypeConverter(typeof(ExpandableObjectConverter))] public struct LightAttributes_s : IMetaXmlItem + [TypeConverter(typeof(ExpandableObjectConverter))] public class LightAttributes : ResourceSystemBlock, IMetaXmlItem { + public override long BlockLength + { + get { return 168; } + } + // structure data public uint Unknown_0h { get; set; } // 0x00000000 public uint Unknown_4h { get; set; } // 0x00000000 @@ -4542,6 +4547,107 @@ namespace CodeWalker.GameFiles public MetaHash ProjectedTextureHash { get; set; } public uint Unknown_A4h { get; set; } // 0x00000000 + public bool HasChanged = false; //used by model light form + + public override void Read(ResourceDataReader reader, params object[] parameters) + { + //read structure data + Unknown_0h = reader.ReadUInt32(); + Unknown_4h = reader.ReadUInt32(); + Position = reader.ReadVector3(); + Unknown_14h = reader.ReadUInt32(); + ColorR = reader.ReadByte(); + ColorG = reader.ReadByte(); + ColorB = reader.ReadByte(); + Flashiness = reader.ReadByte(); + Intensity = reader.ReadSingle(); + Flags = reader.ReadUInt32(); + BoneId = reader.ReadUInt16(); + Type = (LightType)reader.ReadByte(); + GroupId = reader.ReadByte(); + TimeFlags = reader.ReadUInt32(); + Falloff = reader.ReadSingle(); + FalloffExponent = reader.ReadSingle(); + CullingPlaneNormal = reader.ReadVector3(); + CullingPlaneOffset = reader.ReadSingle(); + ShadowBlur = reader.ReadByte(); + Unknown_45h = reader.ReadByte(); + Unknown_46h = reader.ReadUInt16(); + Unknown_48h = reader.ReadUInt32(); + VolumeIntensity = reader.ReadSingle(); + VolumeSizeScale = reader.ReadSingle(); + VolumeOuterColorR = reader.ReadByte(); + VolumeOuterColorG = reader.ReadByte(); + VolumeOuterColorB = reader.ReadByte(); + LightHash = reader.ReadByte(); + VolumeOuterIntensity = reader.ReadSingle(); + CoronaSize = reader.ReadSingle(); + VolumeOuterExponent = reader.ReadSingle(); + LightFadeDistance = reader.ReadByte(); + ShadowFadeDistance = reader.ReadByte(); + SpecularFadeDistance = reader.ReadByte(); + VolumetricFadeDistance = reader.ReadByte(); + ShadowNearClip = reader.ReadSingle(); + CoronaIntensity = reader.ReadSingle(); + CoronaZBias = reader.ReadSingle(); + Direction = reader.ReadVector3(); + Tangent = reader.ReadVector3(); + ConeInnerAngle = reader.ReadSingle(); + ConeOuterAngle = reader.ReadSingle(); + Extent = reader.ReadVector3(); + ProjectedTextureHash = new MetaHash(reader.ReadUInt32()); + Unknown_A4h = reader.ReadUInt32(); + } + public override void Write(ResourceDataWriter writer, params object[] parameters) + { + //write structure data + writer.Write(this.Unknown_0h); + writer.Write(this.Unknown_4h); + writer.Write(this.Position); + writer.Write(this.Unknown_14h); + writer.Write(this.ColorR); + writer.Write(this.ColorG); + writer.Write(this.ColorB); + writer.Write(this.Flashiness); + writer.Write(this.Intensity); + writer.Write(this.Flags); + writer.Write(this.BoneId); + writer.Write((byte)this.Type); + writer.Write(this.GroupId); + writer.Write(this.TimeFlags); + writer.Write(this.Falloff); + writer.Write(this.FalloffExponent); + writer.Write(this.CullingPlaneNormal); + writer.Write(this.CullingPlaneOffset); + writer.Write(this.ShadowBlur); + writer.Write(this.Unknown_45h); + writer.Write(this.Unknown_46h); + writer.Write(this.Unknown_48h); + writer.Write(this.VolumeIntensity); + writer.Write(this.VolumeSizeScale); + writer.Write(this.VolumeOuterColorR); + writer.Write(this.VolumeOuterColorG); + writer.Write(this.VolumeOuterColorB); + writer.Write(this.LightHash); + writer.Write(this.VolumeOuterIntensity); + writer.Write(this.CoronaSize); + writer.Write(this.VolumeOuterExponent); + writer.Write(this.LightFadeDistance); + writer.Write(this.ShadowFadeDistance); + writer.Write(this.SpecularFadeDistance); + writer.Write(this.VolumetricFadeDistance); + writer.Write(this.ShadowNearClip); + writer.Write(this.CoronaIntensity); + writer.Write(this.CoronaZBias); + writer.Write(this.Direction); + writer.Write(this.Tangent); + writer.Write(this.ConeInnerAngle); + writer.Write(this.ConeOuterAngle); + writer.Write(this.Extent); + writer.Write(this.ProjectedTextureHash.Hash); + writer.Write(this.Unknown_A4h); + } + public void WriteXml(StringBuilder sb, int indent) { YdrXml.SelfClosingTag(sb, indent, "Position " + FloatUtil.GetVector3XmlString(Position)); @@ -4622,6 +4728,40 @@ namespace CodeWalker.GameFiles Extent = Xml.GetChildVector3Attributes(node, "Extent"); ProjectedTextureHash = XmlMeta.GetHash(Xml.GetChildInnerText(node, "ProjectedTextureHash")); } + + public Quaternion GetRotation() + { + Vector3 tx = new Vector3(); + Vector3 ty = new Vector3(); + + switch (Type) + { + case LightType.Point: + return Quaternion.Identity; + case LightType.Spot: + tx = Vector3.Normalize(Direction.GetPerpVec()); + ty = Vector3.Normalize(Vector3.Cross(Direction, Tangent)); + break; + case LightType.Capsule: + tx = -Vector3.Normalize(Direction.GetPerpVec()); + ty = Vector3.Normalize(Vector3.Cross(Direction, Tangent)); + break; + } + + var m = new Matrix(); + m.Row1 = new Vector4(tx, 0); + m.Row2 = new Vector4(ty, 0); + m.Row3 = new Vector4(Direction, 0); + return Quaternion.RotationMatrix(m); + } + + public void SetRotation(Quaternion rot) + { + var inv = Quaternion.Invert(GetRotation()); + var delta = rot * inv; + Direction = Vector3.Normalize(delta.Multiply(Direction)); + Tangent = Vector3.Normalize(Direction.GetPerpVec()); + } } @@ -5336,7 +5476,7 @@ namespace CodeWalker.GameFiles // structure data public ulong NamePointer { get; set; } - public ResourceSimpleList64_s LightAttributes { get; set; } + public ResourceSimpleList64 LightAttributes { get; set; } public ulong UnkPointer { get; set; } public ulong BoundPointer { get; set; } @@ -5361,7 +5501,7 @@ namespace CodeWalker.GameFiles // read structure data this.NamePointer = reader.ReadUInt64(); - this.LightAttributes = reader.ReadBlock>(); + this.LightAttributes = reader.ReadBlock>(); this.UnkPointer = reader.ReadUInt64(); this.BoundPointer = reader.ReadUInt64(); @@ -5431,8 +5571,8 @@ namespace CodeWalker.GameFiles Bound = Bounds.ReadXmlNode(bnode, this); } - LightAttributes = new ResourceSimpleList64_s(); - LightAttributes.data_items = XmlMeta.ReadItemArray(node, "Lights"); + LightAttributes = new ResourceSimpleList64(); + LightAttributes.data_items = XmlMeta.ReadItemArray(node, "Lights"); } public static void WriteXmlNode(Drawable d, StringBuilder sb, int indent, string ddsfolder, string name = "Drawable") diff --git a/CodeWalker.Core/GameFiles/Resources/Frag.cs b/CodeWalker.Core/GameFiles/Resources/Frag.cs index 5a05e75..71d2eb0 100644 --- a/CodeWalker.Core/GameFiles/Resources/Frag.cs +++ b/CodeWalker.Core/GameFiles/Resources/Frag.cs @@ -86,7 +86,7 @@ namespace CodeWalker.GameFiles public ulong DrawableClothPointer { get; set; } public ulong Unknown_100h; // 0x0000000000000000 public ulong Unknown_108h; // 0x0000000000000000 - public ResourceSimpleList64_s LightAttributes { get; set; } + public ResourceSimpleList64 LightAttributes { get; set; } public ulong VehicleGlassWindowsPointer { get; set; } public ulong Unknown_128h; // 0x0000000000000000 @@ -155,7 +155,7 @@ namespace CodeWalker.GameFiles this.DrawableClothPointer = reader.ReadUInt64(); this.Unknown_100h = reader.ReadUInt64(); this.Unknown_108h = reader.ReadUInt64(); - this.LightAttributes = reader.ReadBlock>(); + this.LightAttributes = reader.ReadBlock>(); this.VehicleGlassWindowsPointer = reader.ReadUInt64(); this.Unknown_128h = reader.ReadUInt64(); @@ -510,8 +510,8 @@ namespace CodeWalker.GameFiles GlassWindows = new ResourcePointerArray64(); GlassWindows.data_items = gwinds; } - LightAttributes = new ResourceSimpleList64_s(); - LightAttributes.data_items = XmlMeta.ReadItemArray(node, "Lights"); + LightAttributes = new ResourceSimpleList64(); + LightAttributes.data_items = XmlMeta.ReadItemArray(node, "Lights"); Cloths = new ResourcePointerList64(); var cnode = node.SelectSingleNode("Cloths"); if (cnode != null) diff --git a/CodeWalker.Core/Utils/FbxConverter.cs b/CodeWalker.Core/Utils/FbxConverter.cs index af51266..79286d6 100644 --- a/CodeWalker.Core/Utils/FbxConverter.cs +++ b/CodeWalker.Core/Utils/FbxConverter.cs @@ -194,7 +194,7 @@ namespace CodeWalker d.BuildRenderMasks(); - d.LightAttributes = new ResourceSimpleList64_s(); + d.LightAttributes = new ResourceSimpleList64(); //todo: light attributes? diff --git a/CodeWalker/Forms/ModelForm.Designer.cs b/CodeWalker/Forms/ModelForm.Designer.cs index 36f638e..733f0e0 100644 --- a/CodeWalker/Forms/ModelForm.Designer.cs +++ b/CodeWalker/Forms/ModelForm.Designer.cs @@ -52,42 +52,49 @@ this.ClipDictComboBox = new System.Windows.Forms.ComboBox(); this.ModelsTreeView = new CodeWalker.WinForms.TreeViewFix(); this.ToolsMaterialsTabPage = new System.Windows.Forms.TabPage(); - this.MaterialEditorButton = new System.Windows.Forms.Button(); this.TextureViewerButton = new System.Windows.Forms.Button(); this.TexturesTreeView = new CodeWalker.WinForms.TreeViewFix(); this.ToolsDetailsTabPage = new System.Windows.Forms.TabPage(); this.DetailsPropertyGrid = new CodeWalker.WinForms.ReadOnlyPropertyGrid(); this.ToolsOptionsTabPage = new System.Windows.Forms.TabPage(); + this.OptionsTabControl = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.RenderModeComboBox = new System.Windows.Forms.ComboBox(); + this.FragGlassCheckBox = new System.Windows.Forms.CheckBox(); + this.label14 = new System.Windows.Forms.Label(); this.HDTexturesCheckBox = new System.Windows.Forms.CheckBox(); + this.AnisotropicFilteringCheckBox = new System.Windows.Forms.CheckBox(); this.SkeletonsCheckBox = new System.Windows.Forms.CheckBox(); - this.TimeOfDayLabel = new System.Windows.Forms.Label(); - this.label19 = new System.Windows.Forms.Label(); - this.TimeOfDayTrackBar = new System.Windows.Forms.TrackBar(); - this.ControlLightDirCheckBox = new System.Windows.Forms.CheckBox(); + this.label10 = new System.Windows.Forms.Label(); + this.TextureCoordsComboBox = new System.Windows.Forms.ComboBox(); + this.TextureSamplerComboBox = new System.Windows.Forms.ComboBox(); + this.label11 = new System.Windows.Forms.Label(); + this.WireframeCheckBox = new System.Windows.Forms.CheckBox(); this.ShowCollisionMeshesCheckBox = new System.Windows.Forms.CheckBox(); this.GridCheckBox = new System.Windows.Forms.CheckBox(); this.GridCountComboBox = new System.Windows.Forms.ComboBox(); this.label2 = new System.Windows.Forms.Label(); - this.GridSizeComboBox = new System.Windows.Forms.ComboBox(); - this.label1 = new System.Windows.Forms.Label(); - this.StatusBarCheckBox = new System.Windows.Forms.CheckBox(); this.ErrorConsoleCheckBox = new System.Windows.Forms.CheckBox(); + this.GridSizeComboBox = new System.Windows.Forms.ComboBox(); + this.StatusBarCheckBox = new System.Windows.Forms.CheckBox(); + this.label1 = new System.Windows.Forms.Label(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.DeferredShadingCheckBox = new System.Windows.Forms.CheckBox(); + this.HDLightsCheckBox = new System.Windows.Forms.CheckBox(); + this.label19 = new System.Windows.Forms.Label(); this.HDRRenderingCheckBox = new System.Windows.Forms.CheckBox(); - this.SkydomeCheckBox = new System.Windows.Forms.CheckBox(); + this.TimeOfDayTrackBar = new System.Windows.Forms.TrackBar(); this.ShadowsCheckBox = new System.Windows.Forms.CheckBox(); - this.WireframeCheckBox = new System.Windows.Forms.CheckBox(); - this.RenderModeComboBox = new System.Windows.Forms.ComboBox(); - this.label11 = new System.Windows.Forms.Label(); - this.TextureSamplerComboBox = new System.Windows.Forms.ComboBox(); - this.TextureCoordsComboBox = new System.Windows.Forms.ComboBox(); - this.label10 = new System.Windows.Forms.Label(); - this.AnisotropicFilteringCheckBox = new System.Windows.Forms.CheckBox(); - this.label14 = new System.Windows.Forms.Label(); + this.ControlLightDirCheckBox = new System.Windows.Forms.CheckBox(); + this.SkydomeCheckBox = new System.Windows.Forms.CheckBox(); + this.TimeOfDayLabel = new System.Windows.Forms.Label(); + this.tabPage3 = new System.Windows.Forms.TabPage(); + this.LightEditorButton = new System.Windows.Forms.Button(); + this.MaterialEditorButton = new System.Windows.Forms.Button(); this.ToolsPanelHideButton = new System.Windows.Forms.Button(); this.ToolsDragPanel = new System.Windows.Forms.Panel(); this.ToolsPanelShowButton = new System.Windows.Forms.Button(); this.SaveFileDialog = new System.Windows.Forms.SaveFileDialog(); - this.FragGlassCheckBox = new System.Windows.Forms.CheckBox(); this.StatusStrip.SuspendLayout(); this.ConsolePanel.SuspendLayout(); this.ToolsPanel.SuspendLayout(); @@ -98,7 +105,11 @@ this.ToolsMaterialsTabPage.SuspendLayout(); this.ToolsDetailsTabPage.SuspendLayout(); this.ToolsOptionsTabPage.SuspendLayout(); + this.OptionsTabControl.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.tabPage2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.TimeOfDayTrackBar)).BeginInit(); + this.tabPage3.SuspendLayout(); this.SuspendLayout(); // // StatsUpdateTimer @@ -338,7 +349,6 @@ // // ToolsMaterialsTabPage // - this.ToolsMaterialsTabPage.Controls.Add(this.MaterialEditorButton); this.ToolsMaterialsTabPage.Controls.Add(this.TextureViewerButton); this.ToolsMaterialsTabPage.Controls.Add(this.TexturesTreeView); this.ToolsMaterialsTabPage.Location = new System.Drawing.Point(4, 22); @@ -349,16 +359,6 @@ this.ToolsMaterialsTabPage.Text = "Materials"; this.ToolsMaterialsTabPage.UseVisualStyleBackColor = true; // - // MaterialEditorButton - // - this.MaterialEditorButton.Location = new System.Drawing.Point(3, 6); - this.MaterialEditorButton.Name = "MaterialEditorButton"; - this.MaterialEditorButton.Size = new System.Drawing.Size(91, 23); - this.MaterialEditorButton.TabIndex = 3; - this.MaterialEditorButton.Text = "Material editor"; - this.MaterialEditorButton.UseVisualStyleBackColor = true; - this.MaterialEditorButton.Click += new System.EventHandler(this.MaterialEditorButton_Click); - // // TextureViewerButton // this.TextureViewerButton.Location = new System.Drawing.Point(111, 6); @@ -406,32 +406,7 @@ // // ToolsOptionsTabPage // - this.ToolsOptionsTabPage.Controls.Add(this.FragGlassCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.HDTexturesCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.SkeletonsCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.TimeOfDayLabel); - this.ToolsOptionsTabPage.Controls.Add(this.label19); - this.ToolsOptionsTabPage.Controls.Add(this.TimeOfDayTrackBar); - this.ToolsOptionsTabPage.Controls.Add(this.ControlLightDirCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.ShowCollisionMeshesCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.GridCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.GridCountComboBox); - this.ToolsOptionsTabPage.Controls.Add(this.label2); - this.ToolsOptionsTabPage.Controls.Add(this.GridSizeComboBox); - this.ToolsOptionsTabPage.Controls.Add(this.label1); - this.ToolsOptionsTabPage.Controls.Add(this.StatusBarCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.ErrorConsoleCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.HDRRenderingCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.SkydomeCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.ShadowsCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.WireframeCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.RenderModeComboBox); - this.ToolsOptionsTabPage.Controls.Add(this.label11); - this.ToolsOptionsTabPage.Controls.Add(this.TextureSamplerComboBox); - this.ToolsOptionsTabPage.Controls.Add(this.TextureCoordsComboBox); - this.ToolsOptionsTabPage.Controls.Add(this.label10); - this.ToolsOptionsTabPage.Controls.Add(this.AnisotropicFilteringCheckBox); - this.ToolsOptionsTabPage.Controls.Add(this.label14); + this.ToolsOptionsTabPage.Controls.Add(this.OptionsTabControl); this.ToolsOptionsTabPage.Location = new System.Drawing.Point(4, 22); this.ToolsOptionsTabPage.Name = "ToolsOptionsTabPage"; this.ToolsOptionsTabPage.Size = new System.Drawing.Size(217, 500); @@ -439,12 +414,93 @@ this.ToolsOptionsTabPage.Text = "Options"; this.ToolsOptionsTabPage.UseVisualStyleBackColor = true; // + // OptionsTabControl + // + this.OptionsTabControl.Controls.Add(this.tabPage1); + this.OptionsTabControl.Controls.Add(this.tabPage2); + this.OptionsTabControl.Controls.Add(this.tabPage3); + this.OptionsTabControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.OptionsTabControl.Location = new System.Drawing.Point(0, 0); + this.OptionsTabControl.Name = "OptionsTabControl"; + this.OptionsTabControl.SelectedIndex = 0; + this.OptionsTabControl.Size = new System.Drawing.Size(217, 500); + this.OptionsTabControl.TabIndex = 26; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.RenderModeComboBox); + this.tabPage1.Controls.Add(this.FragGlassCheckBox); + this.tabPage1.Controls.Add(this.label14); + this.tabPage1.Controls.Add(this.HDTexturesCheckBox); + this.tabPage1.Controls.Add(this.AnisotropicFilteringCheckBox); + this.tabPage1.Controls.Add(this.SkeletonsCheckBox); + this.tabPage1.Controls.Add(this.label10); + this.tabPage1.Controls.Add(this.TextureCoordsComboBox); + this.tabPage1.Controls.Add(this.TextureSamplerComboBox); + this.tabPage1.Controls.Add(this.label11); + this.tabPage1.Controls.Add(this.WireframeCheckBox); + this.tabPage1.Controls.Add(this.ShowCollisionMeshesCheckBox); + this.tabPage1.Controls.Add(this.GridCheckBox); + this.tabPage1.Controls.Add(this.GridCountComboBox); + this.tabPage1.Controls.Add(this.label2); + this.tabPage1.Controls.Add(this.ErrorConsoleCheckBox); + this.tabPage1.Controls.Add(this.GridSizeComboBox); + this.tabPage1.Controls.Add(this.StatusBarCheckBox); + this.tabPage1.Controls.Add(this.label1); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(209, 474); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "Render"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // RenderModeComboBox + // + this.RenderModeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.RenderModeComboBox.FormattingEnabled = true; + this.RenderModeComboBox.Items.AddRange(new object[] { + "Default", + "Single texture", + "Vertex normals", + "Vertex tangents", + "Vertex colour 1", + "Vertex colour 2", + "Texture coord 1", + "Texture coord 2", + "Texture coord 3"}); + this.RenderModeComboBox.Location = new System.Drawing.Point(86, 15); + this.RenderModeComboBox.Name = "RenderModeComboBox"; + this.RenderModeComboBox.Size = new System.Drawing.Size(114, 21); + this.RenderModeComboBox.TabIndex = 12; + this.RenderModeComboBox.SelectedIndexChanged += new System.EventHandler(this.RenderModeComboBox_SelectedIndexChanged); + // + // FragGlassCheckBox + // + this.FragGlassCheckBox.AutoSize = true; + this.FragGlassCheckBox.Location = new System.Drawing.Point(6, 218); + this.FragGlassCheckBox.Name = "FragGlassCheckBox"; + this.FragGlassCheckBox.Size = new System.Drawing.Size(175, 17); + this.FragGlassCheckBox.TabIndex = 25; + this.FragGlassCheckBox.Text = "Show Fragments Glass Outlines"; + this.FragGlassCheckBox.UseVisualStyleBackColor = true; + this.FragGlassCheckBox.CheckedChanged += new System.EventHandler(this.FragGlassCheckBox_CheckedChanged); + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(6, 72); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(63, 13); + this.label14.TabIndex = 15; + this.label14.Text = "Tex coords:"; + // // HDTexturesCheckBox // this.HDTexturesCheckBox.AutoSize = true; this.HDTexturesCheckBox.Checked = true; this.HDTexturesCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.HDTexturesCheckBox.Location = new System.Drawing.Point(19, 231); + this.HDTexturesCheckBox.Location = new System.Drawing.Point(6, 149); this.HDTexturesCheckBox.Name = "HDTexturesCheckBox"; this.HDTexturesCheckBox.Size = new System.Drawing.Size(82, 17); this.HDTexturesCheckBox.TabIndex = 10; @@ -452,10 +508,23 @@ this.HDTexturesCheckBox.UseVisualStyleBackColor = true; this.HDTexturesCheckBox.CheckedChanged += new System.EventHandler(this.HDTexturesCheckBox_CheckedChanged); // + // AnisotropicFilteringCheckBox + // + this.AnisotropicFilteringCheckBox.AutoSize = true; + this.AnisotropicFilteringCheckBox.Checked = true; + this.AnisotropicFilteringCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.AnisotropicFilteringCheckBox.Location = new System.Drawing.Point(6, 126); + this.AnisotropicFilteringCheckBox.Name = "AnisotropicFilteringCheckBox"; + this.AnisotropicFilteringCheckBox.Size = new System.Drawing.Size(114, 17); + this.AnisotropicFilteringCheckBox.TabIndex = 9; + this.AnisotropicFilteringCheckBox.Text = "Anisotropic filtering"; + this.AnisotropicFilteringCheckBox.UseVisualStyleBackColor = true; + this.AnisotropicFilteringCheckBox.CheckedChanged += new System.EventHandler(this.AnisotropicFilteringCheckBox_CheckedChanged); + // // SkeletonsCheckBox // this.SkeletonsCheckBox.AutoSize = true; - this.SkeletonsCheckBox.Location = new System.Drawing.Point(19, 426); + this.SkeletonsCheckBox.Location = new System.Drawing.Point(6, 195); this.SkeletonsCheckBox.Name = "SkeletonsCheckBox"; this.SkeletonsCheckBox.Size = new System.Drawing.Size(103, 17); this.SkeletonsCheckBox.TabIndex = 22; @@ -463,54 +532,65 @@ this.SkeletonsCheckBox.UseVisualStyleBackColor = true; this.SkeletonsCheckBox.CheckedChanged += new System.EventHandler(this.SkeletonsCheckBox_CheckedChanged); // - // TimeOfDayLabel + // label10 // - this.TimeOfDayLabel.AutoSize = true; - this.TimeOfDayLabel.Location = new System.Drawing.Point(78, 99); - this.TimeOfDayLabel.Name = "TimeOfDayLabel"; - this.TimeOfDayLabel.Size = new System.Drawing.Size(34, 13); - this.TimeOfDayLabel.TabIndex = 5; - this.TimeOfDayLabel.Text = "12:00"; + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(6, 18); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(74, 13); + this.label10.TabIndex = 11; + this.label10.Text = "Render mode:"; // - // label19 + // TextureCoordsComboBox // - this.label19.AutoSize = true; - this.label19.Location = new System.Drawing.Point(7, 99); - this.label19.Name = "label19"; - this.label19.Size = new System.Drawing.Size(65, 13); - this.label19.TabIndex = 4; - this.label19.Text = "Time of day:"; + this.TextureCoordsComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.TextureCoordsComboBox.Enabled = false; + this.TextureCoordsComboBox.FormattingEnabled = true; + this.TextureCoordsComboBox.Items.AddRange(new object[] { + "Texture coord 1", + "Texture coord 2", + "Texture coord 3"}); + this.TextureCoordsComboBox.Location = new System.Drawing.Point(86, 69); + this.TextureCoordsComboBox.Name = "TextureCoordsComboBox"; + this.TextureCoordsComboBox.Size = new System.Drawing.Size(114, 21); + this.TextureCoordsComboBox.TabIndex = 16; + this.TextureCoordsComboBox.SelectedIndexChanged += new System.EventHandler(this.TextureCoordsComboBox_SelectedIndexChanged); // - // TimeOfDayTrackBar + // TextureSamplerComboBox // - this.TimeOfDayTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.TimeOfDayTrackBar.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.TimeOfDayTrackBar.LargeChange = 60; - this.TimeOfDayTrackBar.Location = new System.Drawing.Point(9, 115); - this.TimeOfDayTrackBar.Maximum = 1440; - this.TimeOfDayTrackBar.Name = "TimeOfDayTrackBar"; - this.TimeOfDayTrackBar.Size = new System.Drawing.Size(188, 45); - this.TimeOfDayTrackBar.TabIndex = 6; - this.TimeOfDayTrackBar.TickFrequency = 60; - this.TimeOfDayTrackBar.Value = 720; - this.TimeOfDayTrackBar.Scroll += new System.EventHandler(this.TimeOfDayTrackBar_Scroll); + this.TextureSamplerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.TextureSamplerComboBox.Enabled = false; + this.TextureSamplerComboBox.FormattingEnabled = true; + this.TextureSamplerComboBox.Location = new System.Drawing.Point(86, 42); + this.TextureSamplerComboBox.Name = "TextureSamplerComboBox"; + this.TextureSamplerComboBox.Size = new System.Drawing.Size(114, 21); + this.TextureSamplerComboBox.TabIndex = 14; + this.TextureSamplerComboBox.SelectedIndexChanged += new System.EventHandler(this.TextureSamplerComboBox_SelectedIndexChanged); // - // ControlLightDirCheckBox + // label11 // - this.ControlLightDirCheckBox.AutoSize = true; - this.ControlLightDirCheckBox.Location = new System.Drawing.Point(19, 77); - this.ControlLightDirCheckBox.Name = "ControlLightDirCheckBox"; - this.ControlLightDirCheckBox.Size = new System.Drawing.Size(124, 17); - this.ControlLightDirCheckBox.TabIndex = 3; - this.ControlLightDirCheckBox.Text = "Control light direction"; - this.ControlLightDirCheckBox.UseVisualStyleBackColor = true; - this.ControlLightDirCheckBox.CheckedChanged += new System.EventHandler(this.ControlLightDirCheckBox_CheckedChanged); + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(6, 45); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(67, 13); + this.label11.TabIndex = 13; + this.label11.Text = "Tex sampler:"; + // + // WireframeCheckBox + // + this.WireframeCheckBox.AutoSize = true; + this.WireframeCheckBox.Location = new System.Drawing.Point(6, 103); + this.WireframeCheckBox.Name = "WireframeCheckBox"; + this.WireframeCheckBox.Size = new System.Drawing.Size(74, 17); + this.WireframeCheckBox.TabIndex = 8; + this.WireframeCheckBox.Text = "Wireframe"; + this.WireframeCheckBox.UseVisualStyleBackColor = true; + this.WireframeCheckBox.CheckedChanged += new System.EventHandler(this.WireframeCheckBox_CheckedChanged); // // ShowCollisionMeshesCheckBox // this.ShowCollisionMeshesCheckBox.AutoSize = true; - this.ShowCollisionMeshesCheckBox.Location = new System.Drawing.Point(19, 162); + this.ShowCollisionMeshesCheckBox.Location = new System.Drawing.Point(6, 172); this.ShowCollisionMeshesCheckBox.Name = "ShowCollisionMeshesCheckBox"; this.ShowCollisionMeshesCheckBox.Size = new System.Drawing.Size(132, 17); this.ShowCollisionMeshesCheckBox.TabIndex = 7; @@ -521,7 +601,7 @@ // GridCheckBox // this.GridCheckBox.AutoSize = true; - this.GridCheckBox.Location = new System.Drawing.Point(19, 345); + this.GridCheckBox.Location = new System.Drawing.Point(6, 257); this.GridCheckBox.Name = "GridCheckBox"; this.GridCheckBox.Size = new System.Drawing.Size(45, 17); this.GridCheckBox.TabIndex = 17; @@ -538,7 +618,7 @@ "40", "60", "100"}); - this.GridCountComboBox.Location = new System.Drawing.Point(83, 392); + this.GridCountComboBox.Location = new System.Drawing.Point(86, 308); this.GridCountComboBox.Name = "GridCountComboBox"; this.GridCountComboBox.Size = new System.Drawing.Size(114, 21); this.GridCountComboBox.TabIndex = 21; @@ -547,12 +627,23 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(7, 395); + this.label2.Location = new System.Drawing.Point(6, 311); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(59, 13); this.label2.TabIndex = 20; this.label2.Text = "Grid count:"; // + // ErrorConsoleCheckBox + // + this.ErrorConsoleCheckBox.AutoSize = true; + this.ErrorConsoleCheckBox.Location = new System.Drawing.Point(94, 476); + this.ErrorConsoleCheckBox.Name = "ErrorConsoleCheckBox"; + this.ErrorConsoleCheckBox.Size = new System.Drawing.Size(88, 17); + this.ErrorConsoleCheckBox.TabIndex = 24; + this.ErrorConsoleCheckBox.Text = "Error console"; + this.ErrorConsoleCheckBox.UseVisualStyleBackColor = true; + this.ErrorConsoleCheckBox.CheckedChanged += new System.EventHandler(this.ErrorConsoleCheckBox_CheckedChanged); + // // GridSizeComboBox // this.GridSizeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -562,27 +653,18 @@ "1.0", "10", "100"}); - this.GridSizeComboBox.Location = new System.Drawing.Point(83, 365); + this.GridSizeComboBox.Location = new System.Drawing.Point(86, 281); this.GridSizeComboBox.Name = "GridSizeComboBox"; this.GridSizeComboBox.Size = new System.Drawing.Size(114, 21); this.GridSizeComboBox.TabIndex = 19; this.GridSizeComboBox.SelectedIndexChanged += new System.EventHandler(this.GridSizeComboBox_SelectedIndexChanged); // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(7, 368); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(70, 13); - this.label1.TabIndex = 18; - this.label1.Text = "Grid unit size:"; - // // StatusBarCheckBox // this.StatusBarCheckBox.AutoSize = true; this.StatusBarCheckBox.Checked = true; this.StatusBarCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.StatusBarCheckBox.Location = new System.Drawing.Point(19, 480); + this.StatusBarCheckBox.Location = new System.Drawing.Point(8, 476); this.StatusBarCheckBox.Name = "StatusBarCheckBox"; this.StatusBarCheckBox.Size = new System.Drawing.Size(74, 17); this.StatusBarCheckBox.TabIndex = 23; @@ -590,23 +672,73 @@ this.StatusBarCheckBox.UseVisualStyleBackColor = true; this.StatusBarCheckBox.CheckedChanged += new System.EventHandler(this.StatusBarCheckBox_CheckedChanged); // - // ErrorConsoleCheckBox + // label1 // - this.ErrorConsoleCheckBox.AutoSize = true; - this.ErrorConsoleCheckBox.Location = new System.Drawing.Point(105, 480); - this.ErrorConsoleCheckBox.Name = "ErrorConsoleCheckBox"; - this.ErrorConsoleCheckBox.Size = new System.Drawing.Size(88, 17); - this.ErrorConsoleCheckBox.TabIndex = 24; - this.ErrorConsoleCheckBox.Text = "Error console"; - this.ErrorConsoleCheckBox.UseVisualStyleBackColor = true; - this.ErrorConsoleCheckBox.CheckedChanged += new System.EventHandler(this.ErrorConsoleCheckBox_CheckedChanged); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 284); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(70, 13); + this.label1.TabIndex = 18; + this.label1.Text = "Grid unit size:"; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.DeferredShadingCheckBox); + this.tabPage2.Controls.Add(this.HDLightsCheckBox); + this.tabPage2.Controls.Add(this.label19); + this.tabPage2.Controls.Add(this.HDRRenderingCheckBox); + this.tabPage2.Controls.Add(this.TimeOfDayTrackBar); + this.tabPage2.Controls.Add(this.ShadowsCheckBox); + this.tabPage2.Controls.Add(this.ControlLightDirCheckBox); + this.tabPage2.Controls.Add(this.SkydomeCheckBox); + this.tabPage2.Controls.Add(this.TimeOfDayLabel); + this.tabPage2.Location = new System.Drawing.Point(4, 22); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(209, 474); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "Lighting"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // DeferredShadingCheckBox + // + this.DeferredShadingCheckBox.AutoSize = true; + this.DeferredShadingCheckBox.Location = new System.Drawing.Point(7, 6); + this.DeferredShadingCheckBox.Name = "DeferredShadingCheckBox"; + this.DeferredShadingCheckBox.Size = new System.Drawing.Size(107, 17); + this.DeferredShadingCheckBox.TabIndex = 36; + this.DeferredShadingCheckBox.Text = "Deferred shading"; + this.DeferredShadingCheckBox.UseVisualStyleBackColor = true; + this.DeferredShadingCheckBox.CheckedChanged += new System.EventHandler(this.DeferredShadingCheckBox_CheckedChanged); + // + // HDLightsCheckBox + // + this.HDLightsCheckBox.AutoSize = true; + this.HDLightsCheckBox.Checked = true; + this.HDLightsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.HDLightsCheckBox.Location = new System.Drawing.Point(7, 98); + this.HDLightsCheckBox.Name = "HDLightsCheckBox"; + this.HDLightsCheckBox.Size = new System.Drawing.Size(69, 17); + this.HDLightsCheckBox.TabIndex = 35; + this.HDLightsCheckBox.Text = "HD lights"; + this.HDLightsCheckBox.UseVisualStyleBackColor = true; + this.HDLightsCheckBox.CheckedChanged += new System.EventHandler(this.HDLightsCheckBox_CheckedChanged); + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(4, 147); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(65, 13); + this.label19.TabIndex = 4; + this.label19.Text = "Time of day:"; // // HDRRenderingCheckBox // this.HDRRenderingCheckBox.AutoSize = true; this.HDRRenderingCheckBox.Checked = true; this.HDRRenderingCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.HDRRenderingCheckBox.Location = new System.Drawing.Point(19, 14); + this.HDRRenderingCheckBox.Location = new System.Drawing.Point(7, 29); this.HDRRenderingCheckBox.Name = "HDRRenderingCheckBox"; this.HDRRenderingCheckBox.Size = new System.Drawing.Size(97, 17); this.HDRRenderingCheckBox.TabIndex = 0; @@ -614,23 +746,27 @@ this.HDRRenderingCheckBox.UseVisualStyleBackColor = true; this.HDRRenderingCheckBox.CheckedChanged += new System.EventHandler(this.HDRRenderingCheckBox_CheckedChanged); // - // SkydomeCheckBox + // TimeOfDayTrackBar // - this.SkydomeCheckBox.AutoSize = true; - this.SkydomeCheckBox.Location = new System.Drawing.Point(19, 56); - this.SkydomeCheckBox.Name = "SkydomeCheckBox"; - this.SkydomeCheckBox.Size = new System.Drawing.Size(70, 17); - this.SkydomeCheckBox.TabIndex = 2; - this.SkydomeCheckBox.Text = "Skydome"; - this.SkydomeCheckBox.UseVisualStyleBackColor = true; - this.SkydomeCheckBox.CheckedChanged += new System.EventHandler(this.SkydomeCheckBox_CheckedChanged); + this.TimeOfDayTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.TimeOfDayTrackBar.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.TimeOfDayTrackBar.LargeChange = 60; + this.TimeOfDayTrackBar.Location = new System.Drawing.Point(3, 163); + this.TimeOfDayTrackBar.Maximum = 1440; + this.TimeOfDayTrackBar.Name = "TimeOfDayTrackBar"; + this.TimeOfDayTrackBar.Size = new System.Drawing.Size(205, 45); + this.TimeOfDayTrackBar.TabIndex = 6; + this.TimeOfDayTrackBar.TickFrequency = 60; + this.TimeOfDayTrackBar.Value = 720; + this.TimeOfDayTrackBar.Scroll += new System.EventHandler(this.TimeOfDayTrackBar_Scroll); // // ShadowsCheckBox // this.ShadowsCheckBox.AutoSize = true; this.ShadowsCheckBox.Checked = true; this.ShadowsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.ShadowsCheckBox.Location = new System.Drawing.Point(19, 35); + this.ShadowsCheckBox.Location = new System.Drawing.Point(7, 52); this.ShadowsCheckBox.Name = "ShadowsCheckBox"; this.ShadowsCheckBox.Size = new System.Drawing.Size(70, 17); this.ShadowsCheckBox.TabIndex = 1; @@ -638,102 +774,68 @@ this.ShadowsCheckBox.UseVisualStyleBackColor = true; this.ShadowsCheckBox.CheckedChanged += new System.EventHandler(this.ShadowsCheckBox_CheckedChanged); // - // WireframeCheckBox + // ControlLightDirCheckBox // - this.WireframeCheckBox.AutoSize = true; - this.WireframeCheckBox.Location = new System.Drawing.Point(19, 185); - this.WireframeCheckBox.Name = "WireframeCheckBox"; - this.WireframeCheckBox.Size = new System.Drawing.Size(74, 17); - this.WireframeCheckBox.TabIndex = 8; - this.WireframeCheckBox.Text = "Wireframe"; - this.WireframeCheckBox.UseVisualStyleBackColor = true; - this.WireframeCheckBox.CheckedChanged += new System.EventHandler(this.WireframeCheckBox_CheckedChanged); + this.ControlLightDirCheckBox.AutoSize = true; + this.ControlLightDirCheckBox.Location = new System.Drawing.Point(7, 121); + this.ControlLightDirCheckBox.Name = "ControlLightDirCheckBox"; + this.ControlLightDirCheckBox.Size = new System.Drawing.Size(124, 17); + this.ControlLightDirCheckBox.TabIndex = 3; + this.ControlLightDirCheckBox.Text = "Control light direction"; + this.ControlLightDirCheckBox.UseVisualStyleBackColor = true; + this.ControlLightDirCheckBox.CheckedChanged += new System.EventHandler(this.ControlLightDirCheckBox_CheckedChanged); // - // RenderModeComboBox + // SkydomeCheckBox // - this.RenderModeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.RenderModeComboBox.FormattingEnabled = true; - this.RenderModeComboBox.Items.AddRange(new object[] { - "Default", - "Single texture", - "Vertex normals", - "Vertex tangents", - "Vertex colour 1", - "Vertex colour 2", - "Texture coord 1", - "Texture coord 2", - "Texture coord 3"}); - this.RenderModeComboBox.Location = new System.Drawing.Point(83, 255); - this.RenderModeComboBox.Name = "RenderModeComboBox"; - this.RenderModeComboBox.Size = new System.Drawing.Size(114, 21); - this.RenderModeComboBox.TabIndex = 12; - this.RenderModeComboBox.SelectedIndexChanged += new System.EventHandler(this.RenderModeComboBox_SelectedIndexChanged); + this.SkydomeCheckBox.AutoSize = true; + this.SkydomeCheckBox.Location = new System.Drawing.Point(7, 75); + this.SkydomeCheckBox.Name = "SkydomeCheckBox"; + this.SkydomeCheckBox.Size = new System.Drawing.Size(70, 17); + this.SkydomeCheckBox.TabIndex = 2; + this.SkydomeCheckBox.Text = "Skydome"; + this.SkydomeCheckBox.UseVisualStyleBackColor = true; + this.SkydomeCheckBox.CheckedChanged += new System.EventHandler(this.SkydomeCheckBox_CheckedChanged); // - // label11 + // TimeOfDayLabel // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(7, 285); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(67, 13); - this.label11.TabIndex = 13; - this.label11.Text = "Tex sampler:"; + this.TimeOfDayLabel.AutoSize = true; + this.TimeOfDayLabel.Location = new System.Drawing.Point(75, 147); + this.TimeOfDayLabel.Name = "TimeOfDayLabel"; + this.TimeOfDayLabel.Size = new System.Drawing.Size(34, 13); + this.TimeOfDayLabel.TabIndex = 5; + this.TimeOfDayLabel.Text = "12:00"; // - // TextureSamplerComboBox + // tabPage3 // - this.TextureSamplerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.TextureSamplerComboBox.Enabled = false; - this.TextureSamplerComboBox.FormattingEnabled = true; - this.TextureSamplerComboBox.Location = new System.Drawing.Point(83, 282); - this.TextureSamplerComboBox.Name = "TextureSamplerComboBox"; - this.TextureSamplerComboBox.Size = new System.Drawing.Size(114, 21); - this.TextureSamplerComboBox.TabIndex = 14; - this.TextureSamplerComboBox.SelectedIndexChanged += new System.EventHandler(this.TextureSamplerComboBox_SelectedIndexChanged); + this.tabPage3.Controls.Add(this.LightEditorButton); + this.tabPage3.Controls.Add(this.MaterialEditorButton); + this.tabPage3.Location = new System.Drawing.Point(4, 22); + this.tabPage3.Name = "tabPage3"; + this.tabPage3.Padding = new System.Windows.Forms.Padding(3); + this.tabPage3.Size = new System.Drawing.Size(209, 474); + this.tabPage3.TabIndex = 2; + this.tabPage3.Text = "Editors"; + this.tabPage3.UseVisualStyleBackColor = true; // - // TextureCoordsComboBox + // LightEditorButton // - this.TextureCoordsComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.TextureCoordsComboBox.Enabled = false; - this.TextureCoordsComboBox.FormattingEnabled = true; - this.TextureCoordsComboBox.Items.AddRange(new object[] { - "Texture coord 1", - "Texture coord 2", - "Texture coord 3"}); - this.TextureCoordsComboBox.Location = new System.Drawing.Point(83, 309); - this.TextureCoordsComboBox.Name = "TextureCoordsComboBox"; - this.TextureCoordsComboBox.Size = new System.Drawing.Size(114, 21); - this.TextureCoordsComboBox.TabIndex = 16; - this.TextureCoordsComboBox.SelectedIndexChanged += new System.EventHandler(this.TextureCoordsComboBox_SelectedIndexChanged); + this.LightEditorButton.Location = new System.Drawing.Point(6, 35); + this.LightEditorButton.Name = "LightEditorButton"; + this.LightEditorButton.Size = new System.Drawing.Size(197, 23); + this.LightEditorButton.TabIndex = 37; + this.LightEditorButton.Text = "Light editor"; + this.LightEditorButton.UseVisualStyleBackColor = true; + this.LightEditorButton.Click += new System.EventHandler(this.LightEditorButton_Click); // - // label10 + // MaterialEditorButton // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(7, 258); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(74, 13); - this.label10.TabIndex = 11; - this.label10.Text = "Render mode:"; - // - // AnisotropicFilteringCheckBox - // - this.AnisotropicFilteringCheckBox.AutoSize = true; - this.AnisotropicFilteringCheckBox.Checked = true; - this.AnisotropicFilteringCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.AnisotropicFilteringCheckBox.Location = new System.Drawing.Point(19, 208); - this.AnisotropicFilteringCheckBox.Name = "AnisotropicFilteringCheckBox"; - this.AnisotropicFilteringCheckBox.Size = new System.Drawing.Size(114, 17); - this.AnisotropicFilteringCheckBox.TabIndex = 9; - this.AnisotropicFilteringCheckBox.Text = "Anisotropic filtering"; - this.AnisotropicFilteringCheckBox.UseVisualStyleBackColor = true; - this.AnisotropicFilteringCheckBox.CheckedChanged += new System.EventHandler(this.AnisotropicFilteringCheckBox_CheckedChanged); - // - // label14 - // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(7, 312); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(63, 13); - this.label14.TabIndex = 15; - this.label14.Text = "Tex coords:"; + this.MaterialEditorButton.Location = new System.Drawing.Point(6, 6); + this.MaterialEditorButton.Name = "MaterialEditorButton"; + this.MaterialEditorButton.Size = new System.Drawing.Size(197, 23); + this.MaterialEditorButton.TabIndex = 3; + this.MaterialEditorButton.Text = "Material editor"; + this.MaterialEditorButton.UseVisualStyleBackColor = true; + this.MaterialEditorButton.Click += new System.EventHandler(this.MaterialEditorButton_Click); // // ToolsPanelHideButton // @@ -772,17 +874,6 @@ // this.SaveFileDialog.Filter = "All files|*.*"; // - // FragGlassCheckBox - // - this.FragGlassCheckBox.AutoSize = true; - this.FragGlassCheckBox.Location = new System.Drawing.Point(19, 449); - this.FragGlassCheckBox.Name = "FragGlassCheckBox"; - this.FragGlassCheckBox.Size = new System.Drawing.Size(175, 17); - this.FragGlassCheckBox.TabIndex = 25; - this.FragGlassCheckBox.Text = "Show Fragments Glass Outlines"; - this.FragGlassCheckBox.UseVisualStyleBackColor = true; - this.FragGlassCheckBox.CheckedChanged += new System.EventHandler(this.FragGlassCheckBox_CheckedChanged); - // // ModelForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -819,8 +910,13 @@ this.ToolsMaterialsTabPage.ResumeLayout(false); this.ToolsDetailsTabPage.ResumeLayout(false); this.ToolsOptionsTabPage.ResumeLayout(false); - this.ToolsOptionsTabPage.PerformLayout(); + this.OptionsTabControl.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.tabPage1.PerformLayout(); + this.tabPage2.ResumeLayout(false); + this.tabPage2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.TimeOfDayTrackBar)).EndInit(); + this.tabPage3.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -886,5 +982,12 @@ private System.Windows.Forms.Label label21; private System.Windows.Forms.ComboBox ClipDictComboBox; private System.Windows.Forms.CheckBox FragGlassCheckBox; + private System.Windows.Forms.TabControl OptionsTabControl; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.CheckBox HDLightsCheckBox; + private System.Windows.Forms.CheckBox DeferredShadingCheckBox; + private System.Windows.Forms.TabPage tabPage3; + private System.Windows.Forms.Button LightEditorButton; } } \ No newline at end of file diff --git a/CodeWalker/Forms/ModelForm.cs b/CodeWalker/Forms/ModelForm.cs index e281449..92438d5 100644 --- a/CodeWalker/Forms/ModelForm.cs +++ b/CodeWalker/Forms/ModelForm.cs @@ -103,6 +103,13 @@ namespace CodeWalker.Forms ModelMatForm materialForm = null; bool modelModified = false; + TransformWidget Widget = new TransformWidget(); + TransformWidget GrabbedWidget = null; + ModelLightForm lightForm = null; + bool editingLights = false; + public LightAttributes selectedLight = null; + public bool showLightGizmos = true; + ExploreForm exploreForm = null; RpfFileEntry rpfFileEntry = null; @@ -166,6 +173,13 @@ namespace CodeWalker.Forms return; } + Widget.Position = new Vector3(0f, 0f, 0f); + Widget.Rotation = Quaternion.Identity; + Widget.Scale = Vector3.One; + Widget.Visible = false; + Widget.OnPositionChange += Widget_OnPositionChange; + Widget.OnRotationChange += Widget_OnRotationChange; + ShaderParamNames[] texsamplers = RenderableGeometry.GetTextureSamplerList(); foreach (var texsampler in texsamplers) { @@ -259,6 +273,7 @@ namespace CodeWalker.Forms Renderer.Update(elapsed, MouseLastPoint.X, MouseLastPoint.Y); + UpdateWidgets(); Renderer.BeginRender(context); @@ -270,6 +285,7 @@ namespace CodeWalker.Forms RenderGrid(context); + RenderLightSelection(); Renderer.RenderQueued(); @@ -277,6 +293,7 @@ namespace CodeWalker.Forms Renderer.RenderFinalPass(); + RenderWidgets(); Renderer.EndRender(); @@ -520,10 +537,98 @@ namespace CodeWalker.Forms } } + public void SetCameraPosition(Vector3 p, float distance = 2.0f) + { + Renderer.camera.FollowEntity.Position = p; + camera.TargetDistance = distance; + } + private void RenderLightSelection() + { + if (editingLights) + { + if (selectedLight != null) + { + if (showLightGizmos) + { + Renderer.RenderSelectionDrawableLight(selectedLight); + } + } + } + } - - + private void RenderWidgets() + { + if (Widget.Visible) + { + Renderer.RenderTransformWidget(Widget); + } + } + private void UpdateWidgets() + { + Widget.Update(camera); + } + public void UpdateWidget(bool rotate = false) + { + if(selectedLight != null) + { + if (!rotate) + { + SetWidgetPosition(selectedLight.Position); + } + else + { + SetWidgetRotation(selectedLight.GetRotation()); + } + } + } + public void SetWidgetPosition(Vector3 pos) + { + SetWidgetMode("Position"); + Widget.Position = pos; + } + public void SetWidgetRotation(Quaternion q) + { + SetWidgetMode("Rotation"); + Widget.Rotation = q; + } + public void SetWidgetMode(string mode) + { + lock (Renderer.RenderSyncRoot) + { + switch (mode) + { + case "Default": + Widget.Mode = WidgetMode.Default; + break; + case "Position": + Widget.Mode = WidgetMode.Position; + break; + case "Rotation": + Widget.Mode = WidgetMode.Rotation; + break; + case "Scale": + Widget.Mode = WidgetMode.Scale; + break; + } + } + } + private void Widget_OnPositionChange(Vector3 newpos, Vector3 oldpos) + { + //called during UpdateWidgets() + if (newpos == oldpos) return; + if (selectedLight == null || lightForm == null || !editingLights) return; + selectedLight.Position = newpos; + selectedLight.HasChanged = true; + } + private void Widget_OnRotationChange(Quaternion newrot, Quaternion oldrot) + { + //called during UpdateWidgets() + if (newrot == oldrot) return; + if (selectedLight == null || lightForm == null || !editingLights) return; + selectedLight.SetRotation(newrot); + selectedLight.HasChanged = true; + } private void RenderSingleItem() @@ -631,6 +736,11 @@ namespace CodeWalker.Forms MoveCameraToView(ydr.Drawable.BoundingCenter, ydr.Drawable.BoundingSphereRadius); } + if(ydr.Drawable?.LightAttributes.data_items.Length > 0) + { + DeferredShadingCheckBox.Checked = true; + } + UpdateModelsUI(ydr.Drawable); } public void LoadModels(YddFile ydd) @@ -651,6 +761,15 @@ namespace CodeWalker.Forms MoveCameraToView(Vector3.Zero, maxrad); } + foreach(var draw in ydd.Drawables) + { + if (draw?.LightAttributes.data_items.Length > 0) + { + DeferredShadingCheckBox.Checked = true; + break; + } + } + UpdateModelsUI(ydd.Dict); DetailsPropertyGrid.SelectedObject = ydd; @@ -680,6 +799,11 @@ namespace CodeWalker.Forms MoveCameraToView(dr.BoundingCenter, dr.BoundingSphereRadius); } + if (yft.Fragment?.LightAttributes.data_items.Length > 0) + { + DeferredShadingCheckBox.Checked = true; + } + UpdateModelsUI(yft.Fragment?.Drawable, yft.Fragment); } public void LoadModel(YbnFile ybn) @@ -1220,7 +1344,13 @@ namespace CodeWalker.Forms } - + public void OnLightFormClosed() + { + lightForm = null; + editingLights = false; + selectedLight = null; + Widget.Visible = false; + } public void OnMaterialFormClosed() { @@ -1409,6 +1539,23 @@ namespace CodeWalker.Forms MouseDownPoint = e.Location; MouseLastPoint = MouseDownPoint; + if (MouseLButtonDown) + { + if (Widget.IsUnderMouse && !Input.kbmoving) + { + GrabbedWidget = Widget; + GrabbedWidget.IsDragging = true; + } + } + else + { + if (GrabbedWidget != null) + { + GrabbedWidget.IsDragging = false; + GrabbedWidget = null; + } + } + if (MouseRButtonDown) { @@ -1427,11 +1574,20 @@ namespace CodeWalker.Forms case MouseButtons.Right: MouseRButtonDown = false; break; } + if (e.Button == MouseButtons.Left) + { + if (GrabbedWidget != null) + { + GrabbedWidget.IsDragging = false; + //GrabbedWidget.Position = SelectedItem.WidgetPosition;//in case of any snapping, make sure widget is in correct position at the end + GrabbedWidget = null; + lightForm.UpdateUI(); //do this so position and direction textboxes are updated after a drag + } + } //lock (MouseControlSyncRoot) //{ // MouseControlButtons &= ~e.Button; //} - } private void ModelForm_MouseMove(object sender, MouseEventArgs e) @@ -1446,7 +1602,10 @@ namespace CodeWalker.Forms if (MouseLButtonDown) { - camera.MouseRotate(dx, dy); + if (GrabbedWidget == null) + { + camera.MouseRotate(dx, dy); + } } if (MouseRButtonDown) { @@ -1979,6 +2138,59 @@ namespace CodeWalker.Forms } + private void LightEditorButton_Click(object sender, EventArgs e) + { + DrawableBase drawable = null; + Dictionary dict = null; + + if ((Ydr != null) && (Ydr.Loaded)) + { + drawable = Ydr.Drawable; + } + else if ((Ydd != null) && (Ydd.Loaded)) + { + dict = Ydd.Dict; + } + else if ((Yft != null) && (Yft.Loaded)) + { + drawable = Yft.Fragment?.Drawable; + } + else if ((Ypt != null) && (Ypt.Loaded)) + { + //dict = Ypt.DrawableDict; + } + else + { + MessageBox.Show("Light editor not supported for the current file."); + } + + if (lightForm == null) + { + lightForm = new ModelLightForm(this); + + if (drawable != null) + { + lightForm.LoadModel(drawable); + } + else if (dict != null) + { + lightForm.LoadModels(dict); + } + + editingLights = true; + Widget.Visible = true; + lightForm.Show(this); + } + else + { + if (lightForm.WindowState == FormWindowState.Minimized) + { + lightForm.WindowState = FormWindowState.Normal; + } + lightForm.Focus(); + } + } + private void SaveButton_ButtonClick(object sender, EventArgs e) { Save(); @@ -2008,5 +2220,15 @@ namespace CodeWalker.Forms { EnableRootMotion = EnableRootMotionCheckBox.Checked; } + + private void DeferredShadingCheckBox_CheckedChanged(object sender, EventArgs e) + { + Renderer.shaders.deferred = DeferredShadingCheckBox.Checked; + } + + private void HDLightsCheckBox_CheckedChanged(object sender, EventArgs e) + { + Renderer.renderlights = HDLightsCheckBox.Checked; + } } } diff --git a/CodeWalker/Forms/ModelLightForm.Designer.cs b/CodeWalker/Forms/ModelLightForm.Designer.cs new file mode 100644 index 0000000..19f4e75 --- /dev/null +++ b/CodeWalker/Forms/ModelLightForm.Designer.cs @@ -0,0 +1,1183 @@ +namespace CodeWalker.Forms +{ + partial class ModelLightForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ModelLightForm)); + this.MainSplitContainer = new System.Windows.Forms.SplitContainer(); + this.LightsTreeView = new CodeWalker.WinForms.TreeViewFix(); + this.label1 = new System.Windows.Forms.Label(); + this.LightPropertiesPanel = new System.Windows.Forms.Panel(); + this.label30 = new System.Windows.Forms.Label(); + this.CullingPlaneOffsetTextBox = new System.Windows.Forms.TextBox(); + this.label24 = new System.Windows.Forms.Label(); + this.CullingPlaneNormalTextBox = new System.Windows.Forms.TextBox(); + this.GroupIDTextBox = new System.Windows.Forms.TextBox(); + this.BoneIDTextBox = new System.Windows.Forms.TextBox(); + this.label29 = new System.Windows.Forms.Label(); + this.TimeFlagsPMCheckedListBox = new System.Windows.Forms.CheckedListBox(); + this.TimeFlagsAMCheckedListBox = new System.Windows.Forms.CheckedListBox(); + this.ExtentTextBox = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.label28 = new System.Windows.Forms.Label(); + this.TimeFlagsTextBox = new System.Windows.Forms.TextBox(); + this.CoronaZBiasTextBox = new System.Windows.Forms.TextBox(); + this.label27 = new System.Windows.Forms.Label(); + this.ShadowNearClipTextBox = new System.Windows.Forms.TextBox(); + this.label26 = new System.Windows.Forms.Label(); + this.VolumetricFadeDistanceTextBox = new System.Windows.Forms.TextBox(); + this.label25 = new System.Windows.Forms.Label(); + this.SpecularFadeDistanceTextBox = new System.Windows.Forms.TextBox(); + this.VolumeColorBUpDown = new System.Windows.Forms.NumericUpDown(); + this.VolumeColorGUpDown = new System.Windows.Forms.NumericUpDown(); + this.VolumeColorRUpDown = new System.Windows.Forms.NumericUpDown(); + this.VolumeColorLabel = new System.Windows.Forms.Label(); + this.label22 = new System.Windows.Forms.Label(); + this.ShadowFadeDistanceTextBox = new System.Windows.Forms.TextBox(); + this.label23 = new System.Windows.Forms.Label(); + this.LightFadeDistanceTextBox = new System.Windows.Forms.TextBox(); + this.label21 = new System.Windows.Forms.Label(); + this.VolumeOuterExponentTextBox = new System.Windows.Forms.TextBox(); + this.label20 = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + this.VolumeSizeScaleTextBox = new System.Windows.Forms.TextBox(); + this.label18 = new System.Windows.Forms.Label(); + this.VolumeIntensityTextBox = new System.Windows.Forms.TextBox(); + this.label16 = new System.Windows.Forms.Label(); + this.ShadowBlurTextBox = new System.Windows.Forms.TextBox(); + this.label12 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.FlashinessTextBox = new System.Windows.Forms.TextBox(); + this.label15 = new System.Windows.Forms.Label(); + this.CoronaSizeTextBox = new System.Windows.Forms.TextBox(); + this.label14 = new System.Windows.Forms.Label(); + this.ColourBUpDown = new System.Windows.Forms.NumericUpDown(); + this.ColourGUpDown = new System.Windows.Forms.NumericUpDown(); + this.ColourRUpDown = new System.Windows.Forms.NumericUpDown(); + this.CoronaIntensityUpDown = new System.Windows.Forms.NumericUpDown(); + this.label9 = new System.Windows.Forms.Label(); + this.OuterAngleUpDown = new System.Windows.Forms.NumericUpDown(); + this.label8 = new System.Windows.Forms.Label(); + this.InnerAngleUpDown = new System.Windows.Forms.NumericUpDown(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.HashTextBox = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.FalloffExponentTextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.FalloffTextBox = new System.Windows.Forms.TextBox(); + this.TypeComboBox = new System.Windows.Forms.ComboBox(); + this.IntensityUpDown = new System.Windows.Forms.NumericUpDown(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.ColourLabel = new System.Windows.Forms.Label(); + this.NormalizeDirectionButton = new System.Windows.Forms.Button(); + this.label17 = new System.Windows.Forms.Label(); + this.DirectionTextBox = new System.Windows.Forms.TextBox(); + this.GoToButton = new System.Windows.Forms.Button(); + this.PositionTextBox = new System.Windows.Forms.TextBox(); + this.label31 = new System.Windows.Forms.Label(); + this.menuStripFix1 = new CodeWalker.WinForms.MenuStripFix(); + this.createToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.lightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.deleteLightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.showGizmosToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.moveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.rotateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + ((System.ComponentModel.ISupportInitialize)(this.MainSplitContainer)).BeginInit(); + this.MainSplitContainer.Panel1.SuspendLayout(); + this.MainSplitContainer.Panel2.SuspendLayout(); + this.MainSplitContainer.SuspendLayout(); + this.LightPropertiesPanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.VolumeColorBUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.VolumeColorGUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.VolumeColorRUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.ColourBUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.ColourGUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.ColourRUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.CoronaIntensityUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.OuterAngleUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.InnerAngleUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.IntensityUpDown)).BeginInit(); + this.menuStripFix1.SuspendLayout(); + this.SuspendLayout(); + // + // MainSplitContainer + // + this.MainSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.MainSplitContainer.Location = new System.Drawing.Point(0, 24); + this.MainSplitContainer.Name = "MainSplitContainer"; + // + // MainSplitContainer.Panel1 + // + this.MainSplitContainer.Panel1.Controls.Add(this.LightsTreeView); + this.MainSplitContainer.Panel1.Controls.Add(this.label1); + // + // MainSplitContainer.Panel2 + // + this.MainSplitContainer.Panel2.Controls.Add(this.LightPropertiesPanel); + this.MainSplitContainer.Size = new System.Drawing.Size(732, 544); + this.MainSplitContainer.SplitterDistance = 171; + this.MainSplitContainer.TabIndex = 0; + // + // LightsTreeView + // + this.LightsTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.LightsTreeView.FullRowSelect = true; + this.LightsTreeView.HideSelection = false; + this.LightsTreeView.Location = new System.Drawing.Point(3, 24); + this.LightsTreeView.Name = "LightsTreeView"; + this.LightsTreeView.ShowRootLines = false; + this.LightsTreeView.Size = new System.Drawing.Size(192, 521); + this.LightsTreeView.TabIndex = 5; + this.LightsTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.LightsTreeView_AfterSelect); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(62, 13); + this.label1.TabIndex = 4; + this.label1.Text = "Select light:"; + // + // LightPropertiesPanel + // + this.LightPropertiesPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.LightPropertiesPanel.AutoScroll = true; + this.LightPropertiesPanel.Controls.Add(this.label30); + this.LightPropertiesPanel.Controls.Add(this.CullingPlaneOffsetTextBox); + this.LightPropertiesPanel.Controls.Add(this.label24); + this.LightPropertiesPanel.Controls.Add(this.CullingPlaneNormalTextBox); + this.LightPropertiesPanel.Controls.Add(this.GroupIDTextBox); + this.LightPropertiesPanel.Controls.Add(this.BoneIDTextBox); + this.LightPropertiesPanel.Controls.Add(this.label29); + this.LightPropertiesPanel.Controls.Add(this.TimeFlagsPMCheckedListBox); + this.LightPropertiesPanel.Controls.Add(this.TimeFlagsAMCheckedListBox); + this.LightPropertiesPanel.Controls.Add(this.ExtentTextBox); + this.LightPropertiesPanel.Controls.Add(this.label10); + this.LightPropertiesPanel.Controls.Add(this.label28); + this.LightPropertiesPanel.Controls.Add(this.TimeFlagsTextBox); + this.LightPropertiesPanel.Controls.Add(this.CoronaZBiasTextBox); + this.LightPropertiesPanel.Controls.Add(this.label27); + this.LightPropertiesPanel.Controls.Add(this.ShadowNearClipTextBox); + this.LightPropertiesPanel.Controls.Add(this.label26); + this.LightPropertiesPanel.Controls.Add(this.VolumetricFadeDistanceTextBox); + this.LightPropertiesPanel.Controls.Add(this.label25); + this.LightPropertiesPanel.Controls.Add(this.SpecularFadeDistanceTextBox); + this.LightPropertiesPanel.Controls.Add(this.VolumeColorBUpDown); + this.LightPropertiesPanel.Controls.Add(this.VolumeColorGUpDown); + this.LightPropertiesPanel.Controls.Add(this.VolumeColorRUpDown); + this.LightPropertiesPanel.Controls.Add(this.VolumeColorLabel); + this.LightPropertiesPanel.Controls.Add(this.label22); + this.LightPropertiesPanel.Controls.Add(this.ShadowFadeDistanceTextBox); + this.LightPropertiesPanel.Controls.Add(this.label23); + this.LightPropertiesPanel.Controls.Add(this.LightFadeDistanceTextBox); + this.LightPropertiesPanel.Controls.Add(this.label21); + this.LightPropertiesPanel.Controls.Add(this.VolumeOuterExponentTextBox); + this.LightPropertiesPanel.Controls.Add(this.label20); + this.LightPropertiesPanel.Controls.Add(this.label19); + this.LightPropertiesPanel.Controls.Add(this.VolumeSizeScaleTextBox); + this.LightPropertiesPanel.Controls.Add(this.label18); + this.LightPropertiesPanel.Controls.Add(this.VolumeIntensityTextBox); + this.LightPropertiesPanel.Controls.Add(this.label16); + this.LightPropertiesPanel.Controls.Add(this.ShadowBlurTextBox); + this.LightPropertiesPanel.Controls.Add(this.label12); + this.LightPropertiesPanel.Controls.Add(this.label11); + this.LightPropertiesPanel.Controls.Add(this.FlashinessTextBox); + this.LightPropertiesPanel.Controls.Add(this.label15); + this.LightPropertiesPanel.Controls.Add(this.CoronaSizeTextBox); + this.LightPropertiesPanel.Controls.Add(this.label14); + this.LightPropertiesPanel.Controls.Add(this.ColourBUpDown); + this.LightPropertiesPanel.Controls.Add(this.ColourGUpDown); + this.LightPropertiesPanel.Controls.Add(this.ColourRUpDown); + this.LightPropertiesPanel.Controls.Add(this.CoronaIntensityUpDown); + this.LightPropertiesPanel.Controls.Add(this.label9); + this.LightPropertiesPanel.Controls.Add(this.OuterAngleUpDown); + this.LightPropertiesPanel.Controls.Add(this.label8); + this.LightPropertiesPanel.Controls.Add(this.InnerAngleUpDown); + this.LightPropertiesPanel.Controls.Add(this.label7); + this.LightPropertiesPanel.Controls.Add(this.label6); + this.LightPropertiesPanel.Controls.Add(this.HashTextBox); + this.LightPropertiesPanel.Controls.Add(this.label5); + this.LightPropertiesPanel.Controls.Add(this.FalloffExponentTextBox); + this.LightPropertiesPanel.Controls.Add(this.label4); + this.LightPropertiesPanel.Controls.Add(this.FalloffTextBox); + this.LightPropertiesPanel.Controls.Add(this.TypeComboBox); + this.LightPropertiesPanel.Controls.Add(this.IntensityUpDown); + this.LightPropertiesPanel.Controls.Add(this.label3); + this.LightPropertiesPanel.Controls.Add(this.label2); + this.LightPropertiesPanel.Controls.Add(this.label13); + this.LightPropertiesPanel.Controls.Add(this.ColourLabel); + this.LightPropertiesPanel.Controls.Add(this.NormalizeDirectionButton); + this.LightPropertiesPanel.Controls.Add(this.label17); + this.LightPropertiesPanel.Controls.Add(this.DirectionTextBox); + this.LightPropertiesPanel.Controls.Add(this.GoToButton); + this.LightPropertiesPanel.Controls.Add(this.PositionTextBox); + this.LightPropertiesPanel.Controls.Add(this.label31); + this.LightPropertiesPanel.Location = new System.Drawing.Point(4, 3); + this.LightPropertiesPanel.Name = "LightPropertiesPanel"; + this.LightPropertiesPanel.Size = new System.Drawing.Size(550, 537); + this.LightPropertiesPanel.TabIndex = 1; + // + // label30 + // + this.label30.AutoSize = true; + this.label30.Location = new System.Drawing.Point(261, 301); + this.label30.Name = "label30"; + this.label30.Size = new System.Drawing.Size(99, 13); + this.label30.TabIndex = 218; + this.label30.Text = "Culling plane offset:"; + // + // CullingPlaneOffsetTextBox + // + this.CullingPlaneOffsetTextBox.Location = new System.Drawing.Point(365, 296); + this.CullingPlaneOffsetTextBox.Name = "CullingPlaneOffsetTextBox"; + this.CullingPlaneOffsetTextBox.Size = new System.Drawing.Size(156, 20); + this.CullingPlaneOffsetTextBox.TabIndex = 219; + this.CullingPlaneOffsetTextBox.TextChanged += new System.EventHandler(this.CullingPlaneOffsetTextBox_TextChanged); + // + // label24 + // + this.label24.AutoSize = true; + this.label24.Location = new System.Drawing.Point(261, 275); + this.label24.Name = "label24"; + this.label24.Size = new System.Drawing.Size(104, 13); + this.label24.TabIndex = 216; + this.label24.Text = "Culling plane normal:"; + // + // CullingPlaneNormalTextBox + // + this.CullingPlaneNormalTextBox.Location = new System.Drawing.Point(365, 270); + this.CullingPlaneNormalTextBox.Name = "CullingPlaneNormalTextBox"; + this.CullingPlaneNormalTextBox.Size = new System.Drawing.Size(156, 20); + this.CullingPlaneNormalTextBox.TabIndex = 217; + this.CullingPlaneNormalTextBox.TextChanged += new System.EventHandler(this.CullingPlaneNormalTextBox_TextChanged); + // + // GroupIDTextBox + // + this.GroupIDTextBox.Location = new System.Drawing.Point(88, 195); + this.GroupIDTextBox.Name = "GroupIDTextBox"; + this.GroupIDTextBox.Size = new System.Drawing.Size(154, 20); + this.GroupIDTextBox.TabIndex = 215; + this.GroupIDTextBox.TextChanged += new System.EventHandler(this.GroupIDTextBox_TextChanged); + // + // BoneIDTextBox + // + this.BoneIDTextBox.Location = new System.Drawing.Point(88, 169); + this.BoneIDTextBox.Name = "BoneIDTextBox"; + this.BoneIDTextBox.Size = new System.Drawing.Size(154, 20); + this.BoneIDTextBox.TabIndex = 214; + this.BoneIDTextBox.TextChanged += new System.EventHandler(this.BoneIDTextBox_TextChanged); + // + // label29 + // + this.label29.AutoSize = true; + this.label29.Location = new System.Drawing.Point(10, 380); + this.label29.Name = "label29"; + this.label29.Size = new System.Drawing.Size(40, 13); + this.label29.TabIndex = 212; + this.label29.Text = "Extent:"; + // + // TimeFlagsPMCheckedListBox + // + this.TimeFlagsPMCheckedListBox.CheckOnClick = true; + this.TimeFlagsPMCheckedListBox.FormattingEnabled = true; + this.TimeFlagsPMCheckedListBox.Items.AddRange(new object[] { + "12:00 - 13:00", + "13:00 - 14:00", + "14:00 - 15:00", + "15:00 - 16:00", + "16:00 - 17:00", + "17:00 - 18:00", + "18:00 - 19:00", + "19:00 - 20:00", + "20:00 - 21:00", + "21:00 - 22:00", + "22:00 - 23:00", + "23:00 - 00:00"}); + this.TimeFlagsPMCheckedListBox.Location = new System.Drawing.Point(426, 348); + this.TimeFlagsPMCheckedListBox.Name = "TimeFlagsPMCheckedListBox"; + this.TimeFlagsPMCheckedListBox.Size = new System.Drawing.Size(95, 184); + this.TimeFlagsPMCheckedListBox.TabIndex = 168; + this.TimeFlagsPMCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.TimeFlagsPMCheckedListBox_ItemCheck); + // + // TimeFlagsAMCheckedListBox + // + this.TimeFlagsAMCheckedListBox.CheckOnClick = true; + this.TimeFlagsAMCheckedListBox.FormattingEnabled = true; + this.TimeFlagsAMCheckedListBox.Items.AddRange(new object[] { + "00:00 - 01:00", + "01:00 - 02:00", + "02:00 - 03:00", + "03:00 - 04:00", + "04:00 - 05:00", + "05:00 - 06:00", + "06:00 - 07:00", + "07:00 - 08:00", + "08:00 - 09:00", + "09:00 - 10:00", + "10:00 - 11:00", + "11:00 - 12:00"}); + this.TimeFlagsAMCheckedListBox.Location = new System.Drawing.Point(325, 348); + this.TimeFlagsAMCheckedListBox.Name = "TimeFlagsAMCheckedListBox"; + this.TimeFlagsAMCheckedListBox.Size = new System.Drawing.Size(95, 184); + this.TimeFlagsAMCheckedListBox.TabIndex = 167; + this.TimeFlagsAMCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.TimeFlagsAMCheckedListBox_ItemCheck); + // + // ExtentTextBox + // + this.ExtentTextBox.Location = new System.Drawing.Point(88, 377); + this.ExtentTextBox.Name = "ExtentTextBox"; + this.ExtentTextBox.Size = new System.Drawing.Size(154, 20); + this.ExtentTextBox.TabIndex = 213; + this.ExtentTextBox.TextChanged += new System.EventHandler(this.ExtentTextBox_TextChanged); + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(261, 328); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(58, 13); + this.label10.TabIndex = 169; + this.label10.Text = "Time flags:"; + // + // label28 + // + this.label28.AutoSize = true; + this.label28.Location = new System.Drawing.Point(10, 458); + this.label28.Name = "label28"; + this.label28.Size = new System.Drawing.Size(71, 13); + this.label28.TabIndex = 210; + this.label28.Text = "Corona zbias:"; + // + // TimeFlagsTextBox + // + this.TimeFlagsTextBox.Location = new System.Drawing.Point(365, 322); + this.TimeFlagsTextBox.Name = "TimeFlagsTextBox"; + this.TimeFlagsTextBox.Size = new System.Drawing.Size(156, 20); + this.TimeFlagsTextBox.TabIndex = 170; + this.TimeFlagsTextBox.TextChanged += new System.EventHandler(this.TimeFlagsTextBox_TextChanged); + // + // CoronaZBiasTextBox + // + this.CoronaZBiasTextBox.Location = new System.Drawing.Point(88, 455); + this.CoronaZBiasTextBox.Name = "CoronaZBiasTextBox"; + this.CoronaZBiasTextBox.Size = new System.Drawing.Size(154, 20); + this.CoronaZBiasTextBox.TabIndex = 211; + this.CoronaZBiasTextBox.TextChanged += new System.EventHandler(this.CoronaZBiasTextBox_TextChanged); + // + // label27 + // + this.label27.AutoSize = true; + this.label27.Location = new System.Drawing.Point(261, 247); + this.label27.Name = "label27"; + this.label27.Size = new System.Drawing.Size(92, 13); + this.label27.TabIndex = 208; + this.label27.Text = "Shadow near clip:"; + // + // ShadowNearClipTextBox + // + this.ShadowNearClipTextBox.Location = new System.Drawing.Point(365, 244); + this.ShadowNearClipTextBox.Name = "ShadowNearClipTextBox"; + this.ShadowNearClipTextBox.Size = new System.Drawing.Size(156, 20); + this.ShadowNearClipTextBox.TabIndex = 209; + this.ShadowNearClipTextBox.TextChanged += new System.EventHandler(this.ShadowNearClipTextBox_TextChanged); + // + // label26 + // + this.label26.AutoSize = true; + this.label26.Location = new System.Drawing.Point(261, 221); + this.label26.Name = "label26"; + this.label26.Size = new System.Drawing.Size(100, 13); + this.label26.TabIndex = 206; + this.label26.Text = "Volumetric fade dst:"; + // + // VolumetricFadeDistanceTextBox + // + this.VolumetricFadeDistanceTextBox.Location = new System.Drawing.Point(365, 218); + this.VolumetricFadeDistanceTextBox.Name = "VolumetricFadeDistanceTextBox"; + this.VolumetricFadeDistanceTextBox.Size = new System.Drawing.Size(156, 20); + this.VolumetricFadeDistanceTextBox.TabIndex = 207; + this.VolumetricFadeDistanceTextBox.TextChanged += new System.EventHandler(this.VolumetricFadeDistance_TextChanged); + // + // label25 + // + this.label25.AutoSize = true; + this.label25.Location = new System.Drawing.Point(261, 195); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(93, 13); + this.label25.TabIndex = 204; + this.label25.Text = "Specular fade dst:"; + // + // SpecularFadeDistanceTextBox + // + this.SpecularFadeDistanceTextBox.Location = new System.Drawing.Point(365, 192); + this.SpecularFadeDistanceTextBox.Name = "SpecularFadeDistanceTextBox"; + this.SpecularFadeDistanceTextBox.Size = new System.Drawing.Size(156, 20); + this.SpecularFadeDistanceTextBox.TabIndex = 205; + this.SpecularFadeDistanceTextBox.TextChanged += new System.EventHandler(this.SpecularFadeDistanceTextBox_TextChanged); + // + // VolumeColorBUpDown + // + this.VolumeColorBUpDown.Location = new System.Drawing.Point(483, 115); + this.VolumeColorBUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.VolumeColorBUpDown.Name = "VolumeColorBUpDown"; + this.VolumeColorBUpDown.Size = new System.Drawing.Size(38, 20); + this.VolumeColorBUpDown.TabIndex = 203; + this.VolumeColorBUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.VolumeColorBUpDown.ValueChanged += new System.EventHandler(this.VolumeColorBUpDown_ValueChanged); + // + // VolumeColorGUpDown + // + this.VolumeColorGUpDown.Location = new System.Drawing.Point(440, 115); + this.VolumeColorGUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.VolumeColorGUpDown.Name = "VolumeColorGUpDown"; + this.VolumeColorGUpDown.Size = new System.Drawing.Size(38, 20); + this.VolumeColorGUpDown.TabIndex = 202; + this.VolumeColorGUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.VolumeColorGUpDown.ValueChanged += new System.EventHandler(this.VolumeColorGUpDown_ValueChanged); + // + // VolumeColorRUpDown + // + this.VolumeColorRUpDown.Location = new System.Drawing.Point(399, 115); + this.VolumeColorRUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.VolumeColorRUpDown.Name = "VolumeColorRUpDown"; + this.VolumeColorRUpDown.Size = new System.Drawing.Size(38, 20); + this.VolumeColorRUpDown.TabIndex = 201; + this.VolumeColorRUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.VolumeColorRUpDown.ValueChanged += new System.EventHandler(this.VolumeColorRUpDown_ValueChanged); + // + // VolumeColorLabel + // + this.VolumeColorLabel.BackColor = System.Drawing.Color.White; + this.VolumeColorLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.VolumeColorLabel.Location = new System.Drawing.Point(365, 114); + this.VolumeColorLabel.Name = "VolumeColorLabel"; + this.VolumeColorLabel.Size = new System.Drawing.Size(30, 21); + this.VolumeColorLabel.TabIndex = 200; + this.VolumeColorLabel.Click += new System.EventHandler(this.VolumeColorLabel_Click); + // + // label22 + // + this.label22.AutoSize = true; + this.label22.Location = new System.Drawing.Point(261, 169); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(90, 13); + this.label22.TabIndex = 198; + this.label22.Text = "Shadow fade dst:"; + // + // ShadowFadeDistanceTextBox + // + this.ShadowFadeDistanceTextBox.Location = new System.Drawing.Point(365, 166); + this.ShadowFadeDistanceTextBox.Name = "ShadowFadeDistanceTextBox"; + this.ShadowFadeDistanceTextBox.Size = new System.Drawing.Size(156, 20); + this.ShadowFadeDistanceTextBox.TabIndex = 199; + this.ShadowFadeDistanceTextBox.TextChanged += new System.EventHandler(this.ShadowFadeDistanceTextBox_TextChanged); + // + // label23 + // + this.label23.AutoSize = true; + this.label23.Location = new System.Drawing.Point(10, 432); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(74, 13); + this.label23.TabIndex = 196; + this.label23.Text = "Light fade dst:"; + // + // LightFadeDistanceTextBox + // + this.LightFadeDistanceTextBox.Location = new System.Drawing.Point(88, 429); + this.LightFadeDistanceTextBox.Name = "LightFadeDistanceTextBox"; + this.LightFadeDistanceTextBox.Size = new System.Drawing.Size(154, 20); + this.LightFadeDistanceTextBox.TabIndex = 197; + this.LightFadeDistanceTextBox.TextChanged += new System.EventHandler(this.LightFadeDistanceTextBox_TextChanged); + // + // label21 + // + this.label21.AutoSize = true; + this.label21.Location = new System.Drawing.Point(259, 144); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(92, 13); + this.label21.TabIndex = 194; + this.label21.Text = "Volume outer exp:"; + // + // VolumeOuterExponentTextBox + // + this.VolumeOuterExponentTextBox.Location = new System.Drawing.Point(365, 140); + this.VolumeOuterExponentTextBox.Name = "VolumeOuterExponentTextBox"; + this.VolumeOuterExponentTextBox.Size = new System.Drawing.Size(156, 20); + this.VolumeOuterExponentTextBox.TabIndex = 195; + this.VolumeOuterExponentTextBox.TextChanged += new System.EventHandler(this.VolumeOuterExponentTextBox_TextChanged); + // + // label20 + // + this.label20.AutoSize = true; + this.label20.Location = new System.Drawing.Point(257, 117); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(109, 13); + this.label20.TabIndex = 192; + this.label20.Text = "Volume colour (RGB):"; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(257, 91); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(94, 13); + this.label19.TabIndex = 190; + this.label19.Text = "Volume size scale:"; + // + // VolumeSizeScaleTextBox + // + this.VolumeSizeScaleTextBox.Location = new System.Drawing.Point(365, 88); + this.VolumeSizeScaleTextBox.Name = "VolumeSizeScaleTextBox"; + this.VolumeSizeScaleTextBox.Size = new System.Drawing.Size(156, 20); + this.VolumeSizeScaleTextBox.TabIndex = 191; + this.VolumeSizeScaleTextBox.TextChanged += new System.EventHandler(this.VolumeSizeScaleTextBox_TextChanged); + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(257, 65); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(86, 13); + this.label18.TabIndex = 188; + this.label18.Text = "Volume intensity:"; + // + // VolumeIntensityTextBox + // + this.VolumeIntensityTextBox.Location = new System.Drawing.Point(365, 62); + this.VolumeIntensityTextBox.Name = "VolumeIntensityTextBox"; + this.VolumeIntensityTextBox.Size = new System.Drawing.Size(156, 20); + this.VolumeIntensityTextBox.TabIndex = 189; + this.VolumeIntensityTextBox.TextChanged += new System.EventHandler(this.VolumeIntensityTextBox_TextChanged); + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(10, 406); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(69, 13); + this.label16.TabIndex = 186; + this.label16.Text = "Shadow blur:"; + // + // ShadowBlurTextBox + // + this.ShadowBlurTextBox.Location = new System.Drawing.Point(88, 403); + this.ShadowBlurTextBox.Name = "ShadowBlurTextBox"; + this.ShadowBlurTextBox.Size = new System.Drawing.Size(154, 20); + this.ShadowBlurTextBox.TabIndex = 187; + this.ShadowBlurTextBox.TextChanged += new System.EventHandler(this.ShadowBlurTextBox_TextChanged); + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(10, 197); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(50, 13); + this.label12.TabIndex = 184; + this.label12.Text = "Group id:"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(10, 171); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(46, 13); + this.label11.TabIndex = 182; + this.label11.Text = "Bone id:"; + // + // FlashinessTextBox + // + this.FlashinessTextBox.Location = new System.Drawing.Point(88, 143); + this.FlashinessTextBox.Name = "FlashinessTextBox"; + this.FlashinessTextBox.Size = new System.Drawing.Size(154, 20); + this.FlashinessTextBox.TabIndex = 181; + this.FlashinessTextBox.TextChanged += new System.EventHandler(this.FlashinessTextBox_TextChanged); + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(10, 146); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(56, 13); + this.label15.TabIndex = 180; + this.label15.Text = "Flashiness"; + // + // CoronaSizeTextBox + // + this.CoronaSizeTextBox.Location = new System.Drawing.Point(88, 325); + this.CoronaSizeTextBox.Name = "CoronaSizeTextBox"; + this.CoronaSizeTextBox.Size = new System.Drawing.Size(154, 20); + this.CoronaSizeTextBox.TabIndex = 179; + this.CoronaSizeTextBox.TextChanged += new System.EventHandler(this.CoronaSizeTextBox_TextChanged); + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(10, 328); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(65, 13); + this.label14.TabIndex = 178; + this.label14.Text = "Corona size:"; + // + // ColourBUpDown + // + this.ColourBUpDown.Location = new System.Drawing.Point(204, 91); + this.ColourBUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.ColourBUpDown.Name = "ColourBUpDown"; + this.ColourBUpDown.Size = new System.Drawing.Size(38, 20); + this.ColourBUpDown.TabIndex = 177; + this.ColourBUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.ColourBUpDown.ValueChanged += new System.EventHandler(this.ColourBUpDown_ValueChanged); + // + // ColourGUpDown + // + this.ColourGUpDown.Location = new System.Drawing.Point(163, 91); + this.ColourGUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.ColourGUpDown.Name = "ColourGUpDown"; + this.ColourGUpDown.Size = new System.Drawing.Size(38, 20); + this.ColourGUpDown.TabIndex = 176; + this.ColourGUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.ColourGUpDown.ValueChanged += new System.EventHandler(this.ColourGUpDown_ValueChanged); + // + // ColourRUpDown + // + this.ColourRUpDown.Location = new System.Drawing.Point(122, 91); + this.ColourRUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.ColourRUpDown.Name = "ColourRUpDown"; + this.ColourRUpDown.Size = new System.Drawing.Size(38, 20); + this.ColourRUpDown.TabIndex = 175; + this.ColourRUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.ColourRUpDown.ValueChanged += new System.EventHandler(this.ColourRUpDown_ValueChanged); + // + // CoronaIntensityUpDown + // + this.CoronaIntensityUpDown.Location = new System.Drawing.Point(88, 351); + this.CoronaIntensityUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.CoronaIntensityUpDown.Name = "CoronaIntensityUpDown"; + this.CoronaIntensityUpDown.Size = new System.Drawing.Size(154, 20); + this.CoronaIntensityUpDown.TabIndex = 166; + this.CoronaIntensityUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.CoronaIntensityUpDown.ValueChanged += new System.EventHandler(this.CoronaIntensityUpDown_ValueChanged); + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(10, 353); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(44, 13); + this.label9.TabIndex = 165; + this.label9.Text = "Corona:"; + // + // OuterAngleUpDown + // + this.OuterAngleUpDown.Location = new System.Drawing.Point(88, 299); + this.OuterAngleUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.OuterAngleUpDown.Name = "OuterAngleUpDown"; + this.OuterAngleUpDown.Size = new System.Drawing.Size(154, 20); + this.OuterAngleUpDown.TabIndex = 164; + this.OuterAngleUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.OuterAngleUpDown.ValueChanged += new System.EventHandler(this.OuterAngleUpDown_ValueChanged); + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(10, 301); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(65, 13); + this.label8.TabIndex = 163; + this.label8.Text = "Outer angle:"; + // + // InnerAngleUpDown + // + this.InnerAngleUpDown.Location = new System.Drawing.Point(88, 273); + this.InnerAngleUpDown.Maximum = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.InnerAngleUpDown.Name = "InnerAngleUpDown"; + this.InnerAngleUpDown.Size = new System.Drawing.Size(154, 20); + this.InnerAngleUpDown.TabIndex = 162; + this.InnerAngleUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.InnerAngleUpDown.ValueChanged += new System.EventHandler(this.InnerAngleUpDown_ValueChanged); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(10, 275); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(63, 13); + this.label7.TabIndex = 161; + this.label7.Text = "Inner angle:"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(10, 484); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(51, 13); + this.label6.TabIndex = 159; + this.label6.Text = "Txt hash:"; + // + // HashTextBox + // + this.HashTextBox.Location = new System.Drawing.Point(88, 481); + this.HashTextBox.Name = "HashTextBox"; + this.HashTextBox.Size = new System.Drawing.Size(154, 20); + this.HashTextBox.TabIndex = 160; + this.HashTextBox.TextChanged += new System.EventHandler(this.HashTextBox_TextChanged); + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(10, 250); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(58, 13); + this.label5.TabIndex = 157; + this.label5.Text = "Falloff exp:"; + // + // FalloffExponentTextBox + // + this.FalloffExponentTextBox.Location = new System.Drawing.Point(88, 247); + this.FalloffExponentTextBox.Name = "FalloffExponentTextBox"; + this.FalloffExponentTextBox.Size = new System.Drawing.Size(154, 20); + this.FalloffExponentTextBox.TabIndex = 158; + this.FalloffExponentTextBox.TextChanged += new System.EventHandler(this.FalloffExponentTextBox_TextChanged); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(10, 224); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(38, 13); + this.label4.TabIndex = 155; + this.label4.Text = "Falloff:"; + // + // FalloffTextBox + // + this.FalloffTextBox.Location = new System.Drawing.Point(88, 221); + this.FalloffTextBox.Name = "FalloffTextBox"; + this.FalloffTextBox.Size = new System.Drawing.Size(154, 20); + this.FalloffTextBox.TabIndex = 156; + this.FalloffTextBox.TextChanged += new System.EventHandler(this.FalloffTextBox_TextChanged); + // + // TypeComboBox + // + this.TypeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.TypeComboBox.FormattingEnabled = true; + this.TypeComboBox.Items.AddRange(new object[] { + "Point", + "Spot", + "Capsule"}); + this.TypeComboBox.Location = new System.Drawing.Point(88, 62); + this.TypeComboBox.Name = "TypeComboBox"; + this.TypeComboBox.Size = new System.Drawing.Size(154, 21); + this.TypeComboBox.TabIndex = 154; + this.TypeComboBox.SelectedIndexChanged += new System.EventHandler(this.TypeComboBox_SelectedIndexChanged); + // + // IntensityUpDown + // + this.IntensityUpDown.Location = new System.Drawing.Point(88, 117); + this.IntensityUpDown.Maximum = new decimal(new int[] { + 100000000, + 0, + 0, + 0}); + this.IntensityUpDown.Name = "IntensityUpDown"; + this.IntensityUpDown.Size = new System.Drawing.Size(154, 20); + this.IntensityUpDown.TabIndex = 153; + this.IntensityUpDown.Value = new decimal(new int[] { + 255, + 0, + 0, + 0}); + this.IntensityUpDown.ValueChanged += new System.EventHandler(this.IntensityUpDown_ValueChanged); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(10, 119); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(49, 13); + this.label3.TabIndex = 152; + this.label3.Text = "Intensity:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(10, 93); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(72, 13); + this.label2.TabIndex = 151; + this.label2.Text = "Colour (RGB):"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(10, 65); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(34, 13); + this.label13.TabIndex = 150; + this.label13.Text = "Type:"; + // + // ColourLabel + // + this.ColourLabel.BackColor = System.Drawing.Color.White; + this.ColourLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.ColourLabel.Location = new System.Drawing.Point(88, 90); + this.ColourLabel.Name = "ColourLabel"; + this.ColourLabel.Size = new System.Drawing.Size(30, 21); + this.ColourLabel.TabIndex = 149; + this.ColourLabel.Click += new System.EventHandler(this.ColourLabel_Click); + // + // NormalizeDirectionButton + // + this.NormalizeDirectionButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.NormalizeDirectionButton.Location = new System.Drawing.Point(473, 34); + this.NormalizeDirectionButton.Name = "NormalizeDirectionButton"; + this.NormalizeDirectionButton.Size = new System.Drawing.Size(68, 23); + this.NormalizeDirectionButton.TabIndex = 148; + this.NormalizeDirectionButton.Text = "Normalize"; + this.NormalizeDirectionButton.UseVisualStyleBackColor = true; + this.NormalizeDirectionButton.Click += new System.EventHandler(this.NormalizeDirectionButton_Click); + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(10, 39); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(52, 13); + this.label17.TabIndex = 146; + this.label17.Text = "Direction:"; + // + // DirectionTextBox + // + this.DirectionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.DirectionTextBox.Location = new System.Drawing.Point(88, 36); + this.DirectionTextBox.Name = "DirectionTextBox"; + this.DirectionTextBox.Size = new System.Drawing.Size(379, 20); + this.DirectionTextBox.TabIndex = 147; + this.DirectionTextBox.TextChanged += new System.EventHandler(this.DirectionTextBox_TextChanged); + // + // GoToButton + // + this.GoToButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.GoToButton.Location = new System.Drawing.Point(473, 8); + this.GoToButton.Name = "GoToButton"; + this.GoToButton.Size = new System.Drawing.Size(68, 23); + this.GoToButton.TabIndex = 145; + this.GoToButton.Text = "Go to"; + this.GoToButton.UseVisualStyleBackColor = true; + this.GoToButton.Click += new System.EventHandler(this.GoToButton_Click); + // + // PositionTextBox + // + this.PositionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.PositionTextBox.Location = new System.Drawing.Point(88, 10); + this.PositionTextBox.Name = "PositionTextBox"; + this.PositionTextBox.Size = new System.Drawing.Size(379, 20); + this.PositionTextBox.TabIndex = 144; + this.PositionTextBox.TextChanged += new System.EventHandler(this.PositionTextBox_TextChanged); + // + // label31 + // + this.label31.AutoSize = true; + this.label31.Location = new System.Drawing.Point(10, 13); + this.label31.Name = "label31"; + this.label31.Size = new System.Drawing.Size(47, 13); + this.label31.TabIndex = 143; + this.label31.Text = "Position:"; + // + // menuStripFix1 + // + this.menuStripFix1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.createToolStripMenuItem, + this.optionsToolStripMenuItem, + this.moveToolStripMenuItem, + this.rotateToolStripMenuItem}); + this.menuStripFix1.Location = new System.Drawing.Point(0, 0); + this.menuStripFix1.Name = "menuStripFix1"; + this.menuStripFix1.Size = new System.Drawing.Size(732, 24); + this.menuStripFix1.TabIndex = 1; + this.menuStripFix1.Text = "menuStripFix1"; + // + // createToolStripMenuItem + // + this.createToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.lightToolStripMenuItem, + this.deleteLightToolStripMenuItem}); + this.createToolStripMenuItem.Name = "createToolStripMenuItem"; + this.createToolStripMenuItem.Size = new System.Drawing.Size(39, 20); + this.createToolStripMenuItem.Text = "Edit"; + // + // lightToolStripMenuItem + // + this.lightToolStripMenuItem.Name = "lightToolStripMenuItem"; + this.lightToolStripMenuItem.Size = new System.Drawing.Size(137, 22); + this.lightToolStripMenuItem.Text = "New Light"; + this.lightToolStripMenuItem.Click += new System.EventHandler(this.lightToolStripMenuItem_Click); + // + // deleteLightToolStripMenuItem + // + this.deleteLightToolStripMenuItem.Name = "deleteLightToolStripMenuItem"; + this.deleteLightToolStripMenuItem.Size = new System.Drawing.Size(137, 22); + this.deleteLightToolStripMenuItem.Text = "Delete Light"; + this.deleteLightToolStripMenuItem.Click += new System.EventHandler(this.deleteLightToolStripMenuItem_Click); + // + // optionsToolStripMenuItem + // + this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.showGizmosToolStripMenuItem}); + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); + this.optionsToolStripMenuItem.Text = "Options"; + // + // showGizmosToolStripMenuItem + // + this.showGizmosToolStripMenuItem.Checked = true; + this.showGizmosToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.showGizmosToolStripMenuItem.Name = "showGizmosToolStripMenuItem"; + this.showGizmosToolStripMenuItem.Size = new System.Drawing.Size(175, 22); + this.showGizmosToolStripMenuItem.Text = "Show Light Gizmos"; + this.showGizmosToolStripMenuItem.Click += new System.EventHandler(this.showGizmosToolStripMenuItem_Click); + // + // moveToolStripMenuItem + // + this.moveToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + this.moveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("moveToolStripMenuItem.Image"))); + this.moveToolStripMenuItem.Name = "moveToolStripMenuItem"; + this.moveToolStripMenuItem.Size = new System.Drawing.Size(28, 20); + this.moveToolStripMenuItem.Click += new System.EventHandler(this.moveToolStripMenuItem_Click); + // + // rotateToolStripMenuItem + // + this.rotateToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("rotateToolStripMenuItem.Image"))); + this.rotateToolStripMenuItem.Name = "rotateToolStripMenuItem"; + this.rotateToolStripMenuItem.Size = new System.Drawing.Size(28, 20); + this.rotateToolStripMenuItem.Click += new System.EventHandler(this.rotateToolStripMenuItem_Click); + // + // ModelLightForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(732, 568); + this.Controls.Add(this.MainSplitContainer); + this.Controls.Add(this.menuStripFix1); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MainMenuStrip = this.menuStripFix1; + this.Name = "ModelLightForm"; + this.Text = "ModelLightForm - CodeWalker by dexyfex"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ModelLightForm_FormClosed); + this.MainSplitContainer.Panel1.ResumeLayout(false); + this.MainSplitContainer.Panel1.PerformLayout(); + this.MainSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.MainSplitContainer)).EndInit(); + this.MainSplitContainer.ResumeLayout(false); + this.LightPropertiesPanel.ResumeLayout(false); + this.LightPropertiesPanel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.VolumeColorBUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.VolumeColorGUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.VolumeColorRUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.ColourBUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.ColourGUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.ColourRUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.CoronaIntensityUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.OuterAngleUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.InnerAngleUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.IntensityUpDown)).EndInit(); + this.menuStripFix1.ResumeLayout(false); + this.menuStripFix1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.SplitContainer MainSplitContainer; + private System.Windows.Forms.Label label1; + private WinForms.TreeViewFix LightsTreeView; + private System.Windows.Forms.Panel LightPropertiesPanel; + private System.Windows.Forms.NumericUpDown ColourBUpDown; + private System.Windows.Forms.NumericUpDown ColourGUpDown; + private System.Windows.Forms.NumericUpDown ColourRUpDown; + private System.Windows.Forms.TextBox TimeFlagsTextBox; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.CheckedListBox TimeFlagsPMCheckedListBox; + private System.Windows.Forms.CheckedListBox TimeFlagsAMCheckedListBox; + private System.Windows.Forms.NumericUpDown CoronaIntensityUpDown; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.NumericUpDown OuterAngleUpDown; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.NumericUpDown InnerAngleUpDown; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox HashTextBox; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox FalloffExponentTextBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox FalloffTextBox; + private System.Windows.Forms.ComboBox TypeComboBox; + private System.Windows.Forms.NumericUpDown IntensityUpDown; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label ColourLabel; + private System.Windows.Forms.Button NormalizeDirectionButton; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.TextBox DirectionTextBox; + private System.Windows.Forms.Button GoToButton; + private System.Windows.Forms.TextBox PositionTextBox; + private System.Windows.Forms.Label label31; + private System.Windows.Forms.TextBox CoronaSizeTextBox; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox FlashinessTextBox; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.NumericUpDown VolumeColorBUpDown; + private System.Windows.Forms.NumericUpDown VolumeColorGUpDown; + private System.Windows.Forms.NumericUpDown VolumeColorRUpDown; + private System.Windows.Forms.Label VolumeColorLabel; + private System.Windows.Forms.Label label22; + private System.Windows.Forms.TextBox ShadowFadeDistanceTextBox; + private System.Windows.Forms.Label label23; + private System.Windows.Forms.TextBox LightFadeDistanceTextBox; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.TextBox VolumeOuterExponentTextBox; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.TextBox VolumeSizeScaleTextBox; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.TextBox VolumeIntensityTextBox; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.TextBox ShadowBlurTextBox; + private System.Windows.Forms.Label label28; + private System.Windows.Forms.TextBox CoronaZBiasTextBox; + private System.Windows.Forms.Label label27; + private System.Windows.Forms.TextBox ShadowNearClipTextBox; + private System.Windows.Forms.Label label26; + private System.Windows.Forms.TextBox VolumetricFadeDistanceTextBox; + private System.Windows.Forms.Label label25; + private System.Windows.Forms.TextBox SpecularFadeDistanceTextBox; + private System.Windows.Forms.Label label29; + private System.Windows.Forms.TextBox ExtentTextBox; + private WinForms.MenuStripFix menuStripFix1; + private System.Windows.Forms.ToolStripMenuItem createToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem lightToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem deleteLightToolStripMenuItem; + private System.Windows.Forms.TextBox GroupIDTextBox; + private System.Windows.Forms.TextBox BoneIDTextBox; + private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem showGizmosToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem moveToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem rotateToolStripMenuItem; + private System.Windows.Forms.Label label24; + private System.Windows.Forms.TextBox CullingPlaneNormalTextBox; + private System.Windows.Forms.Label label30; + private System.Windows.Forms.TextBox CullingPlaneOffsetTextBox; + } +} \ No newline at end of file diff --git a/CodeWalker/Forms/ModelLightForm.cs b/CodeWalker/Forms/ModelLightForm.cs new file mode 100644 index 0000000..0a68b2e --- /dev/null +++ b/CodeWalker/Forms/ModelLightForm.cs @@ -0,0 +1,877 @@ +using CodeWalker.GameFiles; +using SharpDX; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace CodeWalker.Forms +{ + public partial class ModelLightForm : Form + { + private ModelForm ModelForm; + private Drawable Drawable; + private FragDrawable FragDrawable; + private Dictionary DrawableDict; + + LightAttributes selectedLight = null; + + bool populatingui = false; + + public ModelLightForm(ModelForm modelForm) + { + InitializeComponent(); + + ModelForm = modelForm; + } + + public void LoadModel(DrawableBase drawable) + { + LightsTreeView.Nodes.Clear(); + LightsTreeView.ShowRootLines = false; + + var dr = drawable as Drawable; + var fr = drawable as FragDrawable; + + if (dr != null) + { + Drawable = dr; + var lights = dr.LightAttributes; + if (lights != null) + { + AddLightsTreeNodes(lights.data_items); + } + } + else if (fr != null) + { + FragDrawable = fr; + var lights = fr.OwnerFragment?.LightAttributes; + if (lights != null) + { + AddLightsTreeNodes(lights.data_items); + } + } + } + public void LoadModels(Dictionary dict) + { + DrawableDict = dict; + + LightsTreeView.Nodes.Clear(); + + if (dict != null) + { + foreach (var kvp in dict) + { + MetaHash mhash = new MetaHash(kvp.Key); + var drawable = kvp.Value; + + var dnode = LightsTreeView.Nodes.Add(mhash.ToString()); + dnode.Tag = drawable; + + var lights = drawable.LightAttributes.data_items; + if(lights != null) + { + AddLightsTreeNodes(lights, dnode); + } + + dnode.Expand(); + } + } + } + private void AddLightsTreeNodes(LightAttributes[] lights, TreeNode parent = null) + { + if (lights == null) return; + + for (int mi = 0; mi < lights.Length; mi++) + { + var tnc = LightsTreeView.Nodes; + var light = lights[mi]; + string mprefix = "Light" + (mi + 1).ToString(); + var mnode = parent == null ? tnc.Add(mprefix) : parent.Nodes.Add(mprefix); + mnode.Tag = light; + mnode.Expand(); + } + } + + + + + public void UpdateUI() + { + var light = selectedLight; + + if(light == null) + { + populatingui = true; + PositionTextBox.Text = ""; + DirectionTextBox.Text = ""; + TypeComboBox.SelectedItem = "Point"; + ColourRUpDown.Value = 0; + ColourGUpDown.Value = 0; + ColourBUpDown.Value = 0; + IntensityUpDown.Value = 0; + FlashinessTextBox.Text = ""; + BoneIDTextBox.Text = ""; + GroupIDTextBox.Text = ""; + FalloffTextBox.Text = ""; + FalloffExponentTextBox.Text = ""; + InnerAngleUpDown.Value = 0; + OuterAngleUpDown.Value = 0; + CoronaSizeTextBox.Text = ""; + CoronaIntensityUpDown.Value = 0; + ExtentTextBox.Text = ""; + ShadowBlurTextBox.Text = ""; + LightFadeDistanceTextBox.Text = ""; + CoronaZBiasTextBox.Text = ""; + HashTextBox.Text = ""; + VolumeIntensityTextBox.Text = ""; + VolumeSizeScaleTextBox.Text = ""; + VolumeColorRUpDown.Value = 0; + VolumeColorGUpDown.Value = 0; + VolumeColorBUpDown.Value = 0; + VolumeOuterExponentTextBox.Text = ""; + ShadowFadeDistanceTextBox.Text = ""; + SpecularFadeDistanceTextBox.Text = ""; + VolumetricFadeDistanceTextBox.Text = ""; + ShadowNearClipTextBox.Text = ""; + CullingPlaneNormalTextBox.Text = ""; + CullingPlaneOffsetTextBox.Text = ""; + TimeFlagsTextBox.Text = ""; + populatingui = false; + } + else + { + populatingui = true; + PositionTextBox.Text = FloatUtil.GetVector3String(light.Position); + DirectionTextBox.Text = FloatUtil.GetVector3String(light.Direction); + TypeComboBox.SelectedItem = light.Type.ToString(); + ColourRUpDown.Value = light.ColorR; + ColourGUpDown.Value = light.ColorG; + ColourBUpDown.Value = light.ColorB; + ColourLabel.BackColor = System.Drawing.Color.FromArgb(light.ColorR, light.ColorG, light.ColorB); + IntensityUpDown.Value = (decimal)light.Intensity > IntensityUpDown.Maximum ? IntensityUpDown.Maximum : (decimal)light.Intensity; + FlashinessTextBox.Text = FloatUtil.ToString(light.Flashiness); + BoneIDTextBox.Text = FloatUtil.ToString(light.BoneId); + GroupIDTextBox.Text = FloatUtil.ToString(light.GroupId); + FalloffTextBox.Text = FloatUtil.ToString(light.Falloff); + FalloffExponentTextBox.Text = FloatUtil.ToString(light.FalloffExponent); + InnerAngleUpDown.Value = (decimal)light.ConeInnerAngle > InnerAngleUpDown.Maximum ? InnerAngleUpDown.Maximum : (decimal)light.ConeInnerAngle; + OuterAngleUpDown.Value = (decimal)light.ConeOuterAngle > OuterAngleUpDown.Maximum ? OuterAngleUpDown.Maximum : (decimal)light.ConeOuterAngle; + CoronaSizeTextBox.Text = FloatUtil.ToString(light.CoronaSize); + CoronaIntensityUpDown.Value = (decimal)light.CoronaIntensity > CoronaIntensityUpDown.Maximum ? CoronaIntensityUpDown.Maximum : (decimal)light.CoronaIntensity; + ExtentTextBox.Text = FloatUtil.GetVector3String(light.Extent); + ShadowBlurTextBox.Text = FloatUtil.ToString(light.ShadowBlur); + LightFadeDistanceTextBox.Text = FloatUtil.ToString(light.LightFadeDistance); + CoronaZBiasTextBox.Text = FloatUtil.ToString(light.CoronaZBias); + HashTextBox.Text = light.ProjectedTextureHash.Hash.ToString(); + VolumeIntensityTextBox.Text = FloatUtil.ToString(light.VolumeIntensity); + VolumeSizeScaleTextBox.Text = FloatUtil.ToString(light.VolumeSizeScale); + VolumeColorRUpDown.Value = light.VolumeOuterColorR; + VolumeColorGUpDown.Value = light.VolumeOuterColorG; + VolumeColorBUpDown.Value = light.VolumeOuterColorB; + VolumeColorLabel.BackColor = System.Drawing.Color.FromArgb(light.VolumeOuterColorR, light.VolumeOuterColorG, light.VolumeOuterColorB); + VolumeOuterExponentTextBox.Text = FloatUtil.ToString(light.VolumeOuterExponent); + ShadowFadeDistanceTextBox.Text = FloatUtil.ToString(light.ShadowFadeDistance); + SpecularFadeDistanceTextBox.Text = FloatUtil.ToString(light.SpecularFadeDistance); + VolumetricFadeDistanceTextBox.Text = FloatUtil.ToString(light.VolumetricFadeDistance); + ShadowNearClipTextBox.Text = FloatUtil.ToString(light.ShadowNearClip); + CullingPlaneNormalTextBox.Text = FloatUtil.GetVector3String(light.CullingPlaneNormal); + CullingPlaneOffsetTextBox.Text = FloatUtil.ToString(light.CullingPlaneOffset); + TimeFlagsTextBox.Text = light.TimeFlags.ToString(); + UpdateFlagsCheckBoxes(); + populatingui = false; + } + } + + public void UpdateLightParams() + { + selectedLight.HasChanged = true; + } + + + private LightAttributes NewLightAttribute() + { + LightAttributes light = new LightAttributes(); + light.Direction = Vector3.BackwardLH; + light.Tangent = Vector3.Normalize(Vector3.BackwardLH.GetPerpVec()); + light.Intensity = 20; + light.ConeInnerAngle = 5; + light.ConeOuterAngle = 35; + light.Extent = Vector3.One; + light.Type = LightType.Spot; + light.Falloff = 10; + light.ColorR = 255; + light.ColorG = 255; + light.ColorB = 255; + return light; + } + private void SelectLight(LightAttributes light) + { + if (light == null) + { + selectedLight = null; + ModelForm.selectedLight = null; + UpdateUI(); + ModelForm.UpdateWidget(); + } + else + { + selectedLight = light; + ModelForm.selectedLight = light; + UpdateUI(); + ModelForm.UpdateWidget(); + } + } + private void CreateLight() + { + if(Drawable != null) + { + List lights = Drawable.LightAttributes.data_items.ToList(); + lights.Add(NewLightAttribute()); + Drawable.LightAttributes.data_items = lights.ToArray(); + UpdateLightParams(); + LoadModel(Drawable); + } + else if(FragDrawable != null) + { + List lights = FragDrawable.OwnerFragment.LightAttributes.data_items.ToList(); + lights.Add(NewLightAttribute()); + FragDrawable.OwnerFragment.LightAttributes.data_items = lights.ToArray(); + UpdateLightParams(); + LoadModel(FragDrawable); + } + else + { + var n = LightsTreeView.SelectedNode; + if (n != null) + { + var dr = n.Tag as Drawable; + if (dr == null) { dr = n.Parent.Tag as Drawable; } //try parent node tag also + if (dr!= null) + { + List lights = dr.LightAttributes.data_items.ToList(); + lights.Add(NewLightAttribute()); + dr.LightAttributes.data_items = lights.ToArray(); + UpdateLightParams(); + LoadModels(DrawableDict); + } + } + } + } + private void DeleteLight() + { + if (selectedLight == null) return; + if(Drawable != null) + { + List lights = Drawable.LightAttributes.data_items.ToList(); + lights.Remove(selectedLight); + Drawable.LightAttributes.data_items = lights.ToArray(); + UpdateLightParams(); + LoadModel(Drawable); + } + else if(FragDrawable != null) + { + List lights = FragDrawable.OwnerFragment.LightAttributes.data_items.ToList(); + lights.Remove(selectedLight); + FragDrawable.OwnerFragment.LightAttributes.data_items = lights.ToArray(); + UpdateLightParams(); + LoadModel(Drawable); + } + else + { + var dr = LightsTreeView.SelectedNode.Parent.Tag as Drawable; + if (dr != null) + { + List lights = dr.LightAttributes.data_items.ToList(); + lights.Remove(selectedLight); + dr.LightAttributes.data_items = lights.ToArray(); + UpdateLightParams(); + LoadModels(DrawableDict); + } + } + } + + private void UpdateFlagsCheckBoxes() + { + var l = selectedLight; + var tfam = (l.TimeFlags >> 0) & 0xFFF; + var tfpm = (l.TimeFlags >> 12) & 0xFFF; + for (int i = 0; i < TimeFlagsAMCheckedListBox.Items.Count; i++) + { + TimeFlagsAMCheckedListBox.SetItemCheckState(i, ((tfam & (1u << i)) > 0) ? CheckState.Checked : CheckState.Unchecked); + } + for (int i = 0; i < TimeFlagsPMCheckedListBox.Items.Count; i++) + { + TimeFlagsPMCheckedListBox.SetItemCheckState(i, ((tfpm & (1u << i)) > 0) ? CheckState.Checked : CheckState.Unchecked); + } + } + + private uint GetFlagsFromItemCheck(CheckedListBox clb, ItemCheckEventArgs e) + { + uint flags = 0; + for (int i = 0; i < clb.Items.Count; i++) + { + if ((e != null) && (e.Index == i)) + { + if (e.NewValue == CheckState.Checked) + { + flags += (uint)(1 << i); + } + } + else + { + if (clb.GetItemChecked(i)) + { + flags += (uint)(1 << i); + } + } + } + return flags; + } + + private void UpdateColour() + { + if (populatingui) return; + + var r = (byte)ColourRUpDown.Value; + var g = (byte)ColourGUpDown.Value; + var b = (byte)ColourBUpDown.Value; + + ColourLabel.BackColor = System.Drawing.Color.FromArgb(r, g, b); + + if (selectedLight != null) + { + selectedLight.ColorR = r; + selectedLight.ColorG = g; + selectedLight.ColorB = b; + UpdateLightParams(); + } + } + + private void UpdateVolumeColour() + { + if (populatingui) return; + + var r = (byte)VolumeColorRUpDown.Value; + var g = (byte)VolumeColorGUpDown.Value; + var b = (byte)VolumeColorBUpDown.Value; + + VolumeColorLabel.BackColor = System.Drawing.Color.FromArgb(r, g, b); + + if (selectedLight != null) + { + selectedLight.VolumeOuterColorR = r; + selectedLight.VolumeOuterColorG = g; + selectedLight.VolumeOuterColorB = b; + } + } + + private void LightsTreeView_AfterSelect(object sender, TreeViewEventArgs e) + { + SelectLight(e.Node.Tag as LightAttributes); + } + + private void ModelLightForm_FormClosed(object sender, FormClosedEventArgs e) + { + ModelForm.OnLightFormClosed(); + } + + private void GoToButton_Click(object sender, EventArgs e) + { + ModelForm.SetCameraPosition(selectedLight.Position, selectedLight.Falloff * 2f); + } + + private void NormalizeDirectionButton_Click(object sender, EventArgs e) + { + Vector3 d = Vector3.Normalize(FloatUtil.ParseVector3String(DirectionTextBox.Text)); + DirectionTextBox.Text = FloatUtil.GetVector3String(d); + } + + private void PositionTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + Vector3 v = FloatUtil.ParseVector3String(PositionTextBox.Text); + if (selectedLight.Position != v) + { + selectedLight.Position = v; + UpdateLightParams(); + } + } + + private void TypeComboBox_SelectedIndexChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + string type = TypeComboBox.Text; + switch (type) + { + case "Point": + selectedLight.Type = LightType.Point; + break; + case "Capsule": + selectedLight.Type = LightType.Capsule; + break; + default: + selectedLight.Type = LightType.Spot; + break; + } + UpdateLightParams(); + } + + private void IntensityUpDown_ValueChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(IntensityUpDown.Text); + if (selectedLight.Intensity != v) + { + selectedLight.Intensity = v; + UpdateLightParams(); + } + } + + private void ColourRUpDown_ValueChanged(object sender, EventArgs e) + { + UpdateColour(); + } + + private void ColourGUpDown_ValueChanged(object sender, EventArgs e) + { + UpdateColour(); + } + + private void ColourBUpDown_ValueChanged(object sender, EventArgs e) + { + UpdateColour(); + } + + private void ColourLabel_Click(object sender, EventArgs e) + { + var colDiag = new ColorDialog { Color = ColourLabel.BackColor }; + if (colDiag.ShowDialog(this) == DialogResult.OK) + { + var c = colDiag.Color; + ColourRUpDown.Value = c.R; + ColourGUpDown.Value = c.G; + ColourBUpDown.Value = c.B; + } + } + + private void FalloffTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(FalloffTextBox.Text); + if (selectedLight.Falloff != v) + { + selectedLight.Falloff = v; + UpdateLightParams(); + } + } + + private void FalloffExponentTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(FalloffExponentTextBox.Text); + if (selectedLight.FalloffExponent != v) + { + selectedLight.FalloffExponent = v; + UpdateLightParams(); + } + } + + private void InnerAngleUpDown_ValueChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(InnerAngleUpDown.Text); + if (selectedLight.ConeInnerAngle != v) + { + selectedLight.ConeInnerAngle = v; + UpdateLightParams(); + } + } + + private void OuterAngleUpDown_ValueChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(OuterAngleUpDown.Text); + if (selectedLight.ConeOuterAngle != v) + { + selectedLight.ConeOuterAngle = v; + UpdateLightParams(); + } + } + + private void CoronaIntensityUpDown_ValueChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(CoronaIntensityUpDown.Text); + if (selectedLight.CoronaIntensity != v) + { + selectedLight.CoronaIntensity = v; + UpdateLightParams(); + } + } + + private void CoronaSizeTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(CoronaSizeTextBox.Text); + if (selectedLight.CoronaSize != v) + { + selectedLight.CoronaSize = v; + UpdateLightParams(); + } + } + + private void DirectionTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + Vector3 v = FloatUtil.ParseVector3String(DirectionTextBox.Text); + if (selectedLight.Direction != v) + { + selectedLight.Direction = v; + selectedLight.Tangent = Vector3.Normalize(selectedLight.Direction.GetPerpVec()); + UpdateLightParams(); + } + } + + private void FlashinessTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(FlashinessTextBox.Text); + if (selectedLight.Flashiness != v) + { + selectedLight.Flashiness = (byte)v; + UpdateLightParams(); + } + } + + private void BoneIDTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(BoneIDTextBox.Text); + if (selectedLight.BoneId != v) + { + selectedLight.BoneId = (ushort)v; + UpdateLightParams(); + } + } + + private void GroupIDTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(GroupIDTextBox.Text); + if (selectedLight.GroupId != v) + { + selectedLight.GroupId = (byte)v; + UpdateLightParams(); + } + } + + private void ExtentTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + Vector3 v = FloatUtil.ParseVector3String(ExtentTextBox.Text); + if (selectedLight.Extent != v) + { + selectedLight.Extent = v; + UpdateLightParams(); + } + } + + private void ShadowBlurTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(ShadowBlurTextBox.Text); + if (selectedLight.ShadowBlur != v) + { + selectedLight.ShadowBlur = (byte)v; + UpdateLightParams(); + } + } + + private void LightFadeDistanceTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(LightFadeDistanceTextBox.Text); + if (selectedLight.LightFadeDistance != v) + { + selectedLight.LightFadeDistance = (byte)v; + UpdateLightParams(); + } + } + + private void CoronaZBiasTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(CoronaZBiasTextBox.Text); + if (selectedLight.CoronaZBias != v) + { + selectedLight.CoronaZBias = v; + UpdateLightParams(); + } + } + + private void VolumeIntensityTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(VolumeIntensityTextBox.Text); + if (selectedLight.VolumeIntensity != v) + { + selectedLight.VolumeIntensity = v; + UpdateLightParams(); + } + } + + private void VolumeSizeScaleTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(VolumeSizeScaleTextBox.Text); + if (selectedLight.VolumeSizeScale != v) + { + selectedLight.VolumeSizeScale = v; + UpdateLightParams(); + } + } + + private void VolumeOuterExponentTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(VolumeOuterExponentTextBox.Text); + if (selectedLight.VolumeOuterExponent != v) + { + selectedLight.VolumeOuterExponent = v; + UpdateLightParams(); + } + } + + private void ShadowFadeDistanceTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(ShadowFadeDistanceTextBox.Text); + if (selectedLight.ShadowFadeDistance != v) + { + selectedLight.ShadowFadeDistance = (byte)v; + UpdateLightParams(); + } + } + + private void SpecularFadeDistanceTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(SpecularFadeDistanceTextBox.Text); + if (selectedLight.SpecularFadeDistance != v) + { + selectedLight.SpecularFadeDistance = (byte)v; + UpdateLightParams(); + } + } + + private void VolumetricFadeDistance_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(VolumetricFadeDistanceTextBox.Text); + if (selectedLight.VolumetricFadeDistance != v) + { + selectedLight.VolumetricFadeDistance = (byte)v; + UpdateLightParams(); + } + } + + private void ShadowNearClipTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(ShadowNearClipTextBox.Text); + if (selectedLight.ShadowNearClip != v) + { + selectedLight.ShadowNearClip = v; + UpdateLightParams(); + } + } + + private void VolumeColorLabel_Click(object sender, EventArgs e) + { + var colDiag = new ColorDialog { Color = ColourLabel.BackColor }; + if (colDiag.ShowDialog(this) == DialogResult.OK) + { + var c = colDiag.Color; + VolumeColorRUpDown.Value = c.R; + VolumeColorGUpDown.Value = c.G; + VolumeColorBUpDown.Value = c.B; + } + } + + private void VolumeColorRUpDown_ValueChanged(object sender, EventArgs e) + { + UpdateVolumeColour(); + } + + private void VolumeColorGUpDown_ValueChanged(object sender, EventArgs e) + { + UpdateVolumeColour(); + } + + private void VolumeColorBUpDown_ValueChanged(object sender, EventArgs e) + { + UpdateVolumeColour(); + } + + private void TimeFlagsTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + uint.TryParse(TimeFlagsTextBox.Text, out uint v); + if (selectedLight.TimeFlags != v) + { + selectedLight.TimeFlags = v; + } + populatingui = true; + UpdateFlagsCheckBoxes(); + populatingui = false; + } + + private void TimeFlagsAMCheckedListBox_ItemCheck(object sender, ItemCheckEventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + var tfam = GetFlagsFromItemCheck(TimeFlagsAMCheckedListBox, e); + var tfpm = GetFlagsFromItemCheck(TimeFlagsPMCheckedListBox, null); + var v = tfam + (tfpm << 12); + if (selectedLight.TimeFlags != v) + { + selectedLight.TimeFlags = v; + } + populatingui = true; + TimeFlagsTextBox.Text = selectedLight.TimeFlags.ToString(); + populatingui = false; + } + + private void TimeFlagsPMCheckedListBox_ItemCheck(object sender, ItemCheckEventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + var tfam = GetFlagsFromItemCheck(TimeFlagsAMCheckedListBox, null); + var tfpm = GetFlagsFromItemCheck(TimeFlagsPMCheckedListBox, e); + var v = tfam + (tfpm << 12); + if (selectedLight.TimeFlags != v) + { + selectedLight.TimeFlags = v; + } + populatingui = true; + TimeFlagsTextBox.Text = selectedLight.TimeFlags.ToString(); + populatingui = false; + } + + private void HashTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + uint.TryParse(HashTextBox.Text, out uint v); + if (selectedLight.ProjectedTextureHash != v) + { + selectedLight.ProjectedTextureHash = v; + } + } + + private void CullingPlaneNormalTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + Vector3 v = FloatUtil.ParseVector3String(CullingPlaneNormalTextBox.Text); + if (selectedLight.CullingPlaneNormal != v) + { + selectedLight.CullingPlaneNormal = v; + } + } + + private void CullingPlaneOffsetTextBox_TextChanged(object sender, EventArgs e) + { + if (populatingui) return; + if (selectedLight == null) return; + float v = FloatUtil.Parse(CullingPlaneOffsetTextBox.Text); + if (selectedLight.CullingPlaneOffset != v) + { + selectedLight.CullingPlaneOffset = v; + UpdateLightParams(); + } + } + + private void lightToolStripMenuItem_Click(object sender, EventArgs e) + { + CreateLight(); + } + + private void deleteLightToolStripMenuItem_Click(object sender, EventArgs e) + { + DeleteLight(); + } + + private void showGizmosToolStripMenuItem_Click(object sender, EventArgs e) + { + showGizmosToolStripMenuItem.Checked = !showGizmosToolStripMenuItem.Checked; + ModelForm.showLightGizmos = showGizmosToolStripMenuItem.Checked; + } + + private void moveToolStripMenuItem_Click(object sender, EventArgs e) + { + moveToolStripMenuItem.Checked = !moveToolStripMenuItem.Checked; + if (moveToolStripMenuItem.Checked) + { + moveToolStripMenuItem.BackColor = System.Drawing.SystemColors.GradientActiveCaption; + rotateToolStripMenuItem.Checked = false; + rotateToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + ModelForm.SetWidgetMode("Position"); + } + else + { + moveToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + ModelForm.SetWidgetMode("Default"); + } + } + + private void rotateToolStripMenuItem_Click(object sender, EventArgs e) + { + rotateToolStripMenuItem.Checked = !rotateToolStripMenuItem.Checked; + if (rotateToolStripMenuItem.Checked) + { + rotateToolStripMenuItem.BackColor = System.Drawing.SystemColors.GradientActiveCaption; + moveToolStripMenuItem.Checked = false; + moveToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + ModelForm.SetWidgetMode("Rotation"); + } + else + { + rotateToolStripMenuItem.BackColor = System.Drawing.SystemColors.Control; + ModelForm.SetWidgetMode("Default"); + } + } + } +} diff --git a/CodeWalker/Forms/ModelLightForm.resx b/CodeWalker/Forms/ModelLightForm.resx new file mode 100644 index 0000000..3825ee4 --- /dev/null +++ b/CodeWalker/Forms/ModelLightForm.resx @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vAAADrwBlbxySQAAAKtJREFUOE+lUlsOgCAM40iegcPxz0n9IfwqXTatk5EYmzQM1paHphlaa1vvfS+l + HCBqrGl7DTbnnIWfQrzZh6gsxhBdBjZjRE9lT9ixIQB1tyuA15T3dfydVShhHDDTSMiksaQPSbbgCfGs + ZsL7PwDHsJBaq4hXNC3GMd+jRxTaTjb35teXYCFGDuDgwfivNKPtxjV6KouBdDZzCHoqi+HfhM3hsT04 + ZG1O6QTGlgf4FZ9QVAAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vAAADrwBlbxySQAAAVFJREFUOE99kzFug0AQRTlCjpAj5AgRPVJadyno6alSubXokVK65Aa4pqKhDz3F + FhgoN/PWO3hNiFf62tGfP3/ZnSH6b03T9DXPswXEnn6+lmV5F/H3OI4/TdPYw+HgQAxHDo2X35eQr5K8 + cNowDLYoChvH8QPgyPkvuhhjXtZiIQ0Ckl3X2TRN/xjAkUNTliW7eIiJBBUEIpJJkti6rp1Ii4nhyKFR + jithsArDOM9zd3dAvKchXg2Ox+NDEnAiCDk0aDV2Bpwge7s12AMagfE1NwN/ujOgbXuFQL8yqLlf4Xw+ + O2LbRn1UoJ1CS+7BAGRZ5oRwPB6t0508BmhU7wwYivBETQjavu93ZwJQQ210vV7fRGz0ZQEGFG87oPD3 + N9S6afQmrfYcg60p0Nngv1iLwyVj/SmFFQZqGk5kYH7yJc8Xs46JdsH/TJXc/eOmiKJfGa9fWzDSupYA + AAAASUVORK5CYII= + + + + 42 + + + + AAABAAMAICAAAAAAGACoDAAANgAAABAQAAAAABgAaAMAAN4MAABAQAAAAAAYACgyAABGEAAAKAAAACAA + AABAAAAAAQAYAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////v8/u3v+Pn6//7+//////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //7+/vX3/rzA3OHl9fz9//////////////////////////////////////////////////////////// + //////////////////////////////////////////////////7//+zv+3Z6qcLI5Pr7//////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////7+/+br+15in6+33vf5//////////////////7+//7+//////////////////// + //////////////////////////////3+//v8//v8//3+//////////////////////7+/+Ho+1dana20 + 4/b4//////////z9//P2/+Tp/ezw/vz9//////////////////////////////////////////7///X4 + /9Pa+tPa+/H1//z9//////////////////7+/93k+SsscaSr3PX3//////7+//L1/7W98AcWgrvC8Pj6 + //////////////////////////////////////////7+/+bs/xohiAEJdrvF9+7y//z9//////////// + //7+/9rh+CEkapmh0/T3//////j6/9HZ/AEHcgEEb9LZ+/r7//////////////////////////////// + //////////7//+/z/3F+zAAAXwQLcZai3fb4//////////////3+/97l/E9Tmaau4fT3/////+/0/1dd + sAAAV7a/8/H1//7+//////////////////////////////////////////////r8/+jv/46Y3QUUf6Ot + 5PX4//////////////3+/9zj+3Z6wLe/7fX4//////D0/212xnaAzerw//z9//////////////////// + //////////////////////////////////v8/+/z/+Dm+/D0//z9//////////7+//j6/9Pd+UhLjb/H + 9/D0//3+//n7/+nt/+jt//n7//////////////////////////////////////////////////////// + //7///7+//7+//7+//////////r8/+7z/83W+ImU2A0UdFNarr/K9env//X4//z9//3+//7///////// + //////////////////////////////////////////////////////////////////7///j6/+Pq/255 + xhckjE5XsVVftUlTqwAKeTA9nr3H8+7z//v8//////////////////////////////////////////// + //////////////////////////////7+//b4/9Tc+Sc0mRonj8rV/crX/ZSb48rX/brG8wwWgQAEdJei + 4efu//n7//7+//z9//z9//z9//z9//3+//////////////////////////////3+//f5/+3y/+nv/+ft + /8vV+io2mImU2M7c/7vG9yIvlQAOfCg4mM3Y/s/c/4aR1AQRfGtzwtni/ebt/9vi/tri/tXd+9Tc+O3x + /vz9//////////////////////////n6/87V+FVftkRPrFlnvSEqjQoUfmJvwWFvvg0TfQQIcxEchwAD + cy89n19rvVVitQwZgwAAaiMrkT9NqTVBoiw3mhQihig1mNLX+fv8//////////////////////////b5 + /52l4EFLqoCK03yF0VBctGhyw52o5GVrvQAAaneBzsHM+jA3mhYgiTtIpJOf3ouW2AAAbmh0wbbA8bS+ + 7qiz5pCb16+56e/z//3+//////////////////////////v8//H1/+vw/+zx/+nv/7/J9YqP3MbP/8LM + +hwqkFZftaCp5EhRrcTQ+9jj/8rW/UJMqn6J0ebt//X3//f5//b4//X3//f5//z9//////////////// + //////////7+//z9//3+//////////3+/+7z/6at64iP3aWs7XN8zRIfhyUykp2o5MHM+oKM0xonjY6X + 2+jv//v8//////7+//n7//b5//r7//7///////////////////7+//f5/+rw/9Pa9fL0/v7///////// + //v8//H1/+Tr/7i/91liu0NPq0VQrS06m0NNqDdCoYqU1+nv//v8//////////n7/9zi/qSt59ri/fL1 + //v8//7///////z9//D0/8rT+h0sjkVQrPD0//////////////////////z9/+7z/8LL9Jqk4aGq6LW/ + 8c3W9+Xs/vH1//v8//////////////f5/6at5gAAbxIfh6u16+Po/fr7//////b5/6ev5gAIeAAPernC + 8fX4//////////3+//v8//z9//////3+//j6//P3//P2//b4//r8//7+//7+//v8//r8//3+//////v8 + /+Xr/nuIzwAAbBseg5Sb2fb5//////f5/8DF8pWe3d/n/vT3//39//////v8/+zx/87V9+3x/v3+//// + //3+//j6//X4//v8//////////n7/+Dm/snR9fD0//39//z8/fv8/+3y/8LK9aGq4dfd9/n7//////z9 + //b5//X4//v8//////////7+/+7z/4aP1gEPet7k/f39//////f5/83U+ZCZ2u3x/v7+//////P3/215 + wgAJd7fB8/L1//7+//////3+//j6//f5//r8//7+//////////////////////////////j6/87W/AAA + X2duue3y//7+//////D0/05asBQfidzj/P39//////X4/6Su6AAAXBccgtff/vv8//////////////// + //////////////////////////////////////P3/3F8xhYli9Xe/fn6/////////+3y/1pltQAJd9be + /fv8//////z9/+rw/36I0Bknjs/W+vv8//////////////////////////////////////////////// + //////f5/8HI7tnf+/X4//7+/////////+/0/3R7xgAAb9ng/Pz9//////////n7/+Ln/dLY+fP2//3+ + //////////////////////////////////////////////////////3+//r7//v8//7+//////////// + //b4/7/F84eP0e/0//7+//////////7+//z9//v8//3+//////////////////////////////////// + //////////////////////////////////////////////////z9//b5//X4//v8//////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////w////4 + P///+D////g8//D4MH/geCB/4Dggf+A4IH/wOCD/+DAB//hgAf//gAP//wAAB/AAAAPwAAAD8AAAA/AA + AAfjAAEHgYADAQPgBwEDEAEBAghgAQwIIEH8CCB//Bggf/wYMH/8ODD///h/////////////KAAAABAA + AAAgAAAAAQAYAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///+vv/fL1/v///wAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///4+Vx7/F5v///wAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAP///4CHtrS62////////////////////wAAAAAAAAAAAP////H0/vf6/v// + /////////4yTwrrB4f///+zw+7rA6P39/////wAAAAAAAAAAAP///56l2BkcguXr/P///////42Uw8jO + 6P///ysvjWVqtP///////wAAAAAAAAAAAP////D0/0hPpsDG6////////6y02d7k8////3qAx+/z/f// + /wAAAAAAAAAAAAAAAAAAAP///////////////8zT8V5ns1Rcrdzh9f///////////wAAAAAAAAAAAAAA + AAAAAP////////7+/6ix3nmBxFthtmdwu09WqbC54/v9//r8//j6//39/wAAAAAAAAAAAOjt/H6I0FJc + skpSqHF+wRMahFZhs4iT1AsNc1pgrm52v2RsuO/z/gAAAP////////L2/cLJ7rrD64+V4DY+ozU+mYmU + 0X2Hy1hfss7V8urv/PP2/v///wAAAP///+Pp+d/k9////////+Pp/4uR3ysymW14xYOM0fD0/P///+Xq + +ri/6Pj6/wAAAOrv/j5DnbS75P////////////X4/+/0/ubr+/r7/////////9rh+hgZhKGo2QAAAPDz + /eLn+f////j6/2Nqttrg9////+Hn+P3+//3+/1hescLJ6/////L2/eru/AAAAAAAAAAAAP///8rR70tR + p/3+//v8/zY6jNPY7////09WqWpwu////wAAAAAAAAAAAAAAAAAAAAAAAPb4/vr7//////v8/5Wd1eHm + +P////v8//T3/wAAAAAAAAAAAAAAAP//AAD8PwAA/D8AAPwDAACAAwAAgAMAAIAHAADABwAAwAEAAMAB + AAAAAQAAAAEAAAABAAAAAQAAwAcAAOAPAAAoAAAAQAAAAIAAAAABABgAAAAAAAAwAAAAAAAAAAAAAAAA + AAAAAAAA//////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////v7//f7//P3//P3//P3/ + /f7//v7///////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////v7//P3/ + +fv/+fv/+Pr/+fv/+vv//P3//v////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////f7/+fr/8/b/7PL/5+3/6e/+9Pf/+vv//v7///////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////P3/9/r/6O7/cXe1UVaet7z17fL/+Pr//f3///////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////+/z/9Pj/4Oj/NzyCUlOd2dz/6O//9Pf//P3///// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////+vv/8vb/2+P9X2OmREGLnqPd + 4+v/8vb/+/z///////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////+vv/8fb/ + 1N35bXK1JSRtbHGz5O7/8fX/+/z///////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + ////////+vv/8PX/3Ob/U1eaDwtXjZLT4+z/8fX/+/z///////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + ////////////////////////+vv/8fb/2eP+MjR6AAA+c3i34Or/8fX/+/z///////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////+vv/8vb/1d/7MS91AAA1UFSS4On/8vb/+/z///// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////+vv/8fb/2OL+NjZ7AAArX2Ok + 4uz/8fX/+/z///////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////+vv/8fb/ + 2eP/LjJ1DAxKfYTE4Or/8fX/+/z//////////////////////////////v7//v7//f7//f7//v7//v// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + ////////+vv/8PX/3OX/gILIR0eVeoHC3eb/8fX/+/z//////////////////////v7//P3/+fv/+Pr/ + +Pr/+Pr/+vv//P3//v7///////////////////////////////////////////////////////////// + /////////////////////////////v7//f7//P3/+vv/+vv/+/z//f3//v7///////////////////// + ////////////////////////+vv/8PX/2eP9ZWeqHx1obnOz4Or/8fX/+/z//////////////////v7/ + +/z/9fj/8vb/8PX/7vT/8fb/9fj/+fr//f7///////////////////////////////////////////// + /////////////////////////////////////////v///P3/+Pr/9fj/9fj/9Pj/9Pf/9vn/+/z//v7/ + ////////////////////////////////////////+vv/8fb/2eP9ODp9AAA5jZDQ5O7/8PX/+/z///// + /////////v7/+/z/9Pf/7fP/5u//wsz6j5XfuMDx7fL/9vn//P3///////////////////////////// + /////////////////////////////////////////////////////////f7/+Pr/8/b/5+3/2eH/2uP/ + 5u3/7fP/8/b/+vv//f7/////////////////////////////////////+vv/8PX/3ef/U1ebBgVKio/O + 4uz/8fX/+/z//////////v///P3/9fj/7fP/4uv/hIzZHSWPAABmU1i14ub/9/r/+/z///////////// + /////////////////////////////////////////////////////////////////////////P3/9Pf/ + 7/X/09z/TlSzNzWYj5bh5O7/6/L/8vb/+fv//f7/////////////////////////////////+vv/8fX/ + 2eP/QUWIEhBZbnSz3uj/8fb/+/z//////////f7/+Pr/7/T/6PH/iI7cAABvAABqAABncXjK6O//9fj/ + +/z///////////////////////////////////////////////////////////////////////////// + ////////+/z/8/f/2uD/Z27EAABnAABiBgl4jJTd5vD/6O//8vX/+fv//f7///////////////////// + ////////+vv/8fb/2OP/Mjd6AQE6ZGup4er/8fX/+/z/////////+vz/8fX/6/T/xM/8ExyJAABwAABu + GySRxc387fT/9ff//P3///////////////////////////////////////////////////////////// + ////////////////////////+vz/8/f/1Nr/MzqhAABhAxOBAARyBgp5jpLg5Oz/7PP/9Pf/+vz//v7/ + ////////////////////////+vv/8fb/2eP/KCtvBwZOjJHS4Or/8fX/+/z//////f7/9/n/7fP/3+j/ + UFq3AABtAAZ3BAh6mZ/n5vD/7vP/+Pr//v7///////////////////////////////////////////// + ////////////////////////////////////////+/z/9Pj/6e//sbb1KzWcAABwBhaBAAFyAgp6fITR + 1d777/T/+Pr//f7/////////////////////////+vv/8PX/3+j/WF2hBglTnaTj5O3/8PX/+/z///// + /P3/9Pf/6vL/k5riAAByAAR0AABrY2vE4ur/6vH/9ff//P3///////////////////////////////// + /////////////////////////////////////////////////////////f3/9/n/7fL/5O3/ytX/RU6w + AABpAA5+AABuAABnhord6e7/+fv//f7/////////////////////////+vv/7/T/3+j/k5jbT1KdgYjJ + 3uf+8fX/+/z/////+/z/9fn/4ef/NDqhAABnAABrJjCU0Nn/5/D/8fX/+vv//v7///////////////// + /////////////////////////////////////////////////////////////////////////v7/+/z/ + 9vn/7vP/6vP/ztb/O0CmAABpAABrQkuoxMn57PH/+Pr//f7/////////////////////////+vv/8PX/ + 2+X/en/CUFGak5nY3+j/8fX//P3//////P3/9fj/4en/i5DbNT2hIyuTpqzv4uz/7vP/9/n//f7///// + //////////////////////////////////////////////////////////////////////////////// + /////////////v7//P3/9vn/7/P/6vL/ytH/X2i9XWi7wsf/6e//8/f/+Pr//v7///////////////// + ////////+vv/8PX/3OX/WF2hW1ylvMD+3uf/8PX/+/z//////f7/9vn/7fP/4uj/j5Pgf4LV3+X/6fD/ + 9Pf//P3///////////////////////////////////////////////////////////////////////// + /////////////////////////////////v///P3/+Pr/8vX/7fP/5+//5u7/6vD/8PT/9vn//P3//v7/ + /////////////////////f7/9/n/7fP/0tz9LDJzNjh/nqTk2uT/7fL/9/n//f7//f7/+fv/8/b/7PL/ + 3eX/zM//5ev/9fj/+fv//v7///////////////////////////////////////////////////////// + /////////////////////////////////////////////////////v///f3/+vv/9/n/9vn/9fj/9vn/ + +fr//P3//v7//////////////v///f7/+vv/9vn/7/T/5vD/2Ob/VFubERNdoajk4u//5O7/7vP/9vj/ + +fr/+vv/+Pr/9fj/9Pj/9fj/9fj/+Pr//P3///////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////v///v7/ + /f7//P3//P3//f3//v7//v///////////////f7/+vz/9vn/8fX/7vT/5O3/3eb/z9n/cHjICxN5d37L + z9n/2eP/5O3/6/L/8PT/9Pf/9/n/+vv/+vv/+/z//P3//f3//v7///////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////P3/+Pr/8/b/7vT/6vL/z9r+jZjeQUeq + IiuQCBN3AAFrBRB8Nj2iUViym6XlydH/4+z/6/L/8PT/9/n/+/z//f7//v////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////f3/9/n/8fX/6/L/3uf/ + mKTkLzibAABoAAB0Fx+HDBh7FSGDAg16AABYAABlCBB/Ji2UhYza1+D/6PL/7fL/9Pf/+vv//f7///// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////v7//P3/9/n/ + 8PT/7PT/z9j/XmO+AABtAABcMDSXoajsu8X7VV+5hYzblZ/fTVSxFSKMAABkAABnAAN2Qkmpsbrz5e3/ + 6vH/8fX/+Pr//P3//v////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////P3/9/n/8PX/7PT/vcn3LTOZAABaAgR1ZWzD0Nf/5vL/1OP/l53lzs3/6fP/4+7/sLzwZ23CBxSD + AABnAABlHiaSmqHo3+j/5+//7/T/9vn//P3//v7///////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////v7/ + /v7//v7//v7//f7/+/z/9vj/7vP/7PX/tcLzEBeGAABkPEWlqLPt2eX/4e7/3On/uMX1gofVe3vPhYzY + z93+5/X/4e3/lJ3gHiOPAABtAABqChiEbHLIytD/5/D/7PL/8/f/+Pr/+fr/+Pr/+Pr/+Pr/+Pr/+Pr/ + +Pr/+fv/+vv/+/z//f7//v7///////////////////////////////////////////////////////// + /v7//f7/+/z/+fv/9/n/9vj/9fj/9Pf/8fX/7PL/4uv/l6HgDhF7AAN4iZDe0d7/3uz/4vD/w83/VVm3 + ICiSAAFyAABlAABwaHTD1N//2un/3er/w838ZW3BEyOJJzKVAQ16NDmfwsn75fD/5u7/7PL/7vP/7fP/ + 7fP/7fL/7fP/7vP/7/T/8fb/9Pj/9vn/+fr//f3//v////////////////////////////////////// + /////////////v7//P3/+Pr/9Pf/8fX/7vT/7PL/6/L/6fH/5u7/6vX/tsD0CQx4AAFwkZvi7ff/4vD/ + 4fD/z9j/OkGlAABiAABwBxWAAAt7BBN+P0uofYLUztb/4O7/6fb/6fP/qa7xQkyoBg56AABqMjugx8/+ + 5fH/4Ov/4On/3uj/3eb/3+j/3uj/1+L/0d3/1d7/3+f/7fL/9vj/+vz//v7///////////////////// + /////////////////////////////f7/+fr/8/f/6/L/2d//v8j6vcf5ucP1wMv8wM3+vMj6PkqoAABo + UF25usP7tsPyvsr6sLrwQ0utAABqAAV1OUameIDRKDWZAAd2GyeOLDecmaHntsL0pbLom6riq7LzUlu0 + AANzBhR/AAZ0NT+ja3bBY2i/XGG6UViyWl65XGG7XGC6TVWvQU6pPkalODygqK7p8vb/+vz//v7///// + /////////////////////////////////////////////P3/9/n/7/T/wcj2R0ysExeFERmGDxuIFB6K + FBqICxSEAABsAAByDBiDCRSBBRCADhaFCRODAAh4AxF/AAl4CxeDHSaPAAp6AAN0AA19AAd3CBOBEBqH + BhGBAAh5AABwAAByAAh5BhSCAxWCAABsAABvAABlAABnAABxAABjAABmAABhAABdAABYAABhCAt/q7Lr + 8/f/+vv//v7//////////////////////////////////////////////////P3/+fv/3uT/SE2vAABn + CBB/GiCMLzmfLTWcGByJFRyKGCOOMj2gHymRDxiGGyOPLDCXBRF/AAh3BhaCEyKMICqTKC2WNDqfIzCV + Awx6Eh+JHiaPAAR3AAZ5CxSDICWQX2q7Q1CqAA1+AAFxDxuHiZTbVGC4dHnQnabrTVqzY23EUV62Slau + LjaZXWm9sLjz5ez/9vn/+fv//v7//////////////////////////////////////////////////P3/ + +Pv/4+n+e4LPfoPVpqv2vsf/zNX/zdb/xtH/v8v8pK7spKfysLb3vcr4ws784ej/hI/YAAZ1AAJzVF25 + yM//3Of/5+//i5LcAABpMzyfp6vxoKznlqHhqbbtx9H/8fz/kpvfAABiAABph4zc5PD/2OP/193/3un/ + 1+D/2OH/1+D/0Nr/zNL/3+j/6/L/7/T/9vn//P3//v////////////////////////////////////// + /////////////f7/+Pr/9Pf/6vD/5u3/3+b/4uv/6PD/5+//5O3/5/P/sL3sXmS7mZzoz9f/3+z/4e// + mKLiEiKKCBF/KTWZr7T06/f/3ev/VF2zChSBipPcz9v+4u7/3ur/3ev/5/X/qrPrISmSDRJ2Xmq/3ur/ + 4uv/6vH/7fP/7fL/7/T/7vP/7fP/7fP/8PX/8fX/9Pf/+Pr/+/z//v7///////////////////////// + /////////////////////////////v7//P3/+Pr/9vn/9Pf/8vb/8vb/8/b/9Pf/7/T/6/L/tL/ubXLH + en/Ti43gqavy0t3/nafjMj6fJzaaAAV1GyeOYmW7Nz6fAABgNj6i1N//3uz/2uX/3Oj/5PH/wcj7FR2J + AAN0gong0tr/6fH/7/P/9vj/+Pr/+fv/+fv/+Pr/+Pr/+Pr/+fv/+vv//P3//f7//v////////////// + /////////////////////////////////////////////////v7//f7//P3/+/z/+/z/+/z//f3//f7/ + +fv/8fX/5Oz/jpbfc3jObnXLcXfOk5rks7b4iY3dR1KvDhuEAABoAABlEBV9U12ytcD13Or/3en/3ej/ + 1eL/q7fvGR+MKDKZbnnNxc/76PD/8fX/+fr//f7//v///////v7//f7//f3//P3//f3//f7//v////// + /////////////////////////////////////////////////////v7//f7//P3//P3//f7//v7///// + /////////////////f7/9vn/7/T/yNH5lJrleoDVmZ3pmpzpc3nPfoTWf4bYVFy3HSaLZ3PGsrb8v8r8 + y9n9q7jre4LRf4fUgIvXAwZ1AABrhYjb0NX/6PH/8PX/+Pr//f7//////////v///f3/+vv/+Pr/9/r/ + 9/n/+Pr/+/z//f7//v7//////////////////////////////////////v///f7/+/z/+fr/9vj/9/n/ + +vz/+vv/+/z//v7//////////////////v7/+vz/8/f/7PL/2uT/t8H1srP6vcH+nKTnSlOxV2C7TVaz + WGS8QUqmSlSuSFOtR1GtbXTKVl23ARB5AAh2AABnd33P3eP/4ur/7/T/9/n//P3//////////////P3/ + 9/n/8vb/7PH/6fD/7PL/7vP/8vb/9vn/+/z//f7//////////////////////////////v7/+/z/+Pr/ + 8/b/7/T/8Pb/6vH/3eP97vL++fr//P3//////////////////////f7/+vv/9fj/7/T/5+//z9f+t7v4 + uLn9Z2zFLzucFCGIMz6gGCCMAAd4AAl2Dx2EER+GXWK8c3XLKzKXd4LP4er/6/L/8PX/9/n//P3//v// + /////////v7/+fv/8/b/7PP/y9H/i4/erLbt4er/5e3/7fP/8/b/+fv//f3//v7///////////////// + /v7/+/z/9vj/8PT/6/L/3+n/x9H9aHTAZGvG3+b9+Pr/+/z//////////////////////////v7/+/z/ + +Pr/8vb/6/H/3OX+wMn4maDmdHrPWGG6T1a1eoHWcHfOTlayUlq1SlKubHjAxMj/0dn/4+v/7PL/8vb/ + +Pr//P3//v7//////////////f7/+fr/7vP/xsv5YGXAHymRKjKYYWS9rbLz4u3/6/P/8vb/+fr//f7/ + /////////////v//+/z/9vj/7fL/5e3/xs7/Y23BIiiSAABeLTab3+b/9/r/+/z///////////////// + /////////////////f7/+vz/9vj/8PX/6vH/3eb/ydL8xM/6uMPyt733w8j/zNb/1Nz/3OT/4uz/5u7/ + 7fP/8vb/9vj/+vz//f7//////////////////////f7/+fv/7vP/jpHiAAJ1CxaBER6GAABoFRmGbXbH + 0Nf/7PL/9fj//P3//////////////v7/+fv/8/f/4Of/hYvbKDGZAABuAABdAAZyi5La5+7/9vn/+/z/ + /////////////////////////////////////v7//P3/+fv/9ff/8vb/7/X/7fP/6/L/5u3/5ez/6fD/ + 7PP/7/T/8fX/9Pf/9/n/+vv//P3//v7//v///////////////////////v7/+fv/8fb/2eH9fIbQExqH + AABrAAp6AAFyAABwS0+uztX39vn/+vz//////////////f7/+Pr/8ff/qbLpAABrAABhAABwDBWAfobX + 5e3/8PX/9vn//f3//////////v///f7/+/z/+vv/+vv/+vz//P3//v7//v///v7//P3/+vz/+Pr/9/n/ + 9vj/9vj/9vj/9vj/9/n/+fr/+/z//P3//f7//v7//f7//P3/+/z/+vz/+/z//P3//v7//////v7/+/z/ + 9fj/7/T/5/H/uML1U1e1AAh5AABuAABvMjmdv8bz9vr/+vv//////////////f7/+fv/7/T/iY7aDxSA + GiONa3XHsr7w4Oj/6/H/9Pf/+vz//v7//////v///P3/+Pr/9Pf/8/f/9fj/9fj/9vn/+/z//v7///// + /////////v7//f7//P3/+/z/+/z//P3//f7//v///////////////v7/+/z/9/n/9vn/9vn/9Pj/9vn/ + +/z//v7//////f7/+vz/9fj/7/T/6vL/3ef/i5PbGRqJBQl5jJbZ6vH/9Pj/+/z//////////////f7/ + +fv/8fT/1Nn9t7/0wcr54er/7fT/8fX/9fj/+vv//f7//////////f3/+Pr/8PT/6/L/3uX/ztb/5Or/ + 8/f/+Pr//f7//////////////f7/+vz/+Pr/+fv/+fv/+vv//f3//v///////////////P3/9/n/7vL/ + 193/ztf/5u3/7vP/9Pf/+/z//v7//////v7//P3/+Pr/8fX/7PP/5/D/sLfxoKnk4+r/8vf/9/n//f3/ + /////////////v7/+/z/9vn/9Pf/8vb/8fb/8fX/9Pf/+Pr//P3//v7//////////v7/+vv/8vb/5+7/ + y9H/WWO9KSmSkZXj6vD/+Pv//P3//////////f7/+Pr/9fj/8vb/6O7/7vP/9fj/+Pr//f7///////// + /v//+vv/8vb/7PP/hYraKiqKlp7i6PD/7fP/9ff/+/z//v7//////////f7/+vv/9ff/8fX/8PX/8vb/ + 8/f/9vn/+/z//v7//////////////////f7/+/z/+vv/+fr/+fr/+vv//P3//v7///////////////// + /P3/9fj/7PL/1d7/RUysAABhAABlg4ja6/D/+Pr//P3/////////+/z/9fj/6e7/2eD/h4/bnaXg7PH/ + 9fj/+/z//////////v7/+Pr/8PX/y9X1JDGVAABaERWDoKnp6PH/7vP/9/n//P3//////////////v7/ + /P3/+vv/+fv/+fv/+vv//P3//v7//////////////////////////v7//v7//v7//v7//v////////// + /////////////v7/+fv/8PX/7PX/ipPdAABsAABlQ1Cp3Ob/7vP/9/n//f7/////////+fv/9Pj/yNH5 + Ule2DBJ8Ljie0df+8fb/+fv//v7//////v7/+Pr/7/X/hY3YAABxAAl7AABuEBaEs7nz6fH/8fX/+vv/ + /v7//////////////////v///v7//v7//v7///////////////////////////////////////////// + /////////////////////////////f3/9vn/7PL/0tn/LzidAQFsAAB0iZHb6vP/8PT/+fv//v////// + /v7/+Pr/8vf/r7rqAAV4AABdPUen1N//7PL/9vn//f7//////v7/+fr/7/T/yc75S1G0AABrARKAAABp + Qker0df/7fP/9/n//f7///////////////////////////////////////////////////////////// + /////////////////////////////////////////////P3/9/n/5+7/cXXNAAd2AABuMDebzdT97PL/ + 9vj//P3//////////v7/9/n/7/X/tL/uFCCLAABqHSqRvcf46fD/9Pf//f3/////////+vv/8vX/6vH/ + yM3+JC2XAABtAAV2Agx9q7Ly7vT/9vn//f7///////////////////////////////////////////// + /////////////////////////////////////////////////////////////P3/9/r/4uj/WWO1AAVx + KTaYu8T07fT/8vb/+vv//v7//////////v7/9/n/7vX/vsn1Iy2SAABrAQ99mp/o6PD/9Pf//P3///// + /////P3/9/n/7vP/6fL/s7z2DBB/AABeQ0uttrr56e7/+Pr//f7///////////////////////////// + /////////////////////////////////////////////////////////////////////////////P3/ + +fv/4ef6g4zNbXfFw8v27fT/8vb/+Pr//f3//////////////v7/9/n/7vT/yNL7MjucAABtBxF/nKLo + 6fH/9Pf//P3//////////v7/+/z/9fj/7fL/6/T/jZXbLzScrrP14en/7fL/+fv//v7///////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////f7/+vz/8PP91dr34+f/8vb/8/f/9/r//P3//v///////////////v7/+Pr/8PX/1N3/ + QUqmAQRxBQ98m6Dm7PL/9fj//P3//////////////v7/+/z/9ff/8PX/5ez/ytH94ej/8vb/9vj/+/z/ + /v7///////////////////////////////////////////////////////////////////////////// + /////////////////////////////v7//P3/+vz/+fv/+Pr/+Pr/+vv//f3//v////////////////// + /v//+fv/9Pf/2+L/SVGtAABsLTaZytL58fX/9/n//f7//////////////////v7/+/z/9/n/9fj/9vn/ + 9fj/9vj/+vz//f7///////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////v7//f7//f3//f3//f3//v7//v////// + ////////////////////+/z/9vn/6e//mZ7gTVarr7bp6/H/9fj/+vv//v7///////////////////// + /v7//f7/+/z/+/z/+/z//P3//v7///////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////f3/+Pr/9fj/6e7/4+n/8fb/9Pf/+Pr//f3///////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////v7//P3/+fv/+fv/+vv/+Pr/+vv/ + /P3//v7///////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////v7//f7/ + /f3//P3//f7//v7//v////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + ///////4D/////////AH////////8Af////////wB/////////AH////////8Af////////wB/////// + //AH////////8Af////////wB/////////AH////////8AfwP//////wB8Af//+Af/AHgB///wA/8AcA + H///AB/wBgAf//8AD/AGAB///wAH8AYAH///AAPwBAAf//8AA/AEAD///wAD8AQAP///AAPwBAB///+A + A/AEAP///8AD4AAA////4AcAAAH////wDgAAAf/////8AAAH//////gAAAf/////4AAAAf/////gAAAA + ////+AAAAAAAD//AAAAAAAAH/4AAAAAAAAf/gAAAAAAAB/+AAAAAAAAH/4AAAAAAAAf/gAAAAAAAB/+A + AAAAAAAP/4AAAAAAAB//wAAAAABAf/4HwAAAAYAf8APAAAADgA/gA+AAAAMAA8AD8AAABwADgAP8AAAf + AAOAA/4AAB8AA4ADAAAAAQADgAIAcA4AgAOABgBwDgBAA4AMAGAMADADwDwAYAwAOAfg+ABgBAAeH//4 + AEAEAB////gAwAYAH///+ADABgAf///4AcAGAB////gBwAcAH///+APAB4A////8B+AHwH//////4A// + ///////gD/////////Af//////////////8= + + + \ No newline at end of file diff --git a/CodeWalker/Rendering/Renderable.cs b/CodeWalker/Rendering/Renderable.cs index ecaa4f4..411cdea 100644 --- a/CodeWalker/Rendering/Renderable.cs +++ b/CodeWalker/Rendering/Renderable.cs @@ -330,7 +330,7 @@ namespace CodeWalker.Rendering { var rlight = new RenderableLight(); rlight.Owner = this; - rlight.Init(ref lights[i]); + rlight.Init(lights[i]); rlights[i] = rlight; } Lights = rlights; @@ -1353,6 +1353,7 @@ namespace CodeWalker.Rendering public class RenderableLight { + public LightAttributes OwnerLight; public Renderable Owner; public Vector3 Position; public Vector3 Colour; @@ -1371,8 +1372,9 @@ namespace CodeWalker.Rendering public uint TimeFlags; public MetaHash TextureHash; - public void Init(ref LightAttributes_s l) + public void Init(LightAttributes l) { + OwnerLight = l; var pos = l.Position; var dir = l.Direction; var tan = l.Tangent; diff --git a/CodeWalker/Rendering/Renderer.cs b/CodeWalker/Rendering/Renderer.cs index 78252a2..ccf967d 100644 --- a/CodeWalker/Rendering/Renderer.cs +++ b/CodeWalker/Rendering/Renderer.cs @@ -1025,6 +1025,40 @@ namespace CodeWalker.Rendering v.Position = c5; SelectionLineVerts.Add(v); } + public void RenderSelectionDrawableLight(LightAttributes dlight) + { + var colblu = (uint)(new Color(0, 0, 255, 255).ToRgba()); + var colwht = (uint)(new Color(255, 255, 255, 255).ToRgba()); + + RenderableLight light = new RenderableLight(); + light.Init(dlight); + + var pos = light.Position; + var dir = light.Direction; + var tx = light.TangentX; + var ty = light.TangentY; + var extent = light.Falloff; + var innerAngle = light.ConeInnerAngle; + var outerAngle = light.ConeOuterAngle; + var type = light.Type; + switch (type) + { + case LightType.Point: + RenderSelectionCircle(pos, Vector3.UnitX, Vector3.UnitZ, extent, colwht); + RenderSelectionCircle(pos, Vector3.UnitX, Vector3.UnitY, extent, colwht); + RenderSelectionCircle(pos, Vector3.UnitY, Vector3.UnitZ, extent, colwht); + break; + case LightType.Spot: + RenderSelectionCone(pos, tx, ty, dir, (float)Math.Sin(outerAngle) * extent, (float)Math.Cos(outerAngle) * extent, colblu); + RenderSelectionCone(pos, tx, ty, dir, (float)Math.Sin(innerAngle) * extent, (float)Math.Cos(innerAngle) * extent, colwht); + break; + case LightType.Capsule: + outerAngle = light.ConeOuterAngle * 0.25f; + RenderSelectionCapsule(pos, tx, ty, dir, extent, outerAngle, colwht); + break; + } + } + public void RenderSelectionLodLight(YmapLODLight lodlight) { @@ -3266,7 +3300,6 @@ namespace CodeWalker.Rendering RenderSkeleton(rndbl, entity); } - if (renderlights && shaders.deferred && (rndbl.Lights != null)) { entity?.EnsureLights(rndbl.Key); @@ -3274,9 +3307,18 @@ namespace CodeWalker.Rendering var linst = new RenderableLightInst(); for (int i = 0; i < rndbl.Lights.Length; i++) { + var rndlight = rndbl.Lights[i]; + var light = rndlight.OwnerLight; + + if (light.HasChanged == true) + { + rndlight.Init(light); + light.HasChanged = false; + } + linst.EntityPosition = position; linst.EntityRotation = orientation; - linst.Light = rndbl.Lights[i]; + linst.Light = rndlight; shaders.Enqueue(ref linst); } }