Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  Print  
  BubbleRacer4k - real time raytracing  (Read 13773 times)
0 Members and 2 Guests are viewing this topic.
Offline moogie

JGO Strike Force
***

Posts: 775
Medals: 5


Java games rock!


« Reply #30 on: 2005-02-14 17:46:40 »

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.

Offline c_lilian

JGO Ninja
***

Posts: 643


Java games will probably rock someday...


« Reply #31 on: 2005-02-15 00:39:53 »

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

Former java games developer...
Offline c_lilian

JGO Ninja
***

Posts: 643


Java games will probably rock someday...


« Reply #32 on: 2005-02-15 06:04:39 »

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 :-)

Lilian

Former java games developer...
Games published by our own members! Go get 'em!
Offline jbanes

JGO Neuromancer
****

Posts: 1178


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #33 on: 2005-02-15 06:44:10 »

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?  Smiley

Java Game Console Project
Last Journal Entry: 12/17/04
Offline c_lilian

JGO Ninja
***

Posts: 643


Java games will probably rock someday...


« Reply #34 on: 2005-02-15 06:56:28 »

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 ;-)

Come back in an hour or so...

Lilian

Former java games developer...
Offline moogie

JGO Strike Force
***

Posts: 775
Medals: 5


Java games rock!


« Reply #35 on: 2005-02-15 14:52:02 »

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 :-)

Lilian



A marked improvement! I am glad the border collision detection helped.

I am avg 25.5 fps on a Pentium 4 2.4 Ghz
Offline Vorax

JGO Ninja
***

Posts: 666
Medals: 1


System shutting down in 5..4..3...


« Reply #36 on: 2005-02-15 15:22:01 »

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

Offline moogie

JGO Strike Force
***

Posts: 775
Medals: 5


Java games rock!


« Reply #37 on: 2005-02-15 15:52:59 »

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...)
Offline Malohkan

JGO Neuromancer
****

Posts: 1108
Medals: 1


while (true) System.out.println("WOO!!!!");


« Reply #38 on: 2005-02-15 15:58:47 »

21fps on normal game

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline c_lilian

JGO Ninja
***

Posts: 643


Java games will probably rock someday...


« Reply #39 on: 2005-02-16 00:15:03 »

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...)


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

Former java games developer...
Games published by our own members! Go get 'em!
Offline Danskeren

Full Member
**

Posts: 181


oi?


« Reply #40 on: 2005-02-16 12:35:27 »

Quote
... (and my code is getting uglier and uglier)...


all 4k games are ugly Cheesy

Offline hilmilho

JGO n00b
*

Posts: 12



« Reply #41 on: 2005-06-07 19:21:06 »

got 25-30 fps... winXP, amd barton 2500+, geForce 5500FX, 512 RAM

Pages: 1 [2]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.087 seconds with 21 queries.