Jump to content
  • Advertisement
Sign in to follow this  
sapman

HLSL Syntax Question

This topic is 3144 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 , iam very beginner at hlsl : please answer these questions : 1)what is the return type of this function : float4 or POSITION float4 mainVSH(float4 pos:POSITION):POSITION {return float4;} --------------------------------------------------------------------- 2)why the mainVSH function should have The Input parameter (like pos in below) ? float4 mainVSH(float4 pos:POSITION):POSITION {return float4;} --------------------------------------------------------------------- 3)what is pixel shader and vertex shader difference ? -------------------------------------------------------------- Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
1) The return type of that function is a float4 that is mapped using the POSITION semantic. Google for "HLSL Semantics" for more information.

2) This is about semantics again. Essentially you have a vertex being provided to the vertex shader and in order to get hold of information in the vertex you have to create input variables and give them semantics. The semantics indicate which information from the input stream should be written into that variable. So in this case the semantic POSITION is used to map the input position in the vertex to the float4 pos.

3) Vertex shader description and Pixel shader description.

Google is your friend.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!