Jump to content

OpenGL invalid operation error


photo

Recommended Posts

Hi !

We recently made this post and with the support team's help we managed to create an OpenGL compatible profile.

My team and I are now facing another problem regarding OpenGL implementation in Unigine.

In the linked zip you can find the data and source folder of a sample project.

If you run this project (Unigine 2.10), you will see that every time the render callback is called, the error message "OpenGL error: invalid operation" is printed in the console.

The error comes from the line 80:

	_albedo_test->fromGLTexture2D(_texture_id, _procedural_width, _procedural_height, Texture::FORMAT_RGBA32F, Texture::WRAP_CLAMP | Texture::FILTER_LINEAR);

Can you help us resolve this error ?

Thanks.

sample_sources.zip

Link to comment

Hello Antoine,

You can debug this kind of errors (OpenGL invalid operation) with the command line argument -video_debug 1.
In your case it gives "OpenGL error(high): GL_INVALID_OPERATION error generated. Texture is immutable."

This is due fromGLTexture2D call every frame. The first time it creates storage for the texture. The second time it attempts to create storage but the storage already exists so it fails. The solution is to move that call to the init stage:

_albedo_test = Texture::create();
_albedo_test->fromGLTexture2D(_texture_id, _procedural_width, _procedural_height, Texture::FORMAT_RGBA8, Texture::WRAP_CLAMP | Texture::FILTER_LINEAR);

 

  • Like 1
  • Thanks 1
Link to comment
×
×
  • Create New...