   Is there any keywords just like "varying" in HLSL?
  In GLSL, there is a keyword "varying", it makes a variable for passing from vertex shader to pixel shader(fragment shader). It can be written by vertex shader, and automatically interpolated by GPU, finally used in pixel shader. It is also the only way that pass variable from vertex shader to pixel shader.But I can't find any similar keyword in DirectX SDK. There are only FIVE kinds of modifiers: "extern", "shared", "static", "uniform", "volatile", and none of them is valid.Thanks very much!   
Quote:Original post by tianrolinIn GLSL, there is a keyword "varying", it makes a variable for passing from vertex shader to pixel shader(fragment shader). It can be written by vertex shader, and automatically interpolated by GPU, finally used in pixel shader. It is also the only way that pass variable from vertex shader to pixel shader.But I can't find any similar keyword in DirectX SDK. There are only FIVE kinds of modifiers: "extern", "shared", "static", "uniform", "volatile", and none of them is valid.Thanks very much!In HLSL, the Vertex Shader returns a vertex structure. The elements in the structure are interpolated, and then passed to the Pixel Shader as input. The Pixel Shader then returns a float4 value for the color to be written.Any basic HLSL tutorial would cover this stuff.   ;  Thanks for the prompt reply.   ;  If i understand your question correctly I think this will help you out:struct VSOutput{float4 position : POSITION;float2 texCoord : TEXCOORD0;float3 varying  : TEXCOORD1; // Varying Variable};VSOutput VS (float3 position : POSITION, float3 normal : NORMAL, float2 texCoord : TEXCOORD){VSOutput outVS = (VSOutput)0;outVS.varying = normal;return outVS;}float4 PS (float2 texCoord : TEXCOORD0, float3 varying : TEXCOORD1) : COLOR{return float4(varying, 1.0f);}technique Tech{pass P0{VertexShader = compile vs_2_0 VS();PixelShader  = compile ps_2_0 PS();}}Edit: Changed what I was setting varying to, not much'll happen with a constant value as sirob said[Edited by - tolliner on December 31, 2007 5:21:35 AM];  in fact this code will get you texcoord1 interpolated but as you set for every vertex the same value then not much will happen. try to set texcoord1 in c++, different for every vertex.   