tag:blogger.com,1999:blog-5003459283230164005.post4317866455567257915..comments2024-03-28T10:54:55.086-07:00Comments on Helix Mod: Velvet AssassinDarkStarSwordhttp://www.blogger.com/profile/14402135338628481428noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5003459283230164005.post-34827063552340746542013-01-21T18:46:56.023-08:002013-01-21T18:46:56.023-08:00mercimerciAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5003459283230164005.post-56490738514082446162012-08-01T19:15:55.306-07:002012-08-01T19:15:55.306-07:00WRITTEN BY RENDROC
I will post the fix in my orig...WRITTEN BY RENDROC<br /><br />I will post the fix in my original topic after some more testing, but here is the code that I added to the world_rtsm_pass.fx file in the Shader directory in Velvet Assassin. Right after this line:<br />Code:<br />Out.Position = mul( P, Transforms[0] );<br /><br />Add this:<br />Code:<br />float nw = Out.Position.w;<br />if (Out.Position.z<=0)<br />{<br />Out.Position.z = 100;<br />}<br />Out.Position.z = Out.Position.z / nw;<br />Out.Position.x = Out.Position.x / nw;<br />Out.Position.y = Out.Position.y / nw;<br />Out.Position.w = 1;<br /><br /><br />I hope this will be of some use to you. The key is that Out.Position.w must be 1, otherwise the Stereo looks different from Mono and is always wrong. I read somewhere that the vertex position is being modified by the 3Dvision driver, so perhaps when Position.w = 1 it cancels out. I think that when w=1 this represents the very back plane of the camera or light, so perhaps that is related to convergence on the far plane being parallel, but that's only a blind guess.<br /><br />Theoretically, I don't think this is a perfect solution. The z=100 line is just to make sure that if something is behind the camera, it isn't used for the shadowmap. The problem with w=1 is that interpolation gets messed up, so that if something like a wall connects from the front of the camera (light) behind the camera (light), it gets interpolated incorrectly and blocks the camera (light) entirely. There may be some other interpolation problems as well. But, I tried it out a bit and it seems to work.eqzitarahttps://www.blogger.com/profile/09263619455673230275noreply@blogger.com