Is Shader to RGB node bad for performance?[Solved]

I’ve noticed that after using several materials with Shader to RGB, my project started to lag on “shader compilation” stage. I want to make sure this node is a significant factor

I would hazard a guess the issue is actually the number of shaders you have plugged into Shader to RGB nodes. Each shader adds a significant amount of time to compilation and render

1 Like

This makes sense. Will be looking to get rid of those nodes since I have several materials with 2 of them.

By the way, do you know an easy way to feed a global space direction vector (like, direction between 2 dummies, or Z axis of some object (other than one shader is applied to)) into shader? I can only think of creating 3 value inputs for XYZ and controlling them with drivers. Perhaps there is something easier, using shader nodes only?

I don’t know for sure if Shader to RGB has a specific impact, I do know for sure that shaders do. I’ve never noticed a difference with a shader to RGB vs without, but it could be that it’s a small calculation that adds up with a lot over time.

One slightly easier way to do what you’re describing is a Combine XYZ node, then you can just put the drivers in one node instead of 3. Im sure there’s a better way, though. Here’s a thought. Connect your wanted vector to an empty with drivers, and then use a Texture Coordinate node and the Object Info output, with the Empty. That might work, I haven’t tried it :sweat_smile:

I’ll give it a try, thank you