Page 19 of 32

Re: Shadows

Posted: 09 Apr 2018, 22:47
by AnyOldName3
Increasing shadow map resolution should increase the load for the rasteriser and fragment shaders, but shouldn't change much else. We've not got complicated meshes, so rasterisation isn't that hard, and our fragment shaders aren't that complex (although if I could get it working, they could be optimised further for shadow casting), so the performance hit might not be as large as for other games. There's also the other issue that the shadow system currently does a load of scene traversals which run on the CPU, so turning on shadows means you're spending a lower ratio of your time waiting for the GPU, so increasing GPU load will have a smaller impact on framerate than one might expect.

Re: Shadows

Posted: 09 Apr 2018, 22:52
by imec
Very interesting, I had no idea that it was related to GPU wait times. Thank you!

Re: Shadows

Posted: 10 Apr 2018, 14:52
by Br0ken
Thanks for your answer!
AnyOldName3 wrote: 09 Apr 2018, 21:18 Regarding soft shadows, I might implement PCSS filtering, but I might not. Usually it's an effect used to hide low-resolution shadow maps instead of making things look more realistic. In my investigations, I've been outside and looked at the shadows cast by real objects, and they don't really get soft until it's extremely cloudy, at which point shadows are really faint anyway, so it doesn't matter so much.
But hard shadows are quite rare IRL.
For example:
Hard vs. soft shadows
Made in the Shade: How NVIDIA Helped Cast More Realistic Shadows in ‘Grand Theft Auto V’

Re: Shadows

Posted: 10 Apr 2018, 16:35
by AnyOldName3
When you see soft shadows in games, they're often significantly softer than in real life to the point that hard shadows would have been more realistic. PCSS is a technique that can be realistic if used correctly, hence why I said I might consider implementing it, and also why it was featured in that GTAV article. The non-GTAV article's example image for soft shadows is a gazillion times softer than any shadow the sun has ever cast (or at least cast on Earth - I imagine that it casts softer shadows on Mercury, but OpenMW isn't primarily designed for games set on Mercury).

Re: Shadows

Posted: 10 Apr 2018, 22:17
by Br0ken
Yes, PCSS seems to be a most good-looking soft shadow technique. May it be combined with current shadow maps like PCF or another rework is needed?

Re: Shadows

Posted: 10 Apr 2018, 23:22
by AnyOldName3
PCSS basically just uses data about the scene and shadow map to determine which size of PCF filter to use, so it shouldn't be too difficult. IIRC it should also only require changes to the shaders, so shouldn't be too hard to add to whatever system we end up with in the end.

Re: Shadows

Posted: 19 Apr 2018, 10:21
by ajira2
How is this progressing?

Any chance we will get shadows on OpenMW 0.44 or it's more like OpenMW 0.45?

Thank you for your good work.

Re: Shadows

Posted: 18 May 2018, 23:04
by AnyOldName3
The last six days have produced amazing results and suddenly it looks like shadows might be mergeable really soon. I need lots of people to start picking fault with things when using this branch: https://github.com/AnyOldName3/openmw/t ... hadow-maps

If I don't get lots of people testing this across the whole surface of Nirn at all times of day both indoors and out, such a big set of changes is bound to introduce regressions. We don't like those, so they must be eradicated.

Re: Shadows

Posted: 19 May 2018, 06:46
by lysol
AnyOldName3 wrote: 18 May 2018, 23:04 The last six days have produced amazing results and suddenly it looks like shadows might be mergeable really soon. I need lots of people to start picking fault with things when using this branch: https://github.com/AnyOldName3/openmw/t ... hadow-maps

If I don't get lots of people testing this across the whole surface of Nirn at all times of day both indoors and out, such a big set of changes is bound to introduce regressions. We don't like those, so they must be eradicated.
Oh. Ok, well I guess I could try them out for you then...

Just kidding. Sounds amazing, I will build this immediately.

Re: Shadows

Posted: 19 May 2018, 12:15
by lgromanowski
AnyOldName3 wrote: 18 May 2018, 23:04 The last six days have produced amazing results and suddenly it looks like shadows might be mergeable really soon. I need lots of people to start picking fault with things when using this branch: https://github.com/AnyOldName3/openmw/t ... hadow-maps
It would be awesome if you would make some short demo-movie on YT with new shadows :)