Hi, I’m using Nez and I’m trying to make a distortion shader using textures.
Currently I’m drawing sprites onto a separate rendertexture (to sample in a distortion shader later), using a shader which samples that rendertexture so it can draw textures onto it with an overlay “blend” function (I think it’s impossible to use an actual blend function for what I’m doing).
The problem is that it leaves square artifacts where textures overlap:
I don’t see any fault with the code right away. But if two textures overlap the blend mode will also come into play. What is your GraphicsDevice’s BlendState set to? And are you using textures with pre-multiplied alpha or not?
I think all the textures are using alpha blend (Nez uses Materials which have BlendStates so I’m not 100% sure about the GraphicsDevice itself), but trying with Additive, AlphaBlend, NonPremultiplied and Opaque blendstates all of them have artifacts.
Also just to add to earlier, this is the other kind of issue it gets when rendering.