Page 1 of 1

Shadows Dependent on Convergence: Why?

Posted: Tue Jul 10, 2012 3:30 am
by subwoofa
Does anyone know why shadows in some games are dependent on convergence?

For Violet Assassin, of which I've read great 3D reviews, some shadows are different and wrong for each eye. I guess I have a different version from the original reviewers.

The important thing is this: if I adjust the convergence, the transforms for the shadows move as well. In other words, it's like the light source is moving as well, but in a totally different direction.

Since supposedly shadow maps are rendered from the light source, why would the location of the convergence-modified "eye" change the result? Is there a DirectX solution? Or a pixelshader solution?

Some games like VioletAssassin have made some of their shadow map code editable, but I haven't made any headway.

Re: Shadows Dependent on Convergence: Why?

Posted: Tue Jul 10, 2012 11:59 am
by Fredz
Maybe they use forward shadow mapping or shadow volumes ?

Re: Shadows Dependent on Convergence: Why?

Posted: Tue Jul 10, 2012 6:15 pm
by cybereality
I think this is because when using shadow mapping the final shadow render is projected back unto the game in screen-space and the stereo driver is altering where the "camera" is (and thus where the game engine thinks the screen is). You can see a detailed explanation of one popular type of shadow technique here: http://www.gamedev.net/page/resources/_ ... dows-r2193

Re: Shadows Dependent on Convergence: Why?

Posted: Wed Jul 11, 2012 11:35 pm
by subwoofa
Thanks. I couldn't understand fully the paper, but you're probably right. I have to figure out how to modify the shader then. I didn't know you could do that until poking around in the game's shader files, but now I realize that it's a text file that gets compiled when you start the game. This game itself seems pretty cool but everything depends on the shadows (so you know where to hide and so on). It might be in vain, but I'm not giving up yet.

Basically I have undo what the paper is doing by either forcing it to use the projection matrix, or transform the viewport coordinates into the projection space. I'm a pretty good programmer, so if I knew more about pixelshaders it would probably be pretty easy, but I'm starting from scratch here.

Re: Shadows Dependent on Convergence: Why?

Posted: Thu Jul 12, 2012 2:21 pm
by Fredz
Maybe you could have a look here : http://helixmod.wikispot.org/

They are basically doing what you are trying to do but on a much greater scale, you could probably borrow some useful informations there.

Re: Shadows Dependent on Convergence: Why?

Posted: Sun Jul 15, 2012 2:41 pm
by subwoofa
Thanks Fredz, this looks promising. Unfortunately, most of their information and documentation is locked up in the nVidia forums, which seems to be shut down because of hackers. I'll have to check back with them later.

Now that I've looked at it a little more, it looks like the stereo camera transformations are being applied to the lights when rendering the shadow maps, when they really shouldn't. This is probably a common problem and I'll find out more once those nVidia forums are back up.

Re: Shadows Dependent on Convergence: Why?

Posted: Tue Jul 24, 2012 11:17 am
by eqzitara1
@subwoofa

If you know shader language. You can use the helix debugger http://helixmod.wikispot.org/oldvers
Guides on how to use debugger are here http://helixmod.blogspot.com/2012/04/ho ... -game.html
Ignore the end part about removing. Just dump and edit the shaders then inject them back into game using same method mentioned in the posting. If you wish to see how shadows are fixed in other games I recommend downloading one of helix's fixes(amalur, dead space 1/2, etc). Then opening his shaderoverride/pixelshaders + vertexshaders and find the corresponding shadow shaders. This will not be what you need to do since each game has a different engine and different programming but maybe it will help you see what he does. He wrote some guides here but it is down http://forums.nvidia.com/index.php?show ... &p=1365862
and here http://helixmod.blogspot.com/2012/03/dlls-update.html

Re: Shadows Dependent on Convergence: Why?

Posted: Tue Jul 24, 2012 5:31 pm
by Neil
Maybe you should reprint the guides here given that the nvidia forums are down for now.

Regards,
Neil

Re: Shadows Dependent on Convergence: Why?

Posted: Wed Jul 25, 2012 1:50 am
by eqzitara1
Well I cant post it since its down and cant seem to find a cache.
I will dig deeper if when they come up its deleted but otherwise I will wait. Its nothing truly vital. Its just the intro to debugger which I have a more noob friendly guide here http://helixmod.blogspot.com/2012/04/ho ... -game.html

And his how to force 2D -> 3d at certain depth % (what we use for crosshairs/etc)
http://helixmod.wikispot.org/How_To_Make_Your_Own_Fixes
Which I have code examples of before/after. Its in the 2d->3d section.


Everthing else is on blogspot/wiki.