mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 20:24:17 +01:00
Fix skin.shpk
This commit is contained in:
parent
8fa0875ec6
commit
8468ed2c07
1 changed files with 4 additions and 15 deletions
|
|
@ -340,21 +340,7 @@ public class MaterialExporter
|
||||||
var diffuse = material.Textures[TextureUsage.SamplerDiffuse];
|
var diffuse = material.Textures[TextureUsage.SamplerDiffuse];
|
||||||
var normal = material.Textures[TextureUsage.SamplerNormal];
|
var normal = material.Textures[TextureUsage.SamplerNormal];
|
||||||
|
|
||||||
// Create a copy of the normal that's the same size as the diffuse for purposes of copying the opacity across.
|
// The normal also stores the skin color influence (.b) and wetness mask (.a) - remove.
|
||||||
var resizedNormal = normal.Clone(context => context.Resize(diffuse.Width, diffuse.Height));
|
|
||||||
diffuse.ProcessPixelRows(resizedNormal, (diffuseAccessor, normalAccessor) =>
|
|
||||||
{
|
|
||||||
for (var y = 0; y < diffuseAccessor.Height; y++)
|
|
||||||
{
|
|
||||||
var diffuseSpan = diffuseAccessor.GetRowSpan(y);
|
|
||||||
var normalSpan = normalAccessor.GetRowSpan(y);
|
|
||||||
|
|
||||||
for (var x = 0; x < diffuseSpan.Length; x++)
|
|
||||||
diffuseSpan[x].A = normalSpan[x].B;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Clear the blue channel out of the normal now that we're done with it.
|
|
||||||
normal.ProcessPixelRows(normalAccessor =>
|
normal.ProcessPixelRows(normalAccessor =>
|
||||||
{
|
{
|
||||||
for (var y = 0; y < normalAccessor.Height; y++)
|
for (var y = 0; y < normalAccessor.Height; y++)
|
||||||
|
|
@ -362,7 +348,10 @@ public class MaterialExporter
|
||||||
var normalSpan = normalAccessor.GetRowSpan(y);
|
var normalSpan = normalAccessor.GetRowSpan(y);
|
||||||
|
|
||||||
for (var x = 0; x < normalSpan.Length; x++)
|
for (var x = 0; x < normalSpan.Length; x++)
|
||||||
|
{
|
||||||
normalSpan[x].B = byte.MaxValue;
|
normalSpan[x].B = byte.MaxValue;
|
||||||
|
normalSpan[x].A = byte.MaxValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue