[osg-users] Shadow Shenanigans (Implementing shadows in OpenMW and associated experiments)

Chris Djali krizdjali at gmail.com
Wed Sep 20 09:07:48 PDT 2017


Hi,

I'm currently in the process of trying to make shadows work in OpenMW and am therefore trying to learn about osgShadow and also convince it to do a bunch of things.

I have several questions, so I'll try and organise them nicely with bullet points and subheadings etc. In case it affects any of this, I'll also include some system details here:

OS: Windows 10, post-'Creators Update'
GPU: Radeon RX Vega 56
GPU Driver: 17.9.1

All testing described here occurs with Scrawl's OSG-On-Steroids fork (github com/OpenMW/osg dot replaced by a space so I can actually post this), which is preferred for OpenMW, and if it turns out that any of my issues are magically fixed in 3.5.x, it means the fix will have to be backported, as there are good reasons why OpenMW uses the fork.

Examples osgshadow

		As described in another user's thread (forum openscenegraph org/viewtopic.php?t=16521 
dots replaced by spaces so I can actually post this), there are issues with the shadow example. I am no longer wholly convinced that I need any scenes other than number four to actually work, so this isn't the end of the world for me.
		Even when using scene four, there are several shadow techniques which appear to do nothing or do something very wrong. I guess I can provide further information if critical, but I've found that LispSM mostly works, so I'm using that.

		
LispSM specifically
	
			There's something wrong with how backfaces are culled when rendering the shadow map for LispSM. The island scene uses a lot of non-manifold meshes, so the backfaces absolutely have to be considered for the shadow map to be correct. There was also some other weirdness I noticed with this (I can't remember the specifics right now), but I think having manifold meshes or disabling backface culling would fix that, too.
		I went hunting through the source code and figured out how to disable the culling in StandardShadowMap, and that fixes scene four.
	
		The cast and receive shadow node masks are completely ignored. I'm not sure if this is a technical problem or just an oversight, but it has the potential to make bad things happen.
	



I've started using LispSM with OpenMW now, as everything else either provides unusably poor results, breaks stuff, or does nothing.

OpenMW & LispSM

		Some shadows seem to end up rendered on the skybox. I'm pretty sure the skybox is rendered really close to the camera in an early render bin, and then the depth buffer is cleared before the rest of the scene gets rendered. If I can't make nodemasks work with LispSM, the scene graph could need some serious rearranging.

		Some shadows seem to disappear when they fall on something close to the camera. This is probably just a constant that needs changing. I can replicate this in the shadow example, but for that, I have to zoom in ridiculously far.

		Some shadows have holes or bits missing. I think this is the same backface culling issue as in the island scene as Bethesda's meshes are often crappy.

		The shadow on a specific door looks like it might be the wrong colour at a very specific time of day. That's probably just Bethesda's fault for setting up a material weirdly, and I can probably tweak this more easily when using OpenMW in shader mode.



Many thanks for any answers,

AnyOldName3

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72019#72019







More information about the osg-users mailing list