Jump to content

Disable backfaceCulling for all meshes


UeliUeli
 Share

Recommended Posts

Hi there

I'm a newby in babylonjs and i'm trying to build a content viewer for 3d models adjusted to my needs. Now: Is there a method to disable backface culling for all meshes of a scene? 

I have tried it with scene.meshes, but i does not work:

 

BABYLON.SceneLoader.loggingLevel = BABYLON.SceneLoader.DETAILED_LOGGING;
BABYLON.SceneLoader.Append("../../", "...", scene, function (scene) {                      

scene.meshes.backFaceCulling = false;

for(var i=0; i<scene.meshes.length; i++)    scene.meshes.checkCollisions=true;

...

 

Help is much appreciated, Thanks!

 

Ps: Additional question: Would it be possible to give all the backsides of the meshes one color?

Link to comment
Share on other sites

Hello and welcome!

you can this:

scene.onNewMaterialAddedObservable.add(function(mat) {
mat.backFaceCulling = false;
});

Regarding coloring backside: This is not directly possible unless you create a second mesh for the backfaces

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