1

I'm trying to make a FPS game using babylon.js as a framework. I want the player to be able to see an outline of their allies through walls (so they can know where they are and what they are doing). As a reference, here is an example I found on google from the game Paladins:

image to describe what I want

The best thing I could find on the babylon.js website (and on google) is how to do the outline: (https://doc.babylonjs.com/how_to/highlight_layer)

var hl = new BABYLON.HighlightLayer("hl1", scene);
hl.addMesh(sphere, BABYLON.Color3.Green());  

While an effect like this is pretty much what I want, it isn't visible though walls. Is anything like this possible in babylon.js? Thanks in advance!

1 Answer 1

0

To render something "on top" of something else you can use rendering groups.

The short documentation can be found here - https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups , but the basic concept is - the higher the rendering group, the later it renders.

You can see it here in action - https://www.babylonjs-playground.com/#2338DN#3

There was an active conversation about the same subject in the forum, which can be found here - https://forum.babylonjs.com/t/highlight-through-objects/8002/3 , credit goes to sebvan

1
  • the BABYLON.Mesh.addExcludedMesh() was what I was missing, thanks a lot Jan 21, 2020 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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