Back to Molly Rocket Molly Rocket
Molly Rocket games and everything even tangentially related
 

  FAQFAQ  SearchSearch  UsergroupsUsergroups 
Log inLog in  RegisterRegister
 

Carmack: Sparse Voxel Octree
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic Reply to topic    Molly Rocket Forum Index -> Sparse Virtual Texturing
View previous topic :: View next topic  
Author Message
ryg



Joined: 31 May 2007
Posts: 276
Location: Kirkland, WA

PostPosted: Wed Aug 20, 2008 11:32 am    Post subject: Reply with quote

sean wrote:
There is a valid point here: real supersampling will give you... something. But the cost of, say, 16x supersampling is pretty enormous.

(On the other hand, I think we really need to go there in the long run rather than expect people to analytically band-limit their pixel shaders.)


I think that in practically relevant shaders, a lot of the computation is really always inherently smooth enough (e.g. diffuse lighting or blending of multiple texture layers). And for the things that aren't, special interpolation and filtering techniques are already being implemented in the shader nowadays (shadow maps being a prime example). Right now this is pretty rare, so coding it by hand is still practical. In the long run, it's probably advantageous to be able to say "compute this part of the shader at subpixel level and give me the result". But as long as at least a significant part of the shader is inherently smooth enough, supersampling it is really a waste of processing time and particularly bandwidth. The amount of arithmetic you can do per pixel without it hurting you is growing quite steadily, but I doubt that using 8x the texture samples is something any architecture will be able to shrug off in the foreseeable future.

sean wrote:
If you have 16x subsampling, you don't get this effect at all. As you move the camera so the contents of one pixel migrates over to the adjacent pixel, there are at most only 16 intermediate values the pixel can undergo. That's better than 1, but I doubt it's good enough to look clean.

It tends to give you some shimmering around the edges. Better than no AA, but yes, it's annoying (for me at least).

sean wrote:
Again, if you defined colors at the corners of voxels, and drew each voxel face as a little pair of triangles, I bet you'd get perfectly acceptable visual results (with sufficient multisampling). The problem is that it seems pretty expensive to try to bolt that onto a raycasting engine.

I agree, you just need some way to sample it properly and it should be fine. But I don't see how to do that efficiently in a raycasting framework
(short of storing a notable amount of adjacency or interpolation info in the voxel, which defeats the data compression aspect that seems to be one of the prime motivations).

TomF wrote:
Normal maps are just evil to filter - they're fundamentally wacky to interpolate.

Well, it depends. It's certainly possible to define something reasonable for normal maps; certainly trilinear interpolation then normalize as basically everyone is doing right now isn't optimal, but it also isn't really bad. I agree that the ideal way to filter normal maps would probably look a bit different (never bothered to work it out); but the building blocks (doing linear combinations of samples, using mipmaps to increase cache coherency and bandlimit the information) are definitely sound.

TomF wrote:
But if you add displacement maps in, they spam positional noise into every texture channel, and a lot of the signal-processing theory gets tossed out the window. Which leaves mipmapping as mere a bandwidth optimizer, NOT as a signal-processing operator.

Depends on the magnitude of displacement at the per-pixel level. As long as it's not too big, you can really treat it as noise on your inputs, and there's actually a lot of signal processing theory to deal with noisy signals. And, again, you'd want displacement at the subpixel level to be limited anyway, since (same as with the infinite surface detail voxels) subdividing and displacing too fine will cause more problems than it solves.

sean wrote:
That's why I'm much more interested in stuff like procedural-generation of textures, or even recording the artists' "brush strokes" and "replaying" those to synthesize on the fly. Which seems a good fit for megatexture (which demands nice rectangular blocks of texture from you), but not for voxel raycasting.

Well, our texgen system is basically smack in the middle between pure procedural and recording "brush strokes". And it does work nicely, and the artists who've used it for a time usually don't want to ever give it up again. But I've stopped really believing in the whole thing back in 2004 (don't ask me while I still haven't thrown it away, at this point I honestly don't know) - yeah, it's nice, and you really get used to having it around, but having to do the rendering is a pain, and I've never managed to really convince anyone (including myself) why you'd want it in a production pipeline.
Back to top
View user's profile Visit poster's website
sean



Joined: 01 Feb 2005
Posts: 1392
Location: Kirkland WA

