Shadows

Everything about development and the OpenMW source code.
User avatar
AnyOldName3
Posts: 2666
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post 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.
imec
Posts: 37
Joined: 13 May 2012, 22:03

Re: Shadows

Post by imec »

Very interesting, I had no idea that it was related to GPU wait times. Thank you!
User avatar
Br0ken
Posts: 243
Joined: 02 Apr 2012, 05:54
Location: Siberia

Re: Shadows

Post 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’
User avatar
AnyOldName3
Posts: 2666
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post 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).
User avatar
Br0ken
Posts: 243
Joined: 02 Apr 2012, 05:54
Location: Siberia

Re: Shadows

Post 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?
User avatar
AnyOldName3
Posts: 2666
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post 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.
ajira2
Posts: 55
Joined: 30 Oct 2017, 14:27

Re: Shadows

Post 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.
User avatar
AnyOldName3
Posts: 2666
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post 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.
User avatar
lysol
Posts: 1513
Joined: 26 Mar 2013, 01:48
Location: Sweden

Re: Shadows

Post 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.
User avatar
lgromanowski
Site Admin
Posts: 1193
Joined: 05 Aug 2011, 22:21
Location: Wroclaw, Poland
Contact:

Re: Shadows

Post 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 :)
Post Reply