-
Notifications
You must be signed in to change notification settings - Fork 2
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
Error when trying to load shaders #1
Comments
Hey, I just saw your issue today... |
I have changed the vector types from vec to float, and that has solved that issue, and I have also changed the file type from GLSL to HLSL using Visual Studio, but I have run into a new issue. After running the shader again in OBS, it now comes up with "error X3000: syntax error: unexpected token 'new'." It doesn't seem to like the "new" functions, and I don't know what to change it to. I wasn't able to find anything on this either. |
In which shader you have that error? |
I'm having that error in the Chromatic Aberration shader, as that's the one I'm currently trying to fix. All but two shaders work because of the vec4 problem. |
This is the original code: /* Chromatic Aberration
*/
#pragma shaderfilter set chromab_dist__description Distance
#pragma shaderfilter set chromab_dist__default 2
#pragma shaderfilter set chromab_dist__min 0
#pragma shaderfilter set chromab_dist__max 8
#pragma shaderfilter set chromab_dist__slider true
uniform float chromab_dist;
vec4 render(vec2 uv) {
vec3 new = vec3(0.0);
vec3 distance = vec3(1.0-(chromab_dist*0.01), 1.0-(chromab_dist*0.02), 1.0-(chromab_dist*0.03));
new.r = vec3(texture2D(image, (uv - vec2(0.50,0.50)) * distance[0] + vec2(0.50,0.50))).r;
new.g = vec3(texture2D(image, (uv - vec2(0.50,0.50)) * distance[1] + vec2(0.50,0.50))).g;
new.b = vec3(texture2D(image, (uv - vec2(0.50,0.50)) * distance[2] + vec2(0.50,0.50))).b;
return vec4(new, 1.0);
} Look at the line that includes the "new" word. |
I tried to use these shaders with ShaderFilter Plus, but only two of the shaders worked. I always get an error like this:
Could not create the effect due to the following error: device_pixelshader_create (D3D11): Compiler warnings/errors for C:/Program Files/obs-studio/obs-plugins/64bit/ShaderFilter-Plus/obs-shaders/chromatic_aberration.glsl (Pixel shader, technique Draw, pass 0): C:\Program Files\obs-studio\obs-plugins\64bit\ShaderFilter-Plus\obs-shaders\chromatic_aberration.glsl (Pixel shader, technique Draw, pass 0)(12,1-4): error X3000: unrecognized identifier 'vec4'
Pass (0) <> missing pixel shader!
Only the "wave" and "quad_don_gilberto_manhatten_ruiz" shaders work. Am I missing something or is there a problem with the code?
The text was updated successfully, but these errors were encountered: