Using Godot's renderer as a library

iche033iche033 Posts: 2Member

Hello! I'm new to the Godot community and I hope this is the right place to ask questions like this and get feedback.

We're interested in using Godot's render engine as a library :)

Some background: we develop and maintain open source robotics simulators (gazebo, ignition) that currently use Ogre3d as the underlying render engine. However, there is growing interest in using an alternative rendering engine. We understand that Godot is a full game engine (and not a rendering engine / library) but after evaluating various open source rendering / game engines out there, we decided that we may devote some effort to investigate and come up with a minimal prototype of using Godot's renderer as a standalone C++ library that allows us to do things from initializing the rendering engine, to creating scenes, objects, lights, and importing assets.

I've found some related posts that suggest it's currently not supported out of the box:
https://godotengine.org/qa/53477/using-the-rendering-engine-alone
https://www.reddit.com/r/godot/comments/ch9aud/using_godot_as_a_c_library/

I think GDNative APIs may not be able to do what we want to achieve (launching the rendering engine, etc all without using the editor)? We also understand that Godot is probably not intended to be use this way and there are frequent changes in internal APIs. So we would like to get some feedback on our plan before we dive deep into this.

The first step in our plan is to either tweak the SCons scripts or create separate build scripts to build and package all source files and shaders used by Godot' renderer as a shared library with APIs that allows us to do things mentioned above all without using the editor.

  • Is this a crazy idea? i.e. we really should not be doing this
  • Are you aware of any similar efforts?
  • Assuming everything goes well, are build changes like this welcome upstream in Godot?

Thanks for reading this long post. Feedback and suggestions appreciated!


Tags :

Comments

  • MegalomaniakMegalomaniak Posts: 2,649Admin

    You can use godot engine as a C/C++ only engine without the editor just fine afaik, though I haven't done so myself. However afaik, no you can't - as is - use the godot renderer as a library. You could however fork godot and integrate your own tech into it and remove any 'bloat' you don't need making your own effective engine out of it.

    Would it be worth the effort? I don't know. You'll have to figure that out yourself. But I do expect the technical dept to be pretty high.

    Whats wrong with OGRE though? And have you considered URHO3D?

  • TwistedTwiglegTwistedTwigleg Posts: 2,663Admin

    Is this a crazy idea? i.e. we really should not be doing this

    Not a crazy idea per say, but it might be difficult. Godot wasn't really designed to be used as a standalone rendering library, so there may be difficulties in getting it working as one. As @Megalomaniak said, you can use it without the editor and as a platform, however it does not really expose a rendering API or anything.

    Are you aware of any similar efforts?

    The question of using Godot as a library comes up every so often, but I don't know if there is already any movement towards modifying Godot so it can act as a library. I would suggest searching something like "Godot as a rendering library" in a search engine, if you have not already, and see if that brings up any results of similar efforts.

    Assuming everything goes well, are build changes like this welcome upstream in Godot?

    While I cannot say for sure, and I am by no means a core Godot developer, I think it would be unlikely that such changes would be merged into Godot. That's not to say it is impossible or unwelcome, I just think it may not be merged because of the additional complexity it could bring and because Godot is intended to be used as a game engine, not a rendering library, I'm not sure the cost of the complexity would be deemed to be worth it. That said, that is just what I think would happen, not necessarily what would. If you want to know more definitively, I would ask on the devel channel on the IRC.


    Also, some interesting, low-level rendering APIs, if you want to go down that route:

    Both are mainly just for making graphics programming easier and cross platform, but they might be interesting to look at. I've been meaning to try a project with either, but I haven't had the time and motivation to get one going just yet.

  • iche033iche033 Posts: 2Member

    @Megalomaniak

    However afaik, no you can't - as is - use the godot renderer as a library

    That's what we suspected after looking at GDNative and also reading this article about Godot's renderer design.

    Whats wrong with OGRE though? And have you considered URHO3D?

    We're happy when we moved from OGRE 1.9 to OGRE 2.1 that comes with better performance and modern rendering techniques. However, the development activity has slowed down in recent years (which is unfortunately the case for many of the open source rendering engines out there that we have looked at). Having said that, we will continue to support OGRE in our tool but also let users choose an alternative rendering engine once we have that ready. We are attracted to Godot for its active community and development of new features. We also evaluated URHO3D but decided to try Godot for the same reason.

    @TwistedTwigleg

    I would suggest searching something like "Godot as a rendering library" in a search engine

    Yeah I found a couple of related posts (e.g. the ones in my original post) but the answers have not been promising. I was hoping to see if things have changed or if there are any insights as to whether or not this is something being considered in Godot's roadmap. But from the sound of things, it's still the same as before.

    I think it would be unlikely that such changes would be merged into Godot.

    One concern for us is the long term maintenance effort. If we find that the changes required to build Godot as a library is too invasive and these changes are not likely going to make it upstream, we may have to reevaluate our plan. It all depends on what we find in the next few weeks I guess.

    Also, some interesting, low-level rendering APIs,

    Thanks! I'll take a look at these two projects.

Sign In or Register to comment.