Hi everyone. It seems that .ambientColor
does not work in PBRMaterial. Here is the reproduction:
Is it expected or am I missing something? Thanks for reading!
Hi everyone. It seems that .ambientColor
does not work in PBRMaterial. Here is the reproduction:
Is it expected or am I missing something? Thanks for reading!
Hi!
materialPBR.metallic = 0
otherwise it reflects the non existing environment.
Thanks for your reply! After adding .metallic=0
, the .ambientcolor
does work.
However, I find that the parameter of .metallic
in the inspector panel is inconsistent.
What is the default value of .metallic
? If I comment the line of setting metallic to 0, the inspector still shows that the metallic value is 0. However, when I uncommented the code, the rendering results changed.
From what Iâve seen, if I hadnât added this line, the rendering result would be like the
metallic value is 1. I finally knew why I couldnât reproduce the rendering result of Blender. Why the default value is 1? This is unusual and seems not to be documented.
It also means that each PBRMaterial in Babylon.js should manually set metallic
to 0 which is really unexpected since Three.js, Unity, Blender, and other 3D software all set PBR metalness to 0 by default.
Here is the playground you can replay:
metallic
is null
by default, thatâs why you need to set a value.
Yes. When the .metallic
value is null, it will eventually set the value to 1. From this perspective, if we donât set the value, its effect is equal to setting the value to 1.
Is it possible to improve this behavior? It is a little bit uncommon and I guess it may confuse some users.
There could be so many apps running in production which relies on the default value of 1
already. I donât see this as a technical bug more like a discrepancy from the specification. Iâd like to have the default value as written in the specs too, however it would introduce a breaking change.
Letâs wait for the othersâŚ
OK. The ambientColor
problem is solved, and it works on PBRMaterial
after setting the .metallic
value to 0.
For the PBR default metallic value problem, Iâm posting it at: PBR default metallic value is not 0 which is unusual
And notice that the inspectorâs inconsistent metallic
display value issue is still not resolved.
This is only the case if you have a texture so the texture value multiplies with 1 ensuring you can set the texture only. In other cases you won t use the metallic workflow.
We won t change the default as it is too big of a breaking change.
Hi, thank you for your reply. The playground posted above explains that if an empty PBRMaterial is created, its rendering result is equivalent to metallic
set to 1. So it doesnât seem to matter if thereâs texture. When a user creates PBRMaterial without any other operation, its metallic effect is equal to 1. I think this behavior may be clarified in the documentation.
By default you are using the Spec/Gloss workflow, those steps are needed to use a metal/rough one:
https://doc.babylonjs.com/features/featuresDeepDive/materials/using/masterPBR#from-metallicroughness-to-pbrmaterial
In spec/gloss the reflectivityColor (aka specular) defaults to white.
I wonder whether the confusion is more about the current default value (white) or the default workflow ? Asking to better target the doc update.
The playground above has already set .roughness
to 1, which means it uses Metallic/Roughness mode.
Even if PBRMetallicRoughnessMaterial is being used, the default metallic value is still 1.
Make sense, I ll update the doc.
I agree with @sebavan (and sure we can always improve the doc). In the end I think (my opinion) we are doing a lot of âfussâ (sry) around something that need to be learned âper appâ or âper designâ no matter what. But then again, thatâs just my opinion.
You are probably right. Maybe this is just a âfussâ. But it took me several days to tune the rendering just because I didnât know the metallic value was 1. I feel like it could also happen to someone else. Are there any other default parameters in Babylon.js that differ from common expectations? Now Iâm even less sure. The design principle seems to be based on historical reasons rather than user experience.
Of course, Babylon.js team definitely has more contextual information on this, so Iâm just passing on what I perceive.
This is a choice we made to allow setting textures without factors issues. It is also 1 to be consistent with the specular case or any case where this is used as a factor so it prevents to set a value when a texture is used. If we were setting 0 by default, you would probably have posted that you use a texture and do not understand the value is unused and you spent several days figuring it out
Also if you think about common expectations, GLTF is probably one of the few standard nowadays and it is 1 as well:
So, yes, this is an arbitrary choice aligned with an ISO standard simplifying the use of textures so as long as the doc explains it it should not be an issue. If you want to be sure the doc is the most helpful, feel free to do the PR there and I will gladly merge it.
I canât agree more.
You have the answer:
and you have a solution to your problem:
and youâre still fussing around
Dude, it took years for hundreds of contributors to give you babylon.js, for free.
Peace!
OMG. I can feel the heat May be you should cool down a little with a fresh beer and a break ?
Hum? Likely true and then, I wasnât here at the beginning neither I donât think this kind of comment is appropriate (sry). We should be happy that there are people wanting to help improve and normalize the framework to push it even further and to the next level, shouldnât we? In my opinion, itâs just a matter of finding a balance between the pros and cons. Nothing easy, nothing easy for sure.
What heat? Iâm OK I believe @yar2001 will not take it personally because I didnât mean to harm anyoneâs feelings. You know me, Iâm the clown, the comedian, the jester, the punster, the meme maker around here
@yar2001 one more time - sry if youâve had bad feelings after you saw my meme - but itâs damned funny and youâll take it as an advice just to move on for now with that what we have availableâŚ
If itâs not neither his comment about spending days to find out something is appropriate. Trying to convince others of your truth by how much time you spent on it is not appropriate. Thatâs why I responded like that.
@yar2001 's other technical observations are ABSOLUTELY appropriate.
Well, one would first have to define âcommon expectationsâ. Common in which sense? A 3D engine, a real time 3D engine? Unity, unreal, three.js (they are already all different)? Common expectation as you say, is not a norm or a convention.
Well, as far as I know, the design principle is historical in that it is based on the pillars of the BJS experience: Open, free, simple, reliable, powerful. One of these pillar being âreliableâ (read âbackwards compatibleâ). So if your question is: âAre there choice of design made for âsimplicityâ or to ensure the largest use case, per design?â The answer is âabsolutelyâ.
If your question is: âAre there some disparities, approximations in the names or default values of parameters?â The answer is âIâm afraid there isâ.
If your question is: âIs BJS going to change it all at once and while doing so, break its promess and temper with one or more of the pillars thatâs part of its DNA?â The answer is: âI sure hope it wonât⌠I sure hope the Team wonât allow this to happen⌠and if so, youâre gonna hear my voice for sure â.
Fair enough. Thatâs what we all do in the beginning. I totally remember doing this for a while. But in the end, the framework and the values arenât just based on âperceptionâ. They cannot be. I believe the most important is that it remains both âconsistentâ and âtrue to its valuesâ. Again, as always, my opinion only. And meanwhile, have yourself a great day