PDA

View Full Version : normal map format



xxiii
11-29-2011, 08:56 PM
What is the lightwave normal map format? I've done some searching, but the closest hint I've found is in the node editor documentation that seems to equate XYZ=RGB=HPB when cross-connecting nodes.

Another software package I am using can export normal maps in about 16 different formats and I need to know which one is appropriate for use in Lightwave.

For example two of the export formats are described as:
(Direct3D) R:X G:Y B:Z A:H
(OpenGL) R:X G:Y(inv) B:Z A:H (I presume that means Y is inverted)
I'm also assuming the H is height and A is alpha (the other package's documention is lacking).

The other options are various permutations on these parameters (and don't have names) with varying ranges. I'm also not sure if this other package is using a Y-up or a Z-up coordinate system or if its left or right-handed (or if that really matters for normal maps).

So, do normal maps assume the base is 0,0,0 and you're supposed to provide the coordinate of the other end of the normal vector, mapped into 0..255 somehow (0..255 is mapped into 0..1 or maybe -1..1 and then alpha/H is used to scale it)?

probiner
11-29-2011, 10:18 PM
LW uses the +X -Y +Z scheme. Normally you have to check the 'Invert Y' option for maps with +Y. 3D-Coat for example makes by detaulf +XYZ maps

Y is the Green grayscale channel. When you invert it, just like any grayscale image, the values flip. The middle value (128) remains more or less the same.

128 for Red (X) and Green (Y) Channels, and 255 for the Blue (Z) are the base values, hence that purpleish color of normal maps.
http://robertokoci.com/images/posts/graphics/game/textures/normal-map/normal-map.png

These values are like 'Incidence' (black -> white)

Red: Left -> Right
Green: Bottom -> Up
Blue: facing sides -> facing you (just like Camera Incidence angle)

So you can even make Normal maps if you make 3 renders with the object mapped like that.


Having difficulty opening the link but this page helps alot (MAX also +X -Y +Z). Cheers
http://wiki.polycount.com/NormalMap

JeffrySG
11-30-2011, 06:29 AM
I didn't know about the polycount wiki. Thanks for the link! Great resource!

xxiii
11-30-2011, 06:50 PM
Yes thanks, that was a helpful reference.

However, I'm stuck. In the attached screenshot, the 3rd party app has convinced me I'm viewing an actual 3-dimensional object. Layout however is not. I have tried various things: and various versions of the 3rd party's normal export. I've tried inverting the various axes, one at a time, and in groups. I've tried massively exaggerating the height (in the normal node, and the bumpheight in the image node for the bumpmap). In the screenshot, everything is cubically mapped onto a rectangular cube.

With respect to whats pictured in the screenshot, I've tried connecting directly to the surface (not through Delta). I've tried hooking up bump and normal individually. I've tried the normalmap by itself on an otherwise plain surface (which makes it look like flat double-width planks). I've tried just the bump map, which is better than the normal map but still not very convincing.

The 3rd party app is convicing me that this should be possible, and I don't think its cheating. If I turn off the normal and bump channels in its viewer, its preview cube becomes flat. (bump seems to be responsible for the illusion of raised bars, while normal seems to fix the lighting to match. If I use only normal or only bump it looks goofy). Also, while the 3rd party app shows a displacement tab, it is not being used here.

I also tried f9 renders, which look better than VPR (apparently VPR uses scaled down image maps), but still aren't convincing, depth-wise.

What am I doing wrong?

probiner
11-30-2011, 07:34 PM
Can you provide the object?

Probably there is some parallax or relief mapping going on in your app, notice how the size of each side of the raised bars is different (the ones facing you are bigger). My understanding is that in a normal map you would see them with the same size, only different shading, since it's still a flat surface and texture render, like you see in you full render attachment, both sides have the same size.

Dpont (http://dpont.pagesperso-orange.fr/plugins/nodes/nodes/ReliefMapping.html#ReliefMap) has a node for relief mapping. Basicly you save your Tangent Space map into a 32bit image and then place the Depth Map (like a Displacement Map) in the same image, as an alpha channel. (Thank you Dpont)

Anyway you probably wait for more experienced input as I can be leading you to a wrong path and your app is doing something else. But that's my hunch

If it's not that I don't know then. I would model the big slopes and just leave the surface roughness to the Normal Map.

Final note: I don't know why would you have to mix Bump and Normal Map. A normal map alone should be fine.

Cheers

xxiii
11-30-2011, 09:30 PM
Can you provide the object?


In lightwave, I just made a 1m x 1m x 1m cube. In the 3rd party app, its a built-in preview cube. I assumed it was slightly distorted looking because of a particularly wide-angle view (with a close-up camera) it seems to use. I'll attach some shots at its default angle of some of its preview options. It also has an orthographic mode.


Final note: I don't know why would you have to mix Bump and Normal Map. A normal map alone should be fine.

I've been struggling with that too (my understanding (which I'm beginning to question) is that a normal map is a more sophisticated version of a bump map), but it seems to be the way this thing works. For that matter, you can even "split-up" the texture between normal/bump maps, and displacement maps, or go all one or the other. I don't see any way to say only bump or only normal however.

Its a procedural texture generator that seems to be aimed at game engines, but as it generates some fantastic textures that are very difficult to believe are not photographs, I'm seriously considering using it. And unlike real photographs, you can tweak the textures in various ways such as deciding how knotty wood should be. Most of its textures aren't this extreme depth-wise, but I chose this one to experiment with to try to make sure I am applying them in Lightwave properly.

Another thing thats bothering me about this particular texture is that it seems to have baked some of the lighting directly into the texture map, but I wouldn't think that would affect Lightwave's "faking" the depth with the normal/bump map (but does explain the "deep" areas being so dark in the lightwave versions).

probiner
11-30-2011, 09:48 PM
When I said the object, I meant it with the textures, of course, I knew it was a cube :p

The middle one is a Displacement/Height/Depth map, whatever, not a Bump map. And you can see how it stretches the diffuse map preety badly on the sides (a Normal map doesn't do that, just shades), so my guess again is that you have a relief map going on there. Use the Dpont's node and you would probably replicate it just fine.

The only shading you could have baked is Occlusion, then in LW input Raw colors into color; occlusion into difuse (or multiply over the raw colors); maybe some specular and then use LW lights. Would work just fine I think.

Whats the software, by the way?

Dodgy
11-30-2011, 09:49 PM
It definitely looks like that engine is doing a parallax mapping as well as just the normal mapping as the bits that go in are closer to the bits that go out in front of them than they are to the bits that go out behind them.
Dpont's node will do this as stated.

xxiii
11-30-2011, 11:29 PM
When I said the object, I meant it with the textures, of course, I knew it was a cube :p

Sorry, after I posted I realized that was probably what you meant. I originally though you were asking for the object being used by the 3rd party software. However, I'm not really sure if I'm allowed to redistribute its output (even though its freely available).


Whats the software, by the way?
Its Substance Player (http://www.allegorithmic.com/products/player). Its free and you can plug substances (http://www.turbosquid.com/Search/Allegorithmic-Substances/substances) (mostly not free, but there are some) into it and generate various maps. The map types available vary by substance. There is also a substance designer (http://www.allegorithmic.com/products/substance-designer-2-lite) (very not free) if you want to make your own. The player currently has a 2048 max output size limitation, but according to their support forum its supposed to be getting upped.

It seems to me that it should be possible to do the same with Lightwave's nodal system, but I haven't seen any native lightwave procedural textures that look this good (at least via preset central or foundation3d. I'm not sure where else there might be LW texture repositories).

It also seems to generally generate output that tiles well.

Anyway, I'm considering buying some of the not-free substances once I convince myself that they would be worth it and that I know how to use them. (As the substance designers include a bunch of substances, I'm also wondering if it would be worth it to just buy one, though so far I'm more of a consumer than a creator when it comes to textures).

They also have a plug-in (or built-in, not sure) allowing substances to just be used directly (without having to render them out to bitmaps) for Maya and 3dmax, and Unity (and some others I think). I'm wondering if it would be worth lobbying Newtek to add this, but then I'm torn again thinking the current nodal system should be able to do this already. But, I don't think it would hurt.

Attached is a lightwave rendering of their metal_floor texture, which looks like its being a bit more sucessful in LW, although I'm a bit suspicious of the look on the narrow-angled side.