O-Town Graphics

Friday, May 12, 2006

From Kudos to Quantum Mechanics

To the nameless Spanish physicist I met at Panera Bread - thank you - I am that much farther along to understanding topics such as Illumination and Relativity :) It is not everyday you see a guy casually reading a book on Quantum Mechanics over coffee. Of course it turns out he is from Spain. You don’t often get that kind of intelligence from Florida natives.

You do get songs like "I found you, Ms. New Booty". Which isn't half bad either, a few latina hotties at Firestone dancing to these songs make it okay that I have a monopoly on certain areas of specialized intelligence... such girls have a monopoly on amazingly seductive dancing talent.

Speaking of which, everything is Physics. Raytracing scales better than triangle rasterization. That simple truth yields many things. On that note, I may just have to switch my degree to Computational Physics.

Wednesday, May 10, 2006


I've started working on a raytracer early this weekend. I've also started learning the mathematics surrounding Illumination, thanks to Eric Lengyel's excellent book. Eric created some sample problems at the end of each chapter and it proves very useful as a way to test yourself with the mathematics and verify your results. I wish more computer graphic books would include answered exercises at the end of the book.

I've now designated Panera Bread as my study area of choice. The free refills on the coffee, the earth-tone lighting, and the large table next to an outlet proves the perfect formula to learn new things. Without an internet connection to distract you, it is much easier to focus on the tasks at hand!! Try it out and let me know what you think. It is easier to get things done when all distractions have been eliminated and free coffee refills are aplenty!

It is ashame though, aside from the Panera Bread and Starbucks, East Orlando doesn't have the same yuppie frills I have grown to know when living in Hyde Park, Tampa. College towns are like 3rd world countries in comparison. Good times.

Wednesday, May 03, 2006

Annoying idioms

I'm really tired of the idiom I see in Win32 and sometimes now OpenGL where you try something, and if it works, then its supported, otherwise, your out of luck. Why can't we just query what a device features?

This really complicates code. For example, to enable full-screen anti-aliasing, you have to do things like create a dummy window and then try to set a pixel format context.

Look at the OpenGL extension:

wglChoosePixelFormatARB(HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats)

This requires an HDC, but you might not know ahead of time if and what modes it supports! So wow, let's try it on a dummy window, and if it works maybe try a few more, just to see what options we have. 8X isn't supported? Hey, let's try 4X? Oh, no, can't do that? Okay, 2X. Shaheesh.

Why not something like this, huh?

int count = wglGetDeviceCapsCount(GL_FSAA_MODES);

std::vector<int> fsaaModes;
wglGetDeviceCapsiv(GL_FSAA_MODES, &fsaaModes[0]);

Is that so hard?? There are also similar evil functions in Win32, where for example if you need to see how many bytes to allocate to a Unicode to string conversion, you use the exact same function for conversion but pass in a different value. Yes I'm talking about the oh so ugly WideCharToMultiByte function.

Do we really need a super function to try to do everything? I'm just tired of round-about ways of trying to get information.

Monday, May 01, 2006


Over the weekend as I cracked open the 3D Mathematics book by Eric Lengyel and poured over the Illumination models, I realized how important lighting is. To my surprise and reluctant delight, my math book covers Bidirectional Reflectance Distribution Functions, which is a prelude to the more advanced BSSRDF model that is used to model skin.

Lightning is so important. All the new research has to do with lighting. If you look at the NVIDIA dawn demo, the textures themselves are so unimpressive. In fact, the textures generally are used simply to store contour or color information. It is the lighting that makes it look so fabulous. For those who think there is no art in programming, think again. Programming is an art.. look at all the cool graphics created from procedural code! That code started with imagination from the programmer. An artist is a slave to the tools – tools that a programmer creates.

In modeling reality, you can never underestimate the importance of physics. When I go back and finish my degree at UCF I plan on minoring in Physics with some extra courses in Optics, Wave Mechanics, and Mechanics.

Unfortunately, as with all things worth pursing, the math is quite, quite difficult. I then realized that one thing to get started that tends to focus more on lightning is raytracing. So it would seem that writing a "simple" raytracer is in order.

Baby steps. In the sea of things one must do to learn, it is hard to prioritize what to learn.

Here is a link I found: http://www.flipcode.com/articles/article_raytrace01.shtml