Results 1 to 24 of 24

Thread: Ray Tracer

  1. #1

    Thread Starter
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    Ray Tracer

    I had a write a ray tracer for a class this quarter. Here is an image it generated.
    Attached Images Attached Images  
    My monkey wearing the fedora points and laughs at you.

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Ray Tracer

    Very nice.
    My usual boring signature: Nothing

  3. #3

  4. #4
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Ray Tracer

    LooL

  5. #5
    Fanatic Member kregg's Avatar
    Join Date
    Feb 2006
    Location
    UK
    Posts
    524

    Re: Ray Tracer

    No offence Arrow_Raider, but clearly NickThissen's ray tracer is a lot more better and clearly far more practical.

    That goes without saying that is a very nice ray tracing image.

  6. #6

    Thread Starter
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    Re: Ray Tracer

    Here is a "more better" (klegg) picture. It is of a chess bishop piece.
    Attached Images Attached Images  
    My monkey wearing the fedora points and laughs at you.

  7. #7
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Ray Tracer

    That is excellent.
    I am interested that you have used a non-Gaussian blur to simulate depth of field.

  8. #8
    Fanatic Member kregg's Avatar
    Join Date
    Feb 2006
    Location
    UK
    Posts
    524

    Re: Ray Tracer

    Quote Originally Posted by Arrow_Raider View Post
    Here is a "more better" (klegg) picture. It is of a chess bishop piece.
    Relax, I was just kidding. Both are excellent pictures.

    I thought that ray tracing required a long time to generate that image? (My understanding is the disadvantage of ray tracing is performance)

  9. #9

  10. #10
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Ray Tracer

    I wrote the software that Pixar use. It's in VB4 if you're interested. *FACT*

  11. #11
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: Ray Tracer

    Quote Originally Posted by wossname View Post
    I wrote the software that Pixar use. It's in VB4 if you're interested. *FACT*
    What does the software do?
    Delete it. They just clutter threads anyway.

  12. #12

    Thread Starter
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    Re: Ray Tracer

    Quote Originally Posted by kregg View Post
    Relax, I was just kidding. Both are excellent pictures.

    I thought that ray tracing required a long time to generate that image? (My understanding is the disadvantage of ray tracing is performance)
    The reference I made to you was in regards to the awesome grammar of "more better."
    Ray tracing is indeed slow. There are many strategies you can use to optimize the algorithms, but even then, it is still slow. I have implemented a few optimizations, but the picture of the bishop thing still took a while to render; I think it was about 15 minutes. I render my image in two passes. The first pass is very fast - half a second to a few seconds. It renders a low resolution version with low sampling and records the color, depth, and shadow information at each pixel. The second pass renders the full size image with normal sampling. It uses the information from the first pass to speed up shadow drawing, speed up depth of field, and to perform adaptive anti-aliasing. For scenes with meshes, such as the bishop, I implemented a KD tree structure to partition the space so that I can perform ray intersection tests with meshes much quicker. Without these optimizations, that image probably would have taken hours to generate.

    Quote Originally Posted by NickThissen View Post
    It is very nice. What do you use to generate this image? Is it all your own work, or is it something like 3DsMax with a custom renderer or something?
    I modeled both meshes using Houdini Apprentice. I rendered them using my custom renderer that I wrote for a class.
    Last edited by Arrow_Raider; Dec 8th, 2010 at 06:58 PM. Reason: fixed time
    My monkey wearing the fedora points and laughs at you.

  13. #13
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Ray Tracer

    So you wrote a class with class for class?

    Pretty classy.
    My usual boring signature: Nothing

  14. #14
    Fanatic Member kregg's Avatar
    Join Date
    Feb 2006
    Location
    UK
    Posts
    524

    Re: Ray Tracer

    Quote Originally Posted by Arrow_Raider View Post
    The reference I made to you was in regards to the awesome grammar of "more better."
    Ray tracing is indeed slow. There are many strategies you can use to optimize the algorithms, but even then, it is still slow. I have implemented a few optimizations, but the picture of the bishop thing still took a while to render; I think it was about 15 minutes. I render my image in two passes. The first pass is very fast - half a second to a few seconds. It renders a low resolution version with low sampling and records the color, depth, and shadow information at each pixel. The second pass renders the full size image with normal sampling. It uses the information from the first pass to speed up shadow drawing, speed up depth of field, and to perform adaptive anti-aliasing. For scenes with meshes, such as the bishop, I implemented a KD tree structure to partition the space so that I can perform ray intersection tests with meshes much quicker. Without these optimizations, that image probably would have taken hours to generate.
    Seriously, this was so interesting, it was the most bestest post ever possible.

  15. #15

    Thread Starter
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    Re: Ray Tracer

    The ray tracer can also render translucent surfaces. In this image, I made the bishop glass-like. There are no caustics though. http://en.wikipedia.org/wiki/Caustic_(optics)
    Attached Images Attached Images  
    My monkey wearing the fedora points and laughs at you.

  16. #16

    Thread Starter
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    Re: Ray Tracer

    The image in my last post had a problem in the refraction. I have fixed that problem and have attached the corrected result. Here is the more correct glass bishop. Note that the dark circle on the bottom of the bishop is most likely caused by the mesh being too low and passing through the ground plane.
    Attached Images Attached Images  
    My monkey wearing the fedora points and laughs at you.

  17. #17
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Ray Tracer

    Can you show us a rendering with one light source?

  18. #18
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Ray Tracer

    Quote Originally Posted by TheBigB View Post
    What does the software do?
    It prints cash.
    I don't live here any more.

  19. #19

    Thread Starter
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    Re: Ray Tracer

    Here is an image with one light and no depth of field.
    Attached Images Attached Images  
    My monkey wearing the fedora points and laughs at you.

  20. #20
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Re: Ray Tracer

    Arrow ... nice work. What are you using for your 3D models ... step files? Also, what language are you using ... VB? I've always had an interest in rendering & played around with many different programs (Blender, TrueSpace, Strata3D, HyperShot, etc) but I've never tried writing my own. You should post your code in the code bank ... I'd love to play around with it.

  21. #21

    Thread Starter
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    Re: Ray Tracer

    My program is divided into three projects in visual studio. These are the projects:
    • RayTracer - Written in C++. Contains core rendering functionality. Can be compiled as a static library or as a standalone executable command line version of the ray tracer. The code is platform agnostic. (I had to run and submit it on a UNIX server for the class.) Unfortunately, the server didn't have boost, so the command line version is single-threaded.
    • RayTracerInterop - Written in C++/CLI. Exposes the top level rendering components to .Net. Required by RayTracerUI.
    • RayTracerUI - Written in C#. Provides user interface for the renderer. It allows you to configure the rendering options and allows you to see the rendering in real-time as it renders. It is renders the scene in a multi-threaded manner and is thus is much faster than the command line version.

    The user interface aspect was solely for my benefit and was not submitted for the class. I may submit the code online sometime. The class is finished and it satisfied the requirements, but there are some areas that are lacking and I would like to complete further. For example, it can only do procedurally generated checkerboard textures right now. I would like to add other procedurally generated textures such as perlin noise. I'd also like to add the ability to use textures from files.
    My monkey wearing the fedora points and laughs at you.

  22. #22

    Thread Starter
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    Re: Ray Tracer

    A new update:
    My ray tracer can now do perlin noise solid texturing.
    Attached Images Attached Images  
    My monkey wearing the fedora points and laughs at you.

  23. #23
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Ray Tracer

    what degree are you going for that you get such challenging and rewarding projects to write? What class required this?
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  24. #24

    Thread Starter
    Hyperactive Member Arrow_Raider's Avatar
    Join Date
    Dec 2001
    Location
    AVR Lovers Club
    Posts
    423

    Re: Ray Tracer

    I just finished my BS in computer information science, which is Ohio State University's computer science program. Ray tracing was the focus of an elective class I took in my last quarter. There are just a few classes that focus on graphics, and this was one of them.


    The professor put up a gallery on the course website to show people's work:
    http://www.cse.ohio-state.edu/~hwshe...lery_2010.html
    The first three images are mine. The images on there were created at the end of the course. I implemented Perlin noise after the course had ended, so my images in the gallery only feature the checkerboard texture.
    Last edited by Arrow_Raider; Dec 28th, 2011 at 02:34 PM.
    My monkey wearing the fedora points and laughs at you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width