Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (482)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (550)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  BubbleRacer4k - real time raytracing  (Read 16293 times)
0 Members and 1 Guest are viewing this topic.
Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #30 - Posted 2005-02-14 22: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

Senior Member


Projects: 1


Java games will probably rock someday...


« Reply #31 - Posted 2005-02-15 05: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

Offline c_lilian

Senior Member


Projects: 1


Java games will probably rock someday...


« Reply #32 - Posted 2005-02-15 11: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

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline jbanes

JGO Coder


Projects: 1


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


« Reply #33 - Posted 2005-02-15 11: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

Senior Member


Projects: 1


Java games will probably rock someday...


« Reply #34 - Posted 2005-02-15 11: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

Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #35 - Posted 2005-02-15 19: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

Senior Member


Projects: 1


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


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

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

Offline moogie

JGO Knight


Medals: 12
Projects: 6
Exp: 10 years


Java games rock!


« Reply #37 - Posted 2005-02-15 20: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

Senior Member




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


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

21fps on normal game

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

Senior Member


Projects: 1


Java games will probably rock someday...


« Reply #39 - Posted 2005-02-16 05: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

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Danskeren

Senior Member


Projects: 1


oi?


« Reply #40 - Posted 2005-02-16 17:35:27 »

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


all 4k games are ugly Cheesy

Offline hilmilho

Senior Newbie





« Reply #41 - Posted 2005-06-07 23:21:06 »

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

Pages: 1 [2]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CopyableCougar4 (14 views)
2014-08-22 19:31:30

atombrot (28 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!