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

ofShader warnings when running in Windows 10. #16

Open
kirbyszeto opened this issue Jun 10, 2019 · 4 comments
Open

ofShader warnings when running in Windows 10. #16

kirbyszeto opened this issue Jun 10, 2019 · 4 comments

Comments

@kirbyszeto
Copy link

I have been writing/compiling my app from Windows 7, VS 2017.
Running the app locally works fine.

If I try to run the compiled app from a Windows 10 machine, I get a series of ofShader warnings, then the app stops rendering. I can see notices running in the debug window, so I know it is still running. just not rendering anything.

warnings look like:
Untitled

@mantissa
Copy link
Contributor

That shader needs to be updated to GLSL version 150 or greater to work in your project.

@kirbyszeto
Copy link
Author

Thanks! is that something updated through the device driver?

@mantissa
Copy link
Contributor

My bad, there is support for OpenGL 4.0 in the source code.
Try using this code to create your window in main.cpp

ofGLWindowSettings settings;
settings.setGLVersion(4,0);
settings.width = 1200;
settings.height = 700;
ofCreateWindow(settings);	

@kirbyszeto
Copy link
Author

When I do that, I now get this error:

[ error ] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader failed to compile
[ error ] ofShader: GL_FRAGMENT_SHADER shader reports:
ERROR: 0:2: 'texture2D' : function is removed in Forward Compatibile context
ERROR: 0:2: 'texture2D' : function is removed in Forward Compatibile context
ERROR: 0:2: '=' : cannot convert from 'const float' to '4-component vector of float'

[ error ] ofShader: GL_FRAGMENT_SHADER, offending line 2 :
1 #version 400
2 uniform sampler2D src_tex0; in vec2 v_texcoord; out vec4 v_fragColor; uniform float width; uniform float height; const vec4 offsets = vec4(-0.50196078431373, -0.50196078431373, 0.0, 0.0); void main() { vec4 CoCgSY = texture2D(src_tex0, v_texcoord); CoCgSY += offsets; float scale = ( CoCgSY.z * ( 255.0 / 8.0 ) ) + 1.0; float Co = CoCgSY.x / scale; float Cg = CoCgSY.y / scale; float Y = CoCgSY.w; vec4 rgba = vec4(Y + Co - Cg, Y + Cg, Y - Co - Cg, 1.0); v_fragColor = rgba; }

[ error ] ofxDSHapVideoPlayer: Failed to setup shader

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