Bug: Attribute Create SOP renders black polygons with Geometries with normal mapping

When I apply an Attribute Create SOP to Calculate Tangents and feed that SOP to a Geometry that uses a Material that uses Normal Mapping, some or all of the faces go pitch black in the render.

image

I can understand this happening with weird imported models, but it happens even with fully native stuff like the Wireframe SOP.

Attached is an example:

attrib_bug.toe (4.3 KB)


Things I tried that didn’t help:

  • inverting normals
  • changing the pixel format of the normal map top

Win 10, 2021.15800


Related topic: Checking Compute Tangents in Create Attribute makes the render of the SOP suddenly go pitch black


Similar issues on other forums: Normal Map gives black render on half the surfaces - Blender Stack Exchange
and cycles render engine - My Normal Map makes my material black - Blender Stack Exchange
and Normal map, sections go black?? - #9 by coonerboy - Materials and Textures - Blender Artists Community
and Applying Normal Map Make Everything Appear Black? - Modelling - Do Not Post Here - Core 4D Community
and https://forum.unity.com/threads/model-and-sky-turns-black-after-adding-a-normal-map.822486/

Recurring theme is NaN values (dunno what that means), poorly calculated tangents, inverted normals.

Hey @matijaerceg

Thanks for the report and sample file.

I’ve logged an issue for a developer to look into it.

Best,
Michel

1 Like

Normal mapping and tangent generation requires useful UV coordinates to create values. The UVs for the generated circle just end up being 0s (you can inspect with a SOP To DAT), which results in 0s for the tangents. This causes the lighting to totally break down. Without tangents you get some default values which end up with something, although the normal mapping wouldn’t look right if you had an actual bumpy map going into that.

Thanks @malcolm

What I’m hearing is that before trying to use normal maps on any shapes, to ensure that they’ve somehow also been assigned UV coords.

Is this something I can do inside of TouchDesigner? In the above example with the Circle SOP > Wireframe SOP, could I generate useful UV coordinates so as to not get a black render?