How can i understand texture nodes better?

Hi

I have invested quite sometimes into learning some composition, lighting and basic modelling.
But now i have found myself where i need to model and make the procedural texturing.
I have analysed how blender works with nodes.
Trying to figure out the math node and asking few questions to Ai, Ai told me some how these nodes work e.g told me that on math node add and subtract are mainly used to offset your object while maintaining its original shape. Or brightten your overall greyscale. If you would like make more contrasts between the value than you make with multiple so you create more contrast.
About midtones you can use logarothm, power etc. On other mix rgb nodes almost always unpredictability happens. E.g tou have lighten you mix 2 colors than some other color happens. If someone would have a few times what are minimum math and rgb operations i need to know doing everything in blender. And except learning from practice how is it possible to learn the operations. E.g in one software when you choose difference it cuts the object but in blender it behaves differently. Can someone if it is possible to explain e.g like this people use multiple mostly for contrast or add is mostly used for this etc

I think there are two major parts in learning how to use material nodes.

  • I think you definitely need to know what nodes exist and what they do. So you can watch some tutorials or just go through the nodes, and make sure to learn what each does:

I mean you should be familiar with the whole menu and sub-menus and at least know that they exist and have a at least a rough idea what each one does. Documentation might even be useful here.

  • The other half is learning how to use them. That one is wider and more difficult to learn. You can watch/read tutorials, attempt creating solutions for what you want to atchieve and practice in general to learn various techniques and ways they can be used. This is more like learning a skill, not only information, so it takes practice and time.

One important bit that you now seem to be missing is that math and other nodes are not only for working with color. Manipulating texture coordinates is also a very important part in making procedural textures. You can think of coordinates as if they were color as well, you can even view them as these gradients:

gradients

And when you do math operations with them you can manipulate the placement of whatever texture they plug into:

math

That’s a big concept in procedural textures.

Anyway. Learn the information(what the nodes are), then the skill part - the techniques how to use them(this includes practice).

I think video tutorials are helpful, but written info(with pictures) is also valuable. I think there is a lot of great information about techniques here on these forums as well as Blender Stack Exchange. You could look for examples what can be done.

So I am afraid there is no way to learn without practice. It is essential, because you are learning not only the information about what each thing does, but also how to combine them in truly infinite ways to atchieve some results. So it’s a skill that you are learning, not theory and therefore it’s impossible without practice. I think you need to accept that, but at the same time, you can aim to do this learning in a more organized and efficient way. If you know that you need to learn techniques, that’s what you should be looking for and concentrating on learning. Hopefully that might make things a bit easier.

Hi,

my advice is to think of an image texture in terms of numbers : each pixel in the image has an RGB value that is made of 3 numbers -one for each color channel- typically between 0 and 1 (0 being black and 1 being white). If you subtract 0.5 from a completely white image, you’ll get a perfect middle grey. If you multiply two of these middle greys together, what would you say you will get ?

Well… grayscale perception isn’t linear, so middle gray is .18. Mathematically you’re correct, but not perceptually, which is admittedly kind of an advanced topic for OP’s question but also is important to understand for procedural texturing

Well… in sRGB it’s .214 :laughing:

If R, G, B are less than or equal to 0.04045
RL = R/12.92
GL = G/12.92
BL = B/12.02
If R, G, B are greater than 0.04045
RL = ((R + 0.055)/1.055)^2.4
GL = ((R + 0.055)/1.055)^2.4
BL = ((R + 0.055)/1.055)^2.4

Specification of sRGB

:laughing: Sorry. Let’s not start. :laughing: :laughing: :laughing:

It’s a bit easier these days since Blender has some functionality for that:

sRGB

Dammit Joseph I am trying to keep it simple !

To put it simple: most of the time you will need texture nodes (noise, gradient, wave, voronoi, musgrave etc), texture coordinate+mapping nodes, mix node, color ramp node, math node, and ofc, shader node (pricipled BSDF will work usually fine).

