New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MeshBasicMaterial: Why are there .aoMap, .lightMap, and .envMap properties? #15548
Comments
Some history: #9975. |
Some earlier history: #6263. |
Regarding the environment map, the PBR materials treat It was not originally like that; that is why the The original three.js materials have largely remained unchanged since their introduction. |
The root of Don's question here comes from the glTF My question on this is, should clients of GltfLoader.js be smart enough to detect Perhaps the environment map could be passed into the glTF loader, so it could make its own decisions about which materials need the environment? |
@emackey Your point is well-stated. As far as I am concerned, this is a legacy three.js issue, and I do not have a strong opinion one way or the other how we resolve it. |
Thanks @WestLangley — that makes more sense knowing MeshBasicMaterial is treating envMap differently than the PBR materials. I do think it would be a step too far for GLTFLoader to take steps ensuring that manual user assignments to a material will do nothing... That MeshBasicMaterial supports these other maps was surprising to me, and I'm not sure I understand the purpose (as a user, why not merge map+aoMap+lightMap into a single texture for MeshBasicMaterial? to use separate UVs?) but I don't feel strongly enough to suggest removing support. Since both creating unlit materials in glTF and adding an environment in three.js are "opt-in" choices, I don't necessarily think a change is needed. Adding a |
I think setting |
Ok, |
Oops, I'm just aware now of that we're talking about not only
This means, should |
The original motivation for the question was just about I strongly think we should not prevent aoMap or lightMap from being applied, just as we would not prevent a user from changing a material's color, just because the glTF file says it is blue. |
Good point. Yeah, setting Starting to think it may be good we add a note to the doc and ask users to check if material is not scene.traverse(object => {
if(object.material && !object.material.isMeshBasicMaterial) {
object.material.envMap = envMap;
object.material.needsUpdate = true;
}
}); Regarding |
Ok, leaning against making a change here but more feedback is welcome. |
The MeshBasicMaterial docs mention that it supports .envMap, .lightMap, and .aoMap. I'm not sure how that aligns with its definition,
This material is not affected by lights.
. Not affected by analytic lights? What's the purpose of a light map or ao map here?The text was updated successfully, but these errors were encountered: