17.12.2015 - Progress report, late 2015



The thing about Oculus Rift is that if the game is bad, you get a slideshow, which is kinda meh-ish ok.

If it's good you get a smooth experience.

But if it is only so and so, then it's nauseating hell at the edge of the native FPS.



On max settings Spaceway tops at just below the no-nausea threshold, and often go down to 10-15FPS, on a fairly good system, which is 50-60-ish without Oculus...

Not good enough.



The last few month were full of hardcore optimizations to make it good in Oculus, resulting in a variety of changes and decoupling from Orbiter.



I started by compiling Spaceway with my own software implementation of OpenGL.

This way i can see every graphical issue clearly, since mine is made to crash on and log the errors, while the real vendor ones transparently ingest errors and spew out their best guesses.

Boy, was it a messy slideshow.

Not as slow as you might think, however - i managed to get it to 10-15 FPS.

Optimizing graphics is much easier when every slowdown is severely amplified. If you want to get a game running with software rendering, you need to clean it up hard.



Fixing up rendering inefficiencies brought up the FPS to 120-ish range, which in Oculus translated to straight in the middle of the nausea zone.

Oh so not good enough.



Software OpenGL does not do everything the real OpenGL does. There is no bus to the GPU to consider.

Further investigations revealed several inefficiencies in that department.

For example, you can store mesh data on the GPU, with a thing called the vertex buffer objects (VBO), to avoid sending it on every frame.

For some weird reason i only stored the vertex data, but not tangent data used by the shaders to draw the normal maps on the terrain.

I guess i thought it was not possible, but turns out it easily is.

With that the FPS got up to 180.

Neat...But that is standing still.



In motion, it was much worse.

Just moving your head produced a serious drop in FPS, almost to 10-15 in Oculus.

WTF?



Well, it was Orbiter, the space flight simulator.

Spaceway grown from a graphics engine i originally designed for Orbiter (OGLAClient), and guess what?

The terrain was generated in the native Spaceway format, then converted to Orbiter compatible one, then converted back to the native format to be drawn.

This allows the engine to work with both sims, and also kills performance in Spaceway and gives a meh one in Orbiter.

It's been years since i did anything for Orbiter, so i realized it was about time to cast off.



That part felt like an end of an era - Orbiter defined many of my interests, and for a long time i developed add-ons for it, that conglomerated into Spaceway as the years went by.

Well, the past was good while it lasted, and now it's time to go ahead.

With the legacy and compatibility stuff dropped, the performance soared, getting 300FPS standing and 290FPS moving.

Almost good enough.



However, some icks still remained.

Quirks in the physics engine.

i.e. the hundreds of particles spewn by engines all went through the big physics calculations, dropping the FPS from 300 to 190 when the engines were running, or from 75 to 70 in Oculus, a critical difference between smooth immersion and nauseating jerks.

Moving them to a dedicated, fast calculation loop removed that drop.



Quirks in the drawing pipeline.

I.e. every time the terrain changed, it all got sent to GPU at once, jerking things at high speeds. That is fixed by allowing only so much terrain change per frame.



Quirks in the overlogic.

I.e. the MFDs were drawn on every frame, which at 300FPS was quite a drain. With 4 external MFDs on the lander chair that amounted to a drop from 300 to 150 FPS.





Made them draw at only ten times a second, and that drop was gone.



Now i'm getting native 75 FPS in Oculus at max settings most of the time.

Almost, almost good enough.



There are still some jerks and quirks left that i didn't track down, but the whole thing works well over ten times faster now.

Which, Oculus or not, is a good thing.



What the future holds...

Well, there are always plans and there are always ideas. Oculus VR demos, game ideas, this and that. I hope to get something interesting out in the coming months.

At the very least, there is enough bugs and performance fixes to just release it for the heck of it, with nothing extra. So out it will be.



In case nothing happens, next progress report will be around spring 2016.



Post/read comments



