Skip to main content
GameDev.net gamedev.net
🔒 Locked

PCF Sampling

Started by hick18 Sep 15, 2010 at 4:31 AM 0 replies 2.6k views
Original Post
hick18
hick18
I keep hearing about hardware PCF sampling that is faster than doing mulitple samples yourself from say a 4x4 of 5x5 kernel. But what exactly are the names of these hardware PCF calls?

For DirectX10, Ive come across

Gather - Gets the 4 x component samples that would be used for bilinear filtering. So I assume this would be used for a 4x4 kernel. But this still requires you to average them and compute the result I believe.

float4 4Reds = Gather( Sampler, Texture );float Average = ( 4Reds.x + 4Reds.y + 4Reds.z + 4Reds.w ) / 4;float Result = Compare( Average, Depth );


But I guess you could use this multiple times for larger kernels.

SampleCmp - This sounds like it just does the compare for you on a 1x1 kernel, where you pass in the depth you want to compare against. But then it says :

Quote:

Comparison filtering provides a basic filtering operation that is useful for percentage-closer-depth filtering.


So I assume if the sampler you provide is set to D3D10_FILTER_MIN_MAG_MIP_LINEAR you'll get bi-linear filtering. So a 4x4 kernel AND it will perform the compare for you to.

What is there for DirectX9?
Demirug
Demirug
For DX9 it was never part of the spec. There are vendor specific „API Hacks“. You can check they vendor developer pages to get information what can be done with their different chips and how.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.