Jump to content

Edges / Rendering Process Order


Cobalt
 Share

Recommended Posts

Hi everyone.

Developing for few month on babylon now, I'm currently facing an issue.

I wish i could display edges of a mesh through an other one. For example, i'm a super hooman and wanna see meshes through a wall, just by their edges. I don't want to make a transparent  wall by the way, this is not the purpose for multiple reasons.

It appears to me that the edges rendering is done by the mesh (by its AbstractMesh inheritance) itself and block the way i want to simulate this behavior.

I'm a little bit confused, even on my method and the way to do it, have you ever facing this behavior and how did you make it ?


Thanks.

Link to comment
Share on other sites

Hi Cobalt, welcome to the forum. 

What you ask... is a strong challenge.  First, let me show you mesh.showBoundingBox

http://www.babylonjs-playground.com/#14VWOV#6

You can see these bounding boxes through a wall (somewhat "x-ray vision"), but this is probably not sufficient for your needs.

Another idea.  BJS has a feature called a RenderTargetTexture (rtt)... and it can be used to display the image from any camera... upon the material of any mesh in the scene.

http://www.babylonjs-playground.com/#1WROZH#6

That scene uses 4 cameras and 4 renderTargetTextures (rtt)... displayed (via material textures) on 4 planes that are parented to the camera.

Let's try our first scene... with ONE rtt... displayed on a plane... positioned against a wall.

http://www.babylonjs-playground.com/#14VWOV#8

Now we can see-through the wall... sort-of.  Note:  RTT's have limited/no anti-aliasing available.


These are some ideas.  Not very good ideas... but still ideas.  :)  Possibly, a custom shader could do this, too... but I am not a shader expert.

Hopefully, smarter people than I... will comment soon.  X-ray vision is advanced tech.  :)

Link to comment
Share on other sites

Thank you both for your answer,

I'm currently trying to implement NasimiAsl's one and i'm facing issues. My meshes are animated and even when i try to animate the one on your playground it does not work anymore.

So i've looked a bit deeper in the source code of babylonX.ShaderBuilder extension and saw those IMap options.

I've tried few things on it but nothing succeed. The code is a bit complex to me. Have you ever try that before ?

Link to comment
Share on other sites

Hi again, C.  Do you know how to "ping" people inside a post?  We need to ping NasimiAsl...  see if he knows how to activate his idea... but still be ok for animated mesh.

First, type @

... then we follow it with a 'n'   (@n)

At this point, a panel should open, showing a list of forum-user names.  Keep typing...

@nas

Now you should see NasimiAsl's name in the list.  Choose it, and his name will be added to the post... colored.  This also triggers the forum's
notification system... if NasimiAsl has it turned-on for himself.  He will know that you are requesting him to read your post.  :)

Now I will ping my good aquaintance far away...  "Naz"  :)  Hey @NasimiAsl, do you have a moment to tell us about using animated mesh with your x-ray vision method?  Thanks!

I will ping you, too, Cobalt... so you can experience a notification.  :)  Hi @Cobalt!  You probably got one when I replied to your thread, too... so you know them already.  Sorry for teaching if you already know how to do pings. 

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.

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

Loading...
 Share

  • Recently Browsing   0 members

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