Sign in to follow this  
snupas

Similar material diffuse colors inconsistent with different light intensities

Recommended Posts

Hello,

I'm trying to match the colors of a material with a diffuse texture, and a material which has a matching diffuse color.

However, I'm not getting a lot of detail on the diffuse texture under the default light intensity, and when I ramp it up, the two materials change colors at completely different paces.

1539865634_Screenshotfrom2019-01-2316-02-44.png.9e7b09739e4d3965fbac379cc0566f48.png905292277_Screenshotfrom2019-01-2316-06-52.png.b441528f18451d336114bc63f3f2a2ed.png

As you can see, I'm getting them to mostly fine on the left side, but I can't make out any facial detail, on the right you can make out facial detail, but it also illuminates the rest of the skin way too brightly.

Meanwhile in Blender I can achieve this:

1944119505_Screenshotfrom2019-01-2316-01-02.thumb.png.ff9663571cc5c403311122601b0bcf0b.png

 

With blender render and the default light. Similar results with a hemi-light. No need to ramp up the intensity, but even if I do, all materials brighten equally:

1450830132_Screenshotfrom2019-01-2316-07-47.png.89202ee0c09f0a40bed1f690daf97fb2.png

Using the exact same texture both in blender and babylonjs as well. Lambert material in blender, default in babylonjs.

This is the lighting and material code:

var light = new BABYLON.HemisphericLight("hemilight", new BABYLON.Vector3(0,1,0), scene);
    light.intensity = 1; //3-4 to see any revelant facial detail

var skincolor = new BABYLON.Color3.FromHexString(globalSkin);

//meshes array are just different body elements of the same body

meshes[0].material.diffuseColor = skincolor; //skin color applied everywhere else besides the front face
meshes[0].material.specularColor = new BABYLON.Color3(0, 0, 0);
meshes[1].material.diffuseColor = skincolor;
meshes[1].material.specularColor = new BABYLON.Color3(0, 0, 0);
meshes[2].material.diffuseColor = skincolor;
meshes[2].material.specularColor = new BABYLON.Color3(0, 0, 0);

var f = new BABYLON.StandardMaterial("myMaterial", scene); //face texture
f.specularColor = new BABYLON.Color3(0, 0, 0);
f.diffuseTexture = new BABYLON.Texture("../u/"+id+"/f.jpg", scene);
meshes[3].material = f;
        

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.