Shadows

Everything about development and the OpenMW source code.
User avatar
raevol
Posts: 2401
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: Shadows

Post by raevol » 23 Sep 2017, 05:12

Keep up the good work @AnyOldName3, glad to hear you are making progress!

User avatar
AnyOldName3
Posts: 459
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post by AnyOldName3 » 03 Oct 2017, 03:36

I was hoping to upload one brilliant commit that magically fixed everything in one go, but between me not having as much time to work on this as I'd like (which I don't understand as I've finished my degree and not got a job yet) and it being complicated (which I do understand) this looks to have been a silly idea.

I've therefore actually put some of the progress I've had made into my OpenMW fork instead of a miniature test program. It's not particularly impressive as the bug it fixes seems to be harder to replicate in OpenMW than I expected (either that, or it just looks like one of the other bugs).

The notes I've written for myself (which therefore might make no sense to anyone else) regarding what to do next are as follows:
  • Casts shadow and receives shadow masks are ignored.
    • I need to work out how to exclude nodes without a mask matching the shadow casting mask when rendering shadow maps.
      • Investigate what the cull traversal thingy is doing with its mask
      • I should investigate what happens here for the working shadow techniques
    • I need to disable shadow receiving on things that shouldn't receive shadows.
      • One possible solution would be to get the shadow receiving mask when rendering nodes and pass an appropriate uniform to the shader.
      • I should investigate what happens here for the working shadow techniques.
  • The calculation of frustums and bounding boxes is broken in some way(s).
    • The camera should always be within the shadow frustum to avoid singularities according to the original paper, but things sometimes work even when it isn't.
      • AABBs are used, and I think including the camera in these would waste a bunch of shadow map.
    • Sometimes the maths appears to fail completely at some point, and the light frustum isn't calculated.
      • This may be because of the projection matrix creation failing.
      • This may be because of the light view matrix creation failing.
Hopefully, someone will enjoy reading that, as it was a bit of a nuisance adding all the list tags to make the indentation stay.

JohnMaster
Posts: 25
Joined: 09 Aug 2017, 05:32

Re: Shadows

Post by JohnMaster » 03 Oct 2017, 04:21

AnyOldName3 wrote:
03 Oct 2017, 03:36
Hopefully, someone will enjoy reading that, as it was a bit of a nuisance adding all the list tags to make the indentation stay.
I enjoyed reading it. Impressive formatting. Thank you for continued effort. Good luck on the job hunt!

User avatar
raevol
Posts: 2401
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: Shadows

Post by raevol » 03 Oct 2017, 07:25

Thank you for your hard work on this! Fingers crossed that we can still see this finished soon.

User avatar
AnyOldName3
Posts: 459
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post by AnyOldName3 » 07 Oct 2017, 02:12

I might have decided that ViewDependentShadowMap works better than LightSpacePerspectiveShadowMap now I'm in a position where I have a better idea about what various things are actually doing. While I've got it sort-of working in mini-experiments, I haven't implemented the shader changes OpenMW would need for it to work, and it crashes my graphics driver when I let OSG set up the shaders for me. It also looks like the aforementioned shader changes may be a little bit very complicated in term of making the uniforms and attributes used compatible with what OpenMW needs to use itself. It's probably going to require me to stab the C++ instead of just the GLSL.

User avatar
raevol
Posts: 2401
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: Shadows

Post by raevol » 07 Oct 2017, 07:17

AAAAAH so excited! I know I keep posting useless encouraging posts, but I can't resist!!

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests