Normal Map setting of baking

Hi everyone,



I did not find this info in tutorials, what settings I must use for Normal map backing. I used Xnormal for baking and texture was rendered incorrect.

This is a blender question right? You gotta see that people cannot look into your head, you have to write down what you are doing and whats your problem.

It looks he thinks we read minds :roll:. @2dkot:If you use blender there are a lot of free video tutorials in blendercookie.com, http://www.cgmasters.net/, http://cg.tutsplus.com/, www.yofrankie.org/, including normal map baking video tutorials.

No I did not use Blender. Sorry for question without details. Well I baked normal maps in Xnormal application. I used this map before in Unity3d, it looked fine. But jmonkeyengine renders it with bad seams. I believe I have found an answer here: http://hub.jmonkeyengine.org/groups/graphics/forum/topic/baked-normal-map-seams-problems?topic_page=5&num=15. Try to follow this post…

Yes, i had this problem also, and i solved my problem there :D.

glaucomardano said:
Yes, i had this problem also, and i solved my problem there :D.

Damn, I invert red and green channel in photoshop, and i still have this problem. glaucomardano could you guide me how you did solve this issue?

My normal map problem wasn’t a channel issue, but i learn how to invert channels in gimp :D. I get rid of those seams by rendering the “blur” and “sharpen” effects in gimp. You could do it in photoshop too.

Trying to use LightBlow.j3md. Well, I added it to “MatDefs”, then create file newMaterial.j3m in “Material” folder. Content of newMaterial.j3m:

Material My Material : MatDefs/LightBlow.j3md {

MaterialParameters {

}

AdditionalRenderState {

}

}

Then attach this material to my model:

[java]

model.setMaterial((Material) assetManager.loadAsset(“Materials/newMaterial.j3m”));

[/java]

Tried to compile and got exception:



SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.NullPointerException: Shader source cannot be null

at com.jme3.shader.Shader$ShaderSource.setSource(Shader.java:156)

at com.jme3.shader.Shader.addSource(Shader.java:294)

at com.jme3.asset.DesktopAssetManager.loadShader(DesktopAssetManager.java:370)

at com.jme3.material.Technique.loadShader(Technique.java:210)

at com.jme3.material.Technique.makeCurrent(Technique.java:195)

at com.jme3.material.Material.selectTechnique(Material.java:728)

at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:423)

at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:132)

at com.jme3.renderer.queue.RenderQueue.renderShadowQueue(RenderQueue.java:144)

at com.jme3.shadow.PssmShadowRenderer.postQueue(PssmShadowRenderer.java:396)

at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:717)

at com.jme3.renderer.RenderManager.render(RenderManager.java:742)

at com.jme3.app.SimpleApplication.update(SimpleApplication.java:249)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:158)

at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:203)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:221)

at java.lang.Thread.run(Thread.java:619)

I believe that I did something with material (((

I figured out, it was necessary to add LightBlow shader in shader folder

How did you get rid of the seams?

Actually my issue is still reproduced ((( even I used LightBlow and invert x normal.



http://img35.imageshack.us/img35/5088/start01.jpg

my normal map:



http://img16.imageshack.us/img16/2772/cavebutchernormalsmapco.jpg



I have baked only upper part of body.

Hi. I did lightblow. Happy that the shader is useful. :slight_smile: Your problem is in flipping uv. you will need to flip uv or a texture. That could be solved in 3 ways:



1 Convert a model through a model loader button located at the menu (not right-clicking and converting).

2 flip the texture horisontal/vertical. In JMP you can edit a texture (right-click) and flip it.

3 flip a texture y channel in your code with boolean true/false

[java]TextureKey tex = new TextureKey ("Texture path", true)[/java]



Hope it will help.

Hi, actually I tried all 3 ways (( And still do not work.



what is this? - TextureKey tex = new TextureKey (“Texture path”, true)

Oh sorry… I did not look at your normal map. There is no problem in flipping.



Your normal map is incorrect. It has purple areas. it was not baked correctly. You should increase a distance of polygon baking to get entirely blue normal map. I cant help you with xnormal as i use only blender for baking. The correct map should look like:

http://www.ericspitler.com/images/2d/normalmap.jpg - without purple areas.



Also in lightblow shader you can flip x/y/z channels to get rid of seams.

Parameters:

Nor_Inv_X

Nor_Inv_Y

Nor_Inv_Z

I think the problem is in the polygon distance.

I baked only upper part of model, so purple areas is not an issue. Your lightblow is great but I tried Nor_Inv_X, Nor_Inv_Y, but it doesn’t help, there were slightly different results, but it still rendered incorrectly

I baked only upper part of model, so purple areas is not an issue. Your lightblow is great but I tried Nor_Inv_X, Nor_Inv_Y, but it doesn’t help, there were slightly different results, but it still rendered incorrectly

1 generate tangents/binormals for your model in JMP with tangent generator.



2 Have a try to play with xnormal settings. you can change normal axys in xnormal.

RE: 1 generate tangents/binormals for your model in JMP with tangent generator.

Sorry, I quiet nooby, how can I do it?

right-click at your j3o - edit in scene composer - select your mesh/node and right-click it - tools-generate tangents.