DirectionalLightShadowFilter look bad compared to PointLightShadowFilter

I have in one scene a couple of lights with shadows with the same settings.

The DirectionalLightShadowFilter is visibly more blocky than the PointLightShadowFilter. AFAIK both use a similiar thechnique.

Also I didn’t manage to test it yet, but I have a hunch that if I increased the actual size of the objects the shadow would look better (that was the case with the deprecated PssmShadowFilter).

Why is that? Can I do anything to increase the quality of the DirectionalLightShadowFilter without compromising performance?

What settings are you using? Have you turned on the filtering?

That’s probably because the point light shadow renderer covers a smaller area than the other.
I don’t know if your ground is set to castAndRecieve, but it looks that it’s completely flat, so you could try to set it to only receive shadows and it may get you a better shadow resolution.

1 Like
@zarch said: What settings are you using? Have you turned on the filtering?

This is with bilinear filtering. All settings are default except for resolution which is 1024 and 4 parts.

@nehon said: That's probably because the point light shadow renderer covers a smaller area than the other.

In general both cover the same area. However I did notice the point light shadow deteriorate in quality with distance. But why would distance matter to a directional light shadow?

@nehon said: I don't know if your ground is set to castAndRecieve, but it looks that it's completely flat, so you could try to set it to only receive shadows and it may get you a better shadow resolution.

It was CastAndRevcieve. However changing it to Recieve didn’t improve anything.

@yezu said: In general both cover the same area. However I did notice the point light shadow deteriorate in quality with distance. But why would distance matter to a directional light shadow?
No you don't get it. Shadow maps are projected on the surfaces. For directional lights the projection surface is computed from a merge between shadow receiving and casting objects. the wider this area the more the shadow's edges will be pixelated. That's basically the reason why PSSM was invented, to alleviate this issue a bit. For point light it's different, because they have a range so the surface covered is usually smaller than a directional light.

Shadows in computer games is a whole area of study and no one ever came up with the perfect solution. It’s all approximation and tricks.
Now for your scene. It seems that your cube is unshaded, or is it? I recommend using lighting it will look more natural with shadows.
You could try to lower the point light shadow resolution and use PCF4 or PCFPOISSON filtering for both filters. So you’ll have an equivalent look.

1 Like
@nehon said: For directional lights the projection surface is computed from a merge between shadow receiving and casting objects. the wider this area the more the shadow's edges will be pixelated. (...) For point light it's different, because they have a range so the surface covered is usually smaller than a directional light.

If I understand correctly, the DirectionalLightShadowFilter takes the whole scene into consideration when calculating the shadow map. So… Would removing shadow casting and shadow receiving objects further away from the camera make it smaller and by effect less pixelated?

@nehon said: Shadows in computer games is a whole area of study and no one ever came up with the perfect solution. It's all approximation and tricks.

:smiley: All game development is approximation and tricks. That’s why I started using jME. I got fed up with writing shaders and postprocessors and scene managers etc. I want focus on the game not rendering :slight_smile:

@nehon said: It seems that your cube is unshaded, or is it? I recommend using lighting it will look more natural with shadows. You could try to lower the point light shadow resolution and use PCF4 or PCFPOISSON filtering for both filters. So you'll have an equivalent look.

Thanks for the suggestion but the cube is no relevant in this scene. Just a placeholder. I am more worried about the ground.