Using the rendering engine alone

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By thewoz

Hi,

for a project I need only to open a window load a model and show it with light and shadows.

It it possible to write down just a piece of c++ code that call the rendering engine
without use the GUI?

Thanks

:bust_in_silhouette: Reply From: Zylann

Strictly speaking, you can’t use the renderer “alone”, in the sense that other engine features are still in the executable even if you don’t use any.
But you can perfectly do what you described without using any GUI, just dont use those nodes. And you can do it without C++ either, using a script and a scene.

If for some reason you don’t want the other features of the engine to even be present in the executable, you need to exclude modules by changing your SCons command: http://docs.godotengine.org/en/3.1/development/compiling/optimizing_for_size.html#disabling-unwanted-modules

If you also want to exclude core features, you’ll have to remove their C++ files from the repo, hoping it doesn’t break other things (at which point it becomes questionnable as to why use Godot in the first place).

Hi Zylann,

Thanks for the answer in the first place.
I admit the I do not understand exactly what you have said.
Moreover I do not know noting about SCons, nodes etc.

I try to explain better my problem.
For a project I need to:

  1. load a model
  2. place a light and a camera,
  3. moving the model rendering it with shadows

I need to do this for different models with different movements and light positions.
I have wrote a small rendering engine to do this in C++ using Assimp to load the model and OpenGL to rendering.
Now the support on OpenGL is deprecated and moreover I have problem with the shadows shader I would like to switch.
So I’m looking forward to find a rendering engine that I can include in my project.

thewoz | 2019-10-13 11:00

Then just do what I proposed in my first paragraph: make a Godot project, create a scene, create a light, write a script to load your model and rotate around it, and there you go. You can use the FileDialog node for prompting the user as well, or use command line arguments provided from the OS singleton. I suggest you learn how to use the engine to do this, reading the docs from beginning.

The only time you’ll eventually need to add some C++ is to support 3D formats that the engine doesn’t support.

Zylann | 2019-10-13 14:40