• Advertisement
Sign in to follow this  

CreatePixelShader help

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