raytracer accelleration structure advice

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 Dec 12, 2012 at 14:57

ive got a single model instancing into the distance at about 30 fps.
Now id like to compose a world made of multiple models.
raytracer1.png

So, the first thing I need is some kind of instance structure that rays can pass empty space and detect hitting instances least steps possible, whats the best method for transformed instances? Animation isnt the most important thing, but id like it to be quick to create because you need to be able to edit the world.

I bet this is the best forum to ask this question, with all the raytracing gurus here :)

Thanks for any replies.

4 Replies

Please log in or register to post a reply.

Ceee4d1295c32a0c1c08a9eae8c9459d
0
v71 105 Dec 13, 2012 at 11:18

I’d go for an octree or a regular grid using a 3d brehsenam ( sp??? ) ray tracing function, i went down this route years ago but due to hardware restrictions it was painfully slow.
If i were you i’d look also into gpu raytracing i saw demos running at 40-50 fps

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 Dec 13, 2012 at 13:03

Yeh, the octree seems like the obvious solution, I just hope I dont blow the memory with all the models loaded into a large texture, to be accessed as they are travelled into.

Im thinking 4096x4096, with this method, itll store about 256 models, and I can employ some lod technique for getting into the distance, i hope thats not too much.

B20d81438814b6ba7da7ff8eb502d039
0
Vilem_Otte 117 Dec 13, 2012 at 13:48

For voxels, definitely go for octree - you won’t find better suited acceleration structure for voxels. On the other hand if you’re with triangles, you can go either with KD-trees (those created in O(n log n), are quite useful - although still too slow for real time editing), or BVHs/QBVHs - they’re a bit faster to create and if you create your BVH on GPU, it can take just a few seconds for power plant.

Ad fps, I can get around 15-30 fps (varies with camera position ofc) in Sibenik on Mobility Radeon 5470 (no magic involved, though viewport is 800x600), and way lot more (basically inmeasurable, it jumps a lot over 100 fps - if I use some 1920x1080 viewport, then in falls to like 30 - 50 fps - varies with different view of course) on Radeon HD 6870 at home. Although I’m using KD-trees, and precomputation of KD-tree takes quite a time (about 3 seconds for Sibenik, when I need rly HQ tree, otherwise I can get under a second, but ray tracing is slower then of course … acceleration structure creation runs on CPU).

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Dec 14, 2012 at 12:29

I use BVH and store them on disc with the object, seems ok.

But my renderer is software only at the moment so speed isn’t an issue, I don’t have any.