Cycles: Baking normal maps from material.

I’m trying to bake some normal maps with cycles and i’m not sure if i’m doing it wrong or if what i want just can’t be done. but I’ve broken my problem down to the simplest use case.

Input Textures:
http://www.lazydodo.com/tmp/cycles_baking/input.png

Shader:
http://www.lazydodo.com/tmp/cycles_baking/shader.png

Final Result:
http://www.lazydodo.com/tmp/cycles_baking/final_result.png

Sofar so good!

Problem description: Export the model for use in an 3D Engine with a diffuse color map and a normal map.

Exporting the model: Easy!

Exporting the color diffuse map: Easy!
http://www.lazydodo.com/tmp/cycles_baking/diffuse_color.png

Exporting the normal map: Not so easy… it bakes the normals of the underlying geometry to the image (which is good), but not anything the shader put on top of that (which makes me sad).

What i got:
http://www.lazydodo.com/tmp/cycles_baking/bake_normals.png

What i wanted:
http://www.lazydodo.com/tmp/cycles_baking/what_i_want.png

(I faked the ‘what i wanted image’ by stuffing the normal map texture into the color port of the diffuse shader block,
doubt it’ll work well as a normal map, and definitely not an option for a more complex shader network )

What i really want is a baking option that works like diffuse color but gets me the per pixel applied normal map.

Is this possible?!

It’s rather trivial to work around the problem with this simplified example, but I bumped into this problem while trying to export rocks created with this tutorial where I don’t see an easy way out…

had the same problem this week…
check here my solution
http://www.blenderartists.org/forum/showthread.php?348799-Baking-Cycles-Procedural-Normals-to-Texture