Sign in to follow this  
sapman

HLSL Syntax Question

Recommended Posts

sapman    100
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
dave    2187
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

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