I am using the ocean simulation to make an animating water texture.
I want to use cycles to render my simulation surface into a nice normal map to be used for better performance while still having the proper caustics of the simulation. All of the preliminaries are sorted already, I.E. The camera is set up, my ocean modifiers are set up properly, the animation is all ready to render, except for the actual coloring part of it.
When it came down to actually attempting to render the normal map, I got as far as feeding the normal geometry output into an emmission shader before I got stuck. The "Normal" output of the geometry shader doesn't behave like a standard texture normal map does, I'm looking for "Normal-Map Periwinkle" (or however the color is named) to show up on a perfectly flat surface, but it outputs as 100% blue (as I should have expected using this hacky method). I tried vector mapping and a few other things to rotate the input, but I don't want to do this a terrible, lazy way that gives me an improper normal map, What should I do instead to make sure this gives me a normal map that will actually work properly for anything I use it in?
I thought maybe normalizing the vectors would do it, but I have no idea how to work the node so I couldn't figure out how to set that up. If anyone knows the real way to do this, I'm sure this is probably the place to ask. I tried another method that LOOKS correct, but I can't tell if it's 100% right: I subtracted 50% blue from the colors, and then added 50% white. it looks correct, but I have no idea if the colors are in fact correct. If anyone knows a setup that would cause 100% accurate results, I would greatly appreciate it.
Update: Everywhere I look, it's apparent that the flat/default color for a Normal Map should be R=0.5, G=0.5, B=1.0. However, in blender, when I sample a normal map with the color picker, I get R=0.212, G=0.212, B=1.0. Because of this, I realized that blender does not handle the colors properly for this particular purpose.
Incidentally, after using the Color Curves node to remap x=0.5,y=0.5 to x=0.5, y=0.212, my test hemisphere normal map ended up almost indistinguishable from one which I baked properly, unfortunately, as with all other methods so far, subtracting it from the proper one in compositing revealed it's still not a perfect normal map.
Still looking for any input on how to fix this.