PDA

View Full Version : checking normal maps

ugluk
01-15-2011, 05:53 PM
I think there is way too much red in the normal map below, but I don't have any utility to visualize the heightmap from which it came and decide for certain. What utilities can I use for this?

http://img829.imageshack.us/img829/8500/bla0height.png
http://img600.imageshack.us/img600/3082/bla0mipmap.png

Anyway, do you agree that there is too much red? x, y, z of the heightmap are all within the interval [0, 1]. The column of the heightmap maps to x, the row to z.

That is, I need a utility that can reconstruct a surface from the heightmap and optionally calculate the normal map from it.

ugluk
01-15-2011, 06:49 PM
Damn, yeah, there was too much red, as I calced x wrongly (from the row) and z from the column instead of the reverse :) If you flop the heightmap and normal map, you get the correct situation.

Sorry for bothering you. Normal maps make the scenes so beautiful, I couldn't help but ask and my eye is not that sharp.

Rosario Leonardi
01-15-2011, 06:54 PM
Gimp: http://developer.valvesoftware.com/wiki/Normal_Map_Creation_in_The_GIMP

Melody: http://developer.nvidia.com/object/melody_home.html (no more developed)

Xnormal: http://www.xnormal.net/1.aspx

Also the program that you usually use to model (Maya, Blender, Max, Xsi) probably have a normal map visualized.

The slope of your height map (so the quantity of red) depend on the scale you give to your conversion program.

ugluk
01-15-2011, 07:09 PM
Thanks, I need to say though, that I did not create the normal map with a modeling program, but with my C++ utility. Also, the map is from a parametric surface. Maybe a modeling program script would be a better choice.

About the scale, yeah, the scale transforms the normals.

Still, how to reconstruct a surface from a heightmap, is there an easy utility to do that? Of course, there are ways to do it in every modeling program, but I don't even know the basics of them.

Alfonse Reinheart
01-15-2011, 09:08 PM
Still, how to reconstruct a surface from a heightmap, is there an easy utility to do that?

By "surface", do you mean how to generate a list of XYZ positions that represent the heightfield?

Well, for a heightfield, the value of the "color" at a position represents the displacement from a neutral height. Let's say zero; that's always a useful base height.

You know the X and Y position for a given height; it's just the X and Y position in the texture for that value. Obviously, you will want to apply a transform to the X and Y values to put it into a reasonable world space. The same goes for the Z values, which are the "colors" in the heightmap. Pick a reasonable scale to apply to them, and you have a Z coordinate.

ugluk
01-16-2011, 01:10 AM
Thanks, I construct the heightmap by sampling a parametric surface, so I can (kind-of, in reality a reconstruction filter would be necessary and not all frequencies would be restored) reconstruct too, but, I was hoping there was some utility, say for viewing terrains, that does that for me. Otherwise, I'd have to write this utility myself and I don't see any point in this, unless, perhaps, the denizens of these forums would like to see a utility like that :)