Hi there!
Is it a way to cast multi-source shadows for single 3d object?
I’ve tried this:
...
// init lights
var light:DirectionalLight = new DirectionalLight(1, -5, -2);
light.color = 0x00ccff;
light.position = new Vector3D(1000, 1000, 1000);
light.castsShadows = true;
_view.scene.addChild(light);
var light2:DirectionalLight = new DirectionalLight(-1, -5, 2);
light2.color = 0xff0000;
light2.position = new Vector3D(-1000, 1000, -1000);
light2.castsShadows = true;
_view.scene.addChild(light2);
_lights = [ light, light2 ];
// init shaded material
var mtl:ColorMaterial = new ColorMaterial(0xeeeeee);
mtl.bothSides = false;
mtl.gloss = 20;
mtl.specular = 0.5;
mtl.ambient = 1;
mtl.ambientColor = 0xff0000;
mtl.shadowMethod = new FilteredShadowMapMethod(_lights[0]);
mtl.addMethod(new FilteredShadowMapMethod(_lights[1]));
mtl.lights = _lights;
// init shadow-casting object (like cubes for example)
...
but with no success. Code raises an “opcode overflow” exception.
The problem is the second “addMethod” call. But… How to fix it? Please, help!