tex2Dproj
#1
Posted 04 September 2008 - 05:55 PM
this function is: tex2Dproj(sampler(s),float4(t))
1. there are 2 forms of this funtion. The first takes a float3 for the last parameter, and the second takes float4. Is the latter the one that preforms depth comparison, or do they both?
2. Do you have to have a special kind of texture to use this function? Commenly mentioned is the D24S8_SHADOWMAP format. Or is it possible to stick with D3DFMT_R32F? I would much like that =/
The last and possibly dumbest question is:
3. Does this function even preform a depth comparison or do fetch4?? I go to different websites and it's like "yes" "no" "yes" "no" "you're a noob!" "yes" "no". It's like interviewing NASA (never a straight answer).
If I am totally wrong on this, what on earth is "hardware shadow mapping"?
EDIT: wait, I just found out the "fetch4" technique is ATI only, I'm optimizing for nvidia.
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
#2
Posted 04 September 2008 - 08:25 PM
All it does is divides the texture coordinate by w before doing the lookup. It does not need a special texture format, does not do depth comparison unless the texture you're reading from is set up to do depth comparison, and there is no necessary connection with shadows, although the function is quite handy for shadow mapping and that is probably its most common use.
According to Microsoft's site there is no form of the function that takes a float3. Where are you seeing this usage?
"Hardware shadow mapping" could mean anything. I'd guess it either means doing the depth comparison in hardware, or it means hardware percentage-closer filtering (PCF).
#3
Posted 05 September 2008 - 12:04 AM
Reedbeta said:
This all begs the question: WTF
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
#4
Posted 05 September 2008 - 02:01 AM
This is good because it actually gives you soft edges on your shadows, as opposed to the non-PCF bilinear filtering method, which is just wrong. (The bilinear filtering of the depth values gives some intermediate depth that doesn't represent the depth of any actual object, and then you compare against that to get a strictly 0 or 1 shadow value.)
On cards with hardware PCF (which I believe all nVidia cards have since the GeForce 6 series or so, and likely since ATI cards of the same generation), you activate it by just turning on bilinear filtering on the shadow map texture. The hardware does the rest. On cards without hardware PCF, you must use nearest-neighbor filtering, and if you want PCF you have to explicitly take four samples in the shader and do the comparisons and interpolation yourself.
#5
Posted 06 September 2008 - 02:45 PM
#6
Posted 06 September 2008 - 04:17 PM
Kenneth Gorking said:
lol, varience shadowmaps *aren't* slow? I've already got them implemented and they take quite a bit more power.... well, let me rephrase that. The pre-blur (gauseen) takes the most power, and without it there's not that much point in using them anyway.
I do see applications for them though in situations where shadows don't need to be so dark. What were you thinking of?
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
#7
Posted 06 September 2008 - 04:27 PM
starstutter said:
#8
Posted 06 September 2008 - 05:55 PM
Kenneth Gorking said:
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
#9
Posted 06 September 2008 - 06:39 PM
Also don't forget that downsampling and doing a smaller (3-tap to 5-tap) blur can be much faster and lead to results just as good as doing a large blur.
#10
Posted 06 September 2008 - 07:02 PM
Reedbeta said:
Quote
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
#11
Posted 07 September 2008 - 05:11 AM
starstutter said:
Oh, man, you've GOT to use separate row and column filters. It's a big speedup. Think of it this way. If you're doing a filter with a width of 4px, then for each pixel in the output you have to take 16 texture samples from the input with a single-pass filter. But if you do a one-dimensional filter along the rows first, and then a one-dimensional filter along the columns second, you are doing two filters of 4px each for a total of 8 texture samples per output pixel - half as many! The best thing is, a Gaussian filter is separable, which means the 1D two-pass version is mathematically equivalent to the 2D one-pass version. The savings from taking fewer texture samples far outweighs the small additional cost of doing a second pass.
Quote
You have to balance the downsampling with the size of the filter to make it work. If you look on my website, there's a filters demo that does exactly this, and the results are quite good.
#12
Posted 07 September 2008 - 05:32 AM
Reedbeta said:
Quote
So in the end this just may work. :)
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
#13
Posted 08 September 2008 - 04:38 AM
When you "upsample" though, are you just taking the smaller blurred render target and stretching it across the screen with the texture filter set to bi-linear? or is there a shader operation for this?
(='.'=) This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!
#14
Posted 08 September 2008 - 05:49 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