PostPosted: Wed Aug 20, 2008 3:29 pm    Post subject: Reply with quote

Quote:
But I've stopped really believing in the whole thing back in 2004


Well, first you convince people you want unique texturing of a large world.

The rest falls out.

(Also, I'm mainly thinking about procedural that can be synthesized on hardware, e.g. primarily consists of alpha compositing, not of the stuff that y'all do that can't be accelerated due to precision issues. The reason I talked about brush strokes and such is because of how id's megatextures are created--people don't sit there and paint them in a fine-grained way, but they do more than slap down tiles. The biggest barrier to procedurally synthesizing their megatextures is presumably the many many gigs of underlying textures they use to synth it, so you'd need those to be procedural as well.)
Back to top
View user's profile Visit poster's website
billyzelsnack



Joined: 05 Jul 2005
Posts: 14

PostPosted: Wed Aug 20, 2008 8:04 pm    Post subject: Reply with quote

[quote="sean"]
Quote:

(Also, I'm mainly thinking about procedural that can be synthesized on hardware, e.g. primarily consists of alpha compositing, not of the stuff that y'all do that can't be accelerated due to precision issues. The reason I talked about brush strokes and such is because of how id's megatextures are created--people don't sit there and paint them in a fine-grained way, but they do more than slap down tiles. The biggest barrier to procedurally synthesizing their megatextures is presumably the many many gigs of underlying textures they use to synth it, so you'd need those to be procedural as well.)


At some point of customization the data you need to synthesize becomes greater than to just store the damn result of the synthesis. Maybe you just need to take the synthesizing to the next step and synthesize the synthesizing.. Try to create the minimal amount of stamps ( or whatever ) needed in memory at once. At that point it just becomes an intermediate compression step.
Back to top
View user's profile
billyzelsnack



Joined: 05 Jul 2005
Posts: 14

PostPosted: Wed Aug 20, 2008 8:42 pm    Post subject: Reply with quote

btw. Don't bother trying to download the class video from the Siggraph site yet. The tricky bitches don't tell you that it's not available to until Sept 1 until after you pay for it.
Back to top
View user's profile
TomF



Joined: 18 Feb 2007
Posts: 107
Location: Seattle

PostPosted: Thu Aug 21, 2008 6:13 am    Post subject: Reply with quote

Quote:
At some point of customization the data you need to synthesize becomes greater than to just store the damn result of the synthesis.

In all my conversations with id, this unfortunately appears to be the case. I kept pointing out that LRB is perfectly capable of doing the compositing of multiple layers on the fly, they then point out that there's such an absurd number of layers that the JPEGgy version is a lot smaller than the source data. I suspect they're not wrong! Give an artist a fish, he'll paint a gallery-worth of interpretations. Teach an artist to fish - heat-death of the universe!

Quote:
Don't bother trying to download the class video from the Siggraph site yet.

If it's any help, my live talk contains significantly less data than the slide deck on the web site. The final slide deck would have taken me 32 minutes to deliver, and I had 20. Unless you desperately want to hear me say "er" and "so" a lot and stumble pathetically over the explanation of hierarchical rasterization (just like I did every time I practiced it), you should probably save your money.
Back to top
View user's profile Visit poster's website
sean



Joined: 01 Feb 2005
Posts: 1392
Location: Kirkland WA

PostPosted: Thu Aug 21, 2008 8:28 am    Post subject: Reply with quote

TomF wrote:
Quote:
At some point of customization the data you need to synthesize becomes greater than to just store the damn result of the synthesis.

In all my conversations with id, this unfortunately appears to be the case.


