I have modeled a car and now im trying to texturize it. I would like to make the materials proceduraly, so I have not unwrapped the model (if its necesary I will, but I dont want to bake the textures).

My problem its that I would like to add dirt at the bottom and front of the vehicle, and I dont know if there is a way to do that, for example, in Substance Painter you can set a direction and it will make a mask with that, but I dont know any way to do that.

I have seen this video: https://www.youtube.com/watch?v=ZmrCoGj9m2Y but it doesnt seem to work to me

Im using blender 2.8. Thx

The model: enter image description here


You can use the Separate XYZ node to extract Z value of the geometry normal, and use this Z value as a factor to mix your base color and dust texture. Here is a simple node setup:

Node setup

The reason I use a Math node (absolute) after Separate XYZ is to make sure that both "up" and "down" gets a positive value, so that you can apply the dust texture onto both top and bottom of your mesh. And here is the render result:

Render result

Additionally, you can add more Math or Color Ramp nodes to get better control of the mix factor (like make top and bottom have different dust density). Here is an example:

More math!

  • $\begingroup$ Thx for the answer, just one question more, do I need to unwrap the model for do that? $\endgroup$ – Alexxjaz Jul 5 '19 at 11:24
  • $\begingroup$ The mix factor part doesn't rely on UV, so you don't need to unwrap the model for that. For the dirt material I used procedural method, which doesn't demand UV unwrapping either. However, if you want to apply an image texture as the car's base color, you'll need to unwrap it anyway. $\endgroup$ – sacrish Jul 5 '19 at 11:30
  • $\begingroup$ Oh and I just realized that I've misread the "front" in your question as "top". To add dirt to the front and bottom at the same time, starting from my second node setup, simply disconnect the maximum node from Z output, and connect it to X or Y (whichever fits your models orientation). You may need to replace it with a Minimum node if your model is facing the negative direction of an axis. $\endgroup$ – sacrish Jul 5 '19 at 11:48

If you meed to give your dirt a direction, other than the object-Z illustrated in Andrew Price's tutorial, you can 'shine' the dirt onto the surface from any point in the object's space.

enter image description here

If you take the normalized Dot Product of the Normal at the shading point with a vector (which you can visualize as a point in the object's local space), then the resulting 0-1 value looks much the same as if the object was illuminated from that point. You could also put the Normal Texture coordinate through a 'Normal'node, but that doesn't take numerical entries, and isn't quite as controllable.

enter image description here

... You can use the value as the factor in a mix between your clean and dirt shaders.

enter image description here

You also have the option of using a Geometry node > 'Pointiness' attribute as a component in the mask, to add dirt in crevices.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.