eryar / occQt

A simple OpenCASCADE Qt demo.
MIT License
280 stars 129 forks source link

VBO creation for Primitive Array has failed for 169 vertices. Out of memory? #14

Closed siserte closed 3 years ago

siserte commented 5 years ago

I have compiled the program and when I execute it, I get the following error:

 TKOpenGl | Type: Performance | ID: 0 | Severity: Low | Message:   
VBO creation for Primitive Array has failed for 169 vertices. Out of memory?

Any idea?

My testbed:

eryar commented 5 years ago

Have you tried with OpenCASCADE7.3.0?

siserte commented 5 years ago

Not yet. Does it mean that it cannot work with OCC 6.9.1?

eryar commented 5 years ago

What operation cause that Out of memory error?

siserte commented 5 years ago

I've executed the original code without changes. Before the error I get this message:

QWidget::repaint: Recursive repaint detected
TKOpenGl | Type: Performance | ID: 0 | Severity: Low | Message:
  VBO creation for Primitive Array has failed for 169 vertices. Out of memory?

Does it help? If not, I am happy to follow your guides to debug!

Thank you!

eryar commented 5 years ago

For opencascade6.9.x I remember that you should set several environment variables, such as: set CSF_ShaderDirectory=%CASROOT%\src\Shaders set CSF_GraphicShr=TKOpenGl.dll

you can define them in a *.bat file before run the occQt.exe.

siserte commented 5 years ago

I've added those variables to the "Run environment" in QT (and also in the .pro file) without any difference. I understand that from there they should be read.

We are missing something...

Thank you!

eryar commented 5 years ago

Could you give a screenshot for that error?

siserte commented 5 years ago

Here it goes!

image

Thank you!

eryar commented 5 years ago

From your screenshot, I think it is the shader environment variable problem, you can refer the older version of occQt to handle this for opencascade6.9.x:

https://github.com/eryar/occQt/commit/37e96f5c8ded2d5775019423d1bc94b82a8bc539#diff-118fcbaaba162ba17933c7893247df3a

For opencascade7.x version solve this problem and do not need set environment variable for shader path. It is better to use the opencascade7.x version.

eryar commented 5 years ago

Hi @siserte, Have you solved the problem?

siserte commented 5 years ago

Sorry! I wanted to test it a little bit more. The program compiles and runs. However, although I can add objects, I cannot rotate, move, etc... them.

Thank you!

eryar commented 5 years ago

@siserte Ok, I will close this issue.

You can not rotate, move, .etc the displayed objects in the current version. The rotate, move and pan function is only for the 3d viewer.

I will add the AIS_Manipulator to move, rotate the objects soon.

siserte commented 5 years ago

Thank you! I'm looking forward for that feature!

eryar commented 5 years ago

The class AIS_Manipulator is introduced in opencascade7.2.0, so the version before 7.2.0 will not support this feature.

mnesarco commented 3 years ago

Hi @eryar , @siserte Do you have any more info about this issue? I have the same error with OCCT 7.4.0

Requesting OpenGL 4.3 core context succeeded
TKOpenGl | Type: Performance | ID: 0 | Severity: Low | Message:
  VBO creation for Primitive Array has failed for 46 vertices. Out of memory?

Sometimes I also get this error:

Requesting OpenGL 4.3 core context succeeded
TKOpenGl | Type: Error | ID: 0 | Severity: High | Message:
  FBO blitting has failed [Error #1282]
  Please check your graphics driver settings or try updating driver.
  MSAA settings should not be overridden by driver!

Thank you in advance.

eryar commented 3 years ago

@mnesarco Maybe your graphics driver problem, try to update your graphics?

mnesarco commented 3 years ago

Hi @eryar It was a synchronization problem, i accidentally modify the renderer state from the gui thread. I have fixed it and now it is working as expected.