Problem with DirectionalShadowMapPass and transparent textures

I have problem with DirectionalShadowMapPass and transparent textures. Particles and software cursor are rendered wrong when they are over the shadow. Do you have idea what is wrong? Is there problem in blend states, render states or something else?



Particles are rendered as dark squares when they are over the shadow.


// particle blend state
alpha = renderer.createBlendState();
alpha.setBlendEnabled(true);
alpha.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
alpha.setDestinationFunction(BlendState.DestinationFunction.One);
alpha.setTestEnabled(true);
alpha.setTestFunction(BlendState.TestFunction.GreaterThan);



Software cursor quad hides shadow totally when it is over the shadow. The cursor hides also the partcles.


// cursor blend state
BlendState as = renderer.createBlendState();
as.setBlendEnabled(true);
as.setSourceFunction(BlendState.SourceFunction.One);
as.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceColor);
as.setTestEnabled(true);
as.setTestFunction(BlendState.TestFunction.GreaterThan);




It Should work well, you can try reading my expanded Flag Rush tutorials right in this section, you basically will have to set the Blend state , the texture & zbufferstate to the particles, don't forget to attach them to the RenderState of the particles!

The new FlagRush tutorial used ShadowedRenderPass, which worked well with particles. I changed my game to use it instead DirectionalShadowMapPass and now it is :D. Thanks for the help! There may still be problem in DirectionalShadowMapPass.