The example is a bit of a hack, there are 2 clearscreens per frame and 2 passes are drawn: one with triangle id numbers (that pass is which GL.ReadPixels() actually uses to "pick" the triangle from) and a second pass which visualizes the object and highlights the selected triangle (or if none, changes background color)
My guess is, that for some reason your graphics card does not like the second clearscreen, or some GL error occurs at the readpixels operation which causes the rest of the frame to fail rendering. I assume the other examples run fine?
You can find out what OpenGL driver is running using GL.GetString with Vendor/Renderer/Version tokens.
Invalid Enum usually translates to "you used some extension that isn't supported by the driver", but the example was meant to be as simple as possible and isn't even using FBO or shaders. A quick look at the source code makes me put my bet on GL.PolygonMode() that draws the triangle's outlines for a better view, but that is actually a GL 1.1 feature. I'm afraid I'm of no help here, cannot debug a problem that I cannot replicate...
GL_VENDOR: Intel
GL_RENDERER: Intel(R) HD Graphics Family
nailing your ongoing problem down to a hardware problem would be quite interesting however i do not think you can complain for incompatibilities. although the vendors should satisfy the OpenGL specifications, Intel video cards have always been known for having flaws regarding the support of graphic features. are your video drivers up to date? it's always worth a shot to update the drivers.
Posted Thursday, 5 April, 2012 - 12:12 by OpenTKstart
yes, but the specification of the graphic card says that i can use it till OpenGL3.0. I just bought the Laptop for this fact, and so it´s more than a reason to complain it. I dont care that Intel had always problems with graphic features, thats their problem, not mine.
I updated all drivers and bios, yesterday. No effect.
Applications need to operate without causing any OpenGL errors, in order to draw correct images. It is possible that neither your Laptop nor the drivers are broken, but that some conditions, which the picking hack relies upon, simply do not work because the framebuffer config requested by the demo is not available or god knows what else. Remember it is a hack exploiting certain conditions - not standard operation.
GL commands cannot be validated at compile time and at runtime it depends on the hardware, driver & context which functions, tokens and extensions are valid to use (assuming no bugs). If commercial games like Quake or the other OpenTK examples run fine (especially if any GLSL examples run at all) you can safely assume that your laptop is ok.
The picking example is generating at very least 1 InvalidEnum error when rendering through your driver, but without even knowing what context was created or direct observation where the error occurs, it's a futile attempt for me to debug it. If you want to find the culprit on your own, you can pinpoint the exact location of the error with a debug build of opentk.dll or by manually checking for errors after each GL call until you find the origin.
Sidenote: If your application's minimum specs are supposed to be "intel laptops" you will have to keep it and work around all problems and issues with it, because if you switch to some AMD/Nvidia renderer this won't change the fact that your users are still using intel laptops ;-)
Comments
Re: OpenGL Picking Example Troubles
The example is a bit of a hack, there are 2 clearscreens per frame and 2 passes are drawn: one with triangle id numbers (that pass is which GL.ReadPixels() actually uses to "pick" the triangle from) and a second pass which visualizes the object and highlights the selected triangle (or if none, changes background color)
My guess is, that for some reason your graphics card does not like the second clearscreen, or some GL error occurs at the readpixels operation which causes the rest of the frame to fail rendering. I assume the other examples run fine?
You can find out what OpenGL driver is running using GL.GetString with Vendor/Renderer/Version tokens.
Re: OpenGL Picking Example Troubles
After i close the Example i get the Error (Error at Swapbuffers: InvalidEnum) shown in the Example Browser.
Here are my Properties:
Re: OpenGL Picking Example Troubles
Invalid Enum usually translates to "you used some extension that isn't supported by the driver", but the example was meant to be as simple as possible and isn't even using FBO or shaders. A quick look at the source code makes me put my bet on GL.PolygonMode() that draws the triangle's outlines for a better view, but that is actually a GL 1.1 feature. I'm afraid I'm of no help here, cannot debug a problem that I cannot replicate...
...maybe you can use OpenGL's own Feedback mechanism to achieve your goal. It's not hardware accelerated but should do the job http://www.glprogramming.com/red/chapter13.html
(Another approach is to do raycasting with a physics library, but that is likely overkill)
Re: OpenGL Picking Example Troubles
but the example was meant to be as simple as possible and isn't even using FBO or shaders.
That´s a interesting point you have marked! My laptop should support till OpenGL 3.0:
http://www.intel.com/support/graphics/intelhdgraphics3000_2000/sb/CS-032...
If i can prove, that this example dont use methods which exceeds OpenGL 3.0, so i can complain a hardware problem at HP.
Re: OpenGL Picking Example Troubles
GL_VENDOR: Intel
GL_RENDERER: Intel(R) HD Graphics Family
nailing your ongoing problem down to a hardware problem would be quite interesting however i do not think you can complain for incompatibilities. although the vendors should satisfy the OpenGL specifications, Intel video cards have always been known for having flaws regarding the support of graphic features. are your video drivers up to date? it's always worth a shot to update the drivers.
Re: OpenGL Picking Example Troubles
yes, but the specification of the graphic card says that i can use it till OpenGL3.0. I just bought the Laptop for this fact, and so it´s more than a reason to complain it. I dont care that Intel had always problems with graphic features, thats their problem, not mine.
I updated all drivers and bios, yesterday. No effect.
Re: OpenGL Picking Example Troubles
Applications need to operate without causing any OpenGL errors, in order to draw correct images. It is possible that neither your Laptop nor the drivers are broken, but that some conditions, which the picking hack relies upon, simply do not work because the framebuffer config requested by the demo is not available or god knows what else. Remember it is a hack exploiting certain conditions - not standard operation.
GL commands cannot be validated at compile time and at runtime it depends on the hardware, driver & context which functions, tokens and extensions are valid to use (assuming no bugs). If commercial games like Quake or the other OpenTK examples run fine (especially if any GLSL examples run at all) you can safely assume that your laptop is ok.
The picking example is generating at very least 1 InvalidEnum error when rendering through your driver, but without even knowing what context was created or direct observation where the error occurs, it's a futile attempt for me to debug it. If you want to find the culprit on your own, you can pinpoint the exact location of the error with a debug build of opentk.dll or by manually checking for errors after each GL call until you find the origin.
Sidenote: If your application's minimum specs are supposed to be "intel laptops" you will have to keep it and work around all problems and issues with it, because if you switch to some AMD/Nvidia renderer this won't change the fact that your users are still using intel laptops ;-)
Re: OpenGL Picking Example Troubles
My Error details is also same as this. Trace informations are listed below. Hope it is a graphic issue
A first chance exception of type 'System.DllNotFoundException' occurred in OpenTK.dll
A first chance exception of type 'System.TypeInitializationException' occurred in OpenTK.dll
A first chance exception of type 'System.DllNotFoundException' occurred in OpenTK.dll
Detected configuration: Windows / .Net
DisplayDevice 1 (primary) supports 57 resolutions.
DisplayDevice 2 (secondary) supports 132 resolutions.
Creating default GraphicsMode (32, 16, 0, 0, 0, 2, False).
Creating GraphicsContext.
Creating GraphicsContext.
Device context: 973150895
Selecting pixel format... GraphicsMode: Index: 2, Color: 32 (8888), Depth: 0, Stencil: 0, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 657110, Parent (Windows.WindowInfo: Handle 3343638, Parent (null))
GraphicsContextFlags: Default
Requested version: 1.0
Loaded opengl32.dll: 1488519168
OpenGL will be bound to handle: 657110
Setting pixel format... 2
Creating temporary context for wgl extensions.
Load extensions for OpenTK.Platform.Windows.Wgl... 44 extensions loaded in 10 ms.
Load extensions for OpenTK.Platform.Windows.Wgl... 44 extensions loaded in 0 ms.
Falling back to GL2... success! (id: 131072)
Selecting pixel format (ARB)... failed (no suitable pixel format).
Disposing context 131072.
Destroying window: Windows.WindowInfo: Handle 3343638, Parent (null)
Device context: 419500557
Selecting pixel format... GraphicsMode: Index: 4, Color: 32 (8888), Depth: 16, Stencil: 0, Samples: 0, Accum: 64 (16161616), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 1968336, Parent (Windows.WindowInfo: Handle 2820272, Parent (null))
GraphicsContextFlags: Default
Requested version: 1.1
OpenGL will be bound to handle: 1968336
Setting pixel format... 4
Falling back to GL2... success! (id: 196608)
Load extensions for OpenTK.Platform.Windows.Wgl... 44 extensions loaded in 0 ms.
Loading extensions for OpenTK.Graphics.OpenGL.GL... 1900 extensions loaded in 222.3988 ms.
Entering main loop.
A first chance exception of type 'OpenTK.Graphics.GraphicsErrorException' occurred in OpenTK.dll
Disposing context 196608.
Destroying window: Windows.WindowInfo: Handle 2820272, Parent (null)
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> OpenTK.Graphics.GraphicsErrorException: InvalidEnum
at OpenTK.Graphics.OpenGL.ErrorHelper.CheckErrors() in C:\OpenTK\1.0\Source\OpenTK\Graphics\OpenGL\ErrorHelper.cs:line 118
at OpenTK.Graphics.OpenGL.ErrorHelper.Dispose() in C:\OpenTK\1.0\Source\OpenTK\Graphics\OpenGL\ErrorHelper.cs:line 129
at OpenTK.Graphics.OpenGL.GL.Enable(EnableCap cap) in C:\OpenTK\1.0\Source\OpenTK\Graphics\OpenGL\GL.cs:line 38768
at Examples.Tutorial.Picking.OnRenderFrame(FrameEventArgs e) in C:\OpenTK\1.0\Source\Examples\OpenGL\1.x\Picking.cs:line 234
at OpenTK.GameWindow.OnRenderFrameInternal(FrameEventArgs e) in C:\OpenTK\1.0\Source\OpenTK\GameWindow.cs:line 1032
at OpenTK.GameWindow.RaiseRenderFrame(Stopwatch render_watch, Double& next_render, FrameEventArgs render_args) in C:\OpenTK\1.0\Source\OpenTK\GameWindow.cs:line 527
at OpenTK.GameWindow.DispatchUpdateAndRenderFrame(Object sender, EventArgs e) in C:\OpenTK\1.0\Source\OpenTK\GameWindow.cs:line 433
at OpenTK.GameWindow.Run(Double updates_per_second, Double frames_per_second) in C:\OpenTK\1.0\Source\OpenTK\GameWindow.cs:line 411
at OpenTK.GameWindow.Run(Double updateRate) in C:\OpenTK\1.0\Source\OpenTK\GameWindow.cs:line 358
at Examples.Tutorial.Picking.Main() in C:\OpenTK\1.0\Source\Examples\OpenGL\1.x\Picking.cs:line 307
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
The thread '' (0x64c) has exited with code 0 (0x0).
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Examples.ExampleBrowser.<>c__DisplayClass2.b__0() in C:\OpenTK\1.0\Source\Examples\ExampleBrowser.cs:line 378