Re: [Algorithms] Texture mip streaming prioritization
Brought to you by:
vexxed72
From: Sebastian S. <seb...@gm...> - 2013-07-22 20:55:30
|
On Mon, Jul 22, 2013 at 12:16 AM, Josh Green <in...@gm...> wrote: > Hi There, > > I'm currently working on a texture streaming system and looking into ways > to prioritize which mips on which textures should be loaded. > I was hoping that people on this list may have experience with these > algorithms that they could share? > > Currently I know which mips need to be loaded in order to render a scene > without degradation in image quality. > I would now like to apply a memory budget to textures, and make decisions > about which mips of which textures should be loaded over others. > > My current line of thinking involves comparing cost / benefit of loading > each individual mip. > i.e. > > How many pixels would be affected by a particular mip level being loaded > versus how much memory would that mip level use? > > This becomes Priority = Benefit / Cost > > I'd then sort for highest priority and assign memory budget to those mips > at the top of the list. > > Any thoughts? comments? Alternatives that work better? Alternatives that > have worked enough? > I would bake in some kind of factor that relates to "quality improvement" as well. If you have a 4k eye ball texture and it's currently at MIP 2 (1Kx1K), it probably won't gain much from loading another MIP even if it's covering a lot of pixels. So you need to compute how far off the pixel currently is from the *ideal* MIP level, and improve pixels that are far off first (weighted by pixel count). Assuming you only load one MIP level at a time (i.e. if MIP N is currently loaded, you'll only consider N-1), maybe something like: (desired_mip - current_mip) * num_pixels / memory_usage, add tuning knobs as needed... That first factor relates to how far "off" a pixel currently is from its ideal MIP level, i.e. how much in need of improvement those pixels are. -- Sebastian Sylvan |