Lypheo / vs-placebo

libplacebo-based debanding, scaling and color mapping plugin for VapourSynth
GNU Lesser General Public License v2.1
73 stars 13 forks source link

My glsl shader does not work #7

Closed HuangZhenHZ closed 3 years ago

HuangZhenHZ commented 3 years ago

I wrote a simple glsl shader, here is the code:

//!HOOK LUMA
//!BIND LUMA
//!DESC HZ

vec4 hook(){
    return vec4(float(LUMA_texOff(vec2(0,0)))*2, 0, 0, 1);
}

It only doubles the values of luma, and works properly in my mpv player.

But when I tries to use it in vs-placebo, it does not work at all.

I have tried "FSRCNNX_x2_8-0-4-1.glsl" in vs-placebo, and it worked well.

Lypheo commented 3 years ago

Can’t reproduce, works fine for me. What’s your VS script?

E: Nevermind, I can reproduce if I supply the shader with shader instead of shader_s.

HuangZhenHZ commented 3 years ago

I use "python-3.8.7-embed-amd64" and "VapourSynth64-Portable-R52" Here is my VS script:

import vapoursynth as vs
core = vs.get_core()
video = core.ffms2.Source(source='input.mp4')
video = core.resize.Bicubic(clip=video, format=vs.YUV444P16)
video = core.placebo.Shader(clip=video, shader=r"D:\glsl\luma.glsl", width=1920, height=1080)
video.set_output()

"FSRCNNX_x2_8-0-4-1.glsl" works fine for me. At the end of "FSRCNNX_x2_8-0-4-1.glsl", there is a line:

return vec4(res[index.x * 2 + index.y], 0, 0, 1);

If I change it to:

return vec4(res[index.x * 2 + index.y] *2 , 0, 0, 1);

and then use it in vs-placebo, I can see the difference obviously, so it works fine. I feel so strange. May be it's not a bug of vs-placebo.

HuangZhenHZ commented 3 years ago

I am sorry that I forgot to reply yesterday. My friend compiled it and it works fine. Thank you very much.