I actually mentioned this myself earlier (the first quote above quoted me saying this but ignored that part of it), and then suggested that this just means you need to actually procedurally generate those underlying textures too. If they're using gigs and gigs of source data, I assume that's at least in part because that source data is super-high-res. (Also, if you look at their authoring video from last year's quakecon or whatever, for the world, they do start with an underlying grid of tiles, rather than it being particularly freeform.)

So if you can synthesize those huge textures from smaller textures, you can maybe scale it back down. For example, the hybrid texture maps thing I wrote up in gdmag offers a way to synthesize an arbitrarily huge non-repeating texture with simple compositing--using multiple layers that aren't synchronized to each other to make the base texture, and then bombing lots of details on pseudo-randomly. That will work just dandy for GPU procedural synth.

id's approach is "simpler", but it really limits how large your fully-unique world can be. Although at least it allows truely fully unique, at least insofar as you can even make that in real life.

I guess I need to spend some time with a good technical 2d artist and a storage budget and see what's really feasible.
Back to top
View user's profile Visit poster's website
skynet



Joined: 01 Sep 2008
Posts: 20

PostPosted: Wed Sep 03, 2008 1:08 am    Post subject: Reply with quote

Hi,

this is my first post here, but I'm too into this topic to resist. I'd like to throw some thoughts into this discussion in the hope to gain some insights I have not yet found. It will be a bit lengthy (I guess...), please bear with me.

First, I'm going to reconsider why we need (better: want) stuff like SVT or SVO. We want almost unlimited detail in our virtual worlds. How did we achieve detail up today? We used textures to approximate detail that we couldn't put into geometry. We used geometry to approximate the surface of real objects which ultimately consist of atoms. So, in theory we could abandon all textures and triangles and build the world out of atoms - voxels.

Is it possible to render scenes with (almost) ulimited detail onto the screen? Yes, because a screen has only a finite number of pixels, the amount of detail it can present is limited as well.

This is _the_ key insight. No matter how large or detailed you world is, at any given time, you _cannot_ see

a) more triangles than there are pixels on the screen
b) more texels than there are pixels on the screen

(things like multiple passes or multisampling act as a constant factor here)


Things that cannot be seen can be classified as
a) out of the screen - frustum culling helps here
b) occluded - occlusion culling helps here
c) too small - level-of-detail and detail culling help.


So, for instance, if you _know_ which texels are needed for a given frame, you don't have to store much more then these texels in RAM. Basically it means, _no matter_ how large or detailed a texture is, you'll never need much more memory at once than a given working set of texels, which is primarily dependend on how large your screen resolution is - which is fixed over the runtime of your program!

This is one of the reasons why Carmack is so happy about his megatexture stuff. The memory footprint for texturing his world is almost independent from how large the textures are or how many of them there are. He can use the same super-detailed-megastuff for all platforms. And all of them seem to behave very good with this system (access times and DVD capacity put aside). The artists can throw any detail they want at the system; at runtime it will gracefully select exactly (more or less) those texels which can actually be percieved. There will be even a tool which automatically determines all possible player locations and then removes mip-texels from the database the player cannot ever possibly see on his screen in order to save some disk space.

Algorithms like this, whose runtime (and storage requirements) is primarily determined by the size of the screen resolution, are often called "output sensitive".

Virtual textures could in this sense be seen as te solution to output sensitive texturing. And Google Earth is the best example that it works Smile


And finally, we come to the _actual_ problem I want to discuss...
Unfortunately, there is no output sensitive solution to geometry yet!


There are a few algorithms that combine hierarchical scenestructure, frustum culling, occlusion culling and forms of LOD to achieve realtime rendering of scenes with billions of triangles but none of them (at least, I doubt that) would be able to render scenes with unlimited detail.

Raytracing promised output sensitivity a long time ago, but yet is not able to keep its promise.
For one, yes, if you employ acceleration structures, the runtime complexity is somwhere at num_pixels*O(log(num_polygons)), thus largely independent from the scene complexity.
But have you ever seen/used an interactive out-of-core raytracer that actually would allow you to explore a really detailed dataset?


So, what's the deal with output sensitive geometry? Level of Detail Sad

Frustum culling and occlusion culling are practically solved problems and can be done in near O(log(num_polygons)) if used with hierarchical datastructures. Raytracing even inherently does both.
But LOD? Uhhm, not that I knew of...
In order to be useful, the LOD algorith must be able to deliver correct LOD-level for any part of the scene anytime.
And here the problem starts... with a triangulated scene, what is a "correct LOD level" ? What is "a part of the scene"?

