This commit is contained in:
4sval 2023-01-14 03:09:26 +01:00
parent 481d9d3032
commit f98c8b34da
5 changed files with 6 additions and 7 deletions

View File

@ -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(

View File

@ -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;

View File

@ -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;

View File

@ -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<Socket>();
Morphs = Array.Empty<Morph>();
Transforms = new List<Transform>();
}
@ -97,8 +99,6 @@ public class Model : IDisposable
if (export.Sockets[i].Load<UStaticMeshSocket>() is not { } socket) continue;
Sockets[i] = new Socket(socket, Transforms[0]);
}
Morphs = Array.Empty<Morph>();
}
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<uint>(Indices, BufferTarget.ElementArrayBuffer);
_vbo = new BufferObject<float>(Vertices, BufferTarget.ArrayBuffer);

View File

@ -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);