Normal Map demo II (Composition by cwright)

Author: cwright
License: MIT
Date: 2010.05.18
Compatibility: 10.5, 10.6
Categories:
Required plugins:
(none)

In conjunction with the previous Normal Mapping demo, today's feature is normal mapping complete with tangent vectors (derived from texture coordinate derivatives)!

Note: this is not for the faint of heart. It drops my GMA950 to its knees, but performs acceptably on my 8800. Definitely not a wise use of GPU resources, but at least it's possible without additional QC hackery.

The tangent vector allows the normal map to work on non-planar surfaces. This could probably be combined with some Kineme3D meshes for some really pretty animations :)

PreviewAttachmentSize
normalMap II.qtz330.43 KB

cybero's picture
Re: Normal Map demo II (Composition by cwright)

Well cwright, those performance reports are definitely hardware specific, I had to drop an fps display to get some real idea of frame rate when moving the 'spot light' over the teapot but I get an easy 55 - 60 fps [9400M].

toneburst's picture
Re: Normal Map demo II (Composition by cwright)

Very cool cwright! I think I found a similar method of computing the TBN matrix somewhere a while back, but never got around to trying it. Glad someone else has though. Sadly, I've been caught up in other things lately, and haven't had any free time to spend on QC-related stuff. Hope I can get back to it someday...

Good to see you're still able to spend time on Kineme though cwright.

a|x

cwright's picture
Re: Normal Map demo II (Composition by cwright)

Was it the one on pouet? If so, that one heavily influenced this (particularly, there were some optimizations further down in the discussion regarding extra normalization removal, etc. that I used when cleaning it up -- helped quite a bit on my poor gma... ;)

gtoledo3's picture
Re: Normal Map demo II (Composition by cwright)

On this one and the other one (Normal Map demo qtz's), what is it that is making the colors of the source texture not really come through? It seems like the colors may be showing a bit (maybe it's my imagination), but overall I get a kind of grey/two tone look, even with colors that are fairly saturated in color in the texture map.

I'll look at it more, and make sure I'm not doing something wrong, but I've thrown a series of normal maps/textures/models at this setup, and I'm seeing that consistently.

dust's picture
Re: Normal Map demo II (Composition by cwright)

sweet now we are talking. i will have to try this with some blend shape animations as im getting a n/a on the framerate with the teapot

cwright's picture
Re: Normal Map demo II (Composition by cwright)

Can you provide some sample material that isn't working as expected? The lighting I'm applying (point-attenuated per-pixel lighting) is quite different from most lighting used in QC. Also, I didn't spend much time at all on the texturing portion -- I was more interested in lighting for these demos.

jersmi's picture
Re: Normal Map demo II (Composition by cwright)

Thanks so much for sharing these. Very very cool.

cwright's picture
Re: Normal Map demo II (Composition by cwright)

Yeah, it's due to the lighting -- to get more color, you'll want to set ambient higher, and light intensity lower (If you do 128/128 for both, it's pretty reasonable. With more tweaking you can probably find something you like). Normally there are several lights in a scene, so you don't get a single over-powering light like this setup washing out everything.

toneburst's picture
Re: Normal Map demo II (Composition by cwright)

cwright wrote:
Was it the one on pouet?

No, it was this:

http://www.terathon.com/code/tangent.html and also http://3d.benjamin-thaut.de/?p=5

The guy I was corresponding with never got it properly working though, for some reason.

a|x

gtoledo3's picture
Re: Normal Map demo II (Composition by cwright)

Cool, gotcha. I see the results now, I had a feeling it had to do with the lighting settings. I should have looked closer.

Prack's picture
Re: Normal Map demo II (Composition by cwright)

thanks a lot! its amazing. i made a simple test with kineme 3d and 3d explode.

i'm running a macbook pro 2.5 GHz Intel Core 2 Duo with 4 GB RAM and OS X 10.6.3. the frame rate, as someone say, decent. cheers m

toneburst's picture
Re: Normal Map demo II (Composition by cwright)

A nice bump/normal-mapping example:

a|x