Why do we need LOD at all, you might ask. Because, in order to be fully output-sensitive our renderer must be "detail-insensitive". Consider this: You've modeled a monster with 1 mio triangles, from which you can see, maybe 500k at any given time. Piece of cake for any modern gfx card! Now you move so far away that the monster is only 10x10 pixels on the screen. But since you are now so far away, you can now see the monster's 1000 brothers, also each occupying 10x10 pixels. That is 500 Million Triangles on an area of 100k pixels now! No current gfx card could handle that amount of vertex data and overdraw. If you had a LOD Algorithm, it would have given you a LOD Level, with say 100 Triangles. Thats 100k Triangles per frame - easy cake for any gfx card. We cannot afford to do work for triangles that are ultimately not visible.

What most people (and even authors of such algorithms) don't seem to realize (at least in this clarity) is that Level-of-Detail should NOT mean to just simplify a geometric object "somehow". Instead LOD algorithms should provide an answer to the sampling question which rasterization/raytracing/raycasting is at its heart.
"Rasterizer: hey LOD, I'm rasterizing this mesh, which is at distance D to the image plane"
"LOD: so your pixels are X units wide at mesh's position, I'm providing you with LOD level L that contains no triangles which project to an area smaller than a pixel."

For textures, this is a solved problem: mipmaps. Computing LOD is easy:
Frequency has a meaning there. Each texel has the same size and each texel has a neighbour, so downsampling them is easy.The MIP-maps have a fixed memory footprint, which is guaranteed to shrink to 1/4 with each level. There is only one way to look at a texture: from above.

For triangle meshes, this is hard:
a) what is the "maximum frequency" of a mesh? can a mesh be treated as "signal" at all?
b) geometry might be placed sparsely in space
c) what is neighbourship here?
d) how to filter? _what_ can be filtered at all?
c) can the 1/2 band-limited version of the mesh guaranteed to be x times smaller in memory than the original?
e) everything is completely view-dependent; the mesh can have completely different properties when view from different angles

There is no triangle-based LOD algorithm known to me that can answer all tese questions.

So, finally we arrive at voxels.
Voxels allow you to compute LOD levels like with textures (especially volume textures). Many things that are hard with triangles are relatively easy with voxels.

I did some tests where I voxelized (and then mipmapped ) an object and rendered it as clouds of point-sprites. Although, it passed the 1000-monsters-test, it quickly showed its ugly side. When many of the points sprites ended up on the same pixels, the overdraw (and pipeline-dependecies?) sucked the fps down. Also, I had to implement a vertexshader which computes the right pointsprite size, so I don't get any holes. Raycasting would get rid of the problem: no holes, no overdraw.

One of the most important things which didn't get covered in Jon Olick's presentation is, why they chose to make their voxels "one sided", as if each voxel would always only represent a part of a surface of a closed body.
But at latest when voxels get mipmapped, they start to represent space. Space that may look different from each view angle... Can you really get away with just averaging colors and normals? The thin-wall-problem can't be solved by the artists, because you just need to go far enough away until you see both walls fall into one pixel...and then the voxel-mipmap-hierarchy must have an answer to this.

Also, there are many papers out there that try to solve signal-reconstruction in the context of point rendering, for instance EWA-splatting. These people go great lengths to achieve good results. Mr. Olick just suggests to "blur the rendered image" to get better looking results.


I'd like to gather your opinions and ideas to all this stuff. How can we achieve the goal of unlimited detail? Is there anything known about a compact representation for view-dependent voxels? How can they be mipmapped?


Sorry for the big post, I'm looking forward to your ideas Smile
Back to top
View user's profile
Won



Joined: 21 Sep 2005
Posts: 506
Location: New York

PostPosted: Wed Sep 03, 2008 2:35 am    Post subject: Reply with quote

skynet wrote:
Hi,

this is my first post here, but I'm too into this topic to resist. I'd like to throw some thoughts into this discussion in the hope to gain some insights I have not yet found. It will be a bit lengthy (I guess...), please bear with me.

...

Virtual textures could in this sense be seen as te solution to output sensitive texturing. And Google Earth is the best example that it works Smile

Close enough for beta!
Quote:

And finally, we come to the _actual_ problem I want to discuss...
Unfortunately, there is no output sensitive solution to geometry yet!

I think Sean mentioned REYES (maybe it was someone else or some other thread), which is what Renderman uses. Basically it takes meshes (usually some kind of curved subdivision surface) and subdivides them into mircopolygons (~pixel sized screen aligned, gouraud-shaded squares) in screen space until it hits some threshold resolution, and the whole thing goes through some reconstruction filter.

