[Bug] Using FCanvasTileItem with a Material

So I’ve a custom hud class and my UI guy has asked me about using Materials outside of Slate. I implemented a component to render them, similar to my standard texture component, but all I got was a black square on the screen. I went back to basics, and created a FCanvasTileItem during the DrawHUD() method… still get a black square.

	FCanvasTileItem cmTest = FCanvasTileItem(
		FVector2D( 500.f, 200.f ),
		mTest->GetRenderProxy( false, false ),
		FVector2D( 256.f, 256.f )
	);

	oCanvas->DrawItem( cmTest );

Is the code I’m using. mTest links to a material, fetched in the constructor and stored in a UPROPERTY(), which renders perfectly fine in the material editor (with no parameters required - though it does have some (I also tried a new material, which just fed a constant vector in to the base colour pin, without success.))

I’ve tried setting the Color to FColor::White and various blend modes. Nothing seems to work.

Has anyone have any luck with it?

9498-blacksquare.png

9499-materialrendering.png

My artist suggested using an unlit material, which worked nicely. However, the material appears to lack any gamma correction.

Hi TTam,

If you need Gamma Correction in an Unlit Material, that adjustment would have to be made at the Texture level. That is not something you would be able to adjust dynamically.

Also, keep an eye out for an announcement regarding Materials and Slate.