Skip to content

Commit

Permalink
submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
4sval committed Oct 25, 2022
1 parent 70c2754 commit edfa327
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "CUE4Parse"]
path = CUE4Parse
url = https://github.com/FabianFG/CUE4Parse
[submodule "EpicManifestParser"]
path = EpicManifestParser
url = https://github.com/FModel/EpicManifestParser
14 changes: 7 additions & 7 deletions FModel/Views/Snooper/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ public void Render(Camera cam)
_shader.SetUniform("uProjection", projMatrix);
_shader.SetUniform("viewPos", cam.Position);

_shader.SetUniform("material.diffuseMap", 0);
_shader.SetUniform("material.normalMap", 1);
_shader.SetUniform("material.specularMap", 2);
_shader.SetUniform("material.emissionMap", 3);
// _shader.SetUniform("material.diffuseMap", 0);
// _shader.SetUniform("material.normalMap", 1);
// _shader.SetUniform("material.specularMap", 2);
// _shader.SetUniform("material.emissionMap", 3);

_shader.SetUniform("light.position", cam.Position);
_shader.SetUniform("light.diffuse", _diffuseLight);
Expand Down Expand Up @@ -186,13 +186,13 @@ private Camera LoadWorld(CancellationToken cancellationToken, UWorld original)

if (textureDataIdx.TryGetValue(out FPackageIndex diffuse, "Diffuse") &&
diffuse.Load() is UTexture2D diffuseTexture)
model.Sections[j].Material.Parameters.Textures["Diffuse"] = diffuseTexture;
model.Sections[j].Material.Parameters.Textures[CMaterialParams2.Diffuse[j]] = diffuseTexture;
if (textureDataIdx.TryGetValue(out FPackageIndex normal, "Normal") &&
normal.Load() is UTexture2D normalTexture)
model.Sections[j].Material.Parameters.Textures["Normals"] = normalTexture;
model.Sections[j].Material.Parameters.Textures[CMaterialParams2.Normals[j]] = normalTexture;
if (textureDataIdx.TryGetValue(out FPackageIndex specular, "Specular") &&
specular.Load() is UTexture2D specularTexture)
model.Sections[j].Material.Parameters.Textures["SpecularMasks"] = specularTexture;
model.Sections[j].Material.Parameters.Textures[CMaterialParams2.SpecularMasks[j]] = specularTexture;
}
}
if (staticMeshComp.TryGetValue(out FPackageIndex[] overrideMaterials, "OverrideMaterials"))
Expand Down
2 changes: 2 additions & 0 deletions FModel/Views/Snooper/Snooper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ private unsafe void WindowShouldClose(bool value, bool clear)
{
_renderer.Cache.DisposeModels();
_renderer.Cache.ClearModels();
_renderer.Cache.DisposeTextures();
_renderer.Cache.ClearTextures();
_renderer.Settings.Reset();
_previousSpeed = 0f;
}
Expand Down

0 comments on commit edfa327

Please sign in to comment.