Shaders for Sverchok 03 - Image Texture Node
This is the third of my Shaders for Sverchok tutorials. They follow on from my Simple Sverchok series. The Shaders for Sverchok posts are mostly about Blender Cycles Materials and how I apply them to my Sverchok models rather than directly about Sverchok nodes.
This post will show how to take the colours from an image and apply them to objects in a scene. It uses the object location given by the "Object Info" node, but see Shaders for Sverchok 01 for other ways to use this node. Of course this technique is useful for scenes with lots of objects generated by the dupliverts for example. Its a great way to try out different colour schemes on a scene very quickly.
The cycles nodes for this is very simple.
The object position is fed into the vector input of an "Image Texture" node via a "Mapping" node. As usual the input of the vector for the "Image Texture" node should be between (0, 0, 0) and (1, 1, 1). The colour at the top right of the image will be accessed with a vector (1, 1, 0). The colour of the image at the bottom left will be accessed with a vector (0, 0, 0). Use the mapping node to change the location vectors into this range. If the values are outside the range they will loop around as if the image was tiled. For example (0.2, 0.2, 0) and (1.2, 1.2, 0) will map to the same place in the image.
It makes sense to use the "Point" option of the "Mapping" node. With this option
output = Scale * input + Location
The Texture, Vector and Normal options do other things. To rotate the image colours about the scene use the "Z" value of the rotation field.
Choose the image to use in the "Image Texture" node. This can be something especially created for the scene to paint particular colours to particular objects, the output of some other Blender render, or a landscape or other photo chosen for its colour balance.
The alpha channel of the image can be used to effect transparency or any other input in the cycles nodes.
It's possible to quickly change the colour scheme of a composition to try out different looks or to have very fine detail control of object colour by drawing over a render or screenshot of the scene taken looking down from +Z.