Jump to content


raytracer accelleration structure advice


4 replies to this topic

#1 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 12 December 2012 - 02:57 PM

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

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.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#2 v71

    Valued Member

  • Members
  • PipPipPipPip
  • 353 posts

Posted 13 December 2012 - 11:18 AM

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
Check my code in the c/c++ section :
http://www.binpress.com/browse/c

#3 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2722 posts

Posted 13 December 2012 - 01:03 PM

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.
you used to be able to fit a game on a disk, then you used to be able to fit a game on a cd, then you used to be able to fit a game on a dvd, now you can barely fit one on your harddrive.

#4 Vilem Otte

    Valued Member

  • Members
  • PipPipPipPip
  • 345 posts

Posted 13 December 2012 - 01:48 PM

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).
My blog about game development (and not just game development) - http://gameprogramme...y.blogspot.com/

If you don't know how to speed up application, go "roarrrrrr!", hit the compiler with the club and use -O3 :D

#5 Stainless

    Member

  • Members
  • PipPipPipPip
  • 581 posts
  • LocationSouthampton

Posted 14 December 2012 - 12:29 PM

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users