Why is 'environmentIntensity' of PBRMetallicRoughnessMaterial not public?

I’m using PBRMetallicRoughnessMaterial which inherits from -> PBRBaseSimpleMaterial -> PBRBaseMaterial.

I found that the environmentIntensity property is not public in PBRBaseMaterial, what is the reason?
what confused me is, I also found a same property but public in PBRMetallicRoughnessBlock for NME…


That’s because PBRMetallicRoughnessMaterial is a subset of the full PBR material and only makes some properties available to keep things simple. If you want access to all PBR properties, use PBRMaterial instead.

yep I know this purpose, because there is _environmentIntensity in the PBRBaseMaterial base class already, I just wonder why this can’t be a public property. what I feel is properties with ‘_’ prefix are just private stuffs which better don’t access them from outside? but actually I feel this one can be as a public one.

Well, it could be, but the question would be: which properties of PBRBaseMaterial should be made available in PBRMetallicRoughnessMaterial? There are a lot, why only make _environmentIntensity visible? For eg, there are: _directIntensity, _emissiveIntensity, _specularIntensity, _opacityTexture, parallax properties and so on.

I think the design goal of PBRMetallicRoughnessMaterial (and PBRSpecularGlossinessMaterial for that matter) was to have a simple PBR material easily configurable without too many properties. If one wants more control, there is PBRMaterial.

1 Like

emmm, ok… thanks.