I’ve created a new PBRMetallicRoughnessMaterial material with a roughness of 0.5 and an environmentTexture.
Assiging it to a sphere in a new scene works fine.
When i load a scene (exported form 3dsmax) and assign this material to an object, the material is now highgloss. Even when I add a sphere by code again in this loaded scene, the material is completly glossy (environmentTexture is not blurred).
I’ve read in some threads to modify the lodGenerationOffset & lodGenerationScale of the environmentTexture with no success.
What I’m doing wrong ?
Hello and welcome to the forum,
It is hard to say without looking into your scene. Could you create a repro in the playground ???
This is pretty strange that using the material on a different mesh makes it glossy.
Here is my Example in playground.
I can’t load my own scene (3dsmax export) so i took the dummy3.babylon scene
With this babylon file everything works fine - in playground and on my desktop.
So maybe theres a problem with the 3dsmax-exporter ?
It is really hard to say without your model as I am expecting the swap to work
Ok, I made several exports with a simple sphere from 3dsmax. I exported a binary file and a “normal” babylon file.
Load the normal babylon file the sphere looks as expected, when I assign my matrerial to it, means i can set the roughness.
Same export but loading the binary file, the roughness settings are ignored and the materiela looks always high glossy !
Is this a bug ?
I often swap materials at run time no matter what exporter is used without issues. I do not think it is a bug but probably a misuse of some APIs, you could host the babylon export on github or others in order to create a playground:
Ok. For completness I updated my example. You have to switch between the loaded files in line 6 / 7.
But in playground everything works fine. When I do the same localy, the “binary sphere” is high gloss.
I don’t get it.
Are you using the same environment ?
var hdrTexture = BABYLON.CubeTexture.CreateFromPrefilteredData("/textures/environment.dds", scene);
Yes…
So there is smthg wrong in your local code, this is the only reason I can think about. Would you mind sharing the smallest local repro you have ?
Ok, i found the problem.
In the “playground-code” i use BABYLON.SceneLoader.ImportMesh to load a mesh. In my “desktop-code” i use BABYLON.SceneLoader.Load and load a scene…
Thanks for your patience, sebavan!
I was thinking about that, when you load the scene like that, you import default hemispheric light also, so maybe specular of that light was causing the issue. I may be wrong, but when I saw this post that’s what came into my mind. But I saw you used ImportMesh so I abandoned that theory.