Shadows

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

Re: Shadows

Post by AnyOldName3 »

You can try this for yourself now as it's just been pushed to my experimental branch.
User avatar
AnyOldName3
Posts: 2673
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post by AnyOldName3 »

The next things to do:
  • Add support for cascaded or parallel split shadow maps (I still haven't exactly worked out the difference) using the existing implementation in osgShadow::ViewDependentShadowMap by attacking the shaders further.
  • Tidy things up.
  • Maybe add support for more cascades/splits if it turns out that things aren't good enough with the hard cap of two that osgShadow::VDSM currently has.
  • Stop the sky from receiving shadows.
  • Find an efficient way to have VDSM support objects that don't receive shadows so we don't have to rearrange the scene graph and don't have to put up with my current workaround of rendering non-receivers twice, once with shadows, and then a second time without, which draws over the first.
  • Potentially change how non-translucent shadow casters are rendered so unnecessary alpha testing is skipped.
  • Probably a bunch of other stuff I haven't thought of.
User avatar
raevol
Posts: 3093
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: Shadows

Post by raevol »

AnyOldName3 wrote: 30 Oct 2017, 21:05 I just added shadow support to the water shader, too, but I'm not exactly sure if this is what shadows striking water looks like because it feels weird. It's quite possible that the convenient 'shadow' variable in the water shader doesn't actually mean what I think it means, so changing its value from a constant 1.0 to what I read from the shadow map may be incorrect.

OpenMW-Shadow-Water.png


I'm not sure, but doesn't look right to me based on:

Image

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

Re: Shadows

Post by lysol »

!!!!!! This looks huge. I need to build this tomorrow, seriously.
raevol wrote: 30 Oct 2017, 21:00 Could it make it into 0.43??
The thing, I guess, is that this would more or less transform OpenMW 0.43 into OpenMW 1.0, which would be kinda dumb to do in the middle of a release phase. That said, I would like to see this in a release NOW as much as anybody.

We still have nightlies and the possibility to build from master though

EDIT: Oh, and regarding the shadow on water surface; I guess it depends on how clear the water is. If it's super clear, like raevol's examples, then there's nothing to cast a shadow on, but if the water is not that clear, then it might look like this or this. Seems like it also depends on if the sun's highlights is directly reflecting from the water to you or not.
User avatar
AnyOldName3
Posts: 2673
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post by AnyOldName3 »

I was hoping that all it would do was turn off the highlights. I might try some experimentation to see what's actually affected by the variable.
magamo
Posts: 109
Joined: 28 May 2016, 17:28

Re: Shadows

Post by magamo »

I would think, Lysol, that it would be even more prudent to get shadows into at least one 0.XX release before 1.0
User avatar
AnyOldName3
Posts: 2673
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post by AnyOldName3 »

I think I'm probably assigning to the value correctly, but in the old OGRE version where the variable originated, there was some shadow fading stuff going on (which I don't think we need), making things a little less clear.

Scrawl authored commit https://github.com/OpenMW/openmw/commit ... 3c126cfa74, which is the last thing that ever discussed water shadows, so he might be able to weigh in.
User avatar
AnyOldName3
Posts: 2673
Joined: 26 Nov 2015, 03:25

Re: Shadows

Post by AnyOldName3 »

I've found myself another thing to investigate. For whatever reason, the terrain isn't making it into the shadow map, so hills and the like don't cast shadows.
User avatar
raevol
Posts: 3093
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: Shadows

Post by raevol »

lysol wrote: 30 Oct 2017, 22:40if the water is not that clear, then it might look like this or this. Seems like it also depends on if the sun's highlights is directly reflecting from the water to you or not.
Thank you! I wasn't completely sure about what I posted, but I was having a hard time finding examples hahaha.
magamo
Posts: 109
Joined: 28 May 2016, 17:28

Re: Shadows

Post by magamo »

I've also noticed that this branch seems to break terrain texture blending, making the entire world a massive patchwork of seams everywhere. That should probably be resolved down the line before this is merged. This is a FANTASTIC start, AON3! Great work!
Post Reply