Texture coordinate will define how the texture will be put onto an object. Usually you will use either object, generated or uv. So it defines is the texture put on a uv map like image textures usually are, or in object or generated space. I don’t clearly understand the difference of object and generated, but both of them utilize the fact that procedural textures are 3-dimensional, so they will be seamless with those.

Mapping node allows you to move, rotate and scale the mapping of the texture. So you can move the texture, make it bigger or smaller, stretched or compressed, and twist it how you want. You can also use this to manipulate a texture without needing to change the uv map.

Generated textures have several of their own settings that can be used to manipulate them into many different forms. Some of them have both color and factor outputs, color is colorful and factor is black and white.

Black and white textures are mathematically maps of numbers between 0 to 1, so that black pixels are 0, white pixels are 1, and grey pixels are something in between like 0,5 or 0,67 etc.

Mix node has two colors/inputs and a factor slider/input. If you use default mix mode then the B color will be mixed on top of A color by the amount of the factor slider. If it’s 0, nothing will be added to the A color. If it’s 1, B color will fully overwrite the A color. In-between values make them appear on top of each other.

But often you will plug a texture into A or B color to mix two textures together, either procedural or image textures. If you use different texture coordinate/mapping nodes for each texture that you mix together you can control each texture separately.

You can also plug a black and white texture into the factor input. This way the mix node will mix the B to A by the brightness values of the factor texture: areas with pure white will get fully the B texture, areas that are black will remain A texture and grey areas smoothly have the mix of the two.

If you want to add contrast or control the brightness of a bw texture you can do it with color ramp or math nodes. Color ramp will have sliders between 0 and 1. If you slide the default white slider to the left, say to 75%, the texture will get pure white on all those areas (from 75% to 100%) that originally had some greyness in them. You can also change the color of the sliders, add new sliders etc to get very complex patterns if you want, but usually color ramp is used to add contrast and clamp into a bw texture.

Math node can be used to do math with the brightness values. If you have a greyish noise texture and you plug it into a first value of a math node set to multiply, it will multiply all the brightness values by the second value. So black areas won’t change because 0 times anything is still zero. But if you multiply 0,5 (greyish) by 1, it’s the same as before. But if you multiply it by 2, it will become 1 (white) etc. Add works similarly but it will add the value to the first value. And so on.

Mix node has two rules of thumb: if you have two bw textures and you want to add black from one texture to another, you must set mix node to multiply. If you have two bw textures and you want to add the white areas from one texture to another, you must use screen. Combine this with something like a gradient texture plugged into the factor input and you can make all kinds of interesting texture combinations.

There is a big difference.
Generated cords are based on the bounding box of the object. The corners of the bounding box will map from 0 to 1 in each direction.

This is a cuboid 20m long. I have noted the values for each corner.

If you use a voronoi texture with generated cords the texture stretches on the x axis because the cuboid is 20m long on the x axis and is still mapping from o to 1 on the x axis.

If you do not want the texture to stretch you would have to multiply the scale of the x axis by ten.

(why by ten? because the cuboid is 2m by 2m by 20m IE the x axis is ten times longer that the y and z.)

Object cords use the distance from the origin of the object. Object cords go in positive and negative directions not restricted to the 0 to 1 range.

Note that the values go from -10,-1,-1 (front black corner) to 10,1,1 far white corner. (the origin is in the center of the cuboid).

If you use a voronoi texture on this it does not stretch on the x axis because the texture is mapping from -10 to 10 (20 units)

Also worth noting that you can use object cords of a different object to map textures. IE use the distance from the origin of a different object that could be a KM away giving you mapping values in the 1000’s. :grinning:

I highly recommend this video

and all of these, for people who want do dive into procedural textures.

The “generated” texture space can also be manipulated in

Properties → Object Data → Texture Space

I rarely ever use it but I guess it can be useful in some odd cases.

