11/14/2007

SH experiments continued

My first spherical harmonics experiments were quite interesting ! I managed to include them in production quite quickly, in the form of irradiance volumes.

I currently use a set of volume textures to encode 3rd order RGB SH coefficients. This allowed me quickly have a convincing diffuse lighting on the animated entities in my project. As the lighting in smooth enough, the SH encodes both direct & indirect lighting with good enough results.

I also experimented with SH for other purposes :
  • obtaining convincing specular colors. The preliminary results were interesting but I lacked time to properly integrate this feature.
  • obtaining lighting for volumetric lighting effects. While I managed to have some nice atmospheric effects, this method is not directly applicable to reconstruct clearly visible "light beams". Moreover, the ray marching code in fragment shader is quite costly, so for now, I discarded it.
  • lighting vegetation planes. This is a nasty hack, but the vegetation now have a subtle view dependent lighting that contributes to reduce a tiling effect ; and the vegetation now better integrates with surrounding geometry.
I'm quite happy with the possibilities lying ahead !

11/06/2007

FreeImage lib clumsiness

I've been using FreeImage lib for some years now, always with a bad feeling about the architecture and the scalability of its features.

I keep on using it as I didn't find another more convincing image loading library ; but today I had the proof that my feelings were right !

While loading a small 11x11 32bits TGA file, FreeImage reported it as being FIC_RGB and not FIC_RGBA, thus leading my wrapping code to remove the alpha channel... After a quick investigation, I found out that the 'FreeImage_GetColorType' function, when called, actually scans all pixels of RGBA images, and reports FIC_RGB if the alpha channel of every pixel is 255 !

Uh...

11/05/2007

Adobe/boost GIL vs. image resampling

After my first experiments with GIL a few months ago, I'm quite convinced that I'll have to take a closer look at it.

My first experiments allowed me to cleanup somehow my image support libs, and the wrapping of FreeImage library.

Having now the objective of a total makeup of my texture generation/compression pipeline, I'd like to have a solid framework to back up my algorithms, that would allow me to be more "data-format agnostic".

I've got to refresh my C++ template metaprogramming tricks as I'll have to face horrendous error messages ; I'll make sure not to drink too much coffee and have some aspirin nearby !

I'll tackle first with some image resampling algorithms, I hoped to find someone kind enough to publish something... Apart the limited resample extension to GIL, I didn't have any luck so far...

I hope GIL will be worth the time I'm going to spend with it ! If anyone who happens to read this have some GIL user experience to share, I'd be glad to be enlightened !