coin3d / coin

Coin3D core library
BSD 3-Clause "New" or "Revised" License
265 stars 105 forks source link

Missing GLES support #449

Open podsvirov opened 3 years ago

podsvirov commented 3 years ago

Strategically, this is a step towards supporting WebAssembly via Emscripten and creating 3D viewers in modern browsers.

PS: If I'm wrong about something, then correct me.

VolkerEnderlein commented 3 years ago

No, you are definitely right. Besides implementing the EGL support for Wayland this is another important issue that needs to be done to keep Coin alive and kicking :)

luzpaz commented 2 years ago

We have a showstopper here.

podsvirov commented 2 years ago

I have experience to port OpenGL ES 3.0 Programming Guide Sample Code to Emscripten. It uses both EGL and GLES API. But I don't have enough free time and knowledge of Coin architecture to apply this experience.

VolkerEnderlein commented 2 years ago

Unfortunately my OpenGL knowledge is very basic. I've had a look into the Coin wgl stuff but could not derive a proper schedule what needs to be done to implement egl bindings. That's why I marked this as help wanted. Sorry.

luzpaz commented 2 years ago

Anyone know of someone that could tackle this? If not, how to we proceed?

luzpaz commented 2 years ago

CC @wmayer @yorikvanhavre @realthunder @kkremitzki

VolkerEnderlein commented 2 years ago

@epuzanov has been kindly working on this and provided PR #470 for this. I have tested this and just merged with master.

hfiguiere commented 2 years ago

I built FreeCAD (as a flatpak) with coin3d from master (commit 28ac68d3de1970b32fd9524ad1ba6d0a502b78f2), passing -DCOIN_BUILD_EGL=YES. On x86_64, no problem.

But on aarch64 (it's built with a Qt5 that only has GLES, and it's running on a RaspberryPi 4 64-bits), when I open a model I get this errors:

Coin warning in cc_glglue_instance(): Error when setting up the GL context. This can happen if there is no current context, or if the context has been set up incorrectly.
Coin warning in SoGLPolygonOffsetElement::updategl(): OpenGL driver doesn't support z-buffer offsetting

And then the display looks like this: freecad

epuzanov commented 2 years ago

The GLES is not an EGL. The Coin3d library used an OpenGL API, some part of it must be rewritten to be compatible with OpenGL ES API. The EGL support is needed for compatibility with Wayland, because Wayland doesn't support GLX API. Summary: GLX (X11) -> EGL (Wayland) OpenGL -> OpenGL ES (GLES)

hfiguiere commented 2 years ago

Which I is I thought I had understood, but https://github.com/coin3d/coin/issues/449#issuecomment-1007506992 threw me off thinking it would work.

At least it no longer crashes, but that could be a different reason.

(yes the RaspberryPi still doesn't use Wayland/Weston)

VolkerEnderlein commented 2 years ago

@hfiguiere So it seems to be my misunderstanding. I thought it to be somewhat related to the EGL work. Sorry for the noise.

luzpaz commented 2 years ago

Any progress on this?

luzpaz commented 3 months ago

bump