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

Is it possible to use Vtk9.0.0 #56

Open
crocketyang opened this issue Jun 16, 2020 · 10 comments
Open

Is it possible to use Vtk9.0.0 #56

crocketyang opened this issue Jun 16, 2020 · 10 comments

Comments

@crocketyang
Copy link

Is it possible to use Vtk9.0.0, since I know Vtk9.0.0 fixed many issues.

@maidamai0
Copy link
Contributor

maidamai0 commented Jun 25, 2020

Did't compile with vtk9.0.0.
I just compiled it with vtk from master, after fixing some small issues there is one left I don't know how to do at quickVtkFboOffscreenWindow.cpp:

auto FboOffscreenWindow::SetFramebufferObject(QOpenGLFramebufferObject *fbo) -> void {
    this->BackLeftBuffer = this->FrontLeftBuffer = this->BackBuffer = this->FrontBuffer = static_cast<unsigned int>(GL_COLOR_ATTACHMENT0);

    auto size                    = fbo->size();

    this->Size[0]                   = size.width();
    this->Size[1]                   = size.height();
    this->NumberOfFrameBuffers      = 1;
    this->FrameBufferObject         = static_cast<unsigned int>(fbo->handle());
    this->DepthRenderBufferObject   = 0;
    this->TextureObjects[0]         = static_cast<unsigned int>(fbo->texture());
    this->OffScreenRendering        = 1;
    this->OffScreenUseFrameBuffer   = 1;
    this->Modified();
}

So, from this commit some real changes must be made to compile with the latest vtk.

@maidamai0
Copy link
Contributor

According to this issue on gitlab vtk it seems still possible to to this.But I don't know how.

@danielbuhrig
Copy link

Any solution yet? I'm facing the same problem.

@qCring
Copy link
Owner

qCring commented Sep 24, 2020

Hey @danielbuhrig, I'm working on refactoring the project and set things up for VTK 9.0 but that will take some time. I'll keep this issue updated as development goes on

@danielbuhrig
Copy link

danielbuhrig commented Sep 24, 2020 via email

@jhuels
Copy link

jhuels commented Nov 10, 2020

@qCring Did you make any progress here? I'm also at looking integrating using the QQuickFrameBuffer interface. From your code, I believe the SetFrameBufferObject function needs to become something like the following:

    auto FboOffscreenWindow::SetFramebufferObject(QOpenGLFramebufferObject* fbo) -> void
    {
        vtkTextureObject* tex = vtkTextureObject::New();
        tex->AssignToExistingTexture(fbo->handle(), fbo->texture());
        this->GetDisplayFramebuffer()->AddColorAttachment(0, tex);
        this->Modified();
    }

After making this change, I'm having some problems with initializing the OpenGL state.

In OpenGLInitState the application is getting an Access Violation in vtkOpenGLState::Initialize() on the following function ::glBlendFuncSeparate(cs.BlendFunc[0], cs.BlendFunc[1], cs.BlendFunc[2], cs.BlendFunc[3]);.

Let me know if you've seen this, maybe we can help each other out.

EDIT: If I call glBlendFuncSeparate directly in OpenGLInitState, it seems to take fine. But the code snippet above probably isn't right. I'm getting lots of gl errors now:

vtkTextureObject.cxx:1751   ERR| vtkTextureObject (000001E44367A6E0): failed at glTexImage2D 1 OpenGL errors detected
  0 : (1280) Invalid enum

I'm just going to roll back to 8.2 for now.

@JensMunkHansen
Copy link

JensMunkHansen commented Nov 11, 2020 via email

@jhuels
Copy link

jhuels commented Nov 11, 2020

Thanks for the hint Jens!

I found out it was due to GLEW not being initialized before setting up the context state. This can be solved by calling vtkOpenGLRenderWindow::OpenGLInitContext() before initializing the vtkOpenGLState.

@behtgod
Copy link

behtgod commented Dec 8, 2020

@jhuels Did you means that you have success to migrate to VTK 9.0?

@jhuels
Copy link

jhuels commented Dec 8, 2020

No, I just used 8.2 cause it worked. I had the same issue on both versions, so presumably you could get 9.0 working as well.

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

7 participants