Node-based material?

Hi yall

Since i have been just using the default material settings of Blender to create game material, I actually have no knowledge about node-based material. I always doubt it gonna lags down the game because it is supposed to be just in the cycles rendering mode.

Can you name any benefit of node-material please? Thanks

Noded materials can be arbitarily complicated. This means they can do awesome effects, it also means they can be slow.
Things to realize:

  • Maths is fast (addition and subtraction and multiplication can be done in a single GPU clock cycle)
  • Texture sampling is slow (Memory lookups, even on DDR5 vram take time)

Benefits? Uh, controlling how you mix materials together using vertex colour rather than a separate mask - allowing you to do it per object rather than needing lots of materials. Ability to go your own weird mapping types. Ability to use data such as global height, lamp vectors and colours and so on in whatever way you please.

Have a play, it’s a lot of fun. I rarely have node shaders as my performance limitations. That said, I have a bit of an idea of what goes on under the hood so I can avoid some pitfalls.

Some tips on shader performance:

  • Adding textures together is just as fast as adding single numbers - and in some cases is faster (amazing, isn’t it! GPU’s are designed for graphics)
  • Blend modes like hard light, screen and overlay are slower than addition and subtraction
  • RGB curves are relatively slow, as is the colour ramp.
  • If / then statements (likewise greater than and less than) are slow compared to addition and subtraction. GPU’s like doing things to lots of data simultaneously. Splitting things up slows them down significantly.
  • As mentioned before, texture sampling is (relatively) slow compared to maths.

Some tips on appearance:

  • Less effect is often more. Don’t go overboard.

Some limitations:

  • In 2.77, you cannot mix normal aps in the node editor. This is fixed in the buildbot version via the addition of a ‘normal map’ node.