Oct 26, 2010

Best Fit Normal Map Generator + Source Code

The BFN generator is finally here! I have found time for this tonight.

So, this small application allows you to generate each face of a BFN cube-map. If you want to encode the BFN only as the length of the best fit normal or transform it to a 2D texture (as suggested in Crytek's presentation), you will have a little bit of work to do but it should not be such a big deal. You can select the resolution of the cube-map as well as the bias vector at compilation time.

Some screen-shots for 256x256x6 cube-maps:


At the origin: the BFN cube-map with a bias vector=vec3(0.5,0.5,0.5).
in the +X direction: the regular normalization cube-map.
In the +X+Y direction: a BFN cubemap with a bias vector=vec3(0.5,0.5,8.0/255.0). It results in less precision for normals having negative Z value and more precision for normals having positive Z value.



The reconstruction error of the regular normalization cube-map as compared to the ground-truth normal map. (scale factor of 50)



The reconstruction error of the BFN cube-map with bias a vector=vec3(0.5,0.5,0.5).
Some reconstruction errors are still visible. (scale factor of 50)


The reconstruction error of the BFN cube-map with bias a vector=vec3(0.5,0.5,8.0/255.0).
No more error patterns are visible. (scale factor of 50)


Reconstruction error on the back faces (scale factor of 50). There is a large error when using a bias vector of (0.5,0.5,8.0/255.0). However, it is not important since only the positive Z values are important when storing normals for a light pre-pass or deferred renderer.


Error when computing a specular lob with the regular normalization cube-map. The specular exponent is 64.

No noticeable difference when changing the bias vector of the BFN.

You can download the source here!

And finally, the important references :
  • Amantide ray marching paper.
  • Crytek's presentation from SIGGRAPH 2010 as well as their 2D BFN texture (which I recommend) can be downloaded here.

Oct 23, 2010

Some more links


Oh, by the way, my tool to generate the Best fit normals cube map will be available shortly (together with C++ sources). Many people asked me about it... Now, I just need to write a blog post and put it on my personal website for download.

Oct 13, 2010

News and random links

Hi everyone!

I am currently very busy because of the end of my PhD thesis and my new job! This is why I am not currently very active.

So, as I said, my PhD is over. The manuscript is currently proofread by my two advisors. I will defend my PhD on January 21st 2010.

I finally had a phone interview with the game company that contacted me 2 times last year. Despite the fact that "I have a very interesting profile", they told me that I still "have to get more experience"... So sad... :/ So this is what I am doing right now by working at Dynamixyz as a R&D engineer. It is a new French start-up so you can imagine that there is a lot of work to do!! :) I am mainly involved in the development of the CG part of their facial animation tools pipeline.

I want to finish this post with these interesting/funny random links:
  • Interesting paper from Insomniac on 2 band spherical harmonics with truncated triple product.
  • Patterncraft or how to teach design patterns using Starcraft2! Much more fun than typical school use cases! :)
  • The blog of a French guy working at Crytek. Sorry, it is in French. :)
  • Game design fundamentals blog post
  • 16bits ALU in Minecraft here
  • Log out fail in MoH
  • Amazing dance animations in this TF2 video
  • What is exactly a doctorate? Answer