BubbleRacer4k - real time raytracing

Mmm raytracing…
But it is kinda slow as been mentioned alot of times allready… what optimiziation have done, speedwise I mean? I tried to play the high res version but at 1.6 Ghz it wasnt realtime :wink:
The realtime raytracing entry from last year sucked! I know 'cause I wrote it…

Hey that’s great, I like experimentations like that.
It’s working rather well for me :I get 4.4 fps on a 2.6+ Athlon (real speed of 1.99Mhz) and a GeForce4 ti4200.
I think you should keep refining your little engine, one day raytracing games will be the norm.Maybe you’ll be able to find some optimizations without sacrificing the raytracing “purity” in the process.
I noticed there’s some reflexion inside of the big spheres.If I make a full stop near one of them, then turn, the camera gets behind the walls and I see some little spheres inside of the big ones.

I would like to try, but my machine is too old… :’( Pentium III 800Mhz and Geforce 2 32Mb… Probably I will get 0FPS… :stuck_out_tongue:

I’ve already written cooler and faster raytracing engines (with space partitionning, autobounding, procedural texturing…), but they requiered more than 4k (and without a game inside).

I’ll drop today a new tuned version of br4k for low-end PC (i’ll try it on my old PIII-800) instead of my brand new PIV 3200.

Beeing so low-res, i’ll drop double computations for floats, and try to add a sorting step before initial ray cast.

And within in a few days, i’ll produce a fully (well… limited by my knowledge of that technology) optimized version : bubbleracer128k, just for fun.

Stay tuned !

Lilian

Ok, this should be my last update (tired of maths for the moment).

I have now 40-50 fps at low res, and 20-25 at normal res.
It’s even becoming playable at 4* normal res (320*200 / 15 fps).

Unfortunately, still at a low and unplayable 5 fps on my PIII-800

Have fun (for those with 2Ghz PC or 1Ghz Mac).

Lilian

1.8 GHz PC ~8 fps High and 15 - 40 in low.
Ambient light a bit low isn’t it? Got a strange sharp dark line on the dark side of the moon…

Way better flow in the game now (then I also tested on a 2x faster mashine…)

I look forward to the bubbleracer128k :smiley:

Hello, I have updated the game.

Now, it runs at 320*240 / 20fps on my PC, and should run better on older computers (I’ve dropped shadows and reflections, and improved the maths).

When testing with java web start, I’ve found that the game ran at 10 times slower speed (14fps/64*48pix) - don’t know why.

So, i invite you to play it from the command line (as described on the web site).

http://www.woogley.net/j4k/bubbleracer4k

I have also added and adaptative resolution, to ensure the game runs at 15 fps at least.

Hope you will try it !

Lilian

looked a little too low res over here :stuck_out_tongue: but it didn’t feel like it was running slow at all. I got 9.7fps on my athlon64 2600. Fun game though, I like it quite a bit.

yeah it’s too low res now.And what’s the reason for making raytracing if you remove reflexion and shadows lol?
I prefer the ancient version better with the 4.44 fps :wink:

Well, I meant to create a 4k playable game, not a full-featured raytracing engine at 0.4 fps :wink:

For this, you will have to wait till the non-4k is out (next week). It runs a little bit faster than this one, but with ground texturing, shadows and reflections.

I have also thought of another good optimization, I’ll try to have it done for this afternoon (GMT).

Thanks for the feedback.

Lilian

not sure if you are currently doing something similar, but when i programmed my own ray tracer, i found that this simple optimisation really spead up the tracing.

-split your film into 4x4 blocks
-for a given block raytrace each of the 4 corners taking note which object was the first object hit.

  • if all four rays hit the same object then assume that the remaining 12 pixels in the block hit the same object and so for these 12 pixels start the ray trace from the intesection with the assumed first object.

I never got around to extending this idea to include the whole order of objects at each intersection. I believe further speed reduction can occur if you do take into account all the objects that the ray (inital and secondary) rays hit by each of the four corner pixel rays. i.e. assume that all the 12 pixel rays hit the same objects (primary and secondary rays) until the point where all four corner pixel rays’ object intersection order nolonger are identical.

I haven’t used this optimization yet, but was thinking of something quite similar (rectangular “fractalisation” of the screen space and recursive traversal of the rects, with same final test than yours) . Since I have some extra 200 bytes (change of obfuscator), I may have enough space to try it out.

Thanks for the tip.

Lilian

UPDATED !

fps is now 140 at low res on my pc (and 40 fps at mid res).

There was a very big hidden bottleneck : graphics.draw() took 2/3 of the frame rate due to scaling. I have replaced it by a programmatic scaling.
Another big improvement is the borders collision testing algorithm (thanks moogie !)

10.5 fps on my PIII-800 (still too low…)

It’s time to try it again :slight_smile:

Lilian

Awesome! That’s some really great optimizing there Lillian. Since it’s so much faster now, do you think there’s any chance we could get reflections back? :slight_smile:

Thank you jbanes !

I think I should try to put them back, but it’s going to be hard… the byte codes deleted have been filled with optimizing algorithms :wink:

Come back in an hour or so…

Lilian

[quote]UPDATED !

fps is now 140 at low res on my pc (and 40 fps at mid res).

There was a very big hidden bottleneck : graphics.draw() took 2/3 of the frame rate due to scaling. I have replaced it by a programmatic scaling.
Another big improvement is the borders collision testing algorithm (thanks moogie !)

10.5 fps on my PIII-800 (still too low…)

It’s time to try it again :slight_smile:

Lilian
[/quote]
A marked improvement! I am glad the border collision detection helped.

I am avg 25.5 fps on a Pentium 4 2.4 Ghz

Very impressive! 32 FPS on medium rez with an AMD 2600

c_lilian, could add an optional (by keypress??) feature of simple anti-aliasing by super sampling? I think that would make it seem even more impressive! (possibly more than reflections…)

21fps on normal game

[quote]c_lilian, could add an optional (by keypress??) feature of simple anti-aliasing by super sampling? I think that would make it seem even more impressive! (possibly more than reflections…)
[/quote]
I am tired of hunting bytecodes (and my code is getting uglier and uglier).
Will do it in bubbleracer2005 (I’ll post a technology preview later today).

I will also try to post a fullscreen (640x480) version today, but i’m not sure it will be under the 4k wall.

Thank you all for the feedback.

Lilian