Well, there is a lot to say from your answer !
First you don’t need to be a procedural node wizard to do cool stuff in blender.
In fact, procedural textures tend to feel artificial and are quite time consuming.
But it’s true that having some knowledge on procedural texture can help a lot.

Then it’s not all about math functions, those helps but it’s more something you integrate on the long run by learning one function and how you can use that as artistic tool.

I think people already posted good content on the fundamentals that are worth looking into.
You can look at that for more practical applications from Ryan King Art that is probably going to help you understand how that works in practice :
https://www.youtube.com/playlist?list=PLsGl9GczcgBs6TtApKKK-L_0Nm6fovNPk

This helped a lot back then to understand the theory :

But this has also been covered in more recent videos by Erindale !

Have fun !

Indeed they can look off often. But don’t forget that you don’t have to stop there. It’s always possible to bake the texture to image and carry on from there in an image editor like Photoshop. Or bake some parts of it, then mix them, maybe mix in some elements from photos and so on. That sometimes helps quite a lot. So at the end of the day procedural textures can be quite awesome in some cases. I am really happy about how realistic you can get wood textures in Blender for example.

It’s a real pain to make! but if you need a specific look and you only have some small sample and if you are willing to spend some time on this… You can then have any size and any resolution you want. That’s quite cool. It works with fabrics as well and some other things. You can mix procedural textures with pre-rendered patterns modeled with geometry that you can then use for normal and displacement maps as well, you can then carry on editing the result further as well… it’s a good tool to have. Procedural step does not need to be the only one in making a texture.

Cannot say anything about the time consuming part though. That’s just terrible. :laughing: It’s true. But sometimes I don’t really see other good options.

Yes you’re right , I tried to keep things simple but indeed it’s not about procedural vs image based but rather a balance between both approach.

Personally I tend to use a few procedural tricks to mix tillable textures and that tend to do the trick. And while some textures would work pretty well in blender like wood, concrete asphalt and many others. When it comes to stuff like chipped paint, rock/stone, and grunges like splats, leaks, stains procedural really take a lot of time for a poor result compared to just taking a photo based texture and tweaking it for 20mn in krita or else.

Sometimes procedural material can be felt like the advanced way to make realistic materials and there is truth to that but I’d say the best results IMO generally lies with 70% images textures mixed with 30% procedurals.
I also insisted on that because the OP was insisting on maths functions that are obviously useful but really not mandatory to make good visual results.

I had a work with my client he sent me some tables and wanted to make very similar to his texture. I didnt manage to find the same on market so i have decided to create one from scratch. Thats why it was necessary for me to being able to create some texture too. If you at some point become professional what do u think will you be able to create a high quality texture within few hours. Because from my perspective since there are many artists out there you need to being able to offer to your client some more specific things, many people make high quality renders but mostly they use asset what they can found i want to be a bit different if client comes to me and says this is my product and i want the same modeling and texture if i can offer them almost everything than i can be ahead

Yeah… A few hours… A few days… :laughing: If you are going to use it just once, it may not pay off. Depends on the texture you need.

Procedural textures really shine when you have to use imported CAD meshes that are un-unwrappable.

Then the client should pay the time. When people make the texture scanning what dimensions are they making. When i e.g start to make a procedural texture i want on a flat plane to work and than from it to generate all pbr. What size should the plane be is 50cm and 50 enough. And usually the pbr texture that we download what are the dimensions of real life that they are taking

50cm, 50m or 20 000 km - whatever you need. :man_shrugging:

Best to make the material on an object that’s the correct size for how the texture will be used (and make sure its scale is applied, that’s very important for procedural stuff).

This YouTube tutorial may be what you are looking for. It explains the math behind each mix node math option. It’s not intuitive. https://youtu.be/tu2VXSDVb4Q?si=G6QnDqWUPUr8_i4S

If I want to evaluate mathematically generated tones and gradients visually, I switch to Raw/None in Color Management with 0 exposure (Cycles).