4
$\begingroup$

Hi is there a way to apply a material on certain parts of an object? What I mean is this ... I have for example RUST and PAINT and in the MIX shader I could assign a texture (ie NOISE) so white parts will be one mat and black another or I could paint a texture myself on UV unwrapped surface to design exactly what I want but... Is there a way to AUTOMACIALY "assign" the RUST to the "sharper" edges/corners?

I know Pointiness could do something like this but dunno if there is a way how to "randomly" fade it out cause have rust exactly only on edges and with the same "amount" all the way along does not look "real". Im looking for effect in top-right corner (Wall-e material).

REM: SHARPER mean NOT with assigned sharpness but angle dependent so as could be seen on the picture below ONLY on the edges of the cube.

enter image description here

Sinerely, Jan

$\endgroup$
7
  • $\begingroup$ Sorry I don't understand if you want a way to create the "stencils" (i.e. the textures that define the areas with material 1 and the areas with material 2) and paint them, or to procedurally create the stencils from geometry information $\endgroup$
    – Nicola Sap
    Commented Oct 21, 2018 at 10:56
  • $\begingroup$ Yep, from GEOMETRY information buddy. $\endgroup$
    – Jan Matys
    Commented Oct 21, 2018 at 13:09
  • $\begingroup$ ...but in fact I need it with a kinda "fade-out" or set the width of the effect cause texturing only the edges (corners) will be almost invisible. $\endgroup$
    – Jan Matys
    Commented Oct 21, 2018 at 15:48
  • $\begingroup$ I only just noticed your edit, so I've edited my answer.. $\endgroup$
    – Robin Betts
    Commented Oct 21, 2018 at 20:32
  • $\begingroup$ @RobinBetts answer is a good solution for more recent blender builds (as he mentions). However, if you are using the 2.79 stable release then the solution that I detailed here should achieve the procedural weathering mask effects that you're looking for: blender.stackexchange.com/questions/55991/… $\endgroup$
    – Hexbob6
    Commented Oct 21, 2018 at 22:32

1 Answer 1

8
$\begingroup$

The traditional method for dirt/wear mapping has been to use an Ambient Occlusion shader to catch recesses, with the normals flipped for convex protrusions. In the AO node available in more recent builds of 2.79, the normals are flipped by using the 'inside' option.

enter image description here

AO is not strictly responding to the angle between adjacent faces, it's a representation of how many hits there have been within a distance threshold, from a sample of rays fired in the hemisphere of directions surrounding the surface normal at that point.

A more specific response to the curvature of a surface can be obtained from its 'Pointiness' value, which you can get from the Geometry input node:

enter image description here

... which as far as I can gather uses angles between adjacent edges to approximate curvature.

In order to make it work here, this cube had to be subdivided. A Simple subdivision will do, or, as illustrated, Catmull-Clark with a bevel to hold the edges.

The values generated from these shaders can be used to control the mix of other shaders or colors, or anything you like that can be controlled by a number. If different gradations are needed, you can put the values through a color ramp, curves, or map them to another range in some other way, as in the second example.

They can be combined in ways like this:

enter image description here

Or this, using AO alone, which is not toplology-dependent.

enter image description here

$\endgroup$
21
  • $\begingroup$ Tried in Blender 2.79 but NOT working for me, I have only the "AO" out and "Color" in in that AO Fade node so I could see only GRAY cube (no texture) after that ColourRamp. SOLVED ... need the new daily build - THX!!! $\endgroup$
    – Jan Matys
    Commented Oct 23, 2018 at 17:17
  • $\begingroup$ Yup the standard stable build is getting quite old now... I don't know when or if it gets updated.... before 2.8 is a stable release... Check out the @Hexbob6 answer, too, it will run more quickly, in any release. $\endgroup$
    – Robin Betts
    Commented Oct 23, 2018 at 17:25
  • $\begingroup$ Sadly its not compatible with bevel somehow and it looks there is no way how to alter/change the size of the FX on the edge - mean when there are additional loops near edges the rust almost disappears (looks like its HARD topology-depending)... Is there a way how to contact You Robin please? $\endgroup$
    – Jan Matys
    Commented Oct 24, 2018 at 16:29
  • 1
    $\begingroup$ Hi mate, body completed somehow: pasteall.org/pic/11416574fd0b63ddda3e9843ab08340b ...not a copy I know but close enough imo ;). $\endgroup$
    – Jan Matys
    Commented Nov 1, 2018 at 5:13
  • 1
    $\begingroup$ Beta... pasteall.org/pic/8fec7ced50d92f138eec867c674f006f $\endgroup$
    – Jan Matys
    Commented Nov 14, 2018 at 21:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .