exeldro / obs-shaderfilter

OBS Studio filter for applying an arbitrary shader to a source.
GNU General Public License v2.0
377 stars 39 forks source link

no matching function for call to `clamp(vec2, vec2, float) #48

Closed CrunchySlime closed 5 months ago

CrunchySlime commented 5 months ago

Hi ! Thanks a lot for this plugin, i'm trying to use the pixelation-transition.shader and it gives the following error :

error: device_pixelshader_create (GL) failed
error: Pass (0) <> missing pixel shader!
warning: [obs-shaderfilter] Unable to create effect. Errors returned from parser:
(null) (110, 1): Error creating shader: 0:66(7): error: no matching function for call to `clamp(vec2, vec2, float)'; candidates are:
0:66(7): error:    float clamp(float, float, float)
0:66(7): error:    vec2 clamp(vec2, float, float)
0:66(7): error:    vec3 clamp(vec3, float, float)
0:66(7): error:    vec4 clamp(vec4, float, float)
0:66(7): error:    vec2 clamp(vec2, vec2, vec2)
0:66(7): error:    vec3 clamp(vec3, vec3, vec3)
0:66(7): error:    vec4 clamp(vec4, vec4, vec4)
0:66(7): error:    int clamp(int, int, int)
0:66(7): error:    ivec2 clamp(ivec2, int, int)
0:66(7): error:    ivec3 clamp(ivec3, int, int)
0:66(7): error:    ivec4 clamp(ivec4, int, int)
0:66(7): error:    ivec2 clamp(ivec2, ivec2, ivec2)
0:66(7): error:    ivec3 clamp(ivec3, ivec3, ivec3)
0:66(7): error:    ivec4 clamp(ivec4, ivec4, ivec4)
0:66(7): error:    uint clamp(uint, uint, uint)
0:66(7): error:    uvec2 clamp(uvec2, uint, uint)
0:66(7): error:    uvec3 clamp(uvec3, uint, uint)
0:66(7): error:    uvec4 clamp(uvec4, uint, uint)
0:66(7): error:    uvec2 clamp(uvec2, uvec2, uvec2)
0:66(7): error:    uvec3 clamp(uvec3, uvec3, uvec3)
0:66(7): error:    uvec4 clamp(uvec4, uvec4, uvec4)

I'm running this on arch linux, obs-shaderfilter being installed from the AUR.

aur/obs-shaderfilter-git 2.2.2-1 (+2 0.04) (Installed: 2.3.1.r1.g30011f0-1)

I've done a bit of googling without any success, would you have a few pointers to where I could find a fix ? Thanks

CrunchySlime commented 5 months ago

temporary fix is to comment line 47 in pixelation-transition.shader

  uv += float2(center_x, center_y);
//uv = clamp(uv, 1.0/uv_size, 1.0);
  float4 rgba = image.Sample(textureSampler, uv);
exeldro commented 5 months ago

change it to uv = clamp(uv, 1.0/uv_size, float2(1.0, 1.0));

CrunchySlime commented 5 months ago

Thx that did it, Thanks for the help and the awesome plugin