I read this: Major material fail - #18 by nehon and still can’t setup my file to work in JME imorter. I have good looking Diffuse map OR good looking Normal map. Can someone look into my blend file and say what is wrong? I spend 2 hours trying different metods but its still not working. I of course activated SeparateTexCoord option in material.
Are they UV mapped? Or do you use some other form of projection-mapping in blender? Did you try creating a j3m material file (in the Properties window under “Material” when you select the geometry) and tweaking that?
Should I add next input attribute inTexCoordX, manage everything with conditional compilation in proper places in .vert and .frag files?
If so, is there any constant number for normal uv map, like inTexCoord5?
Lighting.j3md assumes that it’s the same texture coordinates for normal, bump, and diffuse… because it’s very strange for them to be different. So they all use inTexCoord1. inTexCoord2 is only used for light maps in Lighting.j3md.
If you need different (stranger) behavior then you will need to write a custom shader.
It is not a problem atm
I want to modify current one, but I’m not sure if I understand everything… TexCoord2 is ‘reserved’ for lightmap, so, to be clean, I should use next index, TexCoord3. It means that in Blender I need to make 3 uv maps: first one a basic uv for color, specular etc, second one should be empty (we don’t need lightmap there) and the third one with separate normal map. Do I understand it right?
Well, what did you set it to? If you didn’t set the TexCoord3 vertex buffer then you might just get random crap in there.
Your life will be 10000000000000000000000000000000000000000000000000000000000000x easier if you can just use normal maps that align with your diffuse maps. It’s really strange that you can’t for some reason.
My team member asked me to add this function. He told me that he need it do do something more nice.
Yes yes yes, I know that I need to modify .vert file too.
#ifdef SEPARATE_TEXCOORD_NORM
//TODO: calc newTexCoord3 when we need it with parallax
vec4 normalHeight = texture2D(m_NormalMap, texCoord3);
#else
vec4 normalHeight = texture2D(m_NormalMap, newTexCoord);
#endif
Well, something actually needs to add that mesh data. Not sure what magic incantations or dead-cat-swinging are necessary to make that happen from Blender through the importer. (The importer stopped working on most of my models a long time ago so I haven’t even used it in a while…)