Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Beggining HLSL question

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

I''m currently learning how to program in HLSL from the CgTutorial book. Though the CgTutorial book talks about Cg compiler and using the Cg Toolkit but I want to use my examples via HLSL and DirectX. So I was wondering how do I do it? I have no idea where to start I want to try this program I made out in DX can someone tell me how to do it
struct output
float4 position : POSITION;
float4 color : COLOR;

output myVertexProgram( float4 position : POSITION, uniform float4x4 modelViewProj )
output out;
out.position = mul(modelViewProj, position );
out.color = float4( 0, 255, 0, 255 );
return out;
This simple vertex program just sets the view matrix up and then sets the color of the vertices to green. All fine and dandy and I can even do it in renermonkey but now how do I use my vertex program in d3d? Thanks

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
yes i would like to know this too,
also on how to get the right martix from direxct x

Share this post

Link to post
Share on other sites

  • 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!