Quality of shadow

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
kubatp
Gnome
Posts: 368
Joined: Tue Jan 06, 2009 1:12 pm
x 43

Quality of shadow

Post by kubatp »

Hi,
I am trying to add shadows to the game. It works somehow, but I would like to improve the quality of shadows. I created a short video where directional light is changing its direction to show current state.
https://youtu.be/hDgs_exiJlI
You can notice two things:
  1. The shadows (when you see the barbarian's shadow or shadow of the temple) are "frayed". It almost looks like there are more lights casting shadows, but there is really just one.
  2. Terrain is a grid consisting from coupled triangles with square shape. For better looking terrain I used technique described here http://gamedev.stackexchange.com/questi ... grid#45117 but I am still not happy with that (especially with shadows). Currently every game tile consists of 9x9 vertices. How would you calculate normals for these vertices? I currently do it the simple way that I take these three vertices of triangle and calculate normal with Math.CalculateBasicFaceNormal. Is there a better way how to make the shadows smoother?
Thank you for your help.
kubatp
Gnome
Posts: 368
Joined: Tue Jan 06, 2009 1:12 pm
x 43

Re: Quality of shadow

Post by kubatp »

Noone can give me an advice? I thought that there will be number of ideas... :|
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: Quality of shadow

Post by xrgo »

It looks like your'e using some kind of pcf filter with no interpolation, here are some codes for better soft shadows http://www.ogre3d.org/forums/viewtopic. ... 8&p=517187 maybe you can integrate them in your shaders and get a little improvement.
Also, your selfshadows sometimes suddenly disappear in some faces, I don't think that has to do with normals... maybe you need to adjust (or apply) a bias.
And/Or! you should match the exact color result of the surface with shadows and the surface with no directional light applied << Not sure how to explain... let say you disable shadows, then the surface in the dark areas (where the directional light can't reach (or where NdotL is 0)) with ambient light, GI, or whatever you have enabled... its going to have X color. When you enable shaodws the areas with shadows should have the exact same X color.
Post Reply