SOF map generation

Jun 7, 2010 at 7:07 PM

Hello everyone.

Congratulation for this sub-engine of XNA which makes things easier to do and faster (a lot faster for a guy like me who is more designer than 3d programmer ^^) !

My question is about tutorial 28. How do you generate the SOF map you use to render the guy ?

Is there an automatic way or you have to draw it yourself ? I use 3dsmax and I wonder how to make those maps.


An another thing I'm not sure to have understood well is the RGBM thing. If I use the way you render the scene in the tutorial for my own game (and the provided shader too), what is the influence of the RGBM.

Do I have to change my textures or something ?





Jun 8, 2010 at 11:09 AM

Hi Matt.

I used a combination of offline tools and manual editing to create the 'Sof' textures. Sof simply stands for 'specular, occlusion, face mask'. (Stored in Red, Green and Blue respectively)
It's simply a short cut to having three separate textures.

The original model had monochrome specular textures, so that was easy enough. The occlusion was generated by a test app I built (I was investigating some other effect ideas, however occlusion generators are pretty easy to find).

The skin I drew myself in photoshop, and then combined the layers. So pretty straight forward. I didn't build or supply a tool, because it's something I see as very game specific.
It's up to the game what texture data you ultimately need. The tutorial was more to show the lighting effects anyway.

RGBM means you store a 'multiplier' in alpha. Normal 8bit RGBA can only store values with very limited range (0-255 bytes). By using alpha as an extra scale factor, you can get a range of 0 to 65,535 in the same amount of memory. You also get guarenteed support for MSAA, filtering, blending, etc (not all video cards support these with floating point render targets).
Of course the side effect is you can't do alpha blending very easily, and all your shaders need to output RGBM.

Honestly, I'd expect many people will just use FP16.

Jun 8, 2010 at 7:47 PM

Thanks for the reply.

I will dig the RGBM part.

If I want to change the SOF part and well, maybe make three textures, each for one channel I have to make my own shader right ? (I fear it's right, because I don't understand anything about those shaders)

Do you have good resources to learn how to write shader, or better a software to make my own (kind of wysiwyg software).

I tried the nvidia one, but can't get it to work.