[osg-users] PSSM ... second

Adrian Egli 3dhelp at gmail.com
Fri Nov 2 00:00:10 PDT 2007


hi

here is the topic terry send me some days ago, i didn't yet found the time
to review it, may in the mean time some has time to
check it out, and the we can submiss it.

/adegli

---------- Forwarded message ----------
From: Terry Welsh <mogumbo at gmail.com>
Date: 18.10.2007 23:04
Subject: pssm fix
To: Adrian Egli <3dhelp at gmail.com>

Hey Adrian,
I was playing with your shadow code a bit.  Things look much better on
NVidia if you do two things:

1.  Use factor = 1.1 and units = 4.0

2.  Comment all of this out of the shader:
//        sstr << "        vec4 random"    <<    i    <<" =
"<<(1.25/(double)_resolution)<<"*coord.z*texture2D
(randomTexture,gl_TexCoord["
   <<    (i+1)    <<"].st); "    << std::endl;
//        sstr << "        float shadow1"    <<    i    <<" =
shadow2DProj( shadowTexture"    <<    i    <<",gl_TexCoord["    <<
(i+1)    <<"]+random"    <<    i    <<".r*vec4(-1,-1,0,0)).r;"    <<
std::endl;
//        sstr << "        float shadow2"    <<    i    <<" =
shadow2DProj( shadowTexture"    <<    i    <<",gl_TexCoord["    <<
(i+1)    <<"]+random"    <<    i    <<".g*vec4(1,-1,0,0)).r;"    <<
std::endl;
//        sstr << "        float shadow3"    <<    i    <<" =
shadow2DProj( shadowTexture"    <<    i    <<",gl_TexCoord["    <<
(i+1)    <<"]+random"    <<    i    <<".b*vec4(1,1,0,0)).r;"    <<
std::endl;
//        sstr << "        float shadow4"    <<    i    <<" =
shadow2DProj( shadowTexture"    <<    i    <<",gl_TexCoord["    <<
(i+1)    <<"]+random"    <<    i    <<".a*vec4(-1,1,0,0)).r;"    <<
std::endl;
//        sstr << "        shadow"    <<    i    <<" = shadow"    <<
i    <<" + shadow1"    <<    i    <<" + shadow2"    <<    i    <<" +
shadow3"    <<    i    <<" + shadow4"    <<    i    <<";"    <<
std::endl;
//        sstr << "        shadow"    <<    i    <<" = shadow"    <<
i    <<"*0.2;"    << std::endl;

--
Terry Welsh - mogumbo 'at' gmail.com
www.reallyslick.com  |  www.mogumbo.com


-- 
********************************************
Adrian Egli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071102/90dc56fd/attachment.html 


More information about the osg-users mailing list