1
$\begingroup$

I have a small strip mesh that is placed over a larger terrain mesh. The polygon of the strip overlap perfectly with the polygons on the terrain.

Demonstration

I want to tell Eevee that the strip mesh should always appear above the terrain mesh. But I don't want to render the strip mesh above the entire scene.

With OpenGL this is very easy to do. Just render the terrain mesh first and then render the strip with the Z compare function set to less or equal. Graphic engines typically have render order integers that can be set on meshes or materials to tell who must be rendered after who. But I can't find anything similar in Blender. This sounds like a very basic feature so it must exist right?

I don't want to achieve this by placing the strip slightly above the terrain. This is a dirty trick that will be unnecessary and cause trouble when the scene will be exported and used in a game engine.

Also, the strip is semi transparent so we don't want to remove the terrain under it.

Any advice?

$\endgroup$
7
  • $\begingroup$ "Graphic engines typically have render order integers" and Blender has view layers $\endgroup$ Commented Sep 9, 2023 at 9:25
  • $\begingroup$ Yes I checked view layers. But, as far as I understand, I can only use them to display some objects in front of everything else or behind everything else. This isn't what I want. I want polygons to be sorted by camera distance (as they normally are) but use a value as a tie breaker when some polygons overlap. Can I do that with view layers? $\endgroup$
    – Chiw Neko
    Commented Sep 9, 2023 at 17:18
  • 1
    $\begingroup$ This is exactly how specifying render order in a game engine works, no? Can you point out a specific engine and its specific functionality to make it clearer what you want? $\endgroup$ Commented Sep 9, 2023 at 17:44
  • $\begingroup$ @MarkusvonBroady -- Chiw writes: "I want polygons to be sorted by camera distance (as they normally are" -- so individual faces of your mesh to render by distance from camera. $\endgroup$
    – james_t
    Commented Sep 9, 2023 at 18:06
  • $\begingroup$ I added another example to my answer below: set the strip Alpha to <1.0, and in the strip Material Properties, Settings, set Blend Mode to "Alpha Blend" or "Alpha Hashed"... $\endgroup$
    – james_t
    Commented Sep 9, 2023 at 18:19

1 Answer 1

1
$\begingroup$

There are several possible approaches.

Try using a boolean modifier on the terrain mesh, if the strip mesh overlap perfectly covering the whole area.

Another approach might be to use a Solidify modifier on the strip mesh, to add only the slightest of (0-offset) thicknesses, so that the strip obscured and the terrain is not rendered at that point.

Have matching vertices in both strip and terrain mesh? Add a material to the terrain mesh and make it clear (see-through, Transparent BSDF), select the faces you want to not render, and assign to this clear material.

I did the solidify (you don't want) and transparent approaches (should work for you)

enter image description here

in the attached

UPDATE:

Another example for Eevee is to set the strip Alpha to <1.0, and in the strip Material Properties, Settings, set Blend Mode to "Alpha Blend" or "Alpha Hashed"...

$\endgroup$
2
  • $\begingroup$ A boolean modifier would just hide the polygons under the strip. We don't want that because the strip is semi transparent. I will update the question to specify that. Solidifier would move the polygons away which it what we are trying to avoid. Using several material might be the best option here. But it still kills me that there is no way to set the render order in Blender. $\endgroup$
    – Chiw Neko
    Commented Sep 8, 2023 at 21:49
  • $\begingroup$ @ChiwNeko -- if your strip is semi transparent, then I'm not sure secondary material will work for you either! $\endgroup$
    – james_t
    Commented Sep 9, 2023 at 17:55

You must log in to answer this question.

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