Jump to content


automatic generation of mips (min operator) dx11


4 replies to this topic

#1 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2725 posts

Posted 11 December 2012 - 12:33 PM

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?
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 5311 posts
  • LocationSanta Clara, CA

Posted 11 December 2012 - 07:06 PM

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.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2725 posts

Posted 11 December 2012 - 08:34 PM

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...)
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#4 Reedbeta

    DevMaster Staff

  • Administrators
  • 5311 posts
  • LocationSanta Clara, CA

Posted 11 December 2012 - 08:40 PM

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.
reedbeta.com - developer blog, OpenGL demos, and other projects

#5 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2725 posts

Posted 12 December 2012 - 09:24 AM

got it, wasnt that hard. thankyou kindly.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users