diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 7b4aaf97..79a6e69c 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -86,7 +86,8 @@ public class CUE4ParseViewModel : ViewModel { return Application.Current.Dispatcher.Invoke(delegate { - return _snooper ??= new Snooper(GameWindowSettings.Default, + return _snooper ??= new Snooper( + new GameWindowSettings { RenderFrequency = 240 }, new NativeWindowSettings { Size = new OpenTK.Mathematics.Vector2i( diff --git a/FModel/Views/Snooper/Lights/PointLight.cs b/FModel/Views/Snooper/Lights/PointLight.cs index ef916834..81ac8e58 100644 --- a/FModel/Views/Snooper/Lights/PointLight.cs +++ b/FModel/Views/Snooper/Lights/PointLight.cs @@ -1,6 +1,5 @@ using System; using CUE4Parse.UE4.Assets.Exports; -using CUE4Parse.UE4.Objects.Core.Math; using CUE4Parse.UE4.Objects.Core.Misc; using FModel.Views.Snooper.Shading; using ImGuiNET; diff --git a/FModel/Views/Snooper/Lights/SpotLight.cs b/FModel/Views/Snooper/Lights/SpotLight.cs index 1f7e9468..1d861551 100644 --- a/FModel/Views/Snooper/Lights/SpotLight.cs +++ b/FModel/Views/Snooper/Lights/SpotLight.cs @@ -1,5 +1,4 @@ using CUE4Parse.UE4.Assets.Exports; -using CUE4Parse.UE4.Objects.Core.Math; using CUE4Parse.UE4.Objects.Core.Misc; using FModel.Views.Snooper.Shading; using ImGuiNET; diff --git a/FModel/Views/Snooper/Models/Model.cs b/FModel/Views/Snooper/Models/Model.cs index 827aac75..70200bf6 100644 --- a/FModel/Views/Snooper/Models/Model.cs +++ b/FModel/Views/Snooper/Models/Model.cs @@ -83,6 +83,8 @@ public class Model : IDisposable Type = export.ExportType; UvCount = 1; Box = new FBox(new FVector(-2f), new FVector(2f)); + Sockets = Array.Empty(); + Morphs = Array.Empty(); Transforms = new List(); } @@ -97,8 +99,6 @@ public class Model : IDisposable if (export.Sockets[i].Load() is not { } socket) continue; Sockets[i] = new Socket(socket, Transforms[0]); } - - Morphs = Array.Empty(); } public Model(USkeletalMesh export, CSkeletalMesh skeletalMesh) : this(export, skeletalMesh, Transform.Identity) {} @@ -301,7 +301,7 @@ public class Model : IDisposable public void Setup(Options options) { _handle = GL.CreateProgram(); - var broken = GL.GetInteger(GetPName.MaxTextureUnits) == 0; + var broken = GL.GetInteger(GetPName.MaxTextureCoords) == 0; _ebo = new BufferObject(Indices, BufferTarget.ElementArrayBuffer); _vbo = new BufferObject(Vertices, BufferTarget.ArrayBuffer); diff --git a/FModel/Views/Snooper/Shading/Shader.cs b/FModel/Views/Snooper/Shading/Shader.cs index 13974e63..4cbc9b13 100644 --- a/FModel/Views/Snooper/Shading/Shader.cs +++ b/FModel/Views/Snooper/Shading/Shader.cs @@ -42,7 +42,7 @@ public class Shader : IDisposable var handle = GL.CreateShader(type); var content = reader.ReadToEnd(); - if (file.Equals("default.frag") && GL.GetInteger(GetPName.MaxTextureUnits) == 0) + if (file.Equals("default.frag") && GL.GetInteger(GetPName.MaxTextureCoords) == 0) content = content.Replace("#define MAX_UV_COUNT 8", "#define MAX_UV_COUNT 1"); GL.ShaderSource(handle, content);