mosra / magnum

Lightweight and modular C++11 graphics middleware for games and data visualization
https://magnum.graphics/
Other
4.8k stars 440 forks source link

Vulkan and the future of Magnum #91

Closed mosra closed 8 years ago

mosra commented 9 years ago

As the news about the OpenGL successor are starting to appear, I'm considering what to do next. I deliberately didn't implement any new GL-related functionality lately, partly because I'm putting all available resources into finally finishing #44 and partly because I didn't want to accidentally create APIs that would be incompatible with the approaches found in glNext, now called Vulkan.

Magnum is not just an OpenGL wrapper, it has also math library, some ugly scenegraph implementation, data import framework etc. These things are not dependent on the underlying graphics API and thus the following decisions should not influence them (besides the effort to make stuff more data-oriented).

So, these are the possible next steps:

In any case, the GL API is deemed to be removed at some point in the future, staying with Vulkan backend only.

Thoughts?

bkaradzic commented 9 years ago

Magnum is not just an OpenGL wrapper

Switch to bgfx, and focus on these:

it has also math library, some ugly scenegraph implementation, data import framework etc.

You'll have more time to make that "ugly scenegraph implementation" pretty, and it will work everywhere... :)

mosra commented 9 years ago

I expected this exact comment, yeah :)

bkaradzic commented 9 years ago

I expected this exact comment, yeah :)

I thought it's not obvious, since you haven't listed it. :)

Jiboo commented 9 years ago

Hello mosra,

If the first goal was to make an OpenGL wrapper + math library (like an OpenGL quickstarter for c++), I think that the next step would be to define the next goal. I don't know which option would be best, I think you should pick the one that will seems to be the most fun/enriching/profitable for you.

I would add an option: Stick with the code, and target only the web, though Emscriptem, as WebGL will probably stick with GLES. You'd keep your current goal, but you limit all users to web only. There's tons of library with this goal, but in JavaScript, none in C++ (Yeah UE4 could do that, but it also cover the current features of Magnum though, but you'd be just lighter & simpler, maybe the JS conversion of Unity or UE4 is too heavy).

Bye, JB.

Squareys commented 9 years ago

I haven't used Magnum nearly at all, but have been looking at it with great interest lately. I was hoping to move to Magnum from Irrlicht (easy to use "high-performance" graphics engine, supports many APIs but originally designed around D3D9), which I was using with OpenGL. Because of Irrlichts support for very old OpenGL versions and D3D9 oriented design, Magnum sounds like a charm, being GL only and completely unsupportive of versions which couldn't run a distortion shader (and therefore I don't care about). Also, bye undocumented euler rotations, hello quaternions! :D And C++11!

Create entirely new API as tiny wrapper around Vulkan. Probably as a compile-time option to switch between the two backends

For me seems like the most flexible option. When the time comes, dropping the GL support is super simple with this and also, this would not hold down the Vulkan API, since no compromises would have to be made. And after all, since "Vulkan only" seems to be the end goal for the (distant) future, compromises don't really seem like an option.

wivlaro commented 9 years ago

Magnum strengths as I see them:

If you were going for a [partial?] rewrite, things I would like to see:

I'm guessing uptake of Vulkan is not going to be overnight. We're going to be left with a lot of legacy OpenGL for a while to come yet, so let's not rush to abandon Magnum. Maybe we don't want to be implementing new OpenGL extensions for the moment, but there's other features to be worked on in Magnum?

I read this, this morning, I think at least some of it is applicable to Magnum: http://jmonkeyengine.org/301602/in-the-age-of-free-aaa-game-engines-are-we-still-relevant/

mosra commented 9 years ago

Thanks for the insightful inputs, everyone.

I did some reading, actually a lot of reading, about data-oriented design, Entity-Component systems, SIMD, Vulkan/AZDO, proper GPU feeding etc. Vulkan still has some time to be released, so this is my take on things:

What I won't do, probably:

When these are finished, I think that the lib will be ready for adopting the new Vulkan ideas and dropping the GL ways of thinking along the way. Because of WebGL it would still need to keep some sort of GL compatibility, but hopefully the GL could be wrapped in a Vulkan-compatible package.

vinjn commented 9 years ago

Vulkan has notions of textures and buffers, as well as vertex buffer and index buffer.

mosra commented 9 years ago

ETA for Vulkan: late 2015 [source]

mosra commented 8 years ago

The decision is to have separate OpenGL and Vulkan API wrappers with no abstraction covering both, details in #147, so closing this one.