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

[ Question ] Glsl and OpenGL #120

Open
Snouf-ID opened this issue Apr 20, 2021 · 6 comments
Open

[ Question ] Glsl and OpenGL #120

Snouf-ID opened this issue Apr 20, 2021 · 6 comments

Comments

@Snouf-ID
Copy link

Hello,

I am looking to use this shader glsl in my opengl / c ++ program.
But I see it is strongly linked to mvp.
Anyone have any information or help for using these shader outside of MVP?
If we replace the "hook" function of the shaders with a "main" and arrange the input data should it work? Or there is something else that MVP does and it would be good to know?

thank you in advance :)

@kato-megumi
Copy link

If we replace the "hook" function of the shaders with a "main" and arrange the input data should it work?

Mostly

Or there is something else that MVP does and it would be good to know?

Reference https://mpv.io/manual/stable/#options-glsl-shader for MPV specific metadata

@bloc97
Copy link
Owner

bloc97 commented Apr 20, 2021

Reference https://mpv.io/manual/stable/#options-glsl-shader for MPV specific metadata

Replacing those metadata is enough, the bulk of the shader code is the same. Also, I believe mpv outputs the pure GLSL shader in the logs when you load the shader, and there exists a shader cache https://mpv.io/manual/master/#options-gpu-shader-cache-dir that might help you quickly convert from mpv hook format to pure glsl.

Edit: I just checked, the cache is stored as a binary format, so it is not really useful directly.

@FluffyDiscord
Copy link

FluffyDiscord commented Jul 10, 2021

Would you mind @bloc97 providing us with a version for general use, eg. a normal shader usable (almost) anywhere ?

@EnyMan
Copy link

EnyMan commented Dec 9, 2021

@Snouf-ID Have you managed to rewrite the shaders from the hook format to the general shader?

@yooooooLeon
Copy link

yooooooLeon commented Dec 9, 2021 via email

@Snouf-ID
Copy link
Author

Snouf-ID commented Dec 9, 2021

I had made good progress but it takes a lot of time because I do not have a basic understanding of the syntax used here and defines them from the video player, how shader are call...
It would probably be easier for someone who already understands the code and operation of this repository.
A general-purpose glsh or hlsl shader on this project would be a really great feature.

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

6 participants