Jump to content

Alpha and Mesh edges Rendering


Recommended Posts


I'm making randomly generated mini maps. I'm generating height with a noise generator and need to add "water" when the height is < 0.

https://freckle-ripper.hyperdev.space/ (env are randomly generated, refresh for an image with water).

The problem is the following : I draw the boxes' edges with the enable edges rendering function. When the edges are belonoging to boxes in the sea, I'm expecting to see them at least "blurry", cause there is some water above it. Right now, the edges doesn't seem to be afected by the fact that there is a transparent mesh above it. The edges are way too clean for something under a mesh. 

Is there a way to make it look as if it's underwater ?

Thank you

Link to comment
Share on other sites

Hi Quadear.... good to see you again.

   I'm no expert, but I know two other ways to do edge outlines.  Both suck, but both are not post-processing effects, and therefore SHOULD be affected by semi-transparent mesh atop.

#1.  The linesMesh method.  http://playground.babylonjs.com/#QKQHS#375

That is a miserable "remake" of .showBoundingBox, except you can't see back-side lines THROUGH the mesh.  It takes a serious bit of code per box, likely diminishing performance.

#2.  The 6-plane boxMaker function, with slight gaps at the edges, and another colored box put inside.  http://playground.babylonjs.com/#TYAHX#69

This is also quite a miserable task, and performance damaging. 

Deltakosh's idea is much wiser.  :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...