Page MenuHome

Cycles Standalone: Issue with shader nodes
Closed, ResolvedPublic

Description

Platforms:
macOS 10.14.6,
Intel HD 6000

Arch Linux
Intel Core i5-4440 CPU @ 3.10GHz
NVIDIA GeForce GTX 750 Ti

Broken: rC635bf14747b5: Fix Cycles rendering crash on OpenBSD

Issue Description:
(Please note this task concerns Cycles Standalone specifically)

I've just updated Cycles Standalone to latest commit (4ba92f6d57ef) and I now encounter an issue with shader nodes.

For instance, it happens with the 'scene_monkey.xml' example file.
The rendering is totally black, and I get the following output in console:

build_darwin_cycles$./bin/cycles "/Users/ankitkumar/blender-build/build_darwin_cycles/bin/Resources/cycles/examples/scene_monkey.xml"
Unknown shader node "sky_texture".
Unknown shader node "background".
Unknown shader node name "tex".
Unknown shader node name "bg".
Unknown shader node name "bg".
Unknown shader node "noise_texture".
Unknown shader node "glass_bsdf".
Unknown shader node name "tex".
Unknown shader node name "monkey_closure".
Unknown shader node name "monkey_closure".
Unknown shader node "checker_texture".
Unknown shader node "glossy_bsdf".
Unknown shader node name "checker".
Unknown shader node name "floor_closure".
Unknown shader node name "floor_closure".
E0424 21:37:09.332855 542754240 device.cpp:126] Shader: compile error:
E0424 21:37:09.332937 542754240 device.cpp:127] ===== shader string ====
E0424 21:37:09.332955 542754240 device.cpp:135]  1 #version 330
E0424 21:37:09.332965 542754240 device.cpp:135]  2 uniform vec2 fullscreen;
E0424 21:37:09.332974 542754240 device.cpp:135]  3 in vec2 texCoord;
E0424 21:37:09.332983 542754240 device.cpp:135]  4 in vec2 pos;
E0424 21:37:09.332990 542754240 device.cpp:135]  5 out vec2 texCoord_interp;
E0424 21:37:09.332998 542754240 device.cpp:135]  6 
E0424 21:37:09.333005 542754240 device.cpp:135]  7 vec2 normalize_coordinates()
E0424 21:37:09.333012 542754240 device.cpp:135]  8 {
E0424 21:37:09.333021 542754240 device.cpp:135]  9    return (vec2(2.0) * (pos / fullscreen)) - vec2(1.0);
E0424 21:37:09.333029 542754240 device.cpp:138] 10 }
E0424 21:37:09.333036 542754240 device.cpp:138] 11 
E0424 21:37:09.333043 542754240 device.cpp:138] 12 void main()
E0424 21:37:09.333051 542754240 device.cpp:138] 13 {
E0424 21:37:09.333060 542754240 device.cpp:138] 14    gl_Position = vec4(normalize_coordinates(), 0.0, 1.0);
E0424 21:37:09.333067 542754240 device.cpp:138] 15    texCoord_interp = texCoord;
E0424 21:37:09.333074 542754240 device.cpp:138] 16 }
E0424 21:37:09.333082 542754240 device.cpp:142] ERROR: 0:1: '' :  version '330' is not supported

No matter if I use GPU or CPU rendering.

I can also provide the following file, as another example :

Both files used to render correctly with previous Cycles versions...

Could someone please provide me some help? Many thanks in advance...

Addendum (04-25-2021):
Looking at the code, the problem seems to lie in the new version of NODE_DEFINE (src/render/nodes.cpp), introduced by commit rC635bf14747b5.
The previous version registered the node at program initialization (through a global static variable). In the new version, the node is only registered at the first call of the <Node>::get_node_type method (through a local static variable). This method is never called for shader nodes, so they are never registered, and therefore not recognized during xml parsing...