Possible bug in CG shaders?

Hi all,

I’m having difficulty applying a very simple vertex colour shader to a model. My CG program looks like this:

//Cg


void vshader(
    uniform float4x4 mat_modelproj,
    in float4 vtx_position : POSITION,
    in float4 vtx_color : COLOR,
    out float4 l_position : POSITION,
    out float4 l_color : COLOR)
{
    l_position = mul(mat_modelproj, vtx_position);
    l_color = vtx_color;
}


void fshader(
   in float4 l_color : COLOR,
    out float4 o_color : COLOR)
{
    o_color = l_color;
}

Unless I’m missing something, this just passes the interpolated vertex colour to the fragment shader. However the vertex colours I am seeing rendered are just white. I can get the expected result by deleting the fshader part of the program, but then I get the error:

error C3001: no program defined

So I assume I have to have a minimal fshader at least.

I see the same issues when using the autoshader as well. Has anyone else noticed issues when trying to render a simple, vertex-coloured model using shaders?

No, I haven’t problem with this shader (Panda 1.8.1). May be something with your videodriver?

I use bumblebee-nvidia.

bumblebee-project.org/