PDA

View Full Version : Nvidia Cg krasch



Ninja
04-04-2004, 04:46 AM
Hi,

My vertex program starts like this:

struct App2Vert
{
float4 position : POSITION;
float3 normal : NORMAL;
float2 coords : TEXCOORD0;
float3 tangent : COLOR0;
};

struct Vert2Frag
{
float4 Position : POSITION;
float2 TexCoord0 : TEXCOORD0;
float2 TexCoord1 : TEXCOORD1;
float3 LightDirection : TEXCOORD2;
float3 LightDirection2 : TEXCOORD3;
float3 Eyedirection : TEXCOORD4;
float3 Normal : TEXCOORD5;

};

Vert2Frag main(App2Vert IN,
uniform float4x4 ModelViewProj,
uniform float4x4 ModelViewInv,
uniform float4 LightPosition,
uniform float4 EyePosition)
{
Vert2Frag OUT;

...
}

When I run it on an Ati card with the CG_PROFILE_ARBVP1 profile it works great. But when I tried it on my Gf Fx card this error came up:

Semantic attribute "TEXCOORD4" has too big of a numeric index. Unknown semantics "TEXCOORD4" specified for "EyeDirection". Multiple bindings to output semantic "EyeDirection"

Semantic attribute "TEXCOORD5" has too big of a numeric index. Unknown semantics "TEXCOORD5" specified for "Normal". Multiple bindings to output semantic "Normal"

Switching to the CG_PROFILE_VP30 profile didn't help. Anyone know whats wrong here?

Regards, Ninja

rgpc
04-04-2004, 06:42 PM
I don't know a great deal about CG (this is an Opengl Forum after all) but perhaps you should look into how many texture units your respective cards have? You are attempting to use 6 texture units from what I see, and I don't think any of the nVidia cards have this many TU's (AFAIK).

jwatte
04-04-2004, 07:29 PM
NVIDIA only exposes 4 traditional texture units, but 16 texture samplers and 8 texture coordinate interpolands. You have to bind them to the generic vertex attribute streams, not texture coordinate streams, I believe.