mirror of
https://github.com/4sval/FModel.git
synced 2026-09-30 13:09:31 -05:00
point clouds for now + reduced opacity
This commit is contained in:
Submodule CUE4Parse updated: 8360aeea93...05f36306fa
@@ -89,6 +89,7 @@ uniform Parameters uParameters;
|
|||||||
uniform Light uLights[MAX_LIGHT_COUNT];
|
uniform Light uLights[MAX_LIGHT_COUNT];
|
||||||
uniform int uNumLights;
|
uniform int uNumLights;
|
||||||
uniform int uUvCount;
|
uniform int uUvCount;
|
||||||
|
uniform float uOpacity;
|
||||||
uniform bool uHasVertexColors;
|
uniform bool uHasVertexColors;
|
||||||
uniform vec3 uSectionColor;
|
uniform vec3 uSectionColor;
|
||||||
uniform bool bVertexColors[6];
|
uniform bool bVertexColors[6];
|
||||||
@@ -214,7 +215,7 @@ void main()
|
|||||||
{
|
{
|
||||||
if (bVertexColors[1])
|
if (bVertexColors[1])
|
||||||
{
|
{
|
||||||
FragColor = vec4(uSectionColor, 1.0);
|
FragColor = vec4(uSectionColor, uOpacity);
|
||||||
}
|
}
|
||||||
else if (bVertexColors[2] && uHasVertexColors)
|
else if (bVertexColors[2] && uHasVertexColors)
|
||||||
{
|
{
|
||||||
@@ -224,7 +225,7 @@ void main()
|
|||||||
{
|
{
|
||||||
int layer = LayerToIndex();
|
int layer = LayerToIndex();
|
||||||
vec3 normals = ComputeNormals(layer);
|
vec3 normals = ComputeNormals(layer);
|
||||||
FragColor = vec4(normals, 1.0);
|
FragColor = vec4(normals, uOpacity);
|
||||||
}
|
}
|
||||||
else if (bVertexColors[4])
|
else if (bVertexColors[4])
|
||||||
{
|
{
|
||||||
@@ -281,6 +282,6 @@ void main()
|
|||||||
}
|
}
|
||||||
|
|
||||||
result = result / (result + vec3(1.0));
|
result = result / (result + vec3(1.0));
|
||||||
FragColor = vec4(pow(result, vec3(1.0 / 2.2)), 1.0);
|
FragColor = vec4(pow(result, vec3(1.0 / 2.2)), uOpacity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using CUE4Parse_Conversion;
|
||||||
|
using CUE4Parse_Conversion.Animations;
|
||||||
using CUE4Parse.UE4.Versions;
|
using CUE4Parse.UE4.Versions;
|
||||||
using CUE4Parse_Conversion.Meshes;
|
using CUE4Parse_Conversion.Meshes;
|
||||||
using CUE4Parse_Conversion.Textures;
|
using CUE4Parse_Conversion.Textures;
|
||||||
@@ -48,6 +50,25 @@ namespace FModel.Settings
|
|||||||
return endpoint.Overwrite || endpoint.IsValid;
|
return endpoint.Overwrite || endpoint.IsValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public ExporterOptions ExportOptions => new()
|
||||||
|
{
|
||||||
|
LodFormat = Default.LodExportFormat,
|
||||||
|
MeshFormat = Default.MeshExportFormat,
|
||||||
|
AnimFormat = Default.MeshExportFormat switch
|
||||||
|
{
|
||||||
|
EMeshFormat.UEFormat => EAnimFormat.UEFormat,
|
||||||
|
_ => EAnimFormat.ActorX
|
||||||
|
},
|
||||||
|
MaterialFormat = Default.MaterialExportFormat,
|
||||||
|
TextureFormat = Default.TextureExportFormat,
|
||||||
|
SocketFormat = Default.SocketExportFormat,
|
||||||
|
CompressionFormat = Default.CompressionFormat,
|
||||||
|
Platform = Default.CurrentDir.TexturePlatform,
|
||||||
|
ExportMorphTargets = Default.SaveMorphTargets,
|
||||||
|
ExportMaterials = Default.SaveEmbeddedMaterials
|
||||||
|
};
|
||||||
|
|
||||||
private bool _showChangelog = true;
|
private bool _showChangelog = true;
|
||||||
public bool ShowChangelog
|
public bool ShowChangelog
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -959,24 +959,7 @@ public class CUE4ParseViewModel : ViewModel
|
|||||||
|
|
||||||
private void SaveExport(UObject export, bool auto)
|
private void SaveExport(UObject export, bool auto)
|
||||||
{
|
{
|
||||||
var exportOptions = new ExporterOptions
|
var toSave = new Exporter(export, UserSettings.Default.ExportOptions);
|
||||||
{
|
|
||||||
LodFormat = UserSettings.Default.LodExportFormat,
|
|
||||||
MeshFormat = UserSettings.Default.MeshExportFormat,
|
|
||||||
AnimFormat = UserSettings.Default.MeshExportFormat switch
|
|
||||||
{
|
|
||||||
EMeshFormat.ActorX => EAnimFormat.ActorX,
|
|
||||||
_ => EAnimFormat.UEFormat // i think we said ueformat default is okay
|
|
||||||
},
|
|
||||||
MaterialFormat = UserSettings.Default.MaterialExportFormat,
|
|
||||||
TextureFormat = UserSettings.Default.TextureExportFormat,
|
|
||||||
SocketFormat = UserSettings.Default.SocketExportFormat,
|
|
||||||
CompressionFormat = UserSettings.Default.CompressionFormat,
|
|
||||||
Platform = UserSettings.Default.CurrentDir.TexturePlatform,
|
|
||||||
ExportMorphTargets = UserSettings.Default.SaveMorphTargets,
|
|
||||||
ExportMaterials = UserSettings.Default.SaveEmbeddedMaterials
|
|
||||||
};
|
|
||||||
var toSave = new Exporter(export, exportOptions);
|
|
||||||
|
|
||||||
string dir;
|
string dir;
|
||||||
if (!auto)
|
if (!auto)
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ public class Animation : IDisposable
|
|||||||
if (ImGui.MenuItem("Save"))
|
if (ImGui.MenuItem("Save"))
|
||||||
{
|
{
|
||||||
s.WindowShouldFreeze(true);
|
s.WindowShouldFreeze(true);
|
||||||
saver.Value = new Exporter(_export).TryWriteToDir(new DirectoryInfo(UserSettings.Default.ModelDirectory), out saver.Label, out saver.Path);
|
saver.Value = new Exporter(_export, UserSettings.Default.ExportOptions).TryWriteToDir(new DirectoryInfo(UserSettings.Default.ModelDirectory), out saver.Label, out saver.Path);
|
||||||
s.WindowShouldFreeze(false);
|
s.WindowShouldFreeze(false);
|
||||||
}
|
}
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|||||||
@@ -46,9 +46,14 @@ public class Collision : IDisposable
|
|||||||
shader.SetUniform("uCollisionMatrix", _transform.Matrix);
|
shader.SetUniform("uCollisionMatrix", _transform.Matrix);
|
||||||
|
|
||||||
_vao.Bind();
|
_vao.Bind();
|
||||||
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line);
|
if (_indexData.Length > 0)
|
||||||
GL.DrawElements(PrimitiveType.Triangles, _ebo.Size, DrawElementsType.UnsignedInt, 0);
|
{
|
||||||
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
|
GL.DrawElements(PrimitiveType.Triangles, _ebo.Size, DrawElementsType.UnsignedInt, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GL.DrawArrays(PrimitiveType.Points, 0, _vbo.Size);
|
||||||
|
}
|
||||||
_vao.Unbind();
|
_vao.Unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ public abstract class UModel : IRenderableModel
|
|||||||
Vertices[baseIndex + count++] = vert.Tangent.Y;
|
Vertices[baseIndex + count++] = vert.Tangent.Y;
|
||||||
Vertices[baseIndex + count++] = vert.UV.U;
|
Vertices[baseIndex + count++] = vert.UV.U;
|
||||||
Vertices[baseIndex + count++] = vert.UV.V;
|
Vertices[baseIndex + count++] = vert.UV.V;
|
||||||
Vertices[baseIndex + count++] = hasCustomUvs ? lod.ExtraUV.Value[0][i].U : .5f;
|
Vertices[baseIndex + count++] = hasCustomUvs ? lod.ExtraUV.Value[0][i].U - 1 : .5f;
|
||||||
|
|
||||||
if (HasVertexColors)
|
if (HasVertexColors)
|
||||||
{
|
{
|
||||||
@@ -250,6 +250,7 @@ public abstract class UModel : IRenderableModel
|
|||||||
if (!outline)
|
if (!outline)
|
||||||
{
|
{
|
||||||
shader.SetUniform("uUvCount", UvCount);
|
shader.SetUniform("uUvCount", UvCount);
|
||||||
|
shader.SetUniform("uOpacity", ShowCollisions && IsSelected ? 0.75f : 1f);
|
||||||
shader.SetUniform("uHasVertexColors", HasVertexColors);
|
shader.SetUniform("uHasVertexColors", HasVertexColors);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,10 +309,15 @@ public abstract class UModel : IRenderableModel
|
|||||||
{
|
{
|
||||||
shader.SetUniform("uInstanceMatrix", GetTransform().Matrix);
|
shader.SetUniform("uInstanceMatrix", GetTransform().Matrix);
|
||||||
shader.SetUniform("uScaleDown", Constants.SCALE_DOWN_RATIO);
|
shader.SetUniform("uScaleDown", Constants.SCALE_DOWN_RATIO);
|
||||||
|
|
||||||
|
GL.Disable(EnableCap.CullFace);
|
||||||
|
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line);
|
||||||
foreach (var collision in Collisions)
|
foreach (var collision in Collisions)
|
||||||
{
|
{
|
||||||
collision.Render(shader);
|
collision.Render(shader);
|
||||||
}
|
}
|
||||||
|
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
|
||||||
|
GL.Enable(EnableCap.CullFace);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(Options options)
|
public void Update(Options options)
|
||||||
@@ -375,18 +381,7 @@ public abstract class UModel : IRenderableModel
|
|||||||
|
|
||||||
public bool Save(out string label, out string savedFilePath)
|
public bool Save(out string label, out string savedFilePath)
|
||||||
{
|
{
|
||||||
var exportOptions = new ExporterOptions
|
var toSave = new Exporter(_export, UserSettings.Default.ExportOptions);
|
||||||
{
|
|
||||||
LodFormat = UserSettings.Default.LodExportFormat,
|
|
||||||
MeshFormat = UserSettings.Default.MeshExportFormat,
|
|
||||||
MaterialFormat = UserSettings.Default.MaterialExportFormat,
|
|
||||||
TextureFormat = UserSettings.Default.TextureExportFormat,
|
|
||||||
SocketFormat = UserSettings.Default.SocketExportFormat,
|
|
||||||
Platform = UserSettings.Default.CurrentDir.TexturePlatform,
|
|
||||||
ExportMorphTargets = UserSettings.Default.SaveMorphTargets,
|
|
||||||
ExportMaterials = UserSettings.Default.SaveEmbeddedMaterials
|
|
||||||
};
|
|
||||||
var toSave = new Exporter(_export, exportOptions);
|
|
||||||
return toSave.TryWriteToDir(new DirectoryInfo(UserSettings.Default.ModelDirectory), out label, out savedFilePath);
|
return toSave.TryWriteToDir(new DirectoryInfo(UserSettings.Default.ModelDirectory), out label, out savedFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user