mirror of
https://github.com/4sval/FModel.git
synced 2026-04-18 07:41:14 -05:00
fixed 0 padding + ao pixel color fighting
This commit is contained in:
parent
7a9556e957
commit
617dfad22e
|
|
@ -1 +1 @@
|
|||
Subproject commit 5987bbdb4e094c8c08e7b3cf05fc6ad6728299fb
|
||||
Subproject commit 2ce1512277e2f3f7b64975c46ce978efe824df2f
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#version 330 core
|
||||
#version 330 core
|
||||
|
||||
#define PI 3.1415926535897932384626433832795
|
||||
#define MAX_UV_COUNT 8
|
||||
|
|
@ -23,13 +23,13 @@ struct Boost
|
|||
float Exponent;
|
||||
};
|
||||
|
||||
struct Mask
|
||||
struct AoParams
|
||||
{
|
||||
sampler2D Sampler;
|
||||
Boost SkinBoost;
|
||||
|
||||
float AmbientOcclusion;
|
||||
float Curvature;
|
||||
|
||||
Boost ColorBoost;
|
||||
bool HasColorBoost;
|
||||
};
|
||||
|
||||
struct Parameters
|
||||
|
|
@ -39,8 +39,8 @@ struct Parameters
|
|||
Texture SpecularMasks[MAX_UV_COUNT];
|
||||
Texture Emissive[MAX_UV_COUNT];
|
||||
|
||||
Mask M;
|
||||
bool HasM;
|
||||
AoParams Ao;
|
||||
bool HasAo;
|
||||
|
||||
float Roughness;
|
||||
float EmissiveMult;
|
||||
|
|
@ -172,19 +172,15 @@ void main()
|
|||
vec4 diffuse = SamplerToVector(uParameters.Diffuse[layer].Sampler);
|
||||
vec3 result = uParameters.Diffuse[layer].Color.rgb * diffuse.rgb;
|
||||
|
||||
if (uParameters.HasM)
|
||||
if (uParameters.HasAo)
|
||||
{
|
||||
vec3 m = SamplerToVector(uParameters.M.Sampler).rgb;
|
||||
|
||||
float subsurface = clamp(1.0f, 0.0f, m.b * .04f);
|
||||
if (subsurface > 0.0f && uParameters.M.SkinBoost.Exponent > 0.0f)
|
||||
vec3 m = SamplerToVector(uParameters.Ao.Sampler).rgb;
|
||||
if (uParameters.Ao.HasColorBoost)
|
||||
{
|
||||
vec3 color = uParameters.M.SkinBoost.Color * uParameters.M.SkinBoost.Exponent;
|
||||
result *= clamp(vec3(1.0f), vec3(0.0f), color * m.b);
|
||||
vec3 color = uParameters.Ao.ColorBoost.Color * uParameters.Ao.ColorBoost.Exponent;
|
||||
result = mix(result, result * color, m.b);
|
||||
}
|
||||
|
||||
if (m.r > 0.0f) result *= m.r * uParameters.M.AmbientOcclusion;
|
||||
if (m.g > 0.0f) result += m.g * uParameters.M.Curvature;
|
||||
result = mix(result * m.r * uParameters.Ao.AmbientOcclusion, result, m.g);
|
||||
}
|
||||
|
||||
vec4 emissive = SamplerToVector(uParameters.Emissive[layer].Sampler);
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@
|
|||
IsChecked="{Binding SaveMaterials, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}"/>
|
||||
</UniformGrid>
|
||||
|
||||
<TextBlock Grid.Row="6" Grid.Column="0" Text="Preview Static Meshes From Levels (.umap)" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<TextBlock Grid.Row="6" Grid.Column="0" Text="Preview Levels (.umap)" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<CheckBox Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="3" Content="{Binding IsChecked, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BoolToToggleConverter.Instance}}"
|
||||
IsChecked="{Binding PreviewWorlds, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}"
|
||||
Style="{DynamicResource {x:Static adonisUi:Styles.ToggleSwitch}}" Margin="0 5 0 5"/>
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ public class Material : IDisposable
|
|||
public Vector4[] DiffuseColor;
|
||||
public Vector4[] EmissiveColor;
|
||||
|
||||
public Mask M;
|
||||
public bool HasM;
|
||||
public AoParams Ao;
|
||||
public bool HasAo;
|
||||
|
||||
public float Roughness = 0.5f;
|
||||
public float EmissiveMult = 1f;
|
||||
|
|
@ -89,12 +89,16 @@ public class Material : IDisposable
|
|||
}
|
||||
|
||||
{ // scalars
|
||||
if (Parameters.TryGetTexture2d(out var original, "M", "AEM") && options.TryGetTexture(original, false, out var transformed))
|
||||
if (Parameters.TryGetTexture2d(out var original, "M", "PackedTexture", "AEM") &&
|
||||
!original.Name.Equals("T_BlackMask") && options.TryGetTexture(original, false, out var transformed))
|
||||
{
|
||||
M = new Mask { Texture = transformed, AmbientOcclusion = 0.7f };
|
||||
HasM = true;
|
||||
HasAo = true;
|
||||
Ao = new AoParams { Texture = transformed, AmbientOcclusion = 0.7f };
|
||||
if (Parameters.TryGetLinearColor(out var l, "Skin Boost Color And Exponent"))
|
||||
M.SkinBoost = new Boost { Color = new Vector3(l.R, l.G, l.B), Exponent = l.A };
|
||||
{
|
||||
Ao.HasColorBoost = true;
|
||||
Ao.ColorBoost = new Boost { Color = new Vector3(l.R, l.G, l.B), Exponent = l.A };
|
||||
}
|
||||
}
|
||||
|
||||
if (Parameters.TryGetScalar(out var roughnessMin, "RoughnessMin", "SpecRoughnessMin") &&
|
||||
|
|
@ -197,13 +201,13 @@ public class Material : IDisposable
|
|||
Emissive[i]?.Bind(TextureUnit.Texture0 + unit++);
|
||||
}
|
||||
|
||||
M.Texture?.Bind(TextureUnit.Texture31);
|
||||
shader.SetUniform("uParameters.M.Sampler", 31);
|
||||
shader.SetUniform("uParameters.M.SkinBoost.Color", M.SkinBoost.Color);
|
||||
shader.SetUniform("uParameters.M.SkinBoost.Exponent", M.SkinBoost.Exponent);
|
||||
shader.SetUniform("uParameters.M.AmbientOcclusion", M.AmbientOcclusion);
|
||||
shader.SetUniform("uParameters.M.Curvature", M.Curvature);
|
||||
shader.SetUniform("uParameters.HasM", HasM);
|
||||
Ao.Texture?.Bind(TextureUnit.Texture31);
|
||||
shader.SetUniform("uParameters.Ao.Sampler", 31);
|
||||
shader.SetUniform("uParameters.Ao.HasColorBoost", Ao.HasColorBoost);
|
||||
shader.SetUniform("uParameters.Ao.ColorBoost.Color", Ao.ColorBoost.Color);
|
||||
shader.SetUniform("uParameters.Ao.ColorBoost.Exponent", Ao.ColorBoost.Exponent);
|
||||
shader.SetUniform("uParameters.Ao.AmbientOcclusion", Ao.AmbientOcclusion);
|
||||
shader.SetUniform("uParameters.HasAo", HasAo);
|
||||
|
||||
shader.SetUniform("uParameters.Roughness", Roughness);
|
||||
shader.SetUniform("uParameters.EmissiveMult", EmissiveMult);
|
||||
|
|
@ -227,17 +231,18 @@ public class Material : IDisposable
|
|||
ImGui.DragFloat("", ref UVScale, _step, _zero, _infinite, _mult, _clamp);
|
||||
ImGui.PopID();
|
||||
|
||||
if (HasM)
|
||||
if (HasAo)
|
||||
{
|
||||
SnimGui.Layout("Ambient Occlusion");ImGui.PushID(4);
|
||||
ImGui.DragFloat("", ref M.AmbientOcclusion, _step, _zero, 1.0f, _mult, _clamp);
|
||||
ImGui.PopID();SnimGui.Layout("Curvature");ImGui.PushID(5);
|
||||
ImGui.DragFloat("", ref M.Curvature, _step, _zero, 1.0f, _mult, _clamp);
|
||||
ImGui.PopID();SnimGui.Layout("Color Boost");ImGui.PushID(6);
|
||||
ImGui.ColorEdit3("", ref M.SkinBoost.Color);
|
||||
ImGui.PopID();SnimGui.Layout("Color Boost Exponent");ImGui.PushID(7);
|
||||
ImGui.DragFloat("", ref M.SkinBoost.Exponent, _step, _zero, _infinite, _mult, _clamp);
|
||||
ImGui.PopID();
|
||||
ImGui.DragFloat("", ref Ao.AmbientOcclusion, _step, _zero, 1.0f, _mult, _clamp);ImGui.PopID();
|
||||
if (Ao.HasColorBoost)
|
||||
{
|
||||
SnimGui.Layout("Color Boost");ImGui.PushID(5);
|
||||
ImGui.ColorEdit3("", ref Ao.ColorBoost.Color);ImGui.PopID();
|
||||
SnimGui.Layout("Color Boost Exponent");ImGui.PushID(6);
|
||||
ImGui.DragFloat("", ref Ao.ColorBoost.Exponent, _step, _zero, _infinite, _mult, _clamp);
|
||||
ImGui.PopID();
|
||||
}
|
||||
}
|
||||
ImGui.EndTable();
|
||||
}
|
||||
|
|
@ -308,7 +313,7 @@ public class Material : IDisposable
|
|||
0 => Diffuse[SelectedChannel]?.GetPointer(),
|
||||
1 => Normals[SelectedChannel]?.GetPointer(),
|
||||
2 => SpecularMasks[SelectedChannel]?.GetPointer(),
|
||||
3 => M.Texture?.GetPointer(),
|
||||
3 => Ao.Texture?.GetPointer(),
|
||||
4 => Emissive[SelectedChannel]?.GetPointer(),
|
||||
_ => null
|
||||
};
|
||||
|
|
@ -332,18 +337,18 @@ public class Material : IDisposable
|
|||
{
|
||||
Emissive[i]?.Dispose();
|
||||
}
|
||||
M.Texture?.Dispose();
|
||||
Ao.Texture?.Dispose();
|
||||
GL.DeleteProgram(_handle);
|
||||
}
|
||||
}
|
||||
|
||||
public struct Mask
|
||||
public struct AoParams
|
||||
{
|
||||
public Texture Texture;
|
||||
public Boost SkinBoost;
|
||||
|
||||
public float AmbientOcclusion;
|
||||
public float Curvature;
|
||||
|
||||
public Boost ColorBoost;
|
||||
public bool HasColorBoost;
|
||||
}
|
||||
|
||||
public struct Boost
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ using FModel.Framework;
|
|||
using ImGuiNET;
|
||||
using OpenTK.Windowing.Common;
|
||||
using System.Numerics;
|
||||
using FModel.Settings;
|
||||
using OpenTK.Graphics.OpenGL4;
|
||||
|
||||
namespace FModel.Views.Snooper;
|
||||
|
||||
|
|
@ -37,9 +39,11 @@ public class Save
|
|||
public class SnimGui
|
||||
{
|
||||
public readonly ImGuiController Controller;
|
||||
private bool _viewportFocus;
|
||||
private readonly Swap _swapper = new ();
|
||||
private readonly Save _saver = new ();
|
||||
private readonly string _renderer;
|
||||
private readonly string _version;
|
||||
private bool _viewportFocus;
|
||||
|
||||
private readonly Vector4 _accentColor = new (0.125f, 0.42f, 0.831f, 1.0f);
|
||||
private readonly Vector4 _alertColor = new (0.831f, 0.573f, 0.125f, 1.0f);
|
||||
|
|
@ -49,6 +53,8 @@ public class SnimGui
|
|||
|
||||
public SnimGui(int width, int height)
|
||||
{
|
||||
_renderer = GL.GetString(StringName.Renderer);
|
||||
_version = "OpenGL " + GL.GetString(StringName.Version);
|
||||
Controller = new ImGuiController(width, height);
|
||||
Theme();
|
||||
}
|
||||
|
|
@ -76,6 +82,46 @@ public class SnimGui
|
|||
|
||||
private void DrawWorld(Snooper s)
|
||||
{
|
||||
if (ImGui.BeginTable("world_details", 2, ImGuiTableFlags.SizingStretchProp))
|
||||
{
|
||||
var length = s.Renderer.Options.Models.Count;
|
||||
Layout("Renderer");ImGui.Text($" : {_renderer}");
|
||||
Layout("Version");ImGui.Text($" : {_version}");
|
||||
Layout("Loaded Models");ImGui.Text($" : x{length}");ImGui.SameLine();
|
||||
|
||||
var b = false;
|
||||
if (ImGui.SmallButton("Save All"))
|
||||
{
|
||||
foreach (var model in s.Renderer.Options.Models.Values)
|
||||
{
|
||||
b |= model.TrySave(out _, out _);
|
||||
}
|
||||
}
|
||||
|
||||
Modal("Saved", b, () =>
|
||||
{
|
||||
ImGui.TextWrapped($"Successfully saved {length} models");
|
||||
ImGui.Separator();
|
||||
|
||||
var size = new Vector2(120, 0);
|
||||
if (ImGui.Button("OK", size))
|
||||
{
|
||||
ImGui.CloseCurrentPopup();
|
||||
}
|
||||
|
||||
ImGui.SetItemDefaultFocus();
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGui.Button("Show In Explorer", size))
|
||||
{
|
||||
Process.Start("explorer.exe", $"/select, \"{UserSettings.Default.ModelDirectory.Replace('/', '\\')}\"");
|
||||
ImGui.CloseCurrentPopup();
|
||||
}
|
||||
});
|
||||
|
||||
ImGui.EndTable();
|
||||
}
|
||||
|
||||
ImGui.SetNextItemOpen(true, ImGuiCond.Appearing);
|
||||
if (ImGui.CollapsingHeader("Editor"))
|
||||
{
|
||||
|
|
@ -194,7 +240,8 @@ public class SnimGui
|
|||
{
|
||||
s.Renderer.Options.SelectModel(guid);
|
||||
}
|
||||
if (ImGui.BeginPopupContextItem())
|
||||
|
||||
Popup(() =>
|
||||
{
|
||||
s.Renderer.Options.SelectModel(guid);
|
||||
if (ImGui.MenuItem("Show", null, model.Show)) model.Show = !model.Show;
|
||||
|
|
@ -206,6 +253,7 @@ public class SnimGui
|
|||
_saver.Value = model.TrySave(out _saver.Label, out _saver.Path);
|
||||
s.WindowShouldFreeze(false);
|
||||
}
|
||||
|
||||
ImGui.BeginDisabled(true);
|
||||
// ImGui.BeginDisabled(!model.HasSkeleton);
|
||||
if (ImGui.Selectable("Animate"))
|
||||
|
|
@ -213,23 +261,24 @@ public class SnimGui
|
|||
s.Renderer.Options.AnimateMesh(true);
|
||||
s.WindowShouldClose(true, false);
|
||||
}
|
||||
|
||||
ImGui.EndDisabled();
|
||||
if (ImGui.Selectable("Teleport To"))
|
||||
{
|
||||
var instancePos = model.Transforms[model.SelectedInstance].Position;
|
||||
s.Camera.Position = new Vector3(instancePos.X, instancePos.Y, instancePos.Z);
|
||||
}
|
||||
|
||||
if (ImGui.Selectable("Delete")) s.Renderer.Options.Models.Remove(guid);
|
||||
if (ImGui.Selectable("Deselect")) s.Renderer.Options.SelectModel(Guid.Empty);
|
||||
ImGui.Separator();
|
||||
if (ImGui.Selectable("Copy Name to Clipboard")) ImGui.SetClipboardText(model.Name);
|
||||
ImGui.EndPopup();
|
||||
}
|
||||
});
|
||||
ImGui.PopID();
|
||||
i++;
|
||||
}
|
||||
|
||||
Popup("Saved", _saver.Value, () =>
|
||||
Modal("Saved", _saver.Value, () =>
|
||||
{
|
||||
ImGui.TextWrapped($"Successfully saved {_saver.Label}");
|
||||
ImGui.Separator();
|
||||
|
|
@ -332,7 +381,7 @@ public class SnimGui
|
|||
{
|
||||
s.Renderer.Options.SelectSection(i);
|
||||
}
|
||||
if (ImGui.BeginPopupContextItem())
|
||||
Popup(() =>
|
||||
{
|
||||
s.Renderer.Options.SelectSection(i);
|
||||
if (ImGui.MenuItem("Show", null, section.Show)) section.Show = !section.Show;
|
||||
|
|
@ -347,13 +396,12 @@ public class SnimGui
|
|||
}
|
||||
ImGui.Separator();
|
||||
if (ImGui.Selectable("Copy Name to Clipboard")) ImGui.SetClipboardText(material.Name);
|
||||
ImGui.EndPopup();
|
||||
}
|
||||
});
|
||||
ImGui.PopID();
|
||||
}
|
||||
ImGui.EndTable();
|
||||
|
||||
Popup("Swap?", _swapper.Value, () =>
|
||||
Modal("Swap?", _swapper.Value, () =>
|
||||
{
|
||||
ImGui.TextWrapped("You're about to swap a material.\nThe window will close for you to extract a material!\n\n");
|
||||
ImGui.Separator();
|
||||
|
|
@ -386,64 +434,12 @@ public class SnimGui
|
|||
|
||||
if (ImGui.BeginTabItem("Transform"))
|
||||
{
|
||||
const int width = 100;
|
||||
var speed = s.Camera.Speed / 100f;
|
||||
|
||||
ImGui.PushID(0); ImGui.BeginDisabled(model.TransformsCount < 2);
|
||||
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X);
|
||||
ImGui.SliderInt("", ref model.SelectedInstance, 0, model.TransformsCount - 1, "Instance %i", ImGuiSliderFlags.AlwaysClamp);
|
||||
ImGui.EndDisabled(); ImGui.PopID();
|
||||
|
||||
ImGui.SetNextItemOpen(true, ImGuiCond.Appearing);
|
||||
if (ImGui.TreeNode("Location"))
|
||||
{
|
||||
ImGui.PushID(1);
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("X", ref model.Transforms[model.SelectedInstance].Position.X, speed, 0f, 0f, "%.2f m");
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("Y", ref model.Transforms[model.SelectedInstance].Position.Z, speed, 0f, 0f, "%.2f m");
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("Z", ref model.Transforms[model.SelectedInstance].Position.Y, speed, 0f, 0f, "%.2f m");
|
||||
|
||||
ImGui.PopID();
|
||||
ImGui.TreePop();
|
||||
}
|
||||
|
||||
ImGui.SetNextItemOpen(true, ImGuiCond.Appearing);
|
||||
if (ImGui.TreeNode("Rotation"))
|
||||
{
|
||||
ImGui.PushID(2);
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("X", ref model.Transforms[model.SelectedInstance].Rotation.Roll, .5f, 0f, 0f, "%.1f°");
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("Y", ref model.Transforms[model.SelectedInstance].Rotation.Pitch, .5f, 0f, 0f, "%.1f°");
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("Z", ref model.Transforms[model.SelectedInstance].Rotation.Yaw, .5f, 0f, 0f, "%.1f°");
|
||||
|
||||
ImGui.PopID();
|
||||
ImGui.TreePop();
|
||||
}
|
||||
|
||||
if (ImGui.TreeNode("Scale"))
|
||||
{
|
||||
ImGui.PushID(3);
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("X", ref model.Transforms[model.SelectedInstance].Scale.X, speed, 0f, 0f, "%.3f");
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("Y", ref model.Transforms[model.SelectedInstance].Scale.Z, speed, 0f, 0f, "%.3f");
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("Z", ref model.Transforms[model.SelectedInstance].Scale.Y, speed, 0f, 0f, "%.3f");
|
||||
|
||||
ImGui.PopID();
|
||||
ImGui.TreePop();
|
||||
}
|
||||
|
||||
model.Transforms[model.SelectedInstance].ImGuiTransform(s.Camera.Speed / 100f);
|
||||
model.UpdateMatrix(model.SelectedInstance);
|
||||
ImGui.EndTabItem();
|
||||
}
|
||||
|
|
@ -586,8 +582,20 @@ public class SnimGui
|
|||
ImGui.PopStyleVar();
|
||||
}
|
||||
|
||||
private void Popup(string title, bool condition, Action content)
|
||||
private void Popup(Action content)
|
||||
{
|
||||
ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(4f));
|
||||
if (ImGui.BeginPopupContextItem())
|
||||
{
|
||||
content();
|
||||
ImGui.EndPopup();
|
||||
}
|
||||
ImGui.PopStyleVar();
|
||||
}
|
||||
|
||||
private void Modal(string title, bool condition, Action content)
|
||||
{
|
||||
ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(4f));
|
||||
var pOpen = true;
|
||||
if (condition) ImGui.OpenPopup(title);
|
||||
ImGui.SetNextWindowPos(ImGui.GetMainViewport().GetCenter(), ImGuiCond.Appearing, new Vector2(.5f));
|
||||
|
|
@ -596,6 +604,7 @@ public class SnimGui
|
|||
content();
|
||||
ImGui.EndPopup();
|
||||
}
|
||||
ImGui.PopStyleVar();
|
||||
}
|
||||
|
||||
private void Window(string name, Action content, bool styled = true)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System.Numerics;
|
||||
using CUE4Parse.UE4.Objects.Core.Math;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace FModel.Views.Snooper;
|
||||
|
||||
|
|
@ -22,4 +23,59 @@ public class Transform
|
|||
Matrix4x4.CreateRotationZ(Helper.DegreesToRadians(Rotation.Pitch)) *
|
||||
Matrix4x4.CreateTranslation(Position) *
|
||||
Relation;
|
||||
|
||||
public void ImGuiTransform(float speed)
|
||||
{
|
||||
const int width = 100;
|
||||
|
||||
ImGui.SetNextItemOpen(true, ImGuiCond.Appearing);
|
||||
if (ImGui.TreeNode("Location"))
|
||||
{
|
||||
ImGui.PushID(1);
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("X", ref Position.X, speed, 0f, 0f, "%.2f m");
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("Y", ref Position.Z, speed, 0f, 0f, "%.2f m");
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("Z", ref Position.Y, speed, 0f, 0f, "%.2f m");
|
||||
|
||||
ImGui.PopID();
|
||||
ImGui.TreePop();
|
||||
}
|
||||
|
||||
ImGui.SetNextItemOpen(true, ImGuiCond.Appearing);
|
||||
if (ImGui.TreeNode("Rotation"))
|
||||
{
|
||||
ImGui.PushID(2);
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("X", ref Rotation.Roll, .5f, 0f, 0f, "%.1f°");
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("Y", ref Rotation.Pitch, .5f, 0f, 0f, "%.1f°");
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("Z", ref Rotation.Yaw, .5f, 0f, 0f, "%.1f°");
|
||||
|
||||
ImGui.PopID();
|
||||
ImGui.TreePop();
|
||||
}
|
||||
|
||||
if (ImGui.TreeNode("Scale"))
|
||||
{
|
||||
ImGui.PushID(3);
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("X", ref Scale.X, speed, 0f, 0f, "%.3f");
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("Y", ref Scale.Z, speed, 0f, 0f, "%.3f");
|
||||
|
||||
ImGui.SetNextItemWidth(width);
|
||||
ImGui.DragFloat("Z", ref Scale.Y, speed, 0f, 0f, "%.3f");
|
||||
|
||||
ImGui.PopID();
|
||||
ImGui.TreePop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user