Skip to content

Commit

Permalink
Brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
floxay committed Nov 24, 2021
1 parent 3da0750 commit dce3d1f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions FModel/ViewModels/ModelViewerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,14 @@ private void PushLod(CMeshSection[] sections, CMeshVertex[] verts, FRawStaticInd
{
var offset = 0;
fixed (byte* d = data)
{
for (var i = 0; i < mip.SizeX * mip.SizeY; i++)
{
d[offset] = 0;
(d[offset+1], d[offset+2]) = (d[offset+2], d[offset+1]); // swap G and B
(d[offset + 1], d[offset + 2]) = (d[offset + 2], d[offset + 1]); // swap G and B
offset += 4;
}
}
}
parameters.RoughnessValue = 1;
parameters.MetallicValue = 1;
Expand All @@ -403,12 +405,14 @@ private void PushLod(CMeshSection[] sections, CMeshVertex[] verts, FRawStaticInd
{
var offset = 0;
fixed (byte* d = data)
{
for (var i = 0; i < mip.SizeX * mip.SizeY; i++)
{
(d[offset], d[offset+2]) = (d[offset+2], d[offset]); // swap R and B
(d[offset], d[offset+1]) = (d[offset+1], d[offset]); // swap R and G
(d[offset], d[offset + 2]) = (d[offset + 2], d[offset]); // swap R and B
(d[offset], d[offset + 1]) = (d[offset + 1], d[offset]); // swap R and G
offset += 4;
}
}
}
break;
case "MRAS": // R: Metallic, B: Roughness, B: AO, A: Specular (Legacy PBR)
Expand All @@ -418,11 +422,13 @@ private void PushLod(CMeshSection[] sections, CMeshVertex[] verts, FRawStaticInd
{
var offset = 0;
fixed (byte* d = data)
{
for (var i = 0; i < mip.SizeX * mip.SizeY; i++)
{
(d[offset], d[offset+2]) = (d[offset+2], d[offset]); // swap R and B
(d[offset], d[offset + 2]) = (d[offset + 2], d[offset]); // swap R and B
offset += 4;
}
}
}
break;
}
Expand All @@ -440,11 +446,13 @@ private void PushLod(CMeshSection[] sections, CMeshVertex[] verts, FRawStaticInd
{
var offset = 0;
fixed (byte* d = data)
{
for (var i = 0; i < mip.SizeX * mip.SizeY; i++)
{
(d[offset], d[offset+2]) = (d[offset+2], d[offset]); // swap R and B
(d[offset], d[offset + 2]) = (d[offset + 2], d[offset]); // swap R and B
offset += 4;
}
}
}
break;
}
Expand Down

0 comments on commit dce3d1f

Please sign in to comment.