I had a write a ray tracer for a class this quarter. Here is an image it generated.
Printable View
I had a write a ray tracer for a class this quarter. Here is an image it generated.
Very nice.
That's pretty nice!
I had to write a ray tracer too, I think it did pretty well althoug there's still some bugs as you can see, especially around the arm:
http://i51.tinypic.com/14uddnb.jpg
LooL :D
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.
Here is a "more better" (klegg) picture. It is of a chess bishop piece.
That is excellent.
I am interested that you have used a non-Gaussian blur to simulate depth of field.
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 wrote the software that Pixar use. It's in VB4 if you're interested. *FACT*
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.
I modeled both meshes using Houdini Apprentice. I rendered them using my custom renderer that I wrote for a class.
So you wrote a class with class for class?
Pretty classy.
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)
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.
Can you show us a rendering with one light source?
Here is an image with one light and no depth of field.
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.
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.
A new update:
My ray tracer can now do perlin noise solid texturing.
what degree are you going for that you get such challenging and rewarding projects to write? What class required this?
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.