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

北城以北 提交于 2019-12-10 13:49:39

问题


It seems to!

Here the categoryBitMask is ignored:

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

Here it works!

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

回答1:


That's right, ambient light's categoryBitMask are ignored (documentation is lacking). Note that you can configure materials to ignore ambient lighting:

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


来源:https://stackoverflow.com/questions/29190578/in-scenekit-does-an-scnlight-of-type-scnlighttypeambient-ignore-the-categorybit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!