www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: AGP on December 07, 2013, 08:23:31 am

Title: Normal Mapping with Bones
Post by: AGP on December 07, 2013, 08:23:31 am
The NormalMapping example on the wiki requires you to compile your model. But bones breaks with compiled models. So how do I go about applying a normal map to a bones-animated model?
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 07, 2013, 08:52:16 am
Why should it break? On Android everything is compiled anyway and Bones works just fine with it.
Title: Re: Normal Mapping with Bones
Post by: AGP on December 07, 2013, 06:43:49 pm
All I know is that it does on my test.
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 07, 2013, 06:51:54 pm
That's a bit vague...you have compile it by using compile(true); and maybe a touch() after calling animate.
Title: Re: Normal Mapping with Bones
Post by: AGP on December 07, 2013, 11:02:18 pm
OK, compile(true) worked for me. Now, consider the following screenshot:
(https://dl.dropboxusercontent.com/u/93826015/Batmen.jpg)

Two questions: in order for me to enable/disable the normal mapping (for comparison purposes and performance settings), I need to remove the normal map from its TextureInfo in order to avoid the blueishness seen on the left Batman. How do I go about doing that? And the second question: why is that white line on the normal-mapped Batman's chest? Surely that's not an issue of the map itself as that line doesn't show in 3ds max.
Title: Re: Normal Mapping with Bones
Post by: AGP on December 07, 2013, 11:52:36 pm
And a follow-up to the second question: how do I set a specular map? I expect that this would solve the problem, but simply adding a map after the normal map to TextureInfo didn't help at all.
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 09, 2013, 08:02:32 am
You can try to disable the normal map in the former case by doing a call to

Code: [Select]
normalMap.setEnabled(false);
About the white line: That's an artifact of the way in which "my" normal mapping shader handles tangent vectors. It creates them in the shader, which isn't really accurate and fails in some cases. jPCT can calculate proper tangent vectors for you and feed them into the shader if the shader provides an attribute like

Code: [Select]
attribute vec4 tangent;
You have to modify the shader to use that instead of the calculated value of source. Have a look at the shaders in the HelloShader example to see what to do.
Title: Re: Normal Mapping with Bones
Post by: AGP on December 09, 2013, 04:47:16 pm
Disabling the texture worked, thanks. What about a specular map so that Batman doesn't look so metallic?

And help me out with the shader, man. I've barely even ever looked at one before.
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 09, 2013, 08:08:11 pm
Can you post the shaders that you are currently using?
Title: Re: Normal Mapping with Bones
Post by: AGP on December 09, 2013, 08:14:45 pm
Sure. They're in the wiki:

Code: [Select]
varying vec3 lightVec;
varying vec3 eyeVec;
varying vec2 texCoord;

uniform sampler2D colorMap;
uniform sampler2D normalMap;
uniform float invRadius;

void main (void) {
float distSqr = dot(lightVec, lightVec);
float att = clamp(1.0 - invRadius * sqrt(distSqr), 0.0, 1.0);
vec3 lVec = lightVec * inversesqrt(distSqr);

vec3 vVec = normalize(eyeVec);
vec4 base = texture2D(colorMap, texCoord);
vec3 bump = normalize(texture2D(normalMap, texCoord).xyz * 2.0 - 1.0);

vec4 vAmbient = gl_LightSource[0].ambient * gl_FrontMaterial.ambient;

float diffuse = max(dot(lVec, bump), 0.0);
vec4 vDiffuse = gl_LightSource[0].diffuse * gl_FrontMaterial.diffuse * diffuse;

float specular = pow(clamp(dot(reflect(-lVec, bump), vVec), 0.0, 1.0), gl_FrontMaterial.shininess);
vec4 vSpecular = gl_LightSource[0].specular * gl_FrontMaterial.specular * specular;

gl_FragColor = (vAmbient*base + vDiffuse*base + vSpecular) * att;
}

varying vec3 lightVec;
varying vec3 eyeVec;
varying vec2 texCoord;

void main(void) {
gl_Position = ftransform();
texCoord = gl_MultiTexCoord0.xy;

// jPCT doesn't provide the tangent vector...compute it (this isn't 100% accurate...)

vec3 c1 = cross(gl_Normal, vec3(0.0, 0.0, 1.0));
vec3 c2 = cross(gl_Normal, vec3(0.0, 1.0, 0.0));

vec3 vTangent=c1;
if (length(c2)>length(vTangent)) {
vTangent=c2;
}

vTangent = normalize(vTangent);

vec3 n = normalize(gl_NormalMatrix * gl_Normal);
vec3 t = normalize(gl_NormalMatrix * vTangent);
vec3 b = cross(n, t);

vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex);
vec3 tmpVec = gl_LightSource[0].position.xyz - vVertex;

lightVec.x = dot(tmpVec, t);
lightVec.y = dot(tmpVec, b);
lightVec.z = dot(tmpVec, n);

tmpVec = -vVertex;
eyeVec.x = dot(tmpVec, t);
eyeVec.y = dot(tmpVec, b);
eyeVec.z = dot(tmpVec, n);
}
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 10, 2013, 07:42:47 am
Try this vertex shader instead (make sure to assign it before calling build()):

