Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] MipMapping support #41

Open
orels1 opened this issue Jun 6, 2024 · 6 comments
Open

[Feature Request] MipMapping support #41

orels1 opened this issue Jun 6, 2024 · 6 comments

Comments

@orels1
Copy link
Contributor

orels1 commented Jun 6, 2024

Have been really enjoying using your player, but there is one thing that has been bothering me a little.

When watching 1080p videos with a lot of detail - the aliasing becomes fairly noticeable, especially on the portable screens.

Since you already have a mechanism to blit the screen to fix AVPro empty frame issues and for LTCGI - I was wondering if its possible to add support for generating MipMaps?

I did a quick test and it seems like its possible to simply expand the current blit setup to use mips so it would generate them on blit

            if (bufferedTexture == null)
            {
                int width = texture.width, height = texture.height;
                Debug.Log($"[VVMW] Created temporary render texture for {playerName}: {width}x{height}");
                bufferedTexture = VRCRenderTexture.GetTemporary(width, height, 0, RenderTextureFormat.ARGB64, RenderTextureReadWrite.sRGB, 1);
                bufferedTexture.filterMode = FilterMode.Bilinear;
                bufferedTexture.wrapMode = TextureWrapMode.Clamp;
                bufferedTexture.useMipMap = true;
                bufferedTexture.anisoLevel = 16;
                core._OnTextureChanged();
            }
@JLChnToZ
Copy link
Owner

JLChnToZ commented Jun 7, 2024

It is a good idea though, but if I just enable mipmaps at here will make it inconsistent to other video player backends.

@orels1
Copy link
Contributor Author

orels1 commented Jun 7, 2024

Could at least be an option on the video player handler/somewhere else? Just so people can enable it even if they don't know how to code 🤔

And yeah I haven't tested / looked into the Unity video player side. I assume it doesn't blit at all right now?

@JLChnToZ
Copy link
Owner

JLChnToZ commented Jun 7, 2024

The blit logic only applies to AVPro screen, I'm using a dedicated shader just for this workaround.
Also as this is a workaround, and blitting texture costs performance, this flow might be removed once underlying issue has been fixed in future.
So I still wondering if logic for changing mipmap setting is appropriate in here.

@orels1
Copy link
Contributor Author

orels1 commented Jun 7, 2024

I see.
Do you still blit for both backends if the user uses LTCGI texture export?
Wonder if this could be done in a similar way in that case

@JLChnToZ
Copy link
Owner

JLChnToZ commented Jun 7, 2024

LTCGI flow is just blit to/within a custom render texture, when assigned the target LTCGI screen and it starts playing video, the player simply sets the screen texture to its underly material, nothing fancy here.

@orels1
Copy link
Contributor Author

orels1 commented Jun 7, 2024

I guess I can just handle it on my side and do a second blit of the screen texture before it goes to screen in the world code. Can't really come up with a better solution that doesnt require major changes to the codebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants