Hacker News new | ask | show | jobs
by far33d 3681 days ago
Usually, a frame is rendered on a single processor.
2 comments

Rendering is mostly I/O bound these days due to high complexity models and textures.
That's somewhat true for VFX in general, but not really for Pixar: They mostly use procedural textures (they use them a lot more than most other VFX studios can) so texture IO is a lot less, and is one of the reasons they can get away with starting to use a GPU preview renderer (i.e. the textures fit in VRAM).

Regarding model complexity - that doesn't really matter these days - if you want to raytrace a scene, unless you want to do full-on deferred raybatching and geo paging (like Disney's Hyperion does), you need to fit the scene into memory, so other than at startup/ingestion time, model complexity doesn't really matter in terms of IO. Also, Pixar's base level subd meshes are really rough (compared to what you see in VFX in general - for VFX base levels are probably subdivided down 2/3 times more), so the geo given in in Pixar's case isn't actually that bad.

There's very little info in the Disney paper on geomapping, do you have any ideas on how they do it?

I guess that you don't want to page in full models (as you either need a very large amount of memory per thread, which means smaller ray batches, or you need to have a shared cache, which means waiting on other threads). So you'll probably need something similar to Toro (as described by Pharr et al.), which just doesn't seem very efficient to me (as grids have improved little compared to BVHs).

By "geomapping" I assume you mean paging geo?

Easiest way is to have a two-level BVH, where the lower level just has overall AABBs of every object in the scene which contains a "geometryInstance", each of which then contain another object-space BVH of the triangles (or other primitives).

This is trivial to do, but you take a pretty big penalty for not being able to look down to the primitive (microtriangle, microcurve) level for the lower level BVH, so the quality of it isn't as good. So for stuff with hair on skin, you've pretty much got two objects overlapping which sucks for traversal performance. There is a way around this, but it involves storing a pointer to each primitive in the BVH which is expensive and mixed transforms / motion blur get complicated with this.

The more complex way of doing it would just be to use the single level BVH and partially build it - given the lengths Disney are going to in order to sort and batch the rays, it sounds like they can constrain stuff such as all rays they send in a batch are going in a similar direction anyway, so you can cull a lot of stuff.

These days in VFX we're pretty much just fitting stuff into memory anyway - there's no other option. PRMan does support geometry paging in theory, although Arnold doesn't and VRay only partially does (with VRay meshes), but performance absolutely sucks doing it, so buying more RAM is just the easiest/cheapest solution all round.

Disney are only really doing deferring / reordering to such an extent because of their love of PTex which sucks with random access IO, so...

Yup, I meant paging geometry. The problem with just doing a two level BVH is that some models can be very large, while others may be much smaller, which makes it hard to reserve memory for the geometry cache (even if it just fits one model per thread). Which means that you can store fewer rays in memory, and I'm not really a fan of constantly writing rays to disk. I was thinking of just cutting off subtrees of the BVH and storing those on disk, which makes it possible to assign just a few megabytes of memory to each thread for caching geometry. Not sure how efficient that would be though, probably a bit faster than rebuilding part of the BVH every time (especially when using high quality BVHs with spatial splits). Shouldn't be too bad with large ray batches, sorting and ray streams.

They do mention some tests with "out-of-core rendering of scenes with massive amounts of geometry" in the paper, but there isn't much info on it. AFAIK their patents mention streaming in geometry too.

I know that buying more RAM is probably easier, but it would be interesting to render very large scenes on commodity hardware. I guess paging in geometry is just too much of a hassle, you constantly have to stream in geometry to memory; to compute surface derivates, to do subsurface scattering, to sample arbitrary geometry lights, etc.

Why would you need per-thread geometry caches? That doesn't really make sense (memory duplication)... What you'd do is just map the geometry + bvh into a serialisable format (like vraymesh) such that they can be fread() in one go pretty quickly. You could put heuristics in to not page out very small meshes...

But unless you batch and re-order rays (and I'm not convinced doing this is worth it if you're doing more than 3/4 bounces, as the incoherence just makes things a nightmare), there's no point really doing this (unless you're happy with very slow performance - even mmapping stuff is slow).

Not true.