Code: [Select]
attribute vec4 tangent;

varying vec3 lightVec;
varying vec3 eyeVec;
varying vec2 texCoord;

void main(void) {
gl_Position = ftransform();
texCoord = gl_MultiTexCoord0.xy;

vec3 n = normalize(gl_NormalMatrix * gl_Normal);
vec3 t = normalize(gl_NormalMatrix * tangent.xyz);
vec3 b = tangent.w * cross(n, t);

vec3 vVertex = vec3(gl_ModelViewMatrix * gl_Vertex);
vec3 tmpVec = gl_LightSource[0].position.xyz - vVertex;

lightVec.x = dot(tmpVec, t);
lightVec.y = dot(tmpVec, b);
lightVec.z = dot(tmpVec, n);

tmpVec = -vVertex;
eyeVec.x = dot(tmpVec, t);
eyeVec.y = dot(tmpVec, b);
eyeVec.z = dot(tmpVec, n);
}

About a specular map: Not sure if that is what you are looking for and the shader doesn't support one anyway. I would try to play around with the final color term in the fragment shader:

Code: [Select]
gl_FragColor = (vAmbient*base + vDiffuse*base + vSpecular) * att;

See if you can make the shininess less prominent. If you start to use shaders, you have to get a basic understanding of what they do and how they work or you won't get far. Fiddling around with that term is a good starting point IMHO.
Title: Re: Normal Mapping with Bones
Post by: AGP on December 10, 2013, 08:09:48 am
It's completely black with this one.
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 10, 2013, 08:12:36 am
Are you sure that you did this:

Quote
make sure to assign it before calling build()

???
Title: Re: Normal Mapping with Bones
Post by: AGP on December 10, 2013, 08:22:40 am
Yup, I assigned it before build() (I hadn't even called build() at all before you mentioned it, just now, believe or not; but now I'm calling it after assigning the shader). This is my light code, for whatever it's worth:

Code: [Select]
light = new Light(theWorld);
SimpleVector position = new SimpleVector(batman.model.get(0).getTransformedCenter());
position.x += 60f;
position.y -= 40f;
position.z -= 60f;
light.setPosition(position);
light.setIntensity(185, 185, 145);
light.setDiscardDistance(-1f);
light.setAttenuation(light.getAttenuation()*1.5f);

