   SetVertexShader
  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]
  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. ;  (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];  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 ;  SetVertexShader(NULL);SetFVF(D3DFVF_XYZ|D3DFVF_TEX1); ;  Yes! Thank you very much. Works now. ;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;  Clown - The first sentence in the question was "How do I use SetVertexShader". I believe the previous answers covered that. ;  I saw the parameter and instantly realized that he''s using DX9 with a DX8 tutorial.   .lick