Skip to content

VLC Forces Point Filtering

Summary

Video textures in Unity are Point (Nearest-Neighbor) filtered -- regardless of how Unity tries to filter them.

Minimal project and steps to reproduce

  1. Clone this repo: https://gitlab.com/brisingre/vlc-unity-bugs
  2. Import VLC Unity
  3. Open the "118 Textures Are Pixelated" scene
  4. Press play and watch the bug happen

What is the current bug behavior?

Videos have big sharp-edged pixels regardless of Unity filter mode. (It is possible this can be fixed by changing some libvlc setting.)

What is the expected correct behavior?

Videos should respect Unity filter mode settings.

If that's not practical, there should be a simple way to change the texture filtering settings of the MediaPlayer. (This could exist already.)

If that's not practical either, at very least the default filter mode should be bilinear interpolation, right? That's what most people are going to use...

Does it work on other plaforms? Does it work with the official VLC apps?

Right now VLC for Unity only supports one platform. I have never noticed VLC struggling with this.

Environment

  • OS: Windows
  • Version 10 LTSC
  • Device: PC
  • LibVLC version and architecture 4.0.0 x64
  • LibVLCSharp version Not quite sure how to check this, sorry.
  • VLC Unity plugin version 0.1.3
  • Scripting backend used Mono

Possible fixes

My preferred workaround is to use Graphics.Blit() to copy each frame into a second texture.

Graphics.Blit(vlcTex, outputTex, new Vector2(-1, 1), Vector2.zero); //Copy the vlc texture into the output texture, flipped.

Edited by LL