mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-26 22:40:27 +00:00
Fix sampler saving and lod options for wii u samplers
This commit is contained in:
parent
a2d23b0d43
commit
0b2dd29bae
9 changed files with 18 additions and 7 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -931,9 +931,15 @@ namespace FirstPlugin
|
|||
{
|
||||
mat.TextureRefs = new List<string>();
|
||||
mat.TextureRefs.Clear();
|
||||
mat.Samplers.Clear();
|
||||
mat.SamplerDict.Clear();
|
||||
|
||||
foreach (var textu in m.TextureMaps)
|
||||
foreach (MatTexture textu in m.TextureMaps)
|
||||
{
|
||||
mat.SamplerDict.Add(textu.SamplerName);
|
||||
mat.Samplers.Add(textu.switchSampler);
|
||||
mat.TextureRefs.Add(textu.Name);
|
||||
}
|
||||
|
||||
}
|
||||
public static void WriteRenderInfo(this FMAT m, Material mat)
|
||||
|
|
|
@ -738,9 +738,6 @@ namespace FirstPlugin
|
|||
|
||||
Sampler sampler = new Sampler();
|
||||
sampler.TexSampler = textu.wiiUSampler;
|
||||
sampler.TexSampler.MinLod = textu.MinLod;
|
||||
sampler.TexSampler.MaxLod = textu.MaxLod;
|
||||
sampler.TexSampler.LodBias = textu.BiasLod;
|
||||
sampler.Name = textu.SamplerName;
|
||||
mat.Samplers.Add(textu.SamplerName, sampler);
|
||||
|
||||
|
|
|
@ -286,7 +286,8 @@ namespace FirstPlugin
|
|||
surf.mipOffset = new uint[0];
|
||||
surf.mipData = null;
|
||||
surf.tileMode = (uint)GX2.GX2TileMode.MODE_2D_TILED_THIN1;
|
||||
surf.swizzle = 0;
|
||||
surf.swizzle = (uint)(SheetIndex);
|
||||
surf.swizzle *= 2;
|
||||
surf.numArray = 1;
|
||||
|
||||
var surfaces = GX2.Decode(surf);
|
||||
|
@ -317,6 +318,7 @@ namespace FirstPlugin
|
|||
prop.ArrayCount = ArrayCount;
|
||||
prop.ImageSize = (uint)TextureTGLP.SheetDataList[SheetIndex].Length;
|
||||
prop.Format = Format;
|
||||
prop.Swizzle = (uint)(SheetIndex * 2);
|
||||
|
||||
editor.Text = Text;
|
||||
editor.LoadProperties(prop);
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -837,6 +837,12 @@ namespace Switch_Toolbox.Library
|
|||
[Description("The image size in bytes.")]
|
||||
[Category("Image Info")]
|
||||
public uint ImageSize { get; set; }
|
||||
|
||||
[Browsable(true)]
|
||||
[ReadOnly(true)]
|
||||
[Description("The swizzle value.")]
|
||||
[Category("Image Info")]
|
||||
public uint Swizzle { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue