Jump to content

Problem of color rendering of a Blender object


Dams
 Share

Recommended Posts

Hello guys,

I am experiencing a weird behavior with Blender and Babylon on the color of my object.

I created a simple Mesh in Blender: a plate with Subdivision Surface then I extruded one side and use Crease parameter on edge to get a nice roundish.

When playing with it in Babylon.js, the rendering is really weird: color is not the same aspect on all the surface and on the bottom face as well.  

 

My code is pretty simple:

BABYLON.SceneLoader.ImportMesh(…)

pbr_material = new BABYLON.PBRMaterial("pbr_material", scene);

pbr_material.microSurface = 0.96;

pbr_material.albedoColor = new BABYLON.Color3(0.206, 0.94, 1);

pbr_material.reflectivityColor = new BABYLON.Color3(0.05, 0.05, 0.05);

pbr_material.cameraExposure = 0.66;

pbr_material.cameraContrast = 1.66; 

 

Even in SandBox, my object looks not homogenous.

I tried many many ways (change mesh/vertice in Blender, play with light, colors…) to understand this behavior unfortunately without success…

 

Do you have any ideas to solve that?

Thank you very much !

 

 

 

Capture d’écran 2016-08-12 à 12.40.35.png

Capture d’écran 2016-08-12 à 12.40.45.png

TestSubSurf02.babylon

Link to comment
Share on other sites

Hi @Dams, welcome to the BabylonJS forum.  Sorry to hear you are having problems.  It's probably inverted normals or something like that.  Who knows what evil those darned Blender crease-benders... do.  :)

I noticed you said "plate" and not "plane".  That's interesting in itself.  A plate being somewhat like a box?  *shrug*

No matter.  I published your .babylon file to my github nest, and kindly escorted it into our cool BabylonJS online playground.  Take a look, if ya please:

http://playground.babylonjs.com/#WMW8#1

Yep, it looks kind of strange.  I'm not sure what's wrong, but I'll stare at it and think about it. 

Maybe others will jump-in and have some good ideas.  I still suspect normals.  Got a re- computeNormals choice in Blender?  Maybe there's one here.  Something is not normal about your normals.  :)  Talk more soon.

Link to comment
Share on other sites

Hi @Wingnut and @gryff !!

Thanks a lot for your replies !

I recalculated Normals under Blender (edit mode > A (to select all faces) > Recalculate ("Inside" checked and uncheked). But unfortunately, it does not change anything ! :-(

I need you to give me some advice to solve this problem. Any other idea ?

Thank you very much !

 

Link to comment
Share on other sites

Hi, @Dams 

i'll jump in with a quick note, the colour's you see on any object with curves/bends will vary slightly, due to lightning not being able to reach all areas with the same "strength" / intensity.

and as others already mentioned it, also seemed like you had a slight issue with your normals in your pictures.


I didn't quite understand what you were after, but using @Wingnut's PG as a base, this is what i got.
Note that i reduced the light intensity slightly for better contrast between the edges & sides of the mesh, aswell as disabled backFaceCulling.

Take a look at this PG: http://playground.babylonjs.com/#WMW8#4

Link to comment
Share on other sites

2 hours ago, aWeirdo said:

I didn't quite understand what you were after, but using @Wingnut's PG as a base, this is what i got.
Note that i reduced the light intensity slightly for better contrast between the edges & sides of the mesh, aswell as disabled backFaceCulling.

Nicely done @aWeirdo ! :) If disabling backFaceCulling is producing the correct results then it seems to me again that it is a problem with the normals.

 

21 hours ago, Dams said:

I recalculated Normals under Blender (edit mode > A (to select all faces) > Recalculate ("Inside" checked and uncheked). But unfortunately, it does not change anything ! :-(

I'm not sure what @Dams means by ""Inside" checked and uncheked" but I would Select all the faces ->Normals-> "Recalculate Normals Outside".  Clicking on the "Inside" option just recalculates them on the inside, and it does not toggle them by clicking a second time

cheers, gryff :)

Link to comment
Share on other sites

Thanks to aWeirdothe result is better but still weird with an object bigger... I need to investigate much more to solve this behavior.

For the normals, I found the good way on Blender but still not expecting an acceptable result... I even tried to flip the top face to understand the way it works but nothing helps... On Blender, Normals seem OK for all faces :-(

Maybe it comes from my object in Blender with the way I draw it... I will try other shapes.

If you still have ideas, I will take it :-)

Link to comment
Share on other sites

I am back to you as unfortunately I am still in the mess :-(

My Normals seem OK (see image enclosed) ; and I recalculated them under Blender and by code (as suggested by Pryme8) but the result is still not acceptable… (see image enclosed).

 

I did several tests on Blender side and the behaviour occur when I create rounding (with Subdivision Surface).

 

The problem is the same with PBR material and Standard one…

 

aWeirdo, you found a quite nice equation on my first drawing. Are you able to do the same with this bigger drawing? I need you. It will be very nice!

 

Maybe I should use another technique on Blender to do a rounding. If someone has any idea ?

Normals.png

Strange color behavior.png

TestSubSurf04.babylon

TestSubSurf04.blend

Link to comment
Share on other sites

@Dams : I took a look at your .blend file and added a Hemi lamp directly above the "table" then rendered it in Blender - both the "Cycles" and "Blender" renderer see top part of image below.

I exported the from Blender to a .babylon file and viewed that in the Babylon sandbox - lower part of image.

To me a Hemi lamp emits light as shown in the attached pic with light coming from all directions

:skylight_sky.jpg

yet the ends of the table look like they are not receiving light in this manner - rather the light is coming straight down.

And just so you know, I applied the Subsurf Modifier first and then checked the normals

cheers, gryff :)

renders1.png

Link to comment
Share on other sites

9 hours ago, Dams said:

Unfortunately i tried to play with different lights and different orientation without success.

Do you have any advice on lighting ?

Thank you !

Hello

long story short, you can give a picture depth by just adding shadows somewhere, this is art history. All of the provisos achievements have been also applied to the present. That you can draw a simple line on your screen, goes back to a crazy math formula in the 19th century  

if you want a crash course in lightning go on youtube an watch a tutorial how to set up a lighting for studio shooting. The digital emulation of reality is pretty accurate those days

Best

Link to comment
Share on other sites

Hi Gryff,

Thanks a lot for your experimentation but i certainly missed something :

- the model is fine under Blender (all surface look the same)

- the model is NOT looking fine with Babylon.js even when using a Hemi light. And that is the problem ! And I am sorry but i still do not understand how to solve that... ?

@Nabroski : i will Google lighting for studio shooting. Thanks.

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