cocos2d/cocos2d-x — pull request #8162 by super626 (2014-09-25 14:39:38+00:00)
Title: 3D Light

3D light support for 3D sprite
There are 4 types of lights, Ambient light, Directional light, Point light, Spot light

Usage,
auto light = AmbientLight::create(Color3B(200, 200, 200));
light->setLightFlag(LightFlag::LIGHT0);
addChild(light);

auto sprite = Sprite3D::create("xxx.c3b");
addChild(sprite);
sprite->setLightMask(LightFlag::LIGHT0); // this 3d sprite only receive light from LIGHT0

NOTE:
1. There are shaders with light and without light
2. Use shader with light when there are lights whose flag AND sprite's mask is true, use shader without light other wise.
3. Directional light, Point light, Spot light will not take effect when there is not normal on the model. Ambient light affect on models both with normal and without normal.