Maybe this isn't exactly what you mean, since the meshes are going to be the same, but they would probably be much more compact than the equivalent triangle mesh. Coupling this with coarse, conservative LOD probably isn't too horrible, but I've never done any REYES myself.
Quote:

For textures, this is a solved problem: mipmaps. Computing LOD is easy:
Frequency has a meaning there. Each texel has the same size and each texel has a neighbour, so downsampling them is easy.The MIP-maps have a fixed memory footprint, which is guaranteed to shrink to 1/4 with each level. There is only one way to look at a texture: from above.

For triangle meshes, this is hard:

Even for textures you have to deal with anisotropy. But yeah, textures are still way easier than meshes, but this is largely due to the sparse nature of the data structure/arbitrary topology. You could imagine something like geometry images things might be substantially easier? I dunno...idle speculation on my part.
Quote:

I did some tests where I voxelized (and then mipmapped ) an object and rendered it as clouds of point-sprites. Although, it passed the 1000-monsters-test, it quickly showed its ugly side. When many of the points sprites ended up on the same pixels, the overdraw (and pipeline-dependecies?) sucked the fps down. Also, I had to implement a vertexshader which computes the right pointsprite size, so I don't get any holes. Raycasting would get rid of the problem: no holes, no overdraw.

I wonder if turning on depth/alpha testing, coarsely sorting from front to back with alpha-to-coverage would help.
Quote:

One of the most important things which didn't get covered in Jon Olick's presentation is, why they chose to make their voxels "one sided", as if each voxel would always only represent a part of a surface of a closed body.

It is most definitely covered. There are slides that show the effect, and the annotations even discuss alternatives, like spherical harmonics.

Quote:

Also, there are many papers out there that try to solve signal-reconstruction in the context of point rendering, for instance EWA-splatting. These people go great lengths to achieve good results. Mr. Olick just suggests to "blur the rendered image" to get better looking results.


Well, you can think of the EWA splats as oriented points, so "blur the rendered image" using normal information might work as an OK approximation. The normals could even computed as a post-process using the depth buffer.
Back to top
View user's profile Visit poster's website
TomF



Joined: 18 Feb 2007
Posts: 107
Location: Seattle

PostPosted: Wed Sep 03, 2008 4:46 am    Post subject: Reply with quote

Current signal processing in textures only works if the surface is locally smooth. With extreme LOD of the sort being discussed here, the surface is usually not locally smooth, and texture sampling starts to have problems. Zoom out enough pretty much everything becomes inherently "crinkly". That doesn't mean you can't do signal processing, just that we don't know how to just yet with existing hardware. We can't even figure out how to mipmap normal maps decently! (cones are a start I guess).

