The way I understood it, for this rendering technique you need to first draw the scene at a smaller framebuffer(1/10th to 1/20th of the main resolution) where in the pixel shader you only render: mip level, U, V, texture ID, then read it back to CPU, render scene with the info from the previous frame's "small framebuffer" while on another CPU core analyzing this one and streaming + decompressing the required textures for the next frame.However what if you implement heavy hardware tessellation?This means you would be doing tessellation a minimum of 3 times each frame for each mesh(1 for the small framebuffer, 1 for the "main" pass and 1 for the RSM later).I thought about using stream out, but if I want to go crazy like 1 poly per pixel mesh density, the stream out would become a huge bottleneck?Is there some clever way to save an extra geometry pass?
Sparse Virtual Textures - Is there a way/hack to save that extra geometry pass?
Crossbones+ - Reputation: 1773
Posted 25 March 2013 - 01:17 PM
Actually you *just* need to determine what pages of textures you need, you don't even have to render anything before main scene, and just guess them by distance (this is advantage, when you need to render F.e. stuff behind player (reflective wall?!)) - of course you can use a lot more complicated heuristics to decide which pages you need to load (you can also shoot some rays, etc.). So basically you *don't* need geometry pass.
Also using some better heuristics can eliminate problems when you can quickly rotate around, or such - though I know this isn't much of a problem for fast HDD.
Of course there are disadvantages, you'll effectively hold data that you don't need for actual (respectively next) frame - so it's a trade-off, you save geometry pass, but you most likely will need more memory to store the data.
Edited by Vilem Otte, 25 March 2013 - 01:18 PM.
My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com
Members - Reputation: 778
Posted 25 March 2013 - 09:37 PM
If you are targeting d3d11, you can store your page visibility list in a RWStructuredBuffer<int>. All you need is the page ID, which is easy to compute from the UV coords. In my engine I store this as an array of all pages, and increment the corresponding page index in the pixel shader in the geometry pass. This also gives you the number of pixels that use each page, which you can use to prioritize the page streaming.