Hello Carsten, On 28.11.2012 17:29, Carsten Neumann wrote: > Hello Johannes, > > On 11/28/2012 06:37 AM, Johannes Brunen wrote: >> I have a question about the OpenGL Shading Language version I can use in >> my shader code. Is it possible to use version >= 4 within OpenSG? > > yes, I believe that should work. You need to make sure to create an > OpenGL 4.x context though and have the hardware to support such contexts. >
I have written a trivial version 400 shader but it doesn't work. I'm working on the windows platform and I'm using the following set of functions: wglGetPixelFormatAttribivARB SetPixelFormat wglCreateContext After reading the WGL_ARB_create_context WGL_ARB_create_context_profile specifications, (http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt) I'm inclined to think that OpenSG should alternatively support the use of the function HGLRC wglCreateContextAttribsARB( HDC hDC, HGLRC hShareContext, const int *attribList) allowing to request a specific context. The specification states that a call to wglCreateContext(hdc) is identical to a call of wglCreateContextAttribs(hdc,0,NULL) with the the attribute values for all flags to be set to default values. WGL_CONTEXT_MAJOR_VERSION_ARB = 1 WGL_CONTEXT_MINOR_VERSION_ARB = 0 WGL_CONTEXT_PROFILE_MASK_ARB = WGL_CONTEXT_CORE_PROFILE_BIT_ARB WGL_CONTEXT_LAYER_PLANE = 0 WGL_CONTEXT_FLAGS_ARB = 0 >> In >> case that the answer is No, what is missing for up to date compatibility >> with the GL spec? > > we don't have the infrastructure for the two types of tesselation > shaders that were introduced with 4.x yet. > There might be more to be missing. Correct me if I'm wrong. 1. gl_Vertex etc. aren't supported anymore. The use of glVertexAttribPointer and glEnableVertexAttribArray APIs are necessary. I'm not sure, however. 2. Maybe the use of glBindAttribLocation must be installed. 3. APIs glGetSubroutineIndex, glUniformSubroutinesuiv usage for enabling of shader subroutines. 4. Since many of the former standard uniforms are removed they should be supported by OpenSG defaults. Maybe this is already covered by the OSGShaderVariableOSG provided goodies. >> I ask this question because I'm undecided about what is the best route >> to go for future shader code I have to write. Is there anyone >> (listening) actually writing GLSL 4 based shaders? > > I think the highest #version tag I've used so far was 330, but that was > also outside of OpenSG. By requiring #version 4xx you are excluding > anyone without hardware to support OpenGL 4.x, whether that is > acceptable depends on your use case of course ;) > The API for has changed substantially. So learning a deprecated API is no fun. Therefore I have tinkered with the idea to just learn the current one. Support of older devices is a concern of me. And that will be the reason to go for the older GLSL standard, so. Best, Johannes ------------------------------------------------------------------------------ Keep yourself connected to Go Parallel: VERIFY Test and improve your parallel project with help from experts and peers. http://goparallel.sourceforge.net _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users