Game Development Community

Normal maps in Torque 3d

by Jeff Meyer · in Artist Corner · 03/07/2010 (11:24 pm) · 30 replies

I have normal maps applied to a character. They are rendering fine in Max.

They also work fine in TGEA.

However, in Torque 3d they are producing seams.

I'm leaning towards this being a problem with how the tangents are handled in the engine.

Also, these models are being applied in-game through a demo version of the engine. I am unsure what version it is. Is it possible a newer version has dealt with this issue?

Torque advanced image:
jeff-meyer3d.com/download/TGEA_no_seams.jpg
Torque 3d image:
jeff-meyer3d.com/download/T3D_normal_seams.jpg
Troubleshooting:
Rendered new normal maps in a trial and error fashion by flipping the green and red channels in conjunction with changing how tangents are derived.

Rendered new normals in a host of applications such as melody and x-normal with the same result.

None of them are working.

Can someone explain how the tangents are derived in T3D?
Also, if someone has rendered normal maps in z-mapper successfully for the T3d engine, can you please share your settings.

About the author

Ambient Wave Inc is a digital media production company providing web and graphic design services. http://ambientwave.com

Page «Previous 1 2
#1
03/09/2010 (12:10 am)
Anyone know what is causing this? How can we fix this normal map problem?
#2
03/09/2010 (12:54 am)
There have been a few complaints over the past months.

Let's keep this thread "bumped" so that we can get some action on this.
#3
03/09/2010 (4:44 am)
I fully agree with you with keeping this thread "bumped". You would think that this problem would have been fixed awhile ago.
#4
03/09/2010 (7:35 am)
anyone with problematic models, please send them over to me(with textures) for a lookover..perhaps I can diagnose it to get the 'ball rolling' on this.

www.ericrbarth.com/uploadpanel/view/eb.jpg
#5
03/09/2010 (11:17 am)
If I have some time, being that this is happening to my models too, Ill try to look into the normal and Tangent Calculation within the engine when i get some time, and I might be able to ask my professor if all else fails. We are studying Torque in my Game Engine Design class at the moment.
#6
03/09/2010 (1:44 pm)
try applying a blank normal map to the model which will shade the models triangles based on the direction of the normal, you may have errors that are not readily apparent in the model, especially if you used some sort of polycruncher orif you used decimation master which can mess up some of the normal information. I have seen this problem myself and usually i can fix it by remodeling the problem areas...however there does seem to still be a bug in the dx shader that can still cause the seam issue but generally occurs on models with messy topology, i rarely have any issues with clean models.
#7
03/09/2010 (3:04 pm)
Thanks Ken, that is one of the first things I checked with a fill of RGB 128,128,255. I wanted to check the padding/overpaint to see if that was the culprit. However, the padding is fine, the topology is clean, using all quads without floating verts or any of that. The seam at the neck indicates that it is a problem with tangents as the throat is shaded in reverse on the upper neck than on the lower neck.



Here are the UVs and the normal map.

jeff-meyer3d.com/download/torque_export_uvs.jpg
jeff-meyer3d.com/download/normals_blended.jpg
#8
03/09/2010 (3:34 pm)
make sure your model is converted to triangles (if in max convert to an editable mesh not editable poly) and check the seams, that may or may not be the issue, also what happens if you rotate the model in torque, and look at it in different angles, Also do the normals show up correctly when viewing the model in the shape editor? or is the issue only present when viewing it in the world space? as of now it seems as if sections of the UVs are having their tangents flipped (which you have already concluded) which would be a bug, and one that was present in earlier betas, I have been using 1.1 for a while now and haven't seen this issue since, except in cases as Ive already indicated. the bug in the earlier betas the seams and garbled polies would change as the model was viewed at different angles/distances, so if this is occurring it is the same bug, If you would like I can also take a look at your .dts in 1.1 for you, just let me know.
#9
03/09/2010 (4:27 pm)
Right, the exporter spits out errors when the mesh isn't set to editable mesh. How can I send you the DTS and normals map?
#10
03/09/2010 (5:01 pm)
Here's a screenshot of just the normal map and a plain blue diffuse map to help illustrate the normals working in TGEA.

jeff-meyer3d.com/download/no_diffuse.jpg
#11
03/09/2010 (5:09 pm)
Now, here's the Torque 3D engine with the same model, same diffuse. Same everything.

