massile Posted October 27, 2017 Share Posted October 27, 2017 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 Quote Link to comment Share on other sites More sharing options...
Arte Posted October 27, 2017 Share Posted October 27, 2017 Hi @massile and welcome. PG Is this what you looking for? Quote Link to comment Share on other sites More sharing options...
BlackMojito Posted October 30, 2017 Share Posted October 30, 2017 On 10/28/2017 at 12:41 AM, Arte said: Hi @massile and welcome. PG 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? Thanks Quote Link to comment Share on other sites More sharing options...
Arte Posted October 30, 2017 Share Posted October 30, 2017 Hi @xuchen_shadow, I have never worked with PBR materials. I think @adam right person to ask? Quote Link to comment Share on other sites More sharing options...
adam Posted October 31, 2017 Share Posted October 31, 2017 @Sebavan is the PBR master. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted October 31, 2017 Share Posted October 31, 2017 I think @NasimiAsl was working on making pbr a custom mat as well ? If not agree this will be tougher and in this case using a stencil buffer where you draw your planes to discard some regions might be the easiest. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted October 31, 2017 Share Posted October 31, 2017 yes dear @Sebavan wait for this tools that is so useful i almost have result but wanna fix custom material bugs and add pbr tools in to custom material Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted November 13, 2017 Share Posted November 13, 2017 hi @Sebavan http://www.babylonjs-playground.com/#7AIII8#10 glass material http://www.babylonjs-playground.com/#7AIII8#12 http://www.babylonjs-playground.com/#7AIII8#11 metal+roughness http://www.babylonjs-playground.com/#7AIII8#13 http://www.babylonjs-playground.com/#7AIII8#14 i start make it in custom material too ( but need fix some problem first ) RaananW, jerome and Arte 3 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 13, 2017 Share Posted November 13, 2017 Don't forget to add https to your cdn.rawgit: glass: https://www.babylonjs-playground.com/#7AIII8#17 MR: https://www.babylonjs-playground.com/#7AIII8#18 NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.