Jump to content
  • Advertisement
Sign in to follow this  

CreatePixelShader help

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

basically i am trying to learn pixel shaders the asm way , so here is my code


HRESULT CreateMyShader(IDirect3DDevice9 *Device,IDirect3DPixelShader9 **pShader, float red, float green, float blue, float alpha )
ID3DXBuffer *MyBuffer = NULL;
char MyShader[ 256 ];
sprintf( MyShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", red/255, green/255, blue/255, alpha/255 );
D3DXAssembleShader( MyShader, sizeof( MyShader ), NULL, NULL, 0, &MyBuffer , NULL );
if( FAILED( Device->CreatePixelShader((const DWORD*)MyBuffer ->GetBufferPointer(), pShader)) )return E_FAIL;
return S_OK;

//to create the pixelshader i do
CreateMyShader( pd3dDevice, &Blue, 0, 0, 255 , 255 );//blue

//and in renderscene before drawsubset i have



but the object is not being colored blue, does anyone know why?

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!