# XNA 4.0 - Strange edges with multilight shader

I am generating a light, a depth and a normalmap to calculate the lightning at each pixel with multiple lights.

On both rendertargets, i set the preferredMultiSampleCount parameter to 16 samples because I want smooth edges. It seems to work well on the first picture (normalmap). In the second picture (lightmap), multisampling works great, too. But somehow there are flickering edges at the end of each model.

I think it may have to do something with the depthmap because due to using Surfaceformat.Single I have to use

minfilter = point;
magfilter = point;
mipfilter = point;


for the Texture filter and I think AA doesnt work with filter type point.

Is this a known newbie problem or should I upload the source of my shader files for a better understanding of my problem?

EDIT: If I turn multisampling off, I dont get these edges: (Take a look at the bottom of the square in the middle.. )

• Does the problem go away if multisampling is disabled? It sounds like you're doing some type of deferred shading - do you calculate lighting per-sample or only per-pixel? May 3 '14 at 16:40
• Yes, seems like it's almost gone if I disable multisampling (Picture in main post) May 3 '14 at 16:45
• Standard multisampling anti aliasing is not applicable if you defer your lighting calculations. You may have to switch to some sort of post process like FXAA. May 3 '14 at 17:17