Syncaidius / MoltenEngine

A spare-time C# .NET 8 game engine project. Cross-platform, multi-threaded.
MIT License
299 stars 20 forks source link

OpenGL Support #39

Closed Syncaidius closed 1 year ago

Syncaidius commented 2 years ago

Add support for OpenGL:

IceReaper commented 2 years ago

Been writing several opengl renderers myself lastly. Mac however is a serious problem when it comes to opengl. :/ Might be better to stick to vulkan (or later a metal renderer) on mac? While openGL 4.1 is supported (but marked deprecated) on mac, its always possible OpenGL gets removed completely somewhen.

Also not using OpenGL 4.6 means:

Sure, games also worked pre-4.6. But i personally think that using those "newer" (they are over 5 years old) opengl features might realy make the OpenGL renderer benefit from that.

When my current renderer is somewhat finished, ill push it to github anyway, so if there is interest, ill link it here, as i implemented those features. Its a deferred renderer, with ambient light, directional lights, point lights, spot light as well with full shadow mapping and PBR material support. Planning on also adding gpu skinning before pushing it.

Syncaidius commented 2 years ago

OpenGL is an interesting subject. I've been holding off on OpenGL support while trying to figure out if going straight to Vulkan would be a better use of time.

Many newer android phones now support vulkan in some form, as well as Windows and Linux.

If vulkan is supported on Mac also, then maybe dropping OpenGL in favour of vulkan development and longer-term viability, is a better choice.

The only downside to dropping OpenGL is legacy support for older devices. I'll probably need to look at this more, as it's likely not a small percent of the market.

OpenGL 4.6 sounds like the target to aim for though, if Molten gets OpenGL support.

IceReaper commented 2 years ago

Defenitely. Vulkan works an all platforms, so a proper vulkan renderer would make all others basically obsolete. On mac, all you need is MoltenVK ;) Vulkan even works on mobile and consoles, so no need for any other renderers theoretically.

I have a pretty high interest in building a vulkan renderer myself, but im totaly lacking proper documentation / tutorials. I mean the apis are public, but if you have no clue what you need to lookup, things get tricky :D

Syncaidius commented 1 year ago

OpenGL support is going to be dropped to allow focus on the more modern DirectX 12 and Vulkan APIs.

DirectX 11 support will be maintained until the market shifts away from it.