texture tex2d prefetch in the vertex shader

this is on the list of “Known Shader Bugs and Limitations”
panda3d.org/manual/index.php/Known … imitations

basically i need to use vp4O shader code but panda currently does not support this.

//Cg profile vp40 arbfp1
// no work: vp40 vp40
// no work : arbvp1 arbfp1

void vshader(float4 vtx_position : POSITION, 
             float2 vtx_texcoord0 : TEXCOORD0,
             uniform sampler2D tex_0 : TEXUNIT0,
             uniform float4x4 mat_modelproj,
             uniform float4 k_pos,
	     out float4 l_position : POSITION,
	     out float2 l_texcoord0 : TEXCOORD0
	l_texcoord0 = float2(vtx_position.x+k_pos.x,vtx_position.z-k_pos.y)/10; //
	float4 texColor=tex2D(tex_0, l_texcoord0);
	l_position=mul(mat_modelproj, vtx_position + texColor.w );

void fshader(float2 l_texcoord0 : TEXCOORD0,
       	     uniform sampler2D tex_0 : TEXUNIT0,
	     out float4 o_color : COLOR)
	float4 texColor=tex2D(tex_0, l_texcoord0);
	o_color= texColor;

This is needed in order raise a vertex based on color of the texture on the vertex. This is a cool vertex shader trick to render large … very huge terrains computed mostly on the shader at very little cost. I hope the dev’s can look into why vp40 shades language makes problems.


even though this thread is somewhat old,
has this ever been fixed / implemented ?


Isn’t this a Cg limitation, not a Panda limitation?

I’ve worked with vertex textures in Panda3D before, so there’s no limitation on Panda’s end.