Updatring DirectX Shader Materials PBBitmap from Utility plugin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to update 'PBBitmap->bm' from a utiliy plugin and cant get it to work.
The utility plugin can update Standard Materials subtexture 'Bitmap' no problem.
I'm updateing the Bitmap with 'PutPixels' to a Bitmap*, i get the Bitmap * this way:
Bitmap *bm = ((BitmapTex*) Texmap)->GetBitmap(i);
Then execute this code:
StdMtl->EnableMap(i, TRUE);
StdMtl->SetMtlFlag(MTL_TEX_DISPLAY_ENABLED | MTL_SUB_DISPLAY_ENABLED);
and the bitmap updates in the view port.
I'm trying to update the Bitmap from a DirectX Shader Material like this:
PBBitmap *ptrBitmap = IDxMaterial->GetEffectBitmap(i);
/* Do my 'PutPixels' to 'myBitmap'*/
ptrBitmap.bm->CopyImage(myBitmap, COPY_IMAGE_CROP,0);
IDxMaterial->SetEffectBitmap(i,&ptrBitmap);
But the bitmap does not update.
I have tried directly doing 'ptrBitmap.bm->PutPixels()' with no luck.
What am i missing ?
Is there something I need to do to notify the IDxMaterial that an Effect texture has been modified ?
Thanks for any help, been working on this for a few days with no luck.