2

This tutorial explains how to make a shader that blend object with the ground by extracting the ground texture and applying it to the object. Here is an exemple:enter image description here

The blending is done with a color ramp creating a gradient along the Z axis enter image description here

Here is my version: enter image description here

I would like to use it in combination with a displacement modifier to increase realism. Turns out the gradient along the Z axis is not affected by the displacement (he remain straight) as you can see.

enter image description here Here is how the gradient is created in the shader

enter image description here

Is there a way to get this gradient affected by the displacement map in order to achieve a nice blend between ground and object (blend follows geometry) or any other solution to get a nice blend with an uneven ground, some geometry node maybe ?

here is the file for those who want to have a look:

Here are more tutorial related to the blending between floor and meshes: https://www.youtube.com/watch?v=6auecD4Rhx4&ab_channel=LOLDOBLENDER https://www.youtube.com/watch?v=5xYo0rE0aIM&ab_channel=PalurdasArts https://www.youtube.com/watch?v=4BTM4YPAeh0&ab_channel=Crompwell

pons de leon
  • 1,148
  • 1
  • 8
  • 21
  • I can't think of any easy shader method for this. Since displacement will operate on the normal vector of the faces, the displacement on the ground plane will clip randomly into the displacement from the shapes, breaking the illusion of a seamless texture. – Allen Simpson Jun 09 '22 at 19:57
  • In some cases the workaround could be Ambient Oclusion ... in more complex scenario could help Dynamic Paint with its proximity ... or there exists some OSL shaders that can detect two overlapping objects (just OSL is Cycles based not Eevee)? ... or I saw a few years ago some boolean material? So first question - Does Eevee matters for you? – vklidu Jun 10 '22 at 08:47
  • @vklidu the blending matter more than the engine (but good advantage if Eevee compatible since it would be easier to tweak it with real time result) – pons de leon Jun 10 '22 at 10:20
  • @Aubrey No because my question is about two different objects and one having a displacement modifier or a displacement node – pons de leon Jun 10 '22 at 16:58

2 Answers2

3

May I interest you in a Geometry Nodes solution? This one is good for medium to higher density meshes.

Geometry nodes tree

Rhaenys
  • 1,374
  • 11
  • 20
  • Looks promising ! Are you OK sharing the blend file ? I don't have much knowledge in geometry node and don't understand how it works ands what is the link between the texture and the geo node. – pons de leon Jun 10 '22 at 17:04
  • +1 Great :) I was just thinking about GN proximity too :) – vklidu Jun 10 '22 at 17:11
  • 1
    @ponsdeleon Done! – Rhaenys Jun 10 '22 at 17:35
  • 1
    @ponsdeleon just replicate Material and geometry node-tree for your Cube as used at Rhaenys screens. The core is to use the same name in material "Attribute" and "Store Named Attributed" node. Just as mentioned you would have to subdivide the Cube (it wouldn't work for 8 vertices cube) since it is based on faces. – vklidu Jun 10 '22 at 17:42
  • Works fine with version 3.2 of blender, (not with the 3.0 since the "Store Named Attribute" doesn't exist in this one) – pons de leon Jun 10 '22 at 19:40
2

From mentioned the simplest one is Ambient Occlusion ...

enter image description here enter image description here enter image description here

... disadvantage of it is of course AO is over all object (at the example dirt is covering around small cube as well). In Some cases you can eliminate it by your already used Z axis.

enter image description here enter image description here

vklidu
  • 36,165
  • 1
  • 61
  • 135