Sign in to follow this  
Numsgil

Pixel coordinates

Recommended Posts

When a pixel is rasterized to be sent to the pixel shader, are the coordinates of the pixel in the top left corner, the center, or some other corner? Does it depend on any flags or options?

That is, given a pixel at (4, 5), is the pixel's bounds (4,5) to (5,6), or (3.5, 4.5) to (4.5, 5.5)?

I've tried looking through a few different sources, but I can't find a concrete answer. I could write a test to find out, but I'm betting someone knows off hand.

Share this post


Link to post
Share on other sites
This would be DX9 (XNA actually).

Just so I'm sure I understand, when you say Texel centers are at 0.5, does that mean only when sampling from a texture inside a shader? Otherwise, when triangles are rasterized to be sent to the pixel shader, their pixels are sampled at the center of the pixel?

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