LOD on meshes is pretty evil - meshes are awful to do "algebra" with. But they render really nicely. Even on Larrabee where we don't give a monkey's about custom rasterization hardware, rendering triangles is still faster than any other known method. (tangent - actually I have a sneaking suspicion that splatting could be similarly quick on LRB, but I don't know nearly enough about its quality limitations to do any useful evaluation).

One approach that seems quite promising is take mesh, voxelize, mipmap, turn back into mesh. The important thing is to do all this offline and use it to generate meshes in a standard discrete LOD sequence (and from there you can probably do VIPM to interpolate between however many discrete LODs you choose - but that's another question). I have read about experiments in this area, and they have partial success. The two obvious problems are retaining sharp edges and dealing with material transitions.

I think both of those can be helped a lot by preserving some of the precise positional information from the mesh in the voxel grid to be used during reconstruction, rather than quantising to the voxel grid. They're just hints, and obviously this data might be filtered away by mipmapping when adjacent voxels have incompatible hints, but if it does then the feature was probably "small" and had to be nuked anyway.

I wish I had time to research this stuff more.[/i]
Back to top
View user's profile Visit poster's website
skynet



Joined: 01 Sep 2008
Posts: 20

PostPosted: Wed Sep 03, 2008 11:26 pm    Post subject: Reply with quote

Quote:
I wonder if turning on depth/alpha testing, coarsely sorting from front to back with alpha-to-coverage would help.


My further work on that project would involve creating a spatial hierarchy for the point clouds. This would help to do sorting and occlusion culling with the voxels. But I'm really catching the idea of doing raycasting as well... Just build the hierarchy down to single voxels and the cast rays into it. No complicated occlusion culling or inner-leaf sorting of voxels is needed anymore.

Quote:
There are slides that show the effect, and the annotations even discuss alternatives, like spherical harmonics.


Yes, the slides shortly show the problem, but do not provide a solution. SH's would certainly be a way to store the view-dependent color (and other attributes) for the voxels. But unfortunately, they cost too much memory and probably too much time for evaluating them. Also, how would you create a hierarchical mipmap structure with them?

Quote:
We can't even figure out how to mipmap normal maps decently! (cones are a start I guess).


Maybe Multiresolution Reflectance Filtering http://research.microsoft.com/~stevelin/multires.pdf is a way. Here the mipmapped normals are seen as a collection of stochastic distributed normals. And this distribution is then expressed with a few parameters.


Quote:
...but if it does then the feature was probably "small" and had to be nuked anyway.


This is another thing, Olick didn't mention in his slides. His voxels obviously have no concept of "coverage". But you need something like this, so small isolated features can gracefully vanish, once you are far enough away. Also, small features must be able to "melt" together and thereby build bigger features. The coverage value can be used for antialiasing, too.


My own experiments with voxels ended up with 6 'sided' voxels, rendered as point sprites. The 6 colors were given as 6 4ubyte-streams. The vertexshader is using the viewvector to determine 3 sides of the voxel that can be seen and interpolates between these 3 colors accordingly. The alpha value of the colors is used as coverage and is interpolated as well. It is being used for "backface culling" the voxels as well. If you see a voxel from a side that has no coverage, it can be culled away. Colors and coverage can be mipmapped quite well, as described in this paper:
http://www.cs.princeton.edu/courses/archive/spr01/cs598b/papers/chamberlain96.pdf
Unfortunately, they do not handle normals. Finding a compact, good mip-able normal representation still is my biggest problem.

I also tried to mix voxels and triangles. In this scenario, only triangles that fall below pixel size are replaced by voxels, the rest of the model is still rendered as triangles. The reults look quite promising, but due to the difference in shading (bad voxel-normals), the voxel-replaced geometry can be spotted too easily. Another problem with this approach are needle-like triangles. If you really want to replace such triangles with voxels, you end up drawing many many voxels for just one needle triangle. This makes the voxels render slower than just the needle triangle Sad But the voxels really start to shine, once the triangle model is completely replaced by voxels and the voxel mipmapping kicks in.
Back to top
View user's profile
Zaphos



Joined: 24 Feb 2007
Posts: 90

PostPosted: Thu Sep 04, 2008 2:30 am    Post subject: Reply with quote

skynet wrote:

This is another thing, Olick didn't mention in his slides. His voxels obviously have no concept of "coverage". But you need something like this, so small isolated features can gracefully vanish, once you are far enough away. Also, small features must be able to "melt" together and thereby build bigger features. The coverage value can be used for antialiasing, too.

This sounds tricky to me ... coverage is view dependent and doesn't sum in the same way as an alpha value. Thinking in an axis aligned ortho projection for a moment, if you go through two voxels with 50% coverage each, the second voxel could cover what was already covered by the first and add 0 coverage. Or it could cover only what was not covered by the first and give 100% coverage in sum. So if you have something like a porous surface, I can see the translucency of that surface changing substantially as you transition from 'actual coverage' to an alpha-based approximation of coverage.
Back to top
View user's profile
sean



Joined: 01 Feb 2005
Posts: 1392
Location: Kirkland WA

PostPosted: Thu Sep 04, 2008 10:20 am    Post subject: Reply with quote

Quote:
coverage is view dependent


Well, a classic example of that is a chain-link fence... and it's not like people handle that case well with polygons, either. If you just slap a transparent texture map up there, it loses the effect that at sharp angles it becomes opaque. But that's what people do, and life goes on.

But I agree there seem like there are a lot of problematic cases. You need something coverage-like to allow small details (e.g. powerlines) to disappear gracefully, although if you rely on super-sampling maybe you don't? (E.g. with 16x supersampling you can get the stuff to fade out to 1/16th visibility without a coverage value.)

The worst case I can think of is a free-standing billboard, where you reach a point where from the front it's down to 2x1 voxels in size, so from the side it's still an insanely huge 1 voxel wide. Of course, you can't even make that without having the color/orientation problem, so you'd need an orientation-dependent representation of color, so you maybe you just also throw in an orientation-dependent representation of coverage.

To a first approximation, this could be defining a unique RGBA color for each of the six faces of the cube; again, you need supersampling or some kind of filtering to smooth out the transition as you rotate around it.

But, in the long run, to me this just emphasizes my previous point. Pixels are small 2d areas on the screen, they back project cleanly to small 2d areas on surfaces, and light bounces off surfaces, not volumes. To get voxels to work with high visual quality, I think you have to define them as effectively surfaces. Maybe you can use a voxel structure to accelerate ray-tracing them, but the whole thing seems pretty doubtful to me.

As Tom points out, once your geometry gets super tiny versus a pixel, the 2d-area mapping is no longer quite as advantageous, and you need to start doing crazier LOD stuff for polygons as well (e.g. nobody currently automatically converts a chain-link-fence-modelled-as-polygons to a chain-link-fence-modelled-as-an-alpha-texture, but they need to), but the polygon stuff still seems like a saner toolkit to provide to tackle these problems; a light saber to voxel's blaster.
Back to top
View user's profile Visit poster's website
ryg



Joined: 31 May 2007
Posts: 276
Location: Kirkland, WA

PostPosted: Thu Sep 04, 2008 1:01 pm    Post subject: Reply with quote

sean wrote:
As Tom points out, once your geometry gets super tiny versus a pixel, the 2d-area mapping is no longer quite as advantageous, and you need to start doing crazier LOD stuff for polygons as well (e.g. nobody currently automatically converts a chain-link-fence-modelled-as-polygons to a chain-link-fence-modelled-as-an-alpha-texture, but they need to), but the polygon stuff still seems like a saner toolkit to provide to tackle these problems; a light saber to voxel's blaster.


I've actually already seen the "chain-link-as-polys to chain-link-as-alpha" done before. The relevant paper is Billboard Clouds for Extreme Model simplification, and we used that idea at university while working on a Google Earth-like project (with pretty high-res terrain and city data). It did make it into a commercial product (or actually a range of them): http://www.realitymaps.de/eng/shop/e_shop_3dstadtplan_m.html (sadly there's no good highres screenshots, but you get the idea). The whole thing started out as a fairly standard terrain engine, but the city scenes need a very different approach to LOD than the landscape maps we started with (not a big surprise). Except for some notable landmarks, most of the building are automatically generated from land register data, so most of the building geometry is just cubes with their bottom faces removed and, mostly, a small distance between adjacent buildings; bad news for any conventional LOD scheme, since there's just nothing to simplify away there. For close-up cells, you render the actual geometry; for very distant cells or those viewed at steep angles from above, you drop the house geometry altogether and just use the aerial images directly. The billboard clouds are used for everything inbetween.

That gets you rid of a whole lot of extra geometry, and more importantly, it also prevents the per-cell textures from ever getting too tiny. Facade and roof textures for each cell get packed into a texture atlas, but for the coarser levels, that's a whole lot of <=3x3 pixel snippets and you have as much padding for filtering as you have data. Since IO was a big bottleneck in that system already, that was a major issue. Another was simply visual fidelity - while the billboard clouds look pretty crappy up close, they're good enough from a distance and they filter properly. For normal geometry, even with AA turned on, there's a fair amount of flickering in the distance because it's all hard-edged geometry. With the billboard clouds, it gets slightly blurry instead, which is far less annoying.

All that said, I'm not certain whether the billboard-cloud based stuff actually made it into the DVD; I stopped working on the project about a month before master was due to focus on my diploma thesis. By that point, the BBCloud stuff was tested and debugged on fairly large subsets of the full dataset, but integrating it everywhere would've meant a full rebuild of the dataset, which takes a few days and a modest amount of manual work. Not sure if anyone had the time for that, or if they were working on the usual last-minute bug reports and feature requests instead.
Back to top
View user's profile Visit poster's website
sean



Joined: 01 Feb 2005
Posts: 1392
Location: Kirkland WA

PostPosted: Thu Sep 04, 2008 1:10 pm    Post subject: Reply with quote

Yeah, I did some "research" many years back about applying that sort of approach hierarchically to tree rendering, so you could smoothly morph between multiple tree LODs that actually really represented the same data. I called them "object space impostors".

I also demo'd a really lamely trivial version of the idea to show a big field of lollipops at the 2001 HardCore game seminars. Lollipop demo (56kb) - use a,d,w,r,v,1,3 to move, press space to stop movement; sorry about the fullscreen. Probably one of my first OpenGL apps; this ran at 30 or 60hz on 1999-ish GPUs, because it's not a pair of quads per lollipop; the idea here was to show how scale-free object-space impostors could be; you could use them with one tree to show all the leaves, or you could use them with one forest to show all the trees, and anywhere in between.

But for the single-tree hierarchical thing, I worked from the initial hierarchy provided by the tree, rather than trying to 'discover' good locations for billboards, which I think is what you really need. And I never got any good results, I just showed that it was workable, and I never did anything with it or published it (this was probably 2000-ish). Everyone bootstraps their trees from clusters-of-leaves-as-billboards anyway now, and most people don't bother with smooth LOD transitions.

But it's good to see somebody actually went ahead and tackled this seriously.
Back to top
View user's profile Visit poster's website
ryg



Joined: 31 May 2007
Posts: 276
Location: Kirkland, WA

PostPosted: Sat Sep 06, 2008 12:04 am    Post subject: Reply with quote

TomF wrote:
We can't even figure out how to mipmap normal maps decently! (cones are a start I guess).

I've been thinking about this a bit, and the more I do, the more I think that that's the wrong question to ask (or, more precisely, that the answer is "depends").

With diffuse maps, specular maps, reflection maps etc., it's fairly reasonable to assume that they consist of samples of a (relatively) smooth function, over most of their domain at least - so the whole interpolation machinery is reasonable.

Normal maps are fundamentally different in that regard - they're not approximating a smooth function at all; we're pulling all the little bumps and discontinuities and high-frequency phenomena out of the mesh (to save on triangles) and put them into the normal map. That much is obvious. More importantly, normal maps don't directly influence the pixel's color; they influence the lighting model, which typically generates weights that are then used to combine other textures with each other. Now, you normally want the visual appearance of materials to roughly stay the same as you move away from them; that's where specular materials using mipmapped normal maps fail so miserably, because the transition to a lower frequency texture is very visible since the lighting model amplifies the effect.

Which brings me to my actual point: the "right" way to mipmap a normal map depends on what lighting/reflection model it's being used with. If a material is mostly diffuse, normal mipmapping works quite well - the bumps just smooth themselves out, and from a distance the surface just looks flat (paper is a good example). Specular materials are trickier: If you move away from a bumpy specular object, you get glossy reflections, like in this image:
(random image I found and that I'm shamelessly hotlinking to)

That's what I meant with "how do I mipmap normalmaps" being the wrong question: the net effect you get is blurred reflections, and which sampling scheme you use for your normal maps doesn't really make a significant difference in terms of correctness - you need "average(reflectionMap[reflect(view, normal1)], ..., reflectionMap[reflect(view, normalN)])", not "reflectionMap[reflect(view, superSmartAverage(normal1, ..., normalN))]".

The "right" (or at least a better) way to do this would be to use reflection models that are aware of this effect and take it into account - i.e. microfacet-based models like Cook-Torrance for mostly specular objects and Oren-Nayar for mostly diffuse objects. The normal map contains large-scale perturbations of the normals plus a roughness coefficient in the alpha channel for the really high-frequency microfacet stuff (which gets resolved in the shader based on a stochastic model). Mipmaps of normal maps still do the vector averaging as usual; the error due to this averaging is measured and roughness is increased proportionally.

I haven't tested this, and there's some tweaking involved (particularly how to adjust the roughness), but I'm fairly certain this should deliver a bigger increase in quality than any smart normal interpolation scheme. And such a shader would be a fairly straightforward implementation of the corresponding BRDFs, whereas manual filtering usually gets quite messy (when it's meant to be efficient, at least).
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic Reply to topic    Molly Rocket Forum Index -> Sparse Virtual Texturing All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Page 5 of 7

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Molly Rocket topic RSS feed 
Molly Rocket topic RSS feed 
Molly Rocket topic RSS feed, first posts only 


Powered by phpBB © 2001, 2005 phpBB Group