Jump to content

An example of Babylon 101's not work as expectated. [solved]


 Share

Recommended Posts

http://www.babylonjs-playground.com/#20OAV9#10

first example of Materials Chapter.

missing one diffuseColor expected to be reflected by the first groundMesh.

image.thumb.png.abc9f5e0fac28d3bff001f445c184200.png

 

if I change the for loop from 4 to 3, the missing diffuseColor will come back, and  it even have a specularColor of white(new BABYLON.Color3(1, 1, 1))!

image.thumb.png.31990822908ecdb77d2405a44e109466.png

 it's obviously something (maybe some configuration) that limit it's maximum color to be displayed.

But the article didn't mentioned.

My browser is Chrome 68.0.3440.75.

The maxSimultaneousLights of ground is set to 16 at the end of the code(if you explore the latest example.).

```

    var groundMat = new BABYLON.StandardMaterial("groundMat", scene);
    groundMat.diffuseColor = mats;
 
    groundMat.maxSimultaneousLights = 16;
    var ground = BABYLON.MeshBuilder.CreateGround("ground", {width: 4, height: 6}, scene);  
    ground.position.x = -2.5 + 5 * (i % 2);
    ground.position.z = 4.5 - 7 * (Math.floor(i / 2));
    ground.material = groundMat;
    }
            
return scene;

```

 

Link to comment
Share on other sites

Hi @Totooria Hyperion and welcome to the forum. Thank you for noticing this and pointing it out. The image on the materials page just below the playground you mentioned is a screen capture of the same playground taken at the time of its creation. This means that an update to BabylonJS has changed something and we will need to trace the changes and create a new playground for the page.

Link to comment
Share on other sites

On it!

It is due to a new change for spotlights. We had to introduce more data per light so now we know are over bugdet when having 16 lights.

I will probably fix the sample to restraint lights per material (using light.includedMeshOnly) if that works for you @JohnK

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