How to disable anti-aliasing for RenderTarget?

Hey everyone!
How to draw alpha on UTextureRenderTarget2D without (anti-aliasing), now I’m doing it with this code

RenderTargets[i] = UKismetRenderingLibrary::CreateRenderTarget2D(GetWorld(), Mask[i]->GetSurfaceWidth(), Mask[i]->GetSurfaceHeight());
UCanvas* Canvas;
FVector2D Size;
FDrawToRenderTargetContext Ctx;
UKismetRenderingLibrary::BeginDrawCanvasToRenderTarget(GetWorld(), RenderTargets[i], Canvas, Size, Ctx);
UKismetRenderingLibrary::ClearRenderTarget2D(GetWorld(), RenderTargets[i], FLinearColor::Transparent);
Canvas->K2_DrawTexture(Mask[i], FVector2D::ZeroVector, Size, FVector2D::ZeroVector, FVector2D::UnitVector, FLinearColor::White, BLEND_AlphaComposite);
UKismetRenderingLibrary::EndDrawCanvasToRenderTarget(GetWorld(), Ctx);

in PC everything is fine

but when i run it on oculus quest, it looks like this

I have exported the resulting of render target and as I see the alpha channel is blurred.
Screenshot_21

How it must look like:

All I want to do is draw a texture in runtime

P.S. i am not sure that was anti-aliasing problem

Hey there @yoga3001! Welcome to the community! I don’t know if that’s an AA issue, I think that might actually be a mipmap issue. In the texture2D itself, if it has mipmaps set the generation to noMipMaps and LOD Bias to 0. (you may want to have them on in mobile VR but this may help identify the issue)
image

Give it a shot and let me know how it goes!

Hi!
Thank you, yesterday I tried to do the same thing and it helped, so that was a solution

1 Like