And this is how it looks:
(https://dl.dropboxusercontent.com/u/93826015/BlackBat.jpg)
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 10, 2013, 08:30:32 am
The only thing that has changed in that shader is the use of the tangent vectors attribute instead of the internal calculation. The rest is 100% the same thing and in addition, the result is equal to the example shader in the HelloShader example that comes with jPCT. So this shader is fine, if the tangent vectors are. And they should be if the engine detects that the shader needs them. Maybe there's some hidden build() in your code...try to force tangent vector calculations by calling Object3D.calcTangentVectors() on the model.
Title: Re: Normal Mapping with Bones
Post by: AGP on December 10, 2013, 08:37:26 am
I did. Same thing. Are you sure you gave me a vertex shader? Bear with me and my ignorance, but could you have given me the fragment shader instead?
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 10, 2013, 08:57:30 am
No, it's a vertex shader. Any log messages when compiling the shader?
Title: Re: Normal Mapping with Bones
Post by: AGP on December 10, 2013, 08:59:04 am
Quote
New WorldProcessor created using 1 thread(s) and granularity of 1!
Creating new world processor buffer for thread main
New WorldProcessor created using 1 thread(s) and granularity of 1!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 12/object14 compiled to indexed data using 17352/4051 vertic
es in 47ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 12/object14 compiled to indexed data using 22500/5822 vertic
es in 46ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 12/object14 compiled to indexed data using 23997/5037 vertic
es in 32ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 12/object14 compiled to indexed data using 24000/5355 vertic
es in 31ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 12/object14 compiled to indexed data using 6000/1552 vertice
s in 16ms!
Object 12/object14 compiled to 5 subobjects in 391ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Remapping 2675 vertex indices!
Creating vertex cache (64200 bytes)!
Vertex indices will be mapped!
Subobject of object 16/submesh0 compiled to indexed data using 11997/11997 verti
ces in 32ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Remapping 2728 vertex indices!
Creating vertex cache (65472 bytes)!
Vertex indices will be mapped!
Subobject of object 16/submesh0 compiled to indexed data using 11196/11196 verti
ces in 15ms!
Object 16/submesh0 compiled to 2 subobjects in 93ms!
Creating new world processor buffer for thread main
Checking for triangle strip...
Not a triangle strip at position 1!
Remapping 2413 vertex indices!
Creating vertex cache (57912 bytes)!
Vertex indices will be mapped!
Subobject of object 17/submesh1 compiled to indexed data using 11997/11997 verti
ces in 16ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Remapping 1879 vertex indices!
Creating vertex cache (45096 bytes)!
Vertex indices will be mapped!
Subobject of object 17/submesh1 compiled to indexed data using 9552/9552 vertice
s in 16ms!
Object 17/submesh1 compiled to 2 subobjects in 110ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 21/object23 compiled to indexed data using 5718/1031 vertice
s in 0ms!
Object 21/object23 compiled to 1 subobjects in 0ms!
Additional visibility list (2) created with size: 32000
Additional visibility list (3) created with size: 32000
VBO created for object 'object14'
VBO created for object 'object14'
VBO created for object 'object14'
VBO created for object 'object14'
VBO created for object 'object23'
VBO created for object 'object14'
Compiled 6 VBO!
Shader compiled!
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 10, 2013, 09:00:22 am
Looks fine...except that i don't see any message about calculating the tangent vectors... ???
Title: Re: Normal Mapping with Bones
Post by: AGP on December 10, 2013, 09:01:06 am
Quote
Compiled 6 VBO!
Shader compiled!
Tangent vectors calculated in 31ms!
Tangent vectors calculated in 0ms!
Tangent vectors calculated in 16ms!
Tangent vectors calculated in 31ms!
Tangent vectors calculated in 0ms!
Tangent vectors calculated in 16ms!
Tangent vectors calculated in 16ms!
Tangent vectors calculated in 0ms!
Tangent vectors calculated in 0ms!
Tangent vectors calculated in 16ms!
Tangent vectors calculated in 0ms!
Tangent vectors calculated in 0ms!
Tangent vectors calculated in 0ms!
Tangent vectors calculated in 0ms!
Tangent vectors calculated in 0ms!
Tangent vectors calculated in 0ms!
Visibility lists disposed!
Visibility lists disposed!
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 10, 2013, 10:17:47 am
It's a bit strange that the tangent vector calculation happens after object and shader compilation. Try to move it closer to the actual object creation instead. This looks like as if it happens right before rendering, which might be too late.
Title: Re: Normal Mapping with Bones
Post by: AGP on December 10, 2013, 04:36:23 pm
Still black. If I disable the shader, Batman looks right.

Quote
Tangent vectors calculated in 31ms!
Tangent vectors calculated in 0ms!
Loading file fragmentshader.glsl
Text file fragmentshader.glsl loaded...930 bytes
Loading file vertexshader.glsl
Text file vertexshader.glsl loaded...632 bytes
Joint name: BatmanBip
Joint name: Batman Pelvis
Joint name: Batman Spine
Joint name: Batman L Thigh
Joint name: Batman R Thigh
Joint name: Batman Spine1
Joint name: Batman L Calf
Joint name: Batman R Calf
Joint name: Batman Spine2
Joint name: Batman L Foot
Joint name: Batman R Foot
Joint name: Batman Spine3
Joint name: Batman L Toe0
Joint name: Batman R Toe0
Joint name: Batman Neck
Joint name: Batman Ponytail1
Joint name: Batman Ponytail2
Joint name: Capa_Helper_L
Joint name: Capa_Helper_Main
Joint name: Capa_Helper_R
Joint name: Batman L Toe0Nub
Joint name: Batman R Toe0Nub
Joint name: Batman Head
Joint name: Batman L Clavicle
Joint name: Batman R Clavicle
Joint name: Batman Ponytail11
Joint name: Batman Ponytail21
Joint name: Batman HeadNub
Joint name: Batman L UpperArm
Joint name: Batman R UpperArm
Joint name: Batman Ponytail12
Joint name: Batman Ponytail22
Joint name: Batman L Forearm
Joint name: Batman R Forearm
Joint name: Batman Ponytail13
Joint name: Batman Ponytail23
Joint name: Batman L Hand
Joint name: Batman R Hand
Joint name: Batman Ponytail1Nub
Joint name: Batman Ponytail2Nub
Joint name: Batman L Finger0
Joint name: Batman L Finger1
Joint name: Batman L Finger2
Joint name: Batman L Finger3
Joint name: Batman L Finger4
Joint name: Batman R Finger0
Joint name: Batman R Finger1
Joint name: Batman R Finger2
Joint name: Batman R Finger3
Joint name: Batman R Finger4
Joint name: Bone_LLauncher_Base
Joint name: Batman L Finger01
Joint name: Batman L Finger11
Joint name: Batman L Finger21
Joint name: Batman L Finger31
Joint name: Batman L Finger41
Joint name: Batman R Finger01
Joint name: Batman R Finger11
Joint name: Batman R Finger21
Joint name: Batman R Finger31
Joint name: Batman R Finger41
Joint name: Bone_LLauncher_A1
Joint name: Bone_LLauncher_B1
Joint name: Batman L Finger02
Joint name: Batman L Finger12
Joint name: Batman L Finger22
Joint name: Batman L Finger32
Joint name: Batman L Finger42
Joint name: Batman R Finger02
Joint name: Batman R Finger12
Joint name: Batman R Finger22
Joint name: Batman R Finger32
Joint name: Batman R Finger42
Joint name: Bone_LLauncher_A_End
Joint name: Bone_LLauncher_B_End
Joint name: Batman L Finger0Nub
Joint name: Batman L Finger1Nub
Joint name: Batman L Finger2Nub
Joint name: Batman L Finger3Nub
Joint name: Batman L Finger4Nub
Joint name: Batman R Finger0Nub
Joint name: Batman R Finger1Nub
Joint name: Batman R Finger2Nub
Joint name: Batman R Finger3Nub
Joint name: Batman R Finger4Nub
Loading Texture...V2_Batman_Cape_D2.png
Loading Texture...CapeBottom.png
[ Tue Dec 10 13:33:56 BRST 2013 ] - WARNING: Unsupported Texture height (1816).
.resizing to a height of 256 pixels!
Driver is: igdumdim64/10.18.10.3316 on Intel / Intel(R) HD Graphics 4000
GL_ARB_texture_env_combine supported and used!
FBO supported and used!
VBO supported and used!
OpenGL renderer initialized (using 4 texture stages)
Loading Texture...brown.png
Loading file Cape.mtl
Text file Cape.mtl loaded...336 bytes
Processing new material Cape!
Loading file Cape.obj
Text file Cape.obj loaded...156565 bytes
Processing object from OBJ-file: Cape
Object 'Cape_jPCT20' created using 1906 polygons and 1031 vertices.
Adding Lightsource: 0
Hardware supports textures up to 16384*16384 in size!



Finished shadows. Initialized properly? true


New WorldProcessor created using 1 thread(s) and granularity of 1!
Creating new world processor buffer for thread main
New WorldProcessor created using 1 thread(s) and granularity of 1!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 12/object14 compiled to indexed data using 17352/4051 verti
es in 46ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 12/object14 compiled to indexed data using 22500/5822 verti
es in 32ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 12/object14 compiled to indexed data using 23997/5037 verti
es in 32ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 12/object14 compiled to indexed data using 24000/5355 verti
es in 31ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 12/object14 compiled to indexed data using 6000/1552 vertic
s in 15ms!
Object 12/object14 compiled to 5 subobjects in 343ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Remapping 2675 vertex indices!
Creating vertex cache (64200 bytes)!
Vertex indices will be mapped!
Subobject of object 16/submesh0 compiled to indexed data using 11997/11997 vert
ces in 16ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Remapping 2728 vertex indices!
Creating vertex cache (65472 bytes)!
Vertex indices will be mapped!
Subobject of object 16/submesh0 compiled to indexed data using 11196/11196 vert
ces in 16ms!
Object 16/submesh0 compiled to 2 subobjects in 110ms!
Creating new world processor buffer for thread main
Checking for triangle strip...
Not a triangle strip at position 1!
Remapping 2413 vertex indices!
Creating vertex cache (57912 bytes)!
Vertex indices will be mapped!
Subobject of object 17/submesh1 compiled to indexed data using 11997/11997 vert
ces in 32ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Remapping 1879 vertex indices!
Creating vertex cache (45096 bytes)!
Vertex indices will be mapped!
Subobject of object 17/submesh1 compiled to indexed data using 9552/9552 vertic
s in 15ms!
Object 17/submesh1 compiled to 2 subobjects in 109ms!
Checking for triangle strip...
Not a triangle strip at position 1!
Subobject of object 21/object23 compiled to indexed data using 5718/1031 vertic
s in 16ms!
Object 21/object23 compiled to 1 subobjects in 16ms!
Additional visibility list (2) created with size: 32000
Additional visibility list (3) created with size: 32000
VBO created for object 'object14'
VBO created for object 'object14'
VBO created for object 'object14'
VBO created for object 'object14'
VBO created for object 'object14'
VBO created for object 'object23'
Compiled 6 VBO!
Shader compiled!
Visibility lists disposed!
Visibility lists disposed!
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 10, 2013, 07:25:34 pm
The tangent vectors are part of the Mesh instance. Any chance that somebody (Bones?) replaces this instance with some other? Can you load the model outside of Bones and see if that works?
Apart from that, one actually have to add some stuff to jPCT and Bones to allow proper handling of tangent vectors during an animation. But it may look good enough as it is now, so i would post-pone that step for now.
Title: Re: Normal Mapping with Bones
Post by: AGP on December 10, 2013, 09:39:20 pm
I'll make a test with Object3D now and report back. But don't you think that normal mapping is important enough to be considered a "standard" part of your engine? There should be a simple helper class for it, in my opinion.
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 10, 2013, 10:37:09 pm
That helper class would be either very limited or very complex, so i decided to leave it to the user for now. If everybody and his dog would be asking for direct support, i would consider it...but that's actually not the case. Only few people are explicitly using shaders and those who do, usually write their own.
Title: Re: Normal Mapping with Bones
Post by: AGP on December 11, 2013, 06:25:16 am
I have two golden retrievers. I talked it over with them, and they seem to agree with me that such a helper class would indeed be useful.
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 11, 2013, 07:51:42 am
Yeah, maybe. But it's simply not doable ATM.
Title: Re: Normal Mapping with Bones
Post by: AGP on December 11, 2013, 06:42:58 pm
I can't test the same model as OBJ, by the way, as the textures don't come out right and the model is exported with a different number of pieces. But can't you just assume I'm not doing anything wrong and that there's a better way to make that shader?
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 11, 2013, 08:34:34 pm
No, because the shader is fine. Just look at the shader in the example that is included in the zip. It should be the same thing line by line and it works fine. The only difference between your former and this one is, that this one takes the tangent vectors as an attribute. And the only problem that i can imagine in this context is that this attribute doesn't get filled correctly...most likely because the data needed for this just isn't there. Please try this jar...it also clones the tangent vectors if a mesh is being cloned. Maybe that will fix the problem: http://jpct.de/download/beta/jpct.jar (http://jpct.de/download/beta/jpct.jar)
Title: Re: Normal Mapping with Bones
Post by: AGP on December 11, 2013, 09:24:10 pm
Raft says that Animated3D.getMesh() never returns null. I think I ran into a scenario in which it did, or I wouldn't have made that post:

http://www.jpct.net/forum2/index.php/topic,3581.0.html (http://www.jpct.net/forum2/index.php/topic,3581.0.html)
Title: Re: Normal Mapping with Bones
Post by: AGP on December 11, 2013, 09:26:00 pm
And, by the way, I did try a shader that produced NO shadows. Yours only makes Batman black, but he is still both visible and able to cast shadows.
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 11, 2013, 09:30:34 pm
Animated3D extends Object3D. And each Object3D has a Mesh instance. raft is actually right when he says that it can't return null. If it would, that Object3D wouldn't be renderable at all, because there's no data attached to it. You can set Mesh to null, of course. But you can't render that Object3D then. I'm not sure what you mean with your post about an alternative shader...but have you tried the jar that i uploaded?
Title: Re: Normal Mapping with Bones
Post by: AGP on December 11, 2013, 09:41:42 pm
I hadn't noticed it until just now. Unfortunately, it's still black.

I don't understand how jpct is supposed to pass the shader its normals (I don't know how one interacts with the other). Where does it try that? I guess that functions dot, cross, normalize and the variable gl_Normal, etc. are lwjgl (OpenGL) functions, right? And I see your vec4 tangent global variable on the new shader. Still, where does anything attempt to fill it? And why is it vec4 on the new shader and it was a vec3 on the old one?
Title: Re: Normal Mapping with Bones
Post by: EgonOlsen on December 11, 2013, 10:35:21 pm
The tangent vectors will be filled at render time, if two preconditions are met:


...that's all. If one preconditions isn't met, the tangents will remain (0,0,0), which results in a black rendering when using normal mapping. However, looking at the code and at your log output, i'm not sure what i'm seeing there...actually, the sequence should be something like:

Quote
Compiled XXX VBO!
Shader program compiled and linked fine!
Tangent handle not found (tangents needed: false)!
Shader compiled!

In your log, all i can find is

Quote
Compiled XXX VBO!
Shader compiled!

...which makes me think that you are not using the GLSLShader class at all but the old wiki example that does everything by hand!? If that's the case, it would explain the results. Try to use GLSLShader instead...
Title: Re: Normal Mapping with Bones
Post by: AGP on December 11, 2013, 10:51:06 pm
I was. The GLSLShader class did it brilliantly. Apart from not having the imperfect normals-artifact issue, the effect itself looks sharper and better. I am impressed. Thanks a whole lot.
Title: Re: Normal Mapping with Bones
Post by: AGP on December 11, 2013, 11:06:05 pm
And here is a very nice illustration of the importance of normal-mapping. Notice that the fps counter in the upper left corner doesn't even change.

(https://dl.dropboxusercontent.com/u/93826015/NormalMapInJpct.jpg)