Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
4sval committed May 18, 2024
1 parent 0bef596 commit d7dac03
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CUE4Parse
2 changes: 1 addition & 1 deletion FModel/Resources/default.frag
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ vec3 CalcLight(int layer, vec3 normals, vec3 position, vec3 color, float attenua

float nDotH = max(dot(n, h), 0.0);
float hDotv = max(dot(h, v), 0.0);
float nDotL = max(dot(n, l), 0.4);
float nDotL = max(dot(n, l), 0.0);
float nDotV = max(dot(n, v), 0.0);

vec3 f = schlickFresnel(fLambert, specular_masks.g, hDotv);
Expand Down
2 changes: 2 additions & 0 deletions FModel/Resources/default.vert
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ void main()
}
}
finalPos = normalize(finalPos);
finalNormal = normalize(finalNormal);
finalTangent = normalize(finalTangent);
}
else
{
Expand Down
5 changes: 3 additions & 2 deletions FModel/Resources/outline.vert
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ void main()
}
}
finalPos = normalize(finalPos);
finalNormal = normalize(finalNormal);
}
else
{
Expand All @@ -62,8 +63,8 @@ void main()
}

vec4 worldPos = vInstanceMatrix * finalPos;
float scaleFactor = distance(worldPos.xyz, uViewPos) * 0.0035;
vec4 nor = transpose(inverse(vInstanceMatrix)) * normalize(finalNormal) * scaleFactor;
float scaleFactor = length(uViewPos - worldPos.xyz) * 0.0035;
vec4 nor = transpose(inverse(vInstanceMatrix)) * finalNormal * scaleFactor;
finalPos.xyz += nor.xyz;

gl_Position = uProjection * uView * vInstanceMatrix * finalPos;
Expand Down
2 changes: 1 addition & 1 deletion FModel/Views/Snooper/Shading/Material.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void Setup(Options options, int uvCount)

if (uvCount < 1 || Parameters.IsNull)
{
Diffuse = [new Texture(new FLinearColor(1f, 1f, 1f, 1f))];
Diffuse = [new Texture(new FLinearColor(.6f, .6f, .6f, 1f))];
Normals = [new Texture(new FLinearColor(0.498f, 0.498f, 0.996f, 1f))];
SpecularMasks = [new Texture(new FLinearColor(1f, 0.5f, 0.5f, 1f))];
Emissive = new Texture[1];
Expand Down
13 changes: 8 additions & 5 deletions FModel/Views/Snooper/SnimGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,11 @@ private void DrawOuliner(Snooper s)
ImGui.TableNextColumn();
ImGui.Text(model.UvCount.ToString("D"));
ImGui.TableNextColumn();
if (ImGui.Selectable(model.Name, s.Renderer.Options.SelectedModel == guid, ImGuiSelectableFlags.SpanAllColumns))
var doubleClick = false;
if (ImGui.Selectable(model.Name, s.Renderer.Options.SelectedModel == guid, ImGuiSelectableFlags.SpanAllColumns | ImGuiSelectableFlags.AllowDoubleClick))
{
s.Renderer.Options.SelectModel(guid);
doubleClick = ImGui.IsMouseDoubleClicked(ImGuiMouseButton.Left);
}
Popup(() =>
{
Expand Down Expand Up @@ -456,16 +458,17 @@ private void DrawOuliner(Snooper s)
s.Renderer.IsSkeletonTreeOpen = true;
ImGui.SetWindowFocus("Skeleton Tree");
}
if (ImGui.MenuItem("Teleport To"))
{
s.Renderer.CameraOp.Teleport(model.GetTransform().Matrix.Translation, model.Box);
}
doubleClick = ImGui.MenuItem("Teleport To");
if (ImGui.MenuItem("Delete")) s.Renderer.Options.RemoveModel(guid);
if (ImGui.MenuItem("Deselect")) s.Renderer.Options.SelectModel(Guid.Empty);
ImGui.Separator();
if (ImGui.MenuItem("Copy Path to Clipboard")) ImGui.SetClipboardText(model.Path);
});
if (doubleClick)
{
s.Renderer.CameraOp.Teleport(model.GetTransform().Matrix.Translation, model.Box);
}
ImGui.TableNextColumn();
ImGui.Image(s.Renderer.Options.Icons[model.Attachments.Icon].GetPointer(), new Vector2(_tableWidth));
Expand Down

0 comments on commit d7dac03

Please sign in to comment.