Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Tobias Johansson, posted on September 04, 2001

Image Description, by Tobias Johansson

Inspired by Jaap's GBA screenshots from his 3d engine, I thought I'd try some raytracing on the GBA. For anyone that grew up with dos mode13 graphics programming, programming the GBA is like taking a walk in the park, really nice.

I use the 15bit Mode3, rendering times are 2-3 mins for a simple picture, and 5 times slower with supersampling on.

  • Plane and Sphere primitives
  • Phong shading
  • Shadows
  • Reflections
  • Supersampling
  • As you can see I use iGBA for emulation and I use ARM Software Development Toolkit v2.50 for compilation. The source code the be found at my homepage I have no idea if it works on the actual hardware, but if someone tries please tell me what happened.

    /Tobias Johansson

    Image of the Day Gallery


    Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
    Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

    September 05, 2001, 03:17 PM

    THIS IS GBA?!?! whoa i've gotta get myself one of those as well :)


    September 07, 2001, 08:58 AM

    I just took a peek at your sourcecode.. At first i thought it would be written using fixespoint math, but i see you use floats, and i suppose theyīre not superbly emulated.. Thatīs one way to dodge speed. =)
    You can get this runnig quite fast, atleast with spheres, Iīm not gonna say realtime cause I have no idea how fast the gba is...
    For each row in the image, do a quick'n'dirty sphereplane test for all spheres in the scene, and keep track of all the spheres intersecting the xz-plane that the row makes up, then do the same for all columns in the image, but xy-plane offcrz. This way you know exactly which spheres are covering every single pixel. Once you know this, the sphere intersection is way more simpler than it is now... ( I like the squared radius calc for every intersection test btw..=) )
    A good way to speed up first-hit rays is to either keep a precalculated array of normalized directionvectors, and just transform them with the cameramatrix. Or, you can build the directionvector from the matrix itself, and interpolate it over the screen... Iīve got some really nice results with realtime raytracing if your interested.. (although pc =))
    And also, not retracing pixels gave me a 15-20% increase, so itīs well worth implementing...

    This thread contains 32 messages.
    First Previous ( To view more messages, select a page: 0 1 ... out of 1) Next Last
    Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.