Jump to content

Planar section cut through geometry


Recommended Posts

Hi guys,

I'm looking for a technique to render planar section cuts through arbitrary geometry in realtime.

For now, I have tested BABYLON.CSG  but I found it to be perhaps a bit of a overkill for my case, where all I need is a planar cut (also, I suppose it is not intended to be used in realtime, since it is very slow)
I have also used `scene.clipPlane` which is much more efficient but the clip edges are missing.

I have found a technique that uses stencil buffers to retrieve the missing clip edges http://glbook.gamedev.net/GLBOOK/glbook.gamedev.net/moglgp/advclip.html

It seems possible to use stencil buffers with the BABYLON.JS engine (https://doc.babylonjs.com/classes/3.0/engine#setstencilfunction-stencilfunc-rarr-void), but I'm not sure how to use it to solve my issue :/.

Here is my playground: http://www.babylonjs-playground.com/#UCFKM#23

Link to comment
Share on other sites

On 10/28/2017 at 12:41 AM, Arte said:

Hi @massile and welcome.


Is this what you looking for?

Hi Arte,

I admit that the method listed in my original post can work with StandardMaterial. However, if I would like to work with PBR materials, there is no easy way. I am wondering if it is possible to customize the PBR material classes and Scene (which holds a single clipplane) so that they can work with multiple planes?


Link to comment
Share on other sites

  • 2 weeks later...

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...