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


Submitted by Yannick Suter, posted on January 31, 2001




Image Description, by Yannick Suter



Recently I found these pictures of my raytracer I've programmed with Watcom C++ for DOS three years ago. As I moved to win32/MFC programming I forgot the sourcecodes somewhere on a backup cdrom. Actually the code was quite well structured and the engine could handle some nice features:
  • 3DS loader with multiple Objects and Lights handling
  • optimized ray-castings with dynamic boundary-spheres
  • all these material properties like specular/diffuse etc levels
  • supersampling
  • reflections/refractions
  • texture- and bump-mapping
  • keyframing for objects/lights/camera -> I saved every single frame and compiled them into a *.FLI file
  • notes to the pictures

    big one:
    one of my favourite pictures showing some colourful/antialiased mushrooms. It took quite a lot of time to raytrace this scene. =)

    little pictures from left to right:
    1. This picture shows the boundary-spheres used to optimize the trace-time and you see quite well, that the mushrooms are splitted into subobjects.
    2. Just another mushroom-pic - in a way I like the cold and clean feel of this one.
    3. Here you see a selfmade 3D character originally made for a demo, which unfortunatly never has been finished. It had quite a lot of subobjects and was fully texture-mapped. Again with some psychic omni-lights.
    4. Another test-scene featuring some antic stones. I remember testing here some material properties..

    In the Image Of The Day Gallery I saw some other raytraced pictures. Hey, great work and keep on programming!

    Yannick Suter


    [prev]
    Image of the Day Gallery
    www.flipcode.com

    [next]

     
    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.
     
    Saad Faisal

    January 31, 2001, 04:54 AM

    Wow... You better make sure for your own good sake to find that source ;)

     
    Brother Bob

    January 31, 2001, 04:58 AM

    I have always liked raytracing. Dunno why, maybe because you can easily create a nice looking object, without too much poking. But don't ask me why I haven't done a raytracer myself...

    Anyways, your image was not too bad. Nice and clean, with a nice feeling. All I have to say is: Great work!

    And the character was quite funny looking :)

     
    shrike

    January 31, 2001, 06:05 AM

    I am just wondering how you made the point lights show up. Are they quads, or did you use some special function to make them appear? Also, what type of objects are the mushrooms? Are they made of triangles, or are the CSG, or some sort of special implicit "mushroom" function? I am working on a ray tracer now. Maby when I finish it I will put an IOTD too.

     
    Prophylon

    January 31, 2001, 08:07 AM

    OT : Are you by any chance related to Jaap? :-)

    Ow nice going on the raytracer!

     
    Yannick

    January 31, 2001, 08:30 AM

    I've allways tried never to fake anything - well, I'm faking reality.. hmm =)

    no, the lights are no pictures or any geometry. One I had some problems and I thought, that maybe my light-positions have been messed up somewhere in the tracing-processings and so I'v included some lines of additional code (see below).

    there is absolutly NO tric behind this. it's the same algorithm like we use in real phong-shading. all you need to do is:

    assume your OMNI light consists of a sphere - you will use this anyway if you want to calculate softshadows -> so no was of memory. next you need 2 vector:

    a. called light_dir: pointing from your point of view to the light_source

    b. initial ray_dir: pointing to the "virtual" position of the pixel to be calculated

    -> now calculate the angle between these 2 vector .. et voila! this gives you a cosinus (0..1) with the intensity of the light. add resulting res_color = cos*light_color to the color you got during the normal ray-casts..

    that's it..

    Yannick

     
    Robert Clemens

    January 31, 2001, 09:37 AM

    Wow, looks great!
    The smoothy style of the big picture reminds on Toy Story a bit.
    I'd like to see this rendering with real mush room textures :)

    Great piece of work!

     
    Vorteks

    January 31, 2001, 10:10 AM

    A Raytracer in DOS, eh? Impressive. It must have taken a really long time to raytrace an image an an older machine like that. The result was great though.

     
    DirtyPunk

    January 31, 2001, 10:19 AM

    The words "funky" and "surreal" seem to be useful in place here ;)

    But, a great set of images :)

    Would you do much differently if you were to implement this now?

     
    Yannick

    January 31, 2001, 11:41 AM

    hehe, good question! well, don't know. as I said, if I look at the code today I still understand every line of code (no dirty hack anywhere). structures and class setup are well done and I wouldn't change anything there.

    but I've learned a lot of new stuff in the last few years. I think the shader could be much better programmed. also object-management and caching could be better. using octrees whould speed up tracing time..

    I would also like to implement radiosity or other goodies like displacement maps or maybe hyper-textures. but the very first thing I would change is: convert it to win32 application!

    but even if I whould really like to, I've not that much sparetime.. =((

    Yannick

     
    Alan Gordie

    January 31, 2001, 02:52 PM

    Heh...do you remember Vivid? Or how about DKBTrace? Back in 1988, I remember dialing up a BBS in Chicago named "They Call Me Ray BBS". It was a BBS dedicated to writing and using ray-tracers. So, to answer your question "In DOS?" Yes, these programs were DOS apps and, at the time, they were extremely fast for what they did. But, back in those days (286/386 with no built-in math co-processor) you had to purchase a math-co separately or you couldn't even attempt a trace. I can remember waiting for 12-24 per image at 320x200x16...wow! Nowadays, there are demo crews doing real-time ray-tracing at 320x200x16 on a standard P3...go figure...

    I'm old. 8(

     
    Alan Gordie

    January 31, 2001, 02:54 PM

    That's 12-24 hours per image...DOH!

     
    Yannick

    January 31, 2001, 03:25 PM

    do someone know "heaven 7". it's a 64k intro released at the mekka-sympasium party last year (2k). they show one of the most impressiv realtime raytracers I've ever seen. sure, they don't cast any triangles, but what they do with boolean functions on spheres is absolutly crazy!

    have a look at:

    ftp.scene.org/pub/parties/2000/mekkasymposium00/in64/h7-final.zip

     
    Scrambled Monkey

    January 31, 2001, 05:08 PM

    Send me the source and I'll port it to win32 for you :) :)
    Great looking shot, I like the top one especially; nice lighting.
    Dan

     
    Mathieu 'POĻ' HENRI

    January 31, 2001, 05:46 PM

    FRESNEL2 by KOLOR, another 64kb intro released at THE PARTY 2000, it's very good too, it casts boxes and such and features great textures

    it may be found easily on http://pouet.net



     
    fluffy

    January 31, 2001, 06:20 PM

    Ahh, the visual tricks you can do when speed isn't an issue... :

    Technically, light sources always *would* be visible anyway (it's not like we directly see the illuminated surfaces or anything), and that implementation just makes so much sense... damn. :)

     
    fluffy

    January 31, 2001, 06:22 PM

    Um. POVray.

    Also, even modern machines can still run DOS. :)

     
    Smelly Dog

    January 31, 2001, 11:35 PM

    The mush rooms in the big picture look cool. Nice coding! :)

     
    Smelly Dog

    January 31, 2001, 11:36 PM

    The mush rooms in the big picture look cool. Nice coding! :)

     
    Cybok^Guideline

    February 01, 2001, 05:58 AM

    nice images! somehow the remember me of the things I heave seen at my last TeKno-party, when I closed my eyes...hmz..I wonder :)
    but seriously, it looks realy nice, especially for something dating back from the dos-age. And I relay like the image below-right, it looks, well...it just looks nice. Smart move implementing that 3ds-loader.

    you thought you have seen it all in 64k? hahahaha! You're funny!check: http://www.theproduct.de and be amazed. It's awesome.

     
    David Olsson

    February 01, 2001, 06:43 AM

    I just saw the product. It's more than awsome, it's.... well... supercool ?

    Btw what's wrong with swedish furniture ? :)

     
    Yannick

    February 01, 2001, 07:59 AM

    ah, sorry..
    the mushrooms are normal mesh-objects. the whole scene is stored as seen as a 3ds file which can be unmodified either raytraced or edited in any 3ds compatible editor

    y

     
    This thread contains 21 messages.
     
     
    Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.