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

Possible bug prevents OpenGL from being rendered into React Native Desktop #479

Open
lattice0 opened this issue Jun 30, 2019 · 0 comments
Open

Comments

@lattice0
Copy link

lattice0 commented Jun 30, 2019

I created an OpenGL renderable item to include in my React Native Desktop project. I tested it in pure QT before using it in React Native Desktop.

In the pure QT example, the renderable item behaves as it should: it renders a red screen inside the area delimited by the QML item. For example:

Grid {
columns: 2
spacing: 2
width: 1280
height: 720

OpenGlVideoQtQuick2 {
width: 640
height: 360
}

}

will generate a red rectangle inside the 640x360 area of the grid, which is the first space of the 2x2 grid.

However, when I add that item to React Native Desktop, it will not just render in the entire screen, but render a buggy red dotted screen for which I cannot find an explanation.

See the difference here:

Pure QT example:

Screenshot from 2019-06-30 17-57-44

The same QT item but in React Native Desktop:

Screenshot from 2019-06-30 17-57-34

So the problem is: rendering is wrong, and it occupies the entire screen, when it should have a fixed size.

I created this minimum verifiable example so you can compile and see for yourself:

https://github.com/lucaszanella/orwell_debug_opengl_example/tree/091b9a012b1a2be03f2a5634821704103f41f982

For the qt program, just go into the qt folder and compile there

For the react native desktop program, just go into orwellJS

The compile commands are in the readme.

Here's what happens when I try to render video instead of just a red rectangle:

Screenshot from 2019-06-29 16-08-16

The video becomes red and occupies the entire screen. I've had this problem of video becoming red in other cases, it looks like it's a problem of shaders not being used. But I don't see how this happens in React Native Desktop, as I just instantited the item.

I tried debugging with GammaRay as you can see in the image above, but I got nothing strange. I've also read the React Native Desktop source code to find how items get instantiated. I couldn't find the exact spot yet where that happens, if someone could point me out, I could try to isolate the problem better.

Anyone has any idea of what's happening?

I think the only explanation is that the instantiation of QML items happens in a very exotic way that breaks how OpenGL works, I don't know. PS: by helping me, you're helping an open source project :)

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

1 participant