Pages: [1]   Go Down
Author Topic: Centroid sampling  (Read 7707 times)
August 25, 2010, 10:57:30 am
I never knew this up to now, but TEXCOORD inputs to a pixel shader have an optional centroid modifier since shader model 2.0.

Since a pixel shader is only executed once when MSAA is enabled, it allows you to choose your interpolation style. By default, the input values are interpolated for the center of the pixel. With the centroid modifier the input values are interpolated for the centroid of the active MSAA samples. This image explains it all:

So, to interpolate as shown to the left, you'd use:
float4 myInput : TEXCOORD0;

To interpolate as shown to the right, you'd use:
float4 myInput : TEXCOORD0_centroid;

Also good to know is that while centroid sampling is an option for TEXCOORD inputs, it is always enabled for COLOR inputs. It's a small difference, but it might help get the most out of your shader with MSAA enabled. A little Tip and Trick in the HLSL and Shaders board.
August 25, 2010, 12:45:51 pm
Thanks for sharing! Nice to know this. I saw it breifly in article but thought it's a DX10 feature.

Upgrade to PSSM is available for SSAO customers. Check for details.
September 29, 2010, 03:10:32 pm
Hello everybody
Hope someone can help me ~ ~ by QUEST3D can do a modeling demo! ! !
The logic used to make modeling q3d
To me to be a simple example! ! ! Because I am new to a lot do not understand Sad
Thank you Cheesy
October 14, 2010, 01:54:05 pm
hmm quest 3d is not a Modeller Tool. Sry.
Am i answering a fake post here?

November 07, 2010, 10:23:40 am
please can anyone tell me a name of a good reference for learning hlsl for beginner programmars?
November 08, 2010, 10:00:57 am
You can find more on HLSL learning on the forum.
Pages: [1]   Go Down
Jump to: