Revision: 7142 http://playerstage.svn.sourceforge.net/playerstage/?rev=7142&view=rev Author: natepak Date: 2008-11-14 01:54:08 +0000 (Fri, 14 Nov 2008)
Log Message: ----------- Fixed the GLSL programs for depthmap rendering Modified Paths: -------------- code/gazebo/trunk/Media/materials/programs/DepthMap.frag code/gazebo/trunk/Media/materials/programs/DepthMap.vert code/gazebo/trunk/Media/materials/scripts/Gazebo.material Modified: code/gazebo/trunk/Media/materials/programs/DepthMap.frag =================================================================== --- code/gazebo/trunk/Media/materials/programs/DepthMap.frag 2008-11-14 01:53:24 UTC (rev 7141) +++ code/gazebo/trunk/Media/materials/programs/DepthMap.frag 2008-11-14 01:54:08 UTC (rev 7142) @@ -4,5 +4,6 @@ { float f = depth; + //f = 0.0; gl_FragColor = vec4(f, f, f, f); } Modified: code/gazebo/trunk/Media/materials/programs/DepthMap.vert =================================================================== --- code/gazebo/trunk/Media/materials/programs/DepthMap.vert 2008-11-14 01:53:24 UTC (rev 7141) +++ code/gazebo/trunk/Media/materials/programs/DepthMap.vert 2008-11-14 01:54:08 UTC (rev 7142) @@ -1,3 +1,4 @@ +uniform vec4 texelOffsets; uniform float pNear; uniform float pFar; @@ -6,6 +7,8 @@ void main() { gl_Position = ftransform(); + gl_Position.xy += texelOffsets.zw * gl_Position.w; - depth = gl_Position.z / (pFar - pNear); + //depth = gl_Position.z / (pFar - pNear); + depth = (gl_Position.z - pNear) / (pFar - pNear); } Modified: code/gazebo/trunk/Media/materials/scripts/Gazebo.material =================================================================== --- code/gazebo/trunk/Media/materials/scripts/Gazebo.material 2008-11-14 01:53:24 UTC (rev 7141) +++ code/gazebo/trunk/Media/materials/scripts/Gazebo.material 2008-11-14 01:54:08 UTC (rev 7142) @@ -6,6 +6,7 @@ default_params { + param_named_auto texelOffsets texel_offsets param_named_auto pNear near_clip_distance param_named_auto pFar far_clip_distance } @@ -652,12 +653,8 @@ { technique { - pass Z-write + pass { - //cull_hardware none - //cull_software none - //depth_check off - vertex_program_ref Gazebo/DepthMapVS { } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit