Sign in to follow this  

General image quality

Recommended Posts

Yura    263

Hi all, 

I'm using Sharpdx on WinForms to draw some primitives on 3D scene. My problem is that result image is nod very "pretty",  especially after using rotation or scale, lines becomes very ugly.. Seems like linear interpolation has low-order


See yourself : [attachment=14158:Capture.PNG]



 I know that WinForms using pixel graphics and it is not the best desision to use it for 3D rendering, but I've tried to use same code on WPF and receive the same result. So, I've made a conclusion, that the problem is somewhere inside. Device initialization attached bellow smile.png


d3dDevice = new Device(
                         new PresentParameters()
                             Windowed = true,
                             SwapEffect = SwapEffect.Discard,
                             BackBufferCount = 1,
                             BackBufferFormat = Format.Unknown,
                             PresentationInterval = PresentInterval.Immediate,
                             BackBufferWidth = width,
                             BackBufferHeight = height,
                             EnableAutoDepthStencil = true,
                             AutoDepthStencilFormat = Format.D16,
                             //MultiSampleQuality = 0,                              --> tried to use these
                             //MultiSampleType = MultisampleType.FourSamples            but no desire result



Share this post

Link to post
Share on other sites
Jason Z    6434

If you are talking about the 'jaggedness' of the lines, then you could try either MSAA (as Zaoshi mentioned) or you could also try the multisampled line rendering option in the rasterizer state object.  Your luck will vary with the latter option, as it is vendor specific and can be different quality on different hardware.


If neither of thos work for you, you can try some simulated line thickness algorithms - I believe there was an article in one of the GPU gems books that described this.  It is more or less using a quad to draw a line, and is a bit more work for each line than normal.


EDIT: Sorry - I just saw that you are using D3D9, so you can ignore the rasterizer state comment there...

Edited by Jason Z

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this