kool-engine / kool

An OpenGL / WebGPU engine for Desktop JVM, Android and Javascript written in Kotlin
https://fabmax.github.io/kool/kool-js
Apache License 2.0
303 stars 20 forks source link

iOS support #1

Open dmitrykolesnikovich opened 4 years ago

dmitrykolesnikovich commented 4 years ago

Is there some technical nuance that makes iOS support undoable? Can I suggest my contribution if no?

fabmax commented 4 years ago

I myself have absoluetly no experience in iOS development, therefore I haven't looked into it so far. Obviously iOS doesn't run Java / kotlin directly, but it should be possible to to add a iOS target using kotlin-native. Another thing is that OpenGL ES is deprecated on iOS and apps should use Metal as graphics API. As far as I know Metal is conceptually quite close to Vulkan (which I already implemented for desktop Java), so it should be possible to do this.

If you have experience with that stuff and / or wanna get into it, you are welcome do so!

EDIT: One thing I just realized, which might cause a problem: Currently shaders massively rely on generated GLSL code. I don't know Metal but I don't think it uses GLSL as shader language. So you need to either translate the generated GLSL code to Metal shader code or change the shader generation part to optionally produce Metal shader code directly. Both options are probably pretty difficult to achieve.

dmitrykolesnikovich commented 4 years ago

I will provide iOS and metal support by the end of the summer (hopefully). And based on that I really want to cooperate with you on gamedev platform that I created for myself as pet project (I have no solid understanding of 3d graphics but all the rest is pretty good). Do you consider such an option interesting?

fabmax commented 4 years ago

In general this sounds interesting. However I probably won't be able to contribute much to an additional rather sophisticated project (due to time-constraints...). First, lets see how your iOS implementation goes, and then figure out what to do next.

Ali-RS commented 4 years ago

In case this helps, there is this ANGLE library being developed by Google that translates OpenGL ES calls to other APIs. Supporting iOS through the Metal backend is also planned.

fabmax commented 4 years ago

ANGLE definitely looks interesting. Using it as a compatibility layer on iOS would solve a lot of problems. Lets hope they implement it soon.

Ali-RS commented 4 years ago

Yeah, that would be true for Mac OS as well if Apple decides to drop OpenGL completely in the future. Also with ANGLE Direct3D 11 backend, I guess it might be possible to target Xbox as well :)