Skip to content

Commit

Permalink
colored gta map
Browse files Browse the repository at this point in the history
  • Loading branch information
4sval committed Nov 29, 2021
1 parent 347b28c commit 7033e57
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
19 changes: 15 additions & 4 deletions FModel/ViewModels/ModelViewerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,16 +333,22 @@ private void PushLod(CMeshSection[] sections, CMeshVertex[] verts, FRawStaticInd
var isRendering = !parameters.IsNull;
if (isRendering)
{
if (parameters.Diffuse is UTexture2D diffuse)
if (parameters.HasNoTopDiffuseTexture && parameters.DiffuseColor is { A: > 0 } diffuseColor)
{
Application.Current.Dispatcher.Invoke(() => m.AlbedoColor = new Color4(diffuseColor.R, diffuseColor.G, diffuseColor.B, diffuseColor.A));
}
else if (parameters.Diffuse is UTexture2D diffuse)
{
var s = diffuse.Decode()?.Encode().AsStream();
Application.Current.Dispatcher.Invoke(() => m.AlbedoMap = new TextureModel(s));
}

if (parameters.Normal is UTexture2D normal)
{
var s = normal.Decode()?.Encode().AsStream();
Application.Current.Dispatcher.Invoke(() => m.NormalMap = new TextureModel(s));
}

if (parameters.Specular is UTexture2D specular)
{
var mip = specular.GetFirstMip();
Expand Down Expand Up @@ -531,13 +537,18 @@ public bool ShowMaterialColor
SetProperty(ref _showMaterialColor, value);
for (int i = 0; i < Group3d.Count; i++)
{
if (Group3d[i] is not MeshGeometryModel3D { Material: PBRMaterial material })
if (Group3d[i] is not MeshGeometryModel3D { Material: PBRMaterial material } m)
continue;

var index = B(i);
material.RenderAlbedoMap = !_showMaterialColor;
material.AlbedoColor = !_showMaterialColor ? Color4.White :
new Color4(_table[C(index)] / 255, _table[C(index >> 1)] / 255, _table[C(index >> 2)] / 255, 1);

if (_showMaterialColor)
{
m.Tag = material.AlbedoColor;
material.AlbedoColor = new Color4(_table[C(index)] / 255, _table[C(index >> 1)] / 255, _table[C(index >> 2)] / 255, 1);
}
else material.AlbedoColor = (Color4) m.Tag;
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions FModel/Views/About.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@
<TextBlock Text="{Binding Source={x:Static local:Constants.APP_VERSION}, StringFormat={}FModel {0}}" FontSize="15" FontWeight="500" Foreground="#9DA3DD" FontStretch="Expanded" />
<TextBlock Text="Made with &#x2665; by Asval" FontSize="30" FontWeight="700" Foreground="#DAE5F2" HorizontalAlignment="Center" />
</StackPanel>

<StackPanel HorizontalAlignment="Center">
<TextBlock Text="History" FontSize="15" FontWeight="700" Foreground="#9DA3DD" FontStretch="Expanded" />
<TextBlock Text="&#09;&#09;&#09;&#09;" FontSize="25" FontWeight="700" Height="2" Foreground="Transparent" HorizontalAlignment="Center" />
</StackPanel>
<TextBlock FontSize="12" Foreground="#727272" TextWrapping="Wrap" Margin="0 0 0 30"
Text="Since the release in March 2019, we've continuously added new features and improved old ones. It started as a simple UE4 file explorer to parse assets and, as things progressed, became really popular to datamine games and create items icons. FModel 4 is now the most complete and well-made version so far. It features dozens of settings for you to use to make FModel your own." />

<StackPanel HorizontalAlignment="Center">
<TextBlock Text="Contributors" FontSize="15" FontWeight="700" Foreground="#9DA3DD" FontStretch="Expanded" />
<TextBlock Text="&#09;&#09;&#09;&#09;" FontSize="25" FontWeight="700" Height="2" Foreground="Transparent" HorizontalAlignment="Center" />
</StackPanel>
<TextBlock FontSize="12" Foreground="#727272" TextWrapping="Wrap" Margin="0 0 0 30"
Text="With the help of Waddlesworth, Fabian, Maiky, GMatrix, Amr, Officer, Tiger, Mang0e, and a lot more, this project continues to exist. If you're making money off of FModel consider donating to sustain FModel's continued improvements." />

<StackPanel HorizontalAlignment="Center">
<TextBlock Text="Donators" FontSize="15" FontWeight="700" Foreground="#9DA3DD" FontStretch="Expanded" />
<TextBlock Text="&#09;&#09;&#09;&#09;" FontSize="25" FontWeight="700" Height="2" Foreground="Transparent" HorizontalAlignment="Center" />
</StackPanel>
<TextBlock FontSize="12" Foreground="#727272" TextWrapping="Wrap" Margin="0 0 0 30"
Text="TheGameVlog &#x2665;, Quentin &#x2665;, Maiky &#x2665;, HYPEX &#x2665;, Evan, VenomLeaks, JayKey, Fevers, Netu, Laggy, s0ll, RazTracker, Mikey, kyle, Yanteh, Shiina, SexyNutella, Alexander, Jinx, Tector, imatrix, LamZykoss, Frenzy Leaks, LlamaLeaks, XTigerHyperX, FunGames, WeLoveFortnite." />
Text="TheGameVlog &#x2665;, Quentin &#x2665;, Maiky &#x2665;, HYPEX &#x2665;, Evan, VenomLeaks, JayKey, Fevers, Netu, Laggy, s0ll, RazTracker, Mikey, kyle, Yanteh, Shiina, SexyNutella, Alexander, Jinx, koba, Tector, imatrix, LamZykoss, Frenzy Leaks, LlamaLeaks, xplore, XTigerHyperX, FunGames, WeLoveFortnite." />

<StackPanel HorizontalAlignment="Center">
<TextBlock Text="Powered by" FontSize="15" FontWeight="700" Foreground="#9DA3DD" FontStretch="Expanded" />
<TextBlock Text="&#09;&#09;&#09;&#09;" FontSize="25" FontWeight="700" Height="2" Foreground="Transparent" HorizontalAlignment="Center" />
</StackPanel>
<TextBlock FontSize="12" Foreground="#727272" TextWrapping="Wrap" Margin="0 0 0 30"
Text="CUE4Parse, BenBot, Fortnite-Api, AdonisUI, AvalonEdit, CSCore, NVorbis, VgmStream, RestSharp, Serilog, Discord, K4os.Compression.LZ4, Ookii.Dialogs, Newtonsoft.Json, ..." />
</StackPanel>
</adonisControls:AdonisWindow>
</adonisControls:AdonisWindow>

0 comments on commit 7033e57

Please sign in to comment.