This is the basic logic, you upload 2 sets of 2 points, start and end. Along with each set you upload a different “Bool” value that is represented with 1 or 0. Multiply the projected normal but the Bool. 1 will project a ray, 0 will remain at original shadow caster vertex.
here is some code I found from this link: http://ryanspeets.com/flash/how-i-did-my-2d-shadow-rendering-with-stage3d-tutorial/
alias vc0.xy, CONST_0( 0, 1 ) alias vc0.z, shadowDistance alias va0, vertexPosition alias vc1, lightPosition vt0.xy = vertexPosition.xy - lightPosition.xy vt0.xy *= vertexPosition.z vt0.xy *= shadowDistance vt1.xy = vertexPosition.xy + vt0.xy vt1.z = 0 vt1.w = 1 op = mul4x4(vt1, vc2)
this is AGALMacro, so treat it like pseudocode if you are using MiniAssembler or HXSL.
Hope you guys can make something out of it, enjoy!