Sign in to follow this  

limit of TEXCOORD in HLSL

This topic is 3097 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 !]

Share this post


Link to post
Share on other sites

This topic is 3097 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this