onsdag 30. september 2009

Pretty results

In the results I so proudly presented I always reacted to the very black corners. I initially feared that this was due to some central mistake in my whole architecture, but happily it turned out to be just a small factor of ten-mistake in the size of my hemicubes. This goes to show two things:

  • The maths on which radiosity is based is sound. As long as I try to do this correctly, it will work

  • This kind of bugs is what I get for building my code with duct tape rather than what I know to be the good methods

Let's move on to the new and more beautiful results! I feel that these results exhibit the wanted warmth of radiosity rendering.

The room

Detail: Corner

Detail of the corner under the lamp. Notice that it is darker in the corner and how natural this feels.

Detail: Floor

I have no idea why this pattern appears on the floor. Time to check that duct tape.

Detail: Wall

Another pattern appears on the walls opposing the lamp. Another reason to check that tape.

Fly through

And finally another fly through. This time I use the Wii remote interface for controlling. (That was something I added when I needed a break with something fun to do :)

søndag 6. september 2009

Technical details

A couple of small new things:

The source code is now hosted at bitbucket, rather than freehg.org, which was not up to the task.

Contrary to what I announced in the beginning, the blog is now hosted at blogspot.com. I have however not abandoned my roots -- I still write the blog as Markdown-files in my project. In addition it is published to blogspot.com thanks to my Blogger-integration scripts using Google's Data API. The latest features are updates of posts that have already been published and transparent linking between blog posts. This makes for a very good transparent cross-publishing experience.

That concludes this installment of meta-blogging.

Results

Today, for the first time, I achieved results that actually look like radiosity. Huzzahs are in order.

So, your source code is open to the world?

One of the first reactions I had to this blog was the question "Your source code is accessible to the world?" It is a fair question. The default seems to be to keep your source code locked away and only show it off if you are really proud and you have double checked that you can't make any money from it. I am not hoping to make any money from this project, but I know that at least in some ways my source code is really ugly. I should be hiding my source code under a rock some place far away. So why is it publicly available?

I could try to say something smart about this, but it turns out Brian Fitzpatrick and Ben Collins-Sussman already have. According to them, we too often compare ourselves to the mythical genius programmer. In reality I really have no reason to keep my source hidden.

Instead of fearing what random strangers might think about my source code, I have started accepting that everything is a draft and perfection only keeps you from getting done. Who knows? Maybe somebody can make use of my source code some time? I would rather make that gamble.

So please, go and check it out. :)

GL_PROJECTION abuse

I am apparently guilty of abusing the GL_PROJECTION matrix.

Background

When starting the project I decided to spend as little energy on learning OpenGL as possible, making due with what I already knew. As it turns out, I had a lot I needed to learn anyway and during the course of this project I have learned:

  1. Not to use P-buffers (this was quick)
  2. To use framebuffer objects
  3. To use floating point textures for higher dynamic range
  4. Ways to bend GL_BLEND to do my bidding

When combining 2. and 3. in that list it turns out that there are some strange, hard to debug, hidden requirements.

I think the descision to make due with what I knew about OpenGL combined with the requirement to use floating point textures and framebuffer objects makes for a rather unfashionable combination of old OpenGL-code, which I learned at university and earlier, and recently out-dated extensions to OpenGL. In short, I think a lot of my OpenGL-code can make seasoned graphics developers cry.

What will I do?

I might actually take Steve Baker's advice on how to use the GL_PROJECTION matrix, because it really does make sense. However, I am not about to embark on a conversion to using only the appreciated (non-depreceated) subset of OpenGL 3.1 or anything of that magnitude. For the time being, the goal is to get the project done.

Welcome

In the spirit of getting things done, I will not spend much time on welcoming you to my blog. There are just these few things I would like to say:

  1. This blog is my blog, where I will hopefully do random braindumps. However, the main theme for the blog is my radiosity-renderer project.
  2. I've walked right into the trap of making my own blogging engine (contrary to the spirit of getting things done). It is, however, really simple: I write things in Markdown in my project's source code repository with some conventions on filenames. This is mostly enough for me, but I will make a script or two to render this into HTML and publish it somewhere.
  3. The project is older than this blog. That means I will not be able to talk about everything as I go along. I hope to write some new posts as I figure certain things out (this is probably the most fun) as well as retrospective posts about how I arrived at doing things a certain way. Right now, I am regretting not having a blog for this project from day one, and I wonder if I will at some point in the future come to regard blogging as as essential to programming as having a version control system. It is good to have a way of organising your thoughts.

Enjoy!