Canvas cannot draw UMaterialInstanceDynamic

Hello there,

I’ve been getting completely black texture result from Canvas drawing UMaterialInstanceDynamic. It’s rendering fine with UMaterialInstanceConstant and all. Here’s the code I used:

//----------------OnInit()--------------- //

UMaterialInterface* nMat=
Cast’(StaticLoadObject(UMaterialInterface::StaticClass(),
NULL, path));

if (nMat) T =
UMaterialInstanceDynamic::Create(nMat,
this);

//----------------- OnRender()------------------------- //

if (T) Canvas->K2_DrawMaterial( T,
…);

I’m at my wits end. Hope someone can shred some light on this.

Best,

Not sure if it helps but try to use emission for color (or anything you are trying to do) instead of diffuse in your base material (Because I suppose there is no light in canvas :D). Even if this didn’t work I think your problem is with your material not with your code.

Well, the material is rendered properly when it’s set as UMaterialConstant, so I don’t think my material is at false here. (And yes, I use emissive channel and all that jazz, following all the guides closely here.)

Thanks for the help though. Will there be any other answers for chances that they might help strike the spot? T_T