在 SceneKit 中,SCNLightTypeAmbient 类型的 SCNLight 是否会忽略 categoryBitMask 参数?

In SceneKit, does an SCNLight of type SCNLightTypeAmbient ignore the categoryBitMask parameter?

好像是!

这里忽略了categoryBitMask:

ambientLight = [SCNLight light];
ambientLight.color = [UIColor colorWithRed:0.994 green:0.715 blue:0.179 alpha:1.000];
ambientLight.type = SCNLightTypeAmbient;
ambientLight.categoryBitMask = 1;

有效!

ambientLight = [SCNLight light];
ambientLight.color = [UIColor colorWithRed:0.994 green:0.715 blue:0.179 alpha:1.000];
ambientLight.type = SCNLightTypeOmni;
ambientLight.categoryBitMask = 1;

没错,环境光的categoryBitMask被忽略了(缺少文档)。请注意,您可以配置材质以忽略环境照明:

aMaterial.locksAmbientWithDiffuse = NO;
aMaterial.ambient.contents = blackColor; (the default)