Shadows

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

Re: Shadows

Post by AnyOldName3 » 09 Apr 2018, 22:47

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.
AnyOldName3, Master of Shadows

imec
Posts: 32
Joined: 13 May 2012, 22:03

Re: Shadows

Post by imec » 09 Apr 2018, 22:52

Very interesting, I had no idea that it was related to GPU wait times. Thank you!

User avatar
Br0ken
Posts: 213
Joined: 02 Apr 2012, 05:54
Location: Siberia

Re: Shadows

Post by Br0ken » 10 Apr 2018, 14:52

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: 942
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post by AnyOldName3 » 10 Apr 2018, 16:35

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).
AnyOldName3, Master of Shadows

User avatar
Br0ken
Posts: 213
Joined: 02 Apr 2012, 05:54
Location: Siberia

Re: Shadows

Post by Br0ken » 10 Apr 2018, 22:17

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: 942
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post by AnyOldName3 » 10 Apr 2018, 23:22

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.
AnyOldName3, Master of Shadows

ajira2
Posts: 22
Joined: 30 Oct 2017, 14:27

Re: Shadows

Post by ajira2 » 19 Apr 2018, 10:21

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: 942
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post by AnyOldName3 » 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.
AnyOldName3, Master of Shadows

User avatar
lysol
Posts: 929
Joined: 26 Mar 2013, 01:48
Location: Sweden

Re: Shadows

Post by lysol » 19 May 2018, 06:46

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.
Normal mapped texture replacers, exclusive for OpenMW:
My Nexus page

User avatar
lgromanowski
Site Admin
Posts: 1188
Joined: 05 Aug 2011, 22:21
Location: Wroclaw, Poland
Github profile: https://github.com/lgromanowski
Contact:

Re: Shadows

Post by lgromanowski » 19 May 2018, 12:15

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 :)
best regards,
Lukasz

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests