automatic generation of mips (min operator) dx11

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Dec 11, 2012 at 12:33

In direct x 11, how do you tell the computer you want to build mips with a min operator instead of an average?

I looked on google, and in the sdk help, but I couldnt find anything except a filter setting you could pick in d3dx11createshaderresourceview.

It doesnt seem to even exist… but in this quadtree displacement mapping thing I looked up, it has it, I wonder if it was for dx9?

4 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Dec 11, 2012 at 19:06

I don’t think you can do that with the automatic mip generation. You would have to generate the mips yourself, with your own shader to do the min filter.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Dec 11, 2012 at 20:34

Thanks for reply.
I was afraid of that, I actually attempted it with sorry results, got any tips for when I go do it again? (sampler settings, general idea…)

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Dec 11, 2012 at 20:40

Downsample from each mip to the next lower-res one, so you’re always going by a factor of 2. Then it’s easy; you just do a full-screen pass, and in the pixel shader you sample with a half-texel offset to the upper left, upper right, lower left, lower right. (Half a texel of the source texture, quarter of a texel of the destination.) Use nearest-neighbor sampling too.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Dec 12, 2012 at 09:24

got it, wasnt that hard. thankyou kindly.