Jump to content

Directional light differences from 2.5 to 3.0-alpha


Hersir
 Share

Recommended Posts

Hi, after upgrading to 3.0-alpha I see differences in directional light in my scene that I exported from unity. I attached images and babylon file to show the difference.

Code for scene is:

const canvas = document.querySelector("#renderCanvas") as HTMLCanvasElement;
const engine = new BABYLON.Engine(canvas, true);
let camera;
BABYLON.SceneLoader.ShowLoadingScreen = false;
BABYLON.SceneLoader.Load("src/","light-demo.babylon", engine, function(scene) {

    camera = new BABYLON.ArcRotateCamera("Camera", BABYLON.Tools.ToRadians(180), 0, 3, BABYLON.Vector3.Zero(), scene);
    scene.addCamera(camera);
    scene.setActiveCameraByName("Camera");
    camera.attachControl(canvas, true);
    scene.clearColor = new BABYLON.Color4(0, 0, 0, 0);
    engine.runRenderLoop(function() {
        scene.render();
    });
});

 

Maybe thats some material issue from untiy?

babylon_2.5.png

babylon_3.0.png

light-demo.babylon

Link to comment
Share on other sites

Hi Hersir, thanks for the issue report and pictures.  I don't have solution, but I would like you to TRY something for me, if you have a moment.  I want to see if YOUR issue is related to another issue that I am having... with another project.

// a series of actions to correct the darkness and dullness of scaled spheres.
var yayManeuver = function(mesh) { 
    mesh.bakeCurrentTransformIntoVertices();
    mesh.updateFacetData();
    var myVertexData = BABYLON.VertexData.ExtractFromMesh(mesh, true);
    myVertexData.transform(mesh.getWorldMatrix());
    myVertexData.applyToMesh(mesh);
}

Could you please add this function to your scene code? 

Then, using scene.meshes array or scene.getMeshByName(something), get a reference to your sphere mesh (get it into a variable).  Then, run it through this function...  such as...   yayManeuver(sphere);    (if you please)

I am interested if you see a "correction" in the lighting... after sending the sphere through that code/func.  Thanks either way.  More comments sure to come, thanks again for the report.

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