Page MenuHome

Normal map support in Cycles standalone
Confirmed, LowPublicTO DO


System Information
Windows 8.1 64-bit

Cycles Version

Short description of error

In the latest version available in the Cycles standalone repository, commit d553b8de7180, using a normal map node in a shader graph will cause Cycles to crash. This behavior was not present in release 1.7.0 but has been added since then.

This looks to be caused by an improperly initialized member variable in the ccl::NormalMapNode type. Upon creating an object of type NormalMapNode, the ustring named 'attribute' is initialized such that attribute.c_str() will return a nullptr.

Cycles crashes when the nullptr used to construct a std::string in NormalMapNode::attributes in this bit:

		else {
			attributes->add(ustring((string(attribute.c_str()) + ".tangent").c_str()));
			attributes->add(ustring((string(attribute.c_str()) + ".tangent_sign").c_str()));

Exact steps for others to reproduce the error

I have attached a simple cycles standalone scene that triggers this error here:

Event Timeline

Sergey Sharybin (sergey) lowered the priority of this task from 90 to Normal.

AFAIR, normal map requires tangent space, which in Blender is calculated using mikkspace. This library is not used by the standalone Cycles. So making normal map to work is a bit involved, but think we should still fix the crash.

@Thomas Dinges (dingto), something fun for you to look into? ;)

Is this being addressed? Have a lot of gltf 2.0 assets with tangent space normal maps that just render black (no crash though).

Brecht Van Lommel (brecht) renamed this task from Crash when using normal map node in cycles standalone to Normal map support in Cycles standalone.Wed, Feb 12, 11:22 AM
Brecht Van Lommel (brecht) triaged this task as Low priority.
Brecht Van Lommel (brecht) changed the subtype of this task from "Report" to "To Do".

The solution here would be to move the tangent computation from the Blender exporter into Cycles itself.