From 7d3379c6ce2a78aaefbe0c1325469a4fb7252f9f Mon Sep 17 00:00:00 2001 From: Kevin Caccamo Date: Tue, 3 Sep 2019 22:54:08 -0400 Subject: [PATCH] Fix textures in 2D mode being clamped I have no idea why the textures in 2D more ended up being clamped to begin with, but this should fix that. --- Source/Core/Rendering/Renderer2D.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/Rendering/Renderer2D.cs b/Source/Core/Rendering/Renderer2D.cs index d15f4aeb..1354e214 100755 --- a/Source/Core/Rendering/Renderer2D.cs +++ b/Source/Core/Rendering/Renderer2D.cs @@ -231,6 +231,7 @@ namespace CodeImp.DoomBuilder.Rendering if((backimageverts == null) || (General.Map.Grid.Background.Texture == null)) break; graphics.SetShader(aapass); graphics.SetTexture(General.Map.Grid.Background.Texture); + graphics.SetSamplerState(TextureAddress.Wrap); SetDisplay2DSettings(1f / windowsize.Width, 1f / windowsize.Height, FSAA_FACTOR, layer.alpha, false, true); graphics.Draw(PrimitiveType.TriangleStrip, 0, 2, backimageverts); graphics.SetVertexBuffer(screenverts); @@ -240,6 +241,7 @@ namespace CodeImp.DoomBuilder.Rendering case RendererLayer.Grid: graphics.SetShader(aapass); graphics.SetTexture(gridplotter.Texture); + graphics.SetSamplerState(TextureAddress.Wrap); SetDisplay2DSettings(1f / gridplotter.Width, 1f / gridplotter.Height, FSAA_FACTOR, layer.alpha, false, true); graphics.Draw(PrimitiveType.TriangleStrip, 0, 2); break; @@ -248,6 +250,7 @@ namespace CodeImp.DoomBuilder.Rendering case RendererLayer.Geometry: graphics.SetShader(aapass); graphics.SetTexture(plotter.Texture); + graphics.SetSamplerState(TextureAddress.Wrap); SetDisplay2DSettings(1f / plotter.Width, 1f / plotter.Height, FSAA_FACTOR, layer.alpha, false, false); graphics.Draw(PrimitiveType.TriangleStrip, 0, 2); break; @@ -256,6 +259,7 @@ namespace CodeImp.DoomBuilder.Rendering case RendererLayer.Things: graphics.SetShader(aapass); graphics.SetTexture(thingstex); + graphics.SetSamplerState(TextureAddress.Clamp); SetDisplay2DSettings(1f / thingstex.Width, 1f / thingstex.Height, FSAA_FACTOR, layer.alpha, false, true); graphics.Draw(PrimitiveType.TriangleStrip, 0, 2); break; @@ -264,6 +268,7 @@ namespace CodeImp.DoomBuilder.Rendering case RendererLayer.Overlay: graphics.SetShader(aapass); graphics.SetTexture(overlaytex); + graphics.SetSamplerState(TextureAddress.Wrap); SetDisplay2DSettings(1f / overlaytex.Width, 1f / overlaytex.Height, FSAA_FACTOR, layer.alpha, false, true); graphics.Draw(PrimitiveType.TriangleStrip, 0, 2); break; @@ -272,6 +277,7 @@ namespace CodeImp.DoomBuilder.Rendering case RendererLayer.Surface: graphics.SetShader(aapass); graphics.SetTexture(surfacetex); + graphics.SetSamplerState(TextureAddress.Wrap); SetDisplay2DSettings(1f / overlaytex.Width, 1f / overlaytex.Height, FSAA_FACTOR, layer.alpha, false, true); graphics.Draw(PrimitiveType.TriangleStrip, 0, 2); break;