Archive for the 'Ray Tracing' Category

15
Jan
09

Ray Tracing – More theory

Getting back to lesson 2 in the ray tracer tutorial [1], I read a little about Photo exposure [2], Gamma function [4] and the sRGB format [3].

I then proceeded to lesson 3 [6], where there is a good discussion on Procedural Textures (which I’ve already read about [5]) and Texture Mapping and how they can be implemented.

I didn’t have time to analyze the code carefully yet, but I’ll do as soon as possible.

[1] A raytracer in C++ – Lesson 2
[2] Wikipedia – Tone mapping
[3] Wikipedia – sRGB
[4] Wikipedia – Gamma correction
[5] Kunigami’s Weblog – Texture Types
[6] A raytracer in C++ – Lesson 3

14
Jan
09

Room 5

From the previous attempt, I only added the window grid. I managed to fix the blurred shadow cast by the outside light source. After taking a look at the Spot Lamp manual [1] I discovered that the scene was being rendered using Buffered Shadows, which is fast but renders low quality shadows. The other option is Ray Tracing, which is slow, but renders shadows at a very good resolution.

Room 5 with spot lamp rendered using ray tracing (rendering time: 2m:29s) :
room5rt

Room 5 with spot lamp rendered using buffered shadows (rendering time: 1m:22s):
room5bs

Reference:
[1] Manual/Spot Lamp

10
Jan
09

Ray Tracer Development – First Steps

Reading a theory book about ray tracing is somewhat abstract and I found it too hard to code it from scratch, although there’s a chapter in the book dedicated to the actual development of a ray tracer software. But I decided to research on internet before start coding. The first reference I found was wikipedia [1] which explains basically what I’ve already read in the book. The interesting part was the “external links” section, where I found a excellent tutorial on ray tracing development [2]. There they use lessons and also provide c/c++ source code. My first idea was to recode everything while following the tutorial, but I though it would take too much time for little learning. So it’d be better to read the source code and try to understand it.

I’m in lesson 3 yet, but we’ve already covered aspects like reflection, diffuse and specular lightning, anti-aliasing (by super-sampling) and also some monitor exhibition issues.

I’ve been testing these codes under linux. I could also be doing it in windows, but since it is a command line software, I prefer to develop in linux.

My future plan after finishing the lessons is try to code my own version for blender files.

Reference:
[1] Ray Tracing – Wikipedia
[2] Raytracer in C++

05
Jan
09

Bearing modeling, hotkeys table and ray tracer

I’ve been following a tutorial about modeling a mechanical piece – a bearing [1]. The tutorial is divided into 10 extensive but well detailed parts, and I’m currently in part 4. The great thing about this tutorial is that it uses Blender with numerical precision, like the autoCAD tool (in which I have some 2D experience). Besides learning more about Blender’s modeling tools, I feel that this kind of work might be useful in my field (engineering). The partial result is showed bellow:

Bearing

Some of the things I learned (or remembered how to do):

  • Center the 3D cursor in origin
  • Spin tool
  • Show edges lengths
  • Explanation about the pivot
  • Rotation around a given reference point
  • Snap tools
  • Technic to put a point over a (orthogonal) line
  • Modifier: edge split
  • Edge Special Menu: mark an edge as sharp
  • Hide/Show vertices

Also, I found a hotkey table reference: http://members.chello.nl/j.kassenaar/blender/hotkeys/kall.htm.

Last but not least, I decided to start a big project, and I’m not sure if I’ll have enough time, knowledge, intelligence or will. Well, anyway, the project I’m talking about is to write a ray tracer from scratch.

I’ve borrowed a book at Unicamp library (IMEEC) about the subject. It’s the “An introduction to Ray Tracing” by Andrew S. Glassner.

book

Reference:
[1] Modeling a 608 Bearing