Game Development Community

Mirrored normal maps - Torque 3D

by Andres Bordeu · in Artist Corner · 08/18/2009 (1:55 pm) · 31 replies

Hi, we noticed that models that have mirrored UVs are not displaying normal maps correctly. The mirrored texture area displays an inverted normal map (shading is 'inwards'). Is there a workaround to this that doesn't require "unmirroring"? Other engines we've worked with solve this problem. Perhaps this will be fixed in future Torque 3D updates?

Thanks!
Page«First 1 2 Next»
#21
08/21/2009 (12:23 pm)
@Andres

Not entirely true. You can use a wonderful little modifier in Max called Edit Normals to align the vertex normals at the seams between the two objects the point in the same direction. If you look at them right now they dont actually point outwards, but more at an angle. Unifying them to point in the same direction will create a seamless look.

Remember too that the result of the Normal Bump map is entirely based on the direction that the surface normals are pointing. So you can easily pull off the samples in the tutorial on any mesh if you take the time to orient the normals correctly.
#22
08/21/2009 (1:19 pm)
Thanks Logan. You are right. Still, that would involve some extra time in the asset development that I'd like to avoid if the system is working correctly.

However, I think we're deviating from the main issue. If you look at the screenshot I posted above the normal map is rendering incorrectly on the box model that displays the shader (no mirroring there).
#23
08/21/2009 (1:25 pm)
I have to add something to Logan's point:
- I know that the max2dts pro exporter had a code resource that if added, it would keep the user specified normals if they were defined (or else it would default to smooth groups). This code has not been ported to the regular exporter and it has not been put into the sdk-sources for any the exporters afaik.

Specifying normals works well with .dae which continues to work with cached.dts. However, a regular-exporter dts exported model fails to keep this information. I hope we can have this specified vertex normals added straight to the DTS version 26 exporters. ;) *cough* *cough*
www.ericrbarth.com/uploadpanel/view/normals_daedtsdts2.jpg
...I know this was a bit of a tangent, but it is still quite valid to mention, IMO.
#24
08/21/2009 (2:09 pm)
You may need to flip your bumps. IIRC 3ds Max needs Y flipped or something.

The handedness of the tangent space matrix is handled, but I think it wasn't in Beta 4, it should be in Beta 5, that line Chris pasted is what does it. Tangents are generated at load time in TSMesh, and it's done off the normal and UV direction, this is why mirroring matters...but that code is what should handle it.
#25
08/23/2009 (1:30 pm)
Any chance the code posted by Chris Robertson will be included in the next release (Beta 6) of T3D ?
#26
08/23/2009 (8:27 pm)
Quote:IIRC 3ds Max needs Y flipped or something.

This comment from Pat makes me wonder if it is the normal map that is the problem in this case, and not T3D.
#27
08/24/2009 (10:44 am)
I don't think it's the normal map. I generated it with a projection. Here's how it renders in Valve's Source Engine; facing opposite to Torque 3D:

aceteam.cl/Images/normal_test3.jpg
#28
08/25/2009 (8:49 pm)
This is what I meant: Max creates normal maps with green set to "down", some packages, like ShaderFX expect an inverted value, so that more green = "up". I am not sure what Source expects, but just because a normal map works in one application, doesn't mean it will work in another...or even in the same package in the same application.
#29
08/26/2009 (3:19 pm)
Thanks Pat. I thought the normal map RGB channel 'orientation' was a convention. Still, it would be nice to know what standard will be set in Torque 3D, since after Beta5 all of our previously rendered normal maps ended up flipping.
#30
08/26/2009 (8:34 pm)
Quote:Still, it would be nice to know what standard will be set in Torque 3D, since after Beta5 all of our previously rendered normal maps ended up flipping.

I don't think the convention has changed in T3D (green was always 'up'). What did change in beta5 was handling of the tangent-space handedness; so it is possible that your models were mapped left or right handed (and thus needed to be flipped) which neatly countered the fact that your normalmap green channels were backwards!
#31
04/07/2010 (12:42 pm)
Could this be fixed by turning your model up side down before generating the normal map?

-Hope there will be a standard for this soon so it may be fixed in the code and not worked around with all sorts of weird tricks ;-)
Page«First 1 2 Next»