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,7 +983,10 @@ namespace CodeImp.DoomBuilder.Rendering
}
}
graphics.SetUniform(UniformName.lightsEnabled, false);
// 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
if (thingspass.Count > 0)
@ -1298,8 +1301,11 @@ namespace CodeImp.DoomBuilder.Rendering
//
graphics.SetUniform(UniformName.desaturation, (float)sector.Sector.Desaturation);
// Set the colors to use
graphics.SetUniform(UniformName.sectorfogcolor, sector.Sector.FogColor);
// 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)));
// Render!
@ -1308,7 +1314,10 @@ namespace CodeImp.DoomBuilder.Rendering
else graphics.SetUniform(UniformName.desaturation, 0.0f);
}
graphics.SetUniform(UniformName.lightsEnabled, false);
// 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
if (thingspass.Count > 0)
@ -1442,8 +1451,8 @@ namespace CodeImp.DoomBuilder.Rendering
//
graphics.SetUniform(UniformName.desaturation, (float)t.Thing.Sector.Desaturation);
// Apply changes
graphics.SetUniform(UniformName.world, world);
// Apply changes
graphics.SetUniform(UniformName.world, world);
// Apply buffer
graphics.SetVertexBuffer(t.GeometryBuffer);

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