Search code examples
c#3dxnaantialiasingxna-3.0

Solving XNA 3.0 InvalidOperationException


I am trying out MSAA (multisampling Antialiasing) in xna 3.0 but I keep getting this error message during runtime and it happens everytime I put:

Graphics.PreferMultiSampling = true;

The message reads: "The active render target and depth stencil surface must have the same pixel size and multisampling type"

Does anyone know how to get rid of this error?


Solution

  • I found out what it meants, basically I can not do MSAA without disabling depth buffers. More info on this can be found here: http://www.catalinzima.com/tutorials/deferred-rendering-in-xna/