jeff-meyer3d.com/download/t3d_no_diffuse.jpg
#12
03/09/2010 (5:54 pm)
Ok, so by studying the diffuse and how the shader is behaving I played around with a few settings and come up with this result.

jeff-meyer3d.com/download/custom_settings.jpg
There are still issues, mainly the large seam that is applied at the shoulder. However, at least the shading is correct across the board.

If need be, I supposed I could paint out small problems such as that.

I'll be checking this in TGEA now.
#13
03/09/2010 (6:00 pm)
If anyone is interested in the zmapper config used for the normal creation, let me know.
#14
03/09/2010 (6:08 pm)
Here's the new map back in TGEA. As expected, the map behaves as the T3D did. Initially I thought the tangents were the culprit. It turns out the green channel was causing the problem. This was evident in the bikini on how it looked pushed in.

Also, some UVsmoothing and group seam settings needed to be changed, but all is good now.

jeff-meyer3d.com/download/tgea_newmap.jpg
#15
03/09/2010 (8:49 pm)
oh hahaha, it's all due to the swizzle ? ..well that was simple. I hope the other people with this issue solved their problem this way.
#16
03/09/2010 (9:11 pm)
glad you were able to figure out the issue, i was just going to suggest switching the red and green channels based on your 10th and 11th post shots with the bikini being pushed in instead of out... :) at least all is good now
#17
03/11/2010 (1:59 pm)
Well, it appeared as though the problem had been solved.

However...

Different sections of the mesh are facing inward, and others are facing outward.

By flipping the green channel I can remove the seam. Yet, I have mismatched facings on different UV shells.

The character's mouth and eyebrow will be flipped if I have the bikini facing correctly without a seam. These are part of a different UV shell.

However, if I have the mouth facing right and the bikini facing right...then, well there's a seam.
jeff-meyer3d.com/download/flipped.jpg
Time to dig a bit deeper.
#18
03/11/2010 (4:55 pm)
..there are a few others having this issue as well. The normal map will render properly for them until the level is reloaded..or similar/likeness in issues of the map not rendering correctly.

Hopefully you solve this as quick as the last.
#19
03/11/2010 (6:26 pm)
I've tried the following solutions:

Flipping the red and green channels
Swapping the channels
Flipping only the head in green
Flipping only the head in red
Copying the head in red, pasting in green, then flipping...


Rendering in other baking software, then doing the exact same steps.

Changing the UV layout so the head follows the same rotation as the body. Then, switching channels again...

I've noticed that in max, the map does not render how it renders in T3d even when the green channel is flipped in max. The mouth and eyebrows on the head have the proper facing. I've also played with the X / Y / swap buttons on in the normal bump shader to mimic how T3d is rendering the map incorrectly...I can't even reproduce the problem in max with flipping channels. This tells me that how the tangents/binormals are calcuated is what is causing the problem.

So, in my opinion, there is a really funky way that torque 3d is calcutaing this lighting. I'm going to try generating new maps with adjustments to how the tangents and binormals are calculated. This is just a guessing game at this point.

There needs to be a standard or something for normal maps. Also, why deviate from how TGEA handled normal maps? Rediculous.
#20
03/16/2010 (12:49 am)
Well, progress is not good. Here's some more things I've tried.

UV Mapping:

Checked for flipped/mirrored uvs.

Generated normal maps for each shell, then comped together in photoshop.
(No difference)

Rotated UVs to avoid directional changes along the seams.
jeff-meyer3d.com/download/new_uvs.jpg
***This pretty much fixes the seam between the neck and body. However, this creates a totally new problem. Now the female's face is 1/2 facing out and 1/2 facing inward even though there is no seam down the middle.
jeff-meyer3d.com/download/flipped_tangents.jpg
While adjusting setting with zmapper I found that I could mimic this 1/2 and 1/2 behaviour by switching tangents and "swap tangents with bi-normals".

The approach I am taking is to generate a base normal map, then apply it in-game to the model. Once in Zmapper with the same normal map on the model as the texture, I enable the tangent-space n-map display. The tangent-space map show the behavior in the viewport while adjusting switches like green flip or red flip. Keeping the model rotating also seems to update the viewport per frame.

However, even with this apporach the behavior of T3D's calcs cannot be re-created.

I have also tried every swizzle combination imaginable within Xnormal.

Apprently, this issue is cropping up in the T3D forums as well, with no one resolving the issues.
-----------------------------------------------------------------------
So, has anyone at all been able to create a normal mapped character in torque 3d as of yet without the same problems?


Page «Previous 1 2