mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-25 22:10:22 +00:00
Update material presets
This commit is contained in:
parent
398d42ae2e
commit
706c03f4ac
6 changed files with 90 additions and 16 deletions
|
@ -884,26 +884,17 @@ namespace Toolbox.Library
|
|||
if ((sourcePixel & 0x8000) == 0x8000)
|
||||
{
|
||||
a = 0xFF;
|
||||
r = (byte)((sourcePixel & 0x7C00) >> 10);
|
||||
g = (byte)((sourcePixel & 0x3E0) >> 5);
|
||||
b = (byte)(sourcePixel & 0x1F);
|
||||
|
||||
r = (byte)((r << (8 - 5)) | (r >> (10 - 8)));
|
||||
g = (byte)((g << (8 - 5)) | (g >> (10 - 8)));
|
||||
b = (byte)((b << (8 - 5)) | (b >> (10 - 8)));
|
||||
r = Expand5to8((sourcePixel >> 10) & 0x1F);
|
||||
g = Expand5to8((sourcePixel >> 5) & 0x1F);
|
||||
b = Expand5to8(sourcePixel & 0x1F);
|
||||
}
|
||||
//Alpha bits
|
||||
else
|
||||
{
|
||||
a = (byte)((sourcePixel & 0x7000) >> 12);
|
||||
r = (byte)((sourcePixel & 0xF00) >> 8);
|
||||
g = (byte)((sourcePixel & 0xF0) >> 4);
|
||||
b = (byte)(sourcePixel & 0xF);
|
||||
|
||||
a = (byte)((a << (8 - 3)) | (a << (8 - 6)) | (a >> (9 - 8)));
|
||||
r = (byte)((r << (8 - 4)) | r);
|
||||
g = (byte)((g << (8 - 4)) | g);
|
||||
b = (byte)((b << (8 - 4)) | b);
|
||||
a = Expand3to8(sourcePixel >> 12);
|
||||
r = Expand4to8((sourcePixel >> 8) & 0x0F);
|
||||
g = Expand4to8((sourcePixel >> 4) & 0x0F);
|
||||
b = Expand4to8(sourcePixel & 0x0F);
|
||||
}
|
||||
|
||||
dest[destOffset + 0] = b;
|
||||
|
@ -911,6 +902,23 @@ namespace Toolbox.Library
|
|||
dest[destOffset + 2] = r;
|
||||
dest[destOffset + 3] = a;
|
||||
}
|
||||
|
||||
//From noclip https://github.com/magcius/noclip.website/blob/e5c302ff52ad72429e5d0dc64062420546010831/src/gx/gx_texture.ts
|
||||
private static byte Expand5to8(int n)
|
||||
{
|
||||
return (byte)((n << (8 - 5)) | (n >> (10 - 8)));
|
||||
}
|
||||
|
||||
private static byte Expand4to8(int n)
|
||||
{
|
||||
return (byte)((n << 4) | n);
|
||||
}
|
||||
|
||||
private static byte Expand3to8(int n)
|
||||
{
|
||||
return (byte)((n << (8 - 3)) | (n << (8 - 6)) | (n >> (9 - 8)));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static Tuple<byte[], ushort[]> EncodeFromBitmap(System.Drawing.Bitmap bitmap, TextureFormats Format, PaletteFormats PaletteFormat = PaletteFormats.RGB565)
|
||||
|
|
31
Toolbox/KclMaterialPresets/Mario Kart 8.json
Normal file
31
Toolbox/KclMaterialPresets/Mario Kart 8.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"GameTitle": "Mario Kart 8 Wii U / Deluxe",
|
||||
"PrismThickness": 30.0,
|
||||
"SphereRadius": 25.0,
|
||||
"MaterialPresets": {
|
||||
"0": "Road",
|
||||
"2": "Road (Bumpy)",
|
||||
"4": "Road (Slippery)",
|
||||
"6": "Road (Offroad Sand)",
|
||||
"9": "Road (Slippery Effect Only)",
|
||||
"10": "Road (Booster)",
|
||||
"16": "Latiku",
|
||||
"31": "Glider",
|
||||
"32": "Road (Foamy Sound)",
|
||||
"40": "Road (Offroad, clicking Sound)",
|
||||
"56": "Unsolid",
|
||||
"60": "Water (Drown reset)",
|
||||
"64": "Road (Rocky Sound)",
|
||||
"81": "Wall"
|
||||
"129": "Road (3DS MP Piano)"
|
||||
"134": "Road (RoyalR Offroad Grass)"
|
||||
"161": "Road (3DS MP Xylophone)"
|
||||
"193": "Road (3DS MP Vibraphone)"
|
||||
"227": "Road (SNES RR road)"
|
||||
"297": "Road (MKS Offroad Grass)"
|
||||
"500": "Road (Water Wall)"
|
||||
"4096": "Road (Stunt)"
|
||||
"4106": "Road (Booster + Stunt)"
|
||||
"4108": "Road (Stunt + Glider)"
|
||||
}
|
||||
}
|
7
Toolbox/KclMaterialPresets/Mario Odyssey.json
Normal file
7
Toolbox/KclMaterialPresets/Mario Odyssey.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"GameTitle": "Mario Odyssey",
|
||||
"PrismThickness": 40.0,
|
||||
"SphereRadius": 0.0,
|
||||
"MaterialPresets": {
|
||||
}
|
||||
}
|
8
Toolbox/KclMaterialPresets/Splatoon 1.json
Normal file
8
Toolbox/KclMaterialPresets/Splatoon 1.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"GameTitle": "Splatoon 1",
|
||||
"PrismThickness": 30.0,
|
||||
"SphereRadius": 25.0,
|
||||
"MaterialPresets": {
|
||||
"0": "Unknown",
|
||||
}
|
||||
}
|
8
Toolbox/KclMaterialPresets/Splatoon 2.json
Normal file
8
Toolbox/KclMaterialPresets/Splatoon 2.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"GameTitle": "Splatoon 2",
|
||||
"PrismThickness": 30.0,
|
||||
"SphereRadius": 25.0,
|
||||
"MaterialPresets": {
|
||||
"0": "Unknown",
|
||||
}
|
||||
}
|
|
@ -183,6 +183,18 @@
|
|||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="KclMaterialPresets\Mario Kart 8.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="KclMaterialPresets\Mario Odyssey.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="KclMaterialPresets\Splatoon 1.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="KclMaterialPresets\Splatoon 2.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\app.manifest" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
|
|
Loading…
Reference in a new issue