I am using this example XNA 4.0 format project management in the application that I am writing: http://creators.xna.com/en-US/sample/winforms_series1
It works great, and I did a little work with visual effects and animations. The main problem I am facing is the 3D model and the primitive 3D shapes (cylinders with tessellation 30) that I visualize have very jagged edges, as if they were low resolution.
I tried to figure out how to enable multisampling, but all the examples I can find on the Internet do not seem to apply to this new way of using XNA in a form user control.
A PresentationParameters object is created inside the GraphicsDeviceService () constructor, but the only parameter available is the parameter. MultipleSampleCount integer type. I tried to set this without effect.
I also tried to make the back buffer twice as large as the control size (GraphicsDeviceService.cs):
GraphicsDeviceService (IntPtr windowHandle, int width, int height)
{
parameters.BackBufferWidth = width * 2;
parameters.BackBufferHeight = height * 2;
...
}
Then I changed this function (GraphicsDeviceControl.cs):
void EndDraw ()
{
Rectangle sourceRectangle = new Rectangle (0, 0, ClientSize.Width * 2, ClientSize.Height * 2);
Rectangle destinationRectangle = new Rectangle (0, 0, ClientSize.Width, ClientSize.Height);
GraphicsDevice.Present (sourceRectangle, destinationRectangle, this.Handle);
}
But that did not work. My objects displayed on the screen were assigned to the 1/4 window and cropped. It looked a little less jagged, though ...
So, at the moment I'm not sure what I can do to get high-quality graphics using this method (XNA control in the window). I am new to XNA in general, so any suggestions would be most helpful.
thanks