Why doesn't Babylonjs have an outline

I saw that the outline effect of Threejs is based on the * [Sobel operator], and it also supports penetration for entity models.

And when the highlight layer is turned on, I see that dracall also doubles, and using exclusion models in complex scenes is clearly not flexible enough.
Does BBL have plans to add post-processing similar to outline

1 Like

This should help: Rendering Edges | Babylon.js Documentation

That too: Edge Detection | Babylon.js Documentation


The edge contour of this can deeply penetrate the solid model, but the instance you provided me still cannot meet my needs, and the drawcall has increased too much

you can make one yourself too : P

steps,

  1. make an rtt, push it into scene.customRenderTargets
  2. make sure the renderlist of that always only has meshes you wanna outline
  3. make a postprocess that detects edges of that rtt w/ sobel and overlays them onto the scene

smth like this

this doesn’t use sobel but the rest of the steps are pretty similar

4 Likes


nice! This is what I want, but when the perspective changes in the scene, there is airflow where the contours intersect. I don’t know how to handle it better

not sure what you mean, can you elaborate : O

When I rotated my perspective, I noticed that there were airflow waves at the intersection of objects

if you’re talking about gaps between outline and mesh, it could be cause I did a diff of gaussians on it to give it a worn out sketch pen look, if you change the shader to a smol sobel one, I think you’ll get the results you want.

it’s way simpler than the current shader, I can make an example if you need

The intersections of spheres warble I think he means. Like a precision issue or something.

1 Like

oh :open_mouth: more MSAA samples should fix those ig