Re: [Algorithms] Texture mip streaming prioritization
Brought to you by:
vexxed72
From: Josh G. <in...@gm...> - 2013-07-23 00:21:21
|
Thanks for your thoughts, >Alternatively - object X is Y meters from camera - what should I load. This is essentially what my current calculation gives me. It describes what I need to load in order to render the seen at it's highest image quality. The problem though is then applying a memory constraint to that, that says, I can't have everything I need.... So what will I choose to load? I must admit, I am currently thinking down the line that Sebastian described above: >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... I have the concept of the "Ideal" mip I would like loaded. And I also think dealing with one mip at a time (from prioritisation point of view at least) makes sense. Though that doesn't necessarily mean only one mip is loaded at a time, just one mip is considered for being loaded at a time. I'm thinking if I start with my "target set" as equal to the "ideal set", then execute the following: while (memoryUsage of target set > budget) { sort target texture set according to the "Priority" of having it's current target mip loaded. where priority = (idealMip - currentTargetMip) * numPixelsUsingTexture / MemoryUsage Select texture with the lowest priority subtract 1 from it's currentTargetMip. } This would remove all the mips that will have the least benifit to the scene. Then I would task the resource system with making sure the target set gets loaded. Unfortunately the above algorithm looks like it'd be very serial, and involve a bunch of sorts... But I think it might acheive good results? Have any of you seen these implementations executed in a product or game before? Was it successful? Tricky? worth the time? Thanks for the comments and suggestions so far, Josh |