Page 1 of 1

pre-beginner question about Ogre viability

Posted: Mon Mar 26, 2018 8:22 pm
by cantthinkofusername

Would anyone have any input as to whether Ogre would be viable for the following project:

Running on a headless Linux server, i7, 32Gb ram
  • Loading mesh from a file... mesh will be around 50k vertices
  • Load say 4 textures for different parts of mesh
  • Save 'rendered' image to a JPEG at 1920 x 1080 px
  • Would need shadows and a couple of lights
  • All can be driven from command line
This would need to load & render in less than a second, ideally 500ms.

I know it's a bit of a broad question, but would Ogre be capable of this?

Thank you.

Re: pre-beginner question about Ogre viability

Posted: Wed Mar 28, 2018 2:08 pm
by timl132
I think you could better get a CPU raytracer or rasterizer for that, I thin Ogre3D requires an GPU with decent Ogl or DirectX support, don't think it has a software renderer.
And I don't know if servers even have OpenGL(3+) or DirectX(11 or 9) at all.(Mine doesn't)
Also, I think Ogre3D requires a display to render to.
But If it doesn't need a display, you could try to render to a texture and save that.
But I think your best bet will be a standalone CPU rasterizer/raytracer, but anyone feel free to correct my if I am wrong.

Re: pre-beginner question about Ogre viability

Posted: Wed Mar 28, 2018 11:41 pm
by dark_sylinc

As long as you have a GPU, you can use Ogre (i.e. not rely on software only; you can use a dedicated GPU or the integrated one). However please take in mind several OSes (including Linux and Windows) give a lot of headaches when working in headless mode (no monitors plugged in). A common cheap solution to that problem is one of those fit-Headless plugs selling on Amazon.
It may be possible to avoid the fit-Headless plug, but it's going to require some tiresome work to get it running. You will also have to sort out the EGL / GLX madness. Chances are you're going to require an active X11 server. I don't know if it's possible to render without an X11 server.

Another problem you will face is that Ogre (and 3D APIs) usually requires some "head start" when initializing. It's quite possible launching the process and initializing all required resources is going to occupy most of your 500ms range (if not more); not to mention shader compilations.

The best solution I would see is to keep the process as a daemon, and your command line be a process that communicates with that daemon (e.g. via pipe or tcp) to perform the rendering. If you do that, then rendering in 500ms is perfectly plausible and time taken will depend on your scene complexity and GPU speed (number of vertices is a factor, but not the only one). 500ms looks like a lot of time for just rendering so it should be fine.

Then saving to JPEG is going to have to be done in CPU code, and how long that takes depends on the jpeg lib you use, the compression quality, and the CPU speed. Then saving to disk depends on whether you need the disk transfer to be async (the usual way, fast) or sync (slow, depends directly on the I/O hardware speed i.e. SSD vs HDD, and what other processes are doing with I/O).

Is Ogre capable of doing what you want? Yes.
Do you need to take certain precautions? Yes.

Re: pre-beginner question about Ogre viability

Posted: Thu Mar 29, 2018 12:40 am
by paroj
for reference: the CI runs the Visual tests using xvfb in software: ... 6167#L3711

the tests store their results as 640x480 png images - although I did not actually look at the results yet. (+use them to test against a reference set)

Re: pre-beginner question about Ogre viability

Posted: Thu Mar 29, 2018 9:43 am
by cantthinkofusername
Thank you very much for all your helpful comments and sorry for not replying sooner.

I am tied up with deadlines right now but will have a thorough look into all your comments this weekend.