Game Development Community

Simple Question about variables

by Jess Bermudes · in Torque Game Engine Advanced · 10/01/2008 (8:08 pm) · 3 replies

So I've been playing around with shaders for the past month, and I'm slowly getting the hang of it, but I'm still unsure of a couple things. For instance, I can see in shdrConsts.h all the registers available to us in HLSL, but what about stuff like TEXCOORD0, TEXCOORD1, TEXCOORD2, etc. How do I know what each one of those variables does? I've been trying to find some sort of reference but haven't found anything so far...

#1
10/01/2008 (10:39 pm)
@Jess - Read the DirectX help docs. TEXCOORD[n] is not a variable... its a semantic attached to an input or output to a shader.
#2
10/02/2008 (2:23 am)
Actually, I've seen msdn referring to semantics as variables here and there.

Anyway, here's a few links that might be helpful:

DirectX HLSL Semantics on MSDN
Using shaders in Direct3D 9
HLSL Intristic Function reference
#3
10/02/2008 (2:36 am)
Ah, thanks for those links.

For those who may stumble upon this post later on wondering the same things I was, here's an article that's for a different engine but whose explanations for the general concepts are still excellent:

wiki.truevision3d.com/semantics