Multiple shadows for single object

Software: Away3D 4.x

Avatar
kurono, Sr. Member
Posted: 12 October 2011 01:48 AM   Total Posts: 103

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(100010001000);
   
light.castsShadows true;
   
_view.scene.addChild(light);
   
   var 
light2:DirectionalLight = new DirectionalLight(-1, -52);
   
light2.color 0xff0000;
   
light2.position = new Vector3D(-10001000, -1000);
   
light2.castsShadows true;
   
_view.scene.addChild(light2);
   
   
_lights [ lightlight2 ];

// 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!

   

Avatar
TheSillyOne, Newbie
Posted: 01 November 2011 10:20 AM   Total Posts: 28   [ # 1 ]

It seems you would have to issue multiple shadow (depth) passes. There are other ways to do it, but I’m not aware of the implied limitation, because I haven’t done it myself, yet.

Best regards.

   

Avatar
kurono, Sr. Member
Posted: 12 February 2012 03:08 AM   Total Posts: 103   [ # 2 ]

http://youtu.be/MdsWJH6ozz4
How to practically achieve this cool effect? There’re multishadows, as I see.

   

Jon, Newbie
Posted: 04 May 2012 01:16 PM   Total Posts: 7   [ # 3 ]

Hi !

Same need here wink

Anyone ?

Thanx !

   

Etherlord, Newbie
Posted: 23 June 2012 08:58 AM   Total Posts: 6   [ # 4 ]

Bump!

Only way I see now is to create two (or more) meshes, one (or more) having material’s alpha = 0, but casting shadow anyway.

   

Radagast, Newbie
Posted: 07 November 2012 03:38 PM   Total Posts: 28   [ # 5 ]

Hi!
Like in subject - i would like to create multiple shadows for some light sources. All shadows should be on one ground (for example - Plane). Is it possible to apply more ShadowMapMethods to Material? Or maybe there is another way for casting Shadows in Away3D ? 

Best Regards
Radagast

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X