Jump to content
  • Advertisement
Sign in to follow this  
Yann ALET

Where do Vertex Shader IN, OUT arguments come from ?

This topic is 3720 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

Let's concider this shader : float4x4 worldViewProj : WORLDVIEWPROJ; //our world view projection matrix //application to vertex structure struct a2v { float4 position : POSITION0; }; //vertex to pixel processing structure struct v2p { float4 position : POSITION0; }; //VERTEX SHADER void vs( in a2v IN, out v2p OUT ) { //transforming our position from object space to screen space. OUT.position = mul(IN.position, worldViewProj); } technique simple { pass p0 { vertexshader = compile vs_1_1 vs(); } } Where does Vertex Shader IN, OUT arguments come from ? Because obvisously we're compiling it without providing any argument (compile vs_1_1 vs()) [Edited by - Yann ALET on June 13, 2008 7:13:57 AM]

Share this post


Link to post
Share on other sites
Advertisement
They're setup by the pipeline, based on the semantics you specified in your structs. It's really just nice syntax to make things look nice for you in your HLSL...if you look at the disassembly the POSITION0 input is simply declared as a register (same for the output).

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!