Texture skewing:

- fixed a rare condition where skewed mid textures were not clipped correctly
- fixed a problem where translucent mid textures were not skewed correctly
- fixed a problem where sprites were skewed unintentionally
This commit is contained in:
biwa 2023-07-09 11:45:47 +02:00
parent 9c35a8f65d
commit 4dba3a9234
2 changed files with 21 additions and 11 deletions

View file

@ -983,6 +983,9 @@ namespace CodeImp.DoomBuilder.Rendering
}
}
// Done with geometry, reset potentially lingering skew setting
graphics.SetUniform(UniformName.skew, new Vector2f(0.0f, 0.0f));
graphics.SetUniform(UniformName.lightsEnabled, false);
// Get things for this pass
@ -1298,6 +1301,9 @@ namespace CodeImp.DoomBuilder.Rendering
//
graphics.SetUniform(UniformName.desaturation, (float)sector.Sector.Desaturation);
// Skew
graphics.SetUniform(UniformName.skew, g.Skew);
// Set the colors to use
graphics.SetUniform(UniformName.sectorfogcolor, sector.Sector.FogColor);
graphics.SetUniform(UniformName.highlightcolor, CalculateHighlightColor((g == highlighted) && showhighlight, (g.Selected && showselection)));
@ -1308,6 +1314,9 @@ namespace CodeImp.DoomBuilder.Rendering
else graphics.SetUniform(UniformName.desaturation, 0.0f);
}
// Done with geometry, reset potentially lingering skew setting
graphics.SetUniform(UniformName.skew, new Vector2f(0.0f, 0.0f));
graphics.SetUniform(UniformName.lightsEnabled, false);
// Get things for this pass

View file

@ -530,20 +530,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
else // back_floor
(diff, line) = GetZDiff(true, false);
Vector2D v3 = line.GetPerpendicular() * 10 + line.v1;
Plane p1 = new Plane(
Plane topplane = new Plane(
new Vector3D(line.v1, textop),
new Vector3D(line.v2, textop + diff),
new Vector3D(line.GetPerpendicular() * 10, textop),
new Vector3D(v3, textop),
false);
Plane p2 = new Plane(
Plane bottomplane = new Plane(
new Vector3D(line.v1, texbottom),
new Vector3D(line.v2, texbottom + diff),
new Vector3D(line.GetPerpendicular() * 10, texbottom),
new Vector3D(v3, textop),
true);
return (p1, p2);
return (topplane, bottomplane);
}
else // Invalid skew type