Normal Maps

Alright, so I have a bit of a problem.

I have added all the textures to my model, and they work just fine, but I wanted to have some bumpiness to them. In the material texture settings then, I selected the “normal” option and dragged it to some value which looked good in the rendered version of the model. However, when loaded into jmonkey, one of two things happen:

  1. (Without TangentBinormalGenerator) The floor has the right color and everything that the bump map adds as “shadow”-ish, but it remains completely flat.
  2. (With TangentBinormalGenerator) The floor is completely dark, and I get a buttload of warnings from the SDK.

So, two questions:

  1. With the TangentBinormalGenerator, when I load my scene, should I TBG.generate(scenemodel) or do something else?
  2. Do I have to use a proper normal map - aka the blue kind of normal map - or is the simple check box compatible with jmonkey? (see picture)

@SCOMS said: 1. With the TangentBinormalGenerator, when I load my scene, should I TBG.generate(scenemodel) or do something else?
Yes you have to
@SCOMS said: 2. Do I have to use a proper normal map - aka the blue kind of normal map
Yes, that's what a normal map is.

Also note that editing normal maps in an image editor invariably breaks them (they might work without issues but the results are wrong).

@normen said: Also note that editing normal maps in an image editor invariably breaks them (they might work without issues but the results are wrong).

What about NDo with photoshop? I might purchase this to use for models but if jmonkey models dont work with modified normal maps then i will have to do something else.

Reading this maybe there’s some OP confusion between ‘Normal’ mapping and ‘Bump(?)’ mapping.

Google etc will give many explanations on them but basically Normal mapping adjusts lighting per fragment to give shadows etc and the ‘Perception’ of a rough surface. Bump Mapping will give you an actual rough surface but from what I’ve seen/read its a bit slower and less effective on shadows.

Reading the OP I wonder if they’re wanting Bump(?) mapping, not sure jMe has shaders with bump(?) mapping… I wanted it for my terrain but I’m no shader programmer…

Just thought that might need to be thrown in here.

Edit: ok, I’m the confused one :smiley: — ‘Relief’ or ‘Displacement’ mapping apparently is what they call it that gives true rough surfaces… Sorry for confusing the point.

Edit2: [Plugin] Normal Map Maker • sketchUcation • 1

This should work.

You can’t edit a normal map as “picking a blueish color” and painting hoping for the best.
NDo seems to generate the normal map based on a texture, that’s fine.

Edit : I was answering to @8Keep123

@nehon said: Yes you have to

Yes, that’s what a normal map is.

When I do the TangentBinormalGenerator though, the normal maps do load as they should… however, it takes like a minute to load the app because I get tons of error messages saying:

Warning: Angle between tangents exceeds tolerance for vertex 413

The last number does obviously change.
Any ideas what may cause this?

Questionable triangles/polygons mostly.
-> Might be ignoreable if renders fine (eg non visible detail error)
-> Might be visible, then just rework the part thats affected.

@Empire Phoenix said: Questionable triangles/polygons mostly. -> Might be ignoreable if renders fine (eg non visible detail error) -> Might be visible, then just rework the part thats affected.

Well, it renders fine, but I’m not sure what parts are affected since I am doing the normal generation on the entire scene model. It’s not exactly ignoreable since it takes a lot longer to load the app than it takes without generation… :confused:

Store the result in a j3o.

@Empire Phoenix said: Store the result in a j3o.

How exactly would I do that without having to recompile it each time?

@SCOMS said: How exactly would I do that without having to recompile it each time?

Each time what?

@pspeed said: Each time what?

Alright, how could I activate the TangentBinormalGenerator for a scene model without having to go through the roughly minute-long wait each time I call the generate() function? I interpreted the “store the result in a j3o” as some way to store the scene with the generated normals in a j3o file, so I only had to generate them once.

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:save_and_load

You can generate the tangents in the SDK then save your J3o. This will generate the needed tangent buffer and it will be saved along with the other buffers.
The warnings can be ignored

@8Keep123 said: What about NDo with photoshop? I might purchase this to use for models but if jmonkey models dont work with modified normal maps then i will have to do something else.

Just remember that normal maps are not images. Obviously a tool that is made for normal maps should yield proper normal maps. If you edit with a standard image editor you will simply break the data, creating lots of normals that are not normalized etc.

@normen said: Just remember that normal maps are not images. Obviously a tool that is made for normal maps should yield proper normal maps. If you edit with a standard image editor you will simply break the data, creating lots of normals that are not normalized etc.

Actuall if you are masochistic, and want to do the calculations in head, you could calculate each pixels color manaully ^^

@Empire Phoenix said: Actuall if you are masochistic, and want to do the calculations in head, you could calculate each pixels color manaully ^^

The normals also get normalized in shader anyway. For testing things, I’ve painted normal maps manually using some clever gradients and channel masking. However, I really know what I’m doing and it was very hard.

…for the most part and in 99.9% of cases, Normen is right. :slight_smile: (Even in my case above, I ended up generating the normal map in code ultimately because every time I made a mistake I had to start over again.)

GIMP… little… yellow… different