Sign in to follow this  
eppo

Corrupt VS -> PS interpolants

Recommended Posts

eppo    4877
Hi,

I'm having this issue where artifacts show up around geometric edges (D3D10.1):


[img]http://www.dynamique.nl/pst/pixelwit.png[/img]

These blown-out pixels are caused by per-vertex occlusion values passed from a vertex shader. VS input values are all normalized values between 0.0 - 1.0. I perform no kind of processing on these values in the vertex shader, and they are used as simple multipliers in the PS, but for some reason these errors still occur. I'm writing these values out to a DXGI_FORMAT_R11G11B10_FLOAT render target, but any floating point rt shows the same symptoms.

Any ideas?

Share this post


Link to post
Share on other sites
eppo    4877
Yes, I use MSAA. I've added the centroid modifier to the pixel shader inputs and this resolves the problem. Thanks.

Are there any implications (performance-wise etc.) for using this modifier?

Share this post


Link to post
Share on other sites
Hodgman    51234
Not that I know of... There may be a very small extra cost, but if there is, it would likely be small - maybe just a clock cycle per pixel, etc...

This feature didn't exist in older API's, but I'm pretty sure DX10 supports it for this very reason; the 'traditional' interpolation scheme calculates values for pixel centres, but with MSAA, this position can be outside the edge of a triangle. So, the centroid option was added to allow you to state that you always want your interpolated values to be within the triangle's boundary.

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