limit of TEXCOORD in HLSL

Started by
6 comments, last by NiGoea 14 years, 10 months ago
Hi guys, I'm having some problems with HLSL. It happens that if I use this structure as the input of the pixel shader, it works: struct PS_INPUT { float4 Position : POSITION; float2 Texture : TEXCOORD0; float3 Light : TEXCOORD1; float3 Normal : TEXCOORD2; float3 Camera : TEXCOORD3; float3 Pos : TEXCOORD4; }; but it doesn't anymore if I exchange the position of the last two: struct PS_INPUT { float4 Position : POSITION; float2 Texture : TEXCOORD0; float3 Light : TEXCOORD1; float3 Normal : TEXCOORD2; float3 Pos : TEXCOORD3; float3 Camera : TEXCOORD4; }; WHY !!?!? Is it a limit problem ? Something that I'm doing wrong ??? thanks a lot guys!
Advertisement
Hi,

There's a TEXCOORDN limit but I think it depends on device capabilities. For example, I use HD2600 Pro and I can't use TEXCOORD4, TEXCOORD5, TEXCOORD6 etc.

Try using COLOR12, COLOR13 etc.
There's no "hard", and "the impossible" takes just a little time.
What pixel shader version are you using? PS versions <= 1.3 have a limit of 4 texture samples, PS 1.4+ has 6 according to the Documentation.
Quote:Original post by programci_84
Hi,

There's a TEXCOORDN limit but I think it depends on device capabilities. For example, I use HD2600 Pro and I can't use TEXCOORD4, TEXCOORD5, TEXCOORD6 etc.

Try using COLOR12, COLOR13 etc.


I'm using a GeForce 6800.. it was a high-end card. I can't believe it has only four texture units. Anyway, I will try to use the COLORn that you suggested.

Quote:Original post by Evil Steve
What pixel shader version are you using? PS versions <= 1.3 have a limit of 4 texture samples, PS 1.4+ has 6 according to the Documentation.


I'm loading the shaders with D3DXCompileShaderFromFile, where I specified the version "ps_2_0" and "vs_2_0". I tried to switch to the version 3 also, but nothing changed.

thank you
What does "works" and "doesn't work" mean? If TEXCOORD4 can hold the data for your Position, there's absolutely no reason it would behave differently if you stored your Camera position in there.

Have you used PIX to debug your shaders and actually see what's going on?
Quote:Original post by NiGoea
I'm using a GeForce 6800.. it was a high-end card. I can't believe it has only four texture units. Anyway, I will try to use the COLORn that you suggested.


I have a GeForce 6800 too and it supports at least 6 texcoords.
Quote:Original post by jpventoso
Quote:Original post by NiGoea
I'm using a GeForce 6800.. it was a high-end card. I can't believe it has only four texture units. Anyway, I will try to use the COLORn that you suggested.


I have a GeForce 6800 too and it supports at least 6 texcoords.


I have a 8600 and it supports 8 texcoords and 32 texture image units.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Quote:Original post by MJP
What does "works" and "doesn't work" mean? If TEXCOORD4 can hold the data for your Position, there's absolutely no reason it would behave differently if you stored your Camera position in there.

Have you used PIX to debug your shaders and actually see what's going on?


Actually, I'm not using the parameter Pos. So I don't care if it works or not, I only know that if I set the Camera to use TEXCOORD4, nothing works.

[anyway, somehow, I resolved the problem. Thanks !]

This topic is closed to new replies.

Advertisement