1
$\begingroup$

I'm making 3D models of weathered gravestones with photogrammetry and using the textureless model with simulated shadows to read the engravings:

Photo vs textureless 3D model

It works pretty well, but it's much more legible if I make the engravings black and the surface white and don't depend on shadows. For some stones, I figured out I can do this in Blender by importing the .obj file, and making a shader that divides the world into white and black by coordinates, then very carefully rotating and shifting the model until the surface is in the white zone and the engravings are in the black zone:

Blender nodes for black/white slicing plane

This is tedious, and doesn't work at all if the stone isn't perfectly flat, like if it bulges out in the middle, etc. You can see how the area around "July" is darker because it's not quite flat there:

Engravings shaded with black

How can I make only the engravings dark and the flat parts white, in a way that ignores broad curvature and doesn't require me to rotate it to a specific angle? Is there some kind of "color by local depth while ignoring global depth" shader? Or "take the median position of the connected vertices within a certain radius and then shade based on Y depth relative to that median"? Or "anything that can be touched by a 30 mm rolling ball is colored white and anything touched by a 5 mm rolling ball is colored gray and the rest is colored black" except with continuous color variation vs ball size.

$\endgroup$
6
  • $\begingroup$ There are many ways you could accomplish this, but I think trying to do it all in the material is probably the wrong approach. The parts of the model that you want to be darker in color are fundamentally a property of the mesh, not of the material the object is made from. Therefore, you’ll almost certainly achieve better success by annotating the mesh with additional information that you can use for shading, not carefully trying to make the two parts coincidentally line up. Is there a reason you can’t simply use a different, darker material for the engraved faces? $\endgroup$ May 7, 2021 at 0:10
  • $\begingroup$ @AlexisKing I don't care if they're shaded with different materiails or whatever. My question is how to isolate them from the rest of the mesh in order to do that. It's just one big mesh; there's nothing special about them except their curvature and/or depth. Right now I'm isolating them by effectively slicing them off with a plane, but that doesn't work if the surface isn't planar enough. I have very little experience with Blender so I don't know what other tools are available. $\endgroup$
    – endolith
    May 7, 2021 at 0:14
  • $\begingroup$ I don't really understand what you're trying to do. Are you trying to just make the engraved parts darker? Or are you trying to separate out the engraved part of the mesh? If you posted a blend file of one of the stones it might help to understand. $\endgroup$ May 7, 2021 at 2:53
  • 1
    $\begingroup$ If you're just trying to make the crevices darker as the title says, you might find something useful here: blenderinsight.com/1494-2 <- it's all about 'wear and tear' using various techniques. I'd look at the Pointiness and AO sections, for starters perhaps. $\endgroup$ May 7, 2021 at 2:58
  • $\begingroup$ @DaleCieslak I'm trying to just make the engraved parts darker (by separating out the engraved part of the mesh). :) In the above example, all I've done to "separate" it is to color parts of the object differently depending on which side of a plane they are. $\endgroup$
    – endolith
    May 7, 2021 at 3:09

1 Answer 1

2
$\begingroup$

I mentioned Pointiness in the comments and you said you tried it; the thing with Pointiness is that it's a bit hard to handle so you really need to "crush" the value down in something like a Color Ramp. In this image, both of the stones are exactly the same model, but on the right hand side is the node graph you see below. Note how the words are visible on the right and invisible on the left? I squeezed the pointiness values in on both sides of that Color Ramp:

enter image description here

This might not be the exact solution you want, as the bumpiness of the surface and the edges of the stone also show up in my example due to the pointiness, but if you tweak that color ramp you might get the result you're after. You can also tweak the Mix node to make it more or less subtle.

You can also try the "Advanced Pointiness" from that link I shared in the comments above. It gets rid of the spottedness and might be more what you're looking for:

enter image description here

Where I have that "Noise" texture that would be where you put your actual texture; I just did that to give the cube some kind of texture. To adjust the darkness, you can change that -10 to anywhere in the range -10 to 10 based on how sharp you want the color. 0 would be gray and likely invisible.

$\endgroup$
3
  • $\begingroup$ It doesn't matter what I do with the color ramp, I just see a solid color: i.imgur.com/eKPjAU6.png $\endgroup$
    – endolith
    May 8, 2021 at 15:28
  • $\begingroup$ Oh I had to turn on "Cycles". Now it kind of works, but yeah the graininess of the surface makes it all speckled i.imgur.com/ZJNIL4D.png $\endgroup$
    – endolith
    May 8, 2021 at 15:40
  • $\begingroup$ I added another method above that you can try. $\endgroup$ May 10, 2021 at 5:22

You must log in to answer this question.

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