I am making a very small 3d game (isometric view) using papervision3d. I needed some dynamic shadow element for some elements. I came across this very wonderful class that does the shadow casting from here. So I used ShadowCaster class to cast my shadows of my displayobject3d. I would need this following things for my purpose:
1) A do3d, target object whose shadow has to be created/rendered
2) A light source
3) A plane at which shadow would fall/render.
4) And of course our ShadowCaster class 😀

So i started playing with the shadowcaster class to get my hands dirty. I was trying to cast shadows of 4 plane on another surface plane. I created a light source. So here is how i was casting shadow with the code:

var blurr:BlurFilter = new BlurFilter(10, 10, 1);

shadowCaster_one = new ShadowCaster("plane1_shadow", 0x000000, BlendMode.MULTIPLY, 0.3, [blurr]);

shadowCaster_two = new ShadowCaster("plane2_shadow", 0x000000, BlendMode.MULTIPLY, 1, [blurr]);

shadowCaster_three = new ShadowCaster("plane3_shadow", 0x000000, BlendMode.MULTIPLY, 0.3, [blurr]);

shadowCaster_four = new ShadowCaster("plane4_shadow", 0x000000, BlendMode.MULTIPLY, 1, [blurr]);

Above I created 4 separate shadowcaster to cast on 4 separate plane.

override protected function onRenderTick(event:Event = null):void


shadowCaster_one.castModel(plane1, light, shadowPlane);
shadowCaster_two.castModel(plane2, light, shadowPlane);
shadowCaster_three.castModel(plane3, light, shadowPlane);
shadowCaster_four.castModel(plane4, light, shadowPlane);

Above I am rendering four shadows of four separate planes. I am rendering them on onRenderTick. Now its time to test it in browser.
1) Google chrome browser: Smooth run
2) Firefox: smooth run
3) Safari: smooth run
4) Opera: smooth run
5) Internet Explorer: FPS:1~0 (very very very very lag)

Yes there was very massive frame rate drop on internet explorer, interactive response was almost none. All other browser ran the game smoothly. Only one thing came to my mind:” Internet Explorer sucks”, but i knew that i had to optimize my code and for that i had to find the code that was consuming so much memory resource. My first suspect was shadow casting code at onRenderTick(), so i commented all shadow casting line and ran it again in internet explorer and yeah you guessed it correct that it ran smoothly. But i had to cast the shadows so i need to optimize this part. So i did some alteration:

First instead of adding those 4 planes directly to scene, i added them to one do3d.


Second, instead of creating 4 shadow caster, i created only one caster that would cast onto displayobject3d which has four planes as its children.
shadowCaster = new ShadowCaster("plane4_shadow", 0x000000, BlendMode.MULTIPLY, 1, [blurr]);


Then cast and render the shadow:

shadowCaster.castModel(shadowObjectContainer, light, shadowPlane);

This really optimized the performance and frame rate on internet explorer went up.

I am not claiming that this is the way to write. I am just sharing what i just faced and how i tackled it. I am still working on more better approach for optimization of my code and objective. But still i would say internet explorer sucks as only this browser showed massive drop on fps rate without any optimized code :D. But yeah i know writing efficient code makes life easier 😛