#BIRP issue: Blit() ignores point filtering, applies bilinear filtering.

1 messages · Page 1 of 1 (latest)

wicked grotto
#

It is as the title reads.
I'm creating several render textures in a script on awake, making sure to set all their filter modes to "point" like so:

rt_NativeBase = new RenderTexture(rtd_Native); // Using a RenderTextureDescriptor, which does NOT have filter nor wrap modes...
rt_NativeBase.filterMode = FilterMode.Point;
rt_NativeBase.wrapMode = TextureWrapMode.Clamp;
rt_NativeBase.Create(); // I got paranoid that the RT was being "created" before I applied the filter mode, so I create it here manually afterwards.

The issue comes in my OnPostRender() method, where-in I take what was rendered to rt_NativeBase (which has a resolution of 320x240, pretty small), apply a dither pass to rt_NativeDither (created by suppling rt_NativeBase in its constructor, ensuring it gets all the same parameters), and then finally blit rt_NativeDither to a larger RT named rt_ScreenUpscale. Ideally, this should upscale the low-res pixel render with point-filtering, so it remains pixelated. But instead, I get a clearly bilinearly upscaled result.

I have zero clue why this is happening. To my knowledge, the only filter mode that should affect this outcome, is the src-texture's filter mode right? Since it is the texture being "stretched" due to UV space being 0-1 and all that. But regardless, every texture I use here has been explicitly set to have point filtering, yet I get bilinear filtering.

The attached image is the result I get. I've checked the Frame Debugger and the steps show the dithering draw event behaving correctly, and then the very next draw event is the upscale happening bilinearly with no explanation. The src/dest RTs look good too, it's been bugging me for over a day now lol. Does anyone know why this is happening? Is it just how the blit-shader works, and should I really be writing my own or what?

pallid rampart
#

Perhaps blit is the problem? Try using a custom shader that uses the texture sampler that you set to point.