Too complex procedural material for Cycles?

Hi there,

I’m currently working on a mosaic procedural texture that is getting very complex right now. Here is a screenshot to give you an idea :

The problem is that at a certain point of complexity, Cycles renders something completely black instead of the texture (preview and render). This appears even when I’m previewing the material using the node wrangler. Surprisingly, eevee doesn’t have any trouble rendering it (usualy if the material is too heavy, eevee replace the material by the pink of death :wink: ).

The strange thing is that sometimes, I keep building my tree and suddenly rendering with cycles works again. So it looks a bit random and I want to get the reason why it behaves like this.

If someone had the same issue I’m curious to know how it appeared.

Have a nice day everyone!

Yes there is a complexity limit. Check the console. It says something like “stack too large” or something like that.

3 Likes

Thank you for letting me know where I could find my answer. So yes I overpassed the complexity limit :upside_down_face:

3 Likes

You can try enabling open shading language. It doesn’t have the svn stack limitation. The only downside being that it’s significantly slower.

2 Likes

Ok that’s interesting. Though I think I won’t use it for this project because it’s almost done and I’ve planned to render different maps using eevee. The complexity doesn’t come from a lot of noise generation but from a complex pattern (so it means a large tree with a lot of basic nodes).

As I understand, both eevee and cycles have limitations but it’s not defined the same.

Brecht said:

There is a limit on the number of textures that can be used in a shader with OpenGL, it’s particularly low on macOS. We do not consider this a bug, it will probably only be fixed when we switch to Vulkan/Metal.

See https://developer.blender.org/T66590

I have this problem a lot and the way I work with it is to temporarily mute some texture nodes (keystroke m when hovering over node). This might be helpful or not depending on your setup.
Not very helpful if you don’t use baked textures as an end result. If you do bake you can bake parts of your model and tick of Clear image. But all depends on your setup again.

It is not only limited to macOS.

More: https://www.google.com/search?q=pink+limit+nodes+site%3Ahttps%3A%2F%2Fdeveloper.blender.org%2F&rlz=1C1CHBF_enNL896NL896&sxsrf=ALeKk01taIfDVeFNsZDXO9yb1-hE6mSGXw%3A1619079228975&ei=PDCBYNuRO8-tkgXT97DgDg&oq=pink+limit+nodes+site%3Ahttps%3A%2F%2Fdeveloper.blender.org%2F&gs_lcp=Cgdnd3Mtd2l6EANQvWhYg64BYMu4AWgHcAJ4AIABR4gBzgaSAQIxOZgBAKABAaoBB2d3cy13aXrAAQE&sclient=gws-wiz&ved=0ahUKEwjbn7mStJHwAhXPlqQKHdM7DOwQ4dUDCA8&uact=5

1 Like

thanks for letting me know too, i had the same issue with a sort of complex node setup…

in my case appears the svm out of stack as well in the console


but how do i fix that guys? i have to break my node setup or something what should i do to avoid this limitation?

I think using several complex nodegroup instances is the first reason for increasing complexity so personally I would try to optimize this and use less of these nodes but that’s kinda hard to do.
For example I see on your screenshot that you use 6 different instances of the same nodegroup with different mapping information. There’s often a way to compute only one map of coordinates made especially for your needs and use your node group on this map. You can do this using vector math nodes set on snapping, modulo, these are quite handy for this kind of situation.

Otherwise if it’s impossible to do this you can work with open shading language as @hi_there_dear_john said.

If it still doesn’t work, the only solution I see is to progressively bake your intermediate maps to continue to build your shader on it but you’ll have to deal with resolution limitations.

I’m happy to see this topic being helpful for someone else than me :slight_smile:

1 Like