Jump to content
  • Advertisement

Archived

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

Erzengeldeslichtes

SetVertexShader

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

How do I use (IDirect3DDevice9*)->SetVertexShader(IDirect3DVertexShader9* pShader)? In the book I have that shows me how to do 3d, the author uses SetVertexShader(D3DFVF_XYZ|D3DFVF_TEX1) which doesn't work because that's an int and it wants a vertex shader (Obviously it worked in Dx8 but I'm using Dx9), and there are no overloaded functions that I know of. On top of that, D3D constantly complains that the Vertex shader is not set (yes, I realize that, thank you d3d) and so won't draw anything. How do I create the most basic of basic of basic vertex shaders? [edited by - Erzengeldeslichtes on August 19, 2003 1:16:22 AM]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
as of DX9, shaders now have handles. look at the create...shader functions and see where they give you the handle to the shader. Use that to set.

Share this post


Link to post
Share on other sites
(IDirect3DDevice9*)->CreateVertexShader(DWORD* pFunction, IDirect3DVertexShader9** ppShader);

Okay, according to the code samples pFunction is something I have to get from a databuffer that I load from .vsh. What the frell are vshs, how do I make them, where do I find them, etc. etc. etc? It is very unkind of Microsoft to use in their code samples a function (DXUtil_FindMediaFileCb()) and not tell me which library (if any) it is in...

Is there any way to just set pFunction to black or something? Setting it to 0 or null is considered an invalid function pointer...

[edited by - Erzengeldeslichtes on August 19, 2003 1:57:25 AM]

Share this post


Link to post
Share on other sites
If you want to start writing your own shaders, you should look at the shader samples that come with the SDK or on the NVIDIA and ATI websites.

On the other hand, if all you want to do is use the same kind of code that you see in your book, then you don''t really need to use shaders (at least not for the functionality you described earlier). Your original post said that you were trying to do something like IDirect3DDevice9::SetVertexShader(D3DFVF_XYZ|D3DFVF_TEX1). If this is what you want to do, pass the same argument into IDirect3DDevice9::SetFVF instead. SetFVF in DX9 does the same thing as SetVertexShader did for DX8 (when it comes to dealing with the fixed function pipeline).

Hope this helps,
neneboricua

Share this post


Link to post
Share on other sites
quote:
Original post by glassJAw
SetVertexShader(NULL);
SetFVF(D3DFVF_XYZ|D3DFVF_TEX1);


Very funny that none of the previous posters understood he wanted SetFVF(). I guess glassJAw and I are smart. Wuahahaha!!!!

.lick

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Clown - The first sentence in the question was "How do I use SetVertexShader". I believe the previous answers covered that.

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!