Sojour

The solo virtual table top

Category: Sojour 2.0

  • DirectX Separation & PBR

    Dorian now supports PBR (Physical Based Rendering)!

    The graphics engine for Sojour 2 has had two quite large enhancements made to it.

    Firstly the lighting and materials rendering system now uses Physical Based Rendering (PBR). This is a rendering technique that uses approximations of actual lighting physics to produce more natural lighting.

    The other advantage of PBR is that it can simulate practically any material that you can think of with the correct textures and setup.

    For example, the sphere shown above is actually a smooth sphere, but looks rocky thanks to the textures below combined in magical mathematical PBR ways:

    Dorian now accepts many texture types to support its material modelling.

    Here is the same sphere with different textures and materials applied, as you can see, it’s totally smooth!:

    Applying different materials to anything is a doddle!

    Even where a model has no textures, like the TIE Fighter for example, you can easily change its look on the fly:

    I’d like a TIE fighter please Sir! But in Chrome!

    The next huge undertaking was removing DirectX from the engine and keeping it completely separate:

    DirectX-11 has now been separated from the Engine!

    It was a huge job, but it is necessary to allow the engine to support other backend renderers such as DirectX-12 or Vulkan.

    This was a huge undertaking as all aspects of the system got altered to support a more abstracted means of rendering.

    What makes writing a graphics engine difficult – apart from the complexity – is ensuring performance is not compromised by code changes such as the refactor above.

    The amount of code changed to separate DirectX-11 was staggering and the initial performance results were not too good (all graphs measure the scene you see above):

    Whilst the new one held 120 FPS (my TV’s refresh rate) – it took a noticeable dip in performance for 1% and 0.2% lows.
    These are frame times. Lower is better and you can see that the newer version’s performance really falls away compared to the pre-DirectX separated version. It also has a ton of random spikes in frame time. (Frame time is a better measure for performance)
    This graph really brings home how much worse the newer system was in terms of performance.

    Detailed performance measurements when creating a graphics engine are critical. It’s almost impossible to see the above differences by eye – so you must take the measurements before and after each change.

    In this case I traced the problem to the fact that material caching had been broken by the refactor. After around a day of coding, everything is now back where it should be (and in fact a little better than it was!):

    Much better! In fact we are now performing a little better than the original system!
    The new version produces lower frame times across the board! The only thing left to investigate are the occasional big spikes.
    For smooth frame times the newer Direct-X system is way better than the old one! Quite amazing given how much more complex the new version is!

    This is one of the reasons why engine development takes so long. You aren’t just writing code that works, you are also writing code that’s highly performant!

    I’ll leave you with a You-Tube video showing everything in motion. As usual, the smooth framerates never seem to translate well on You-Tube. If you look carefully, you’ll see me toggling the TIE Fighter to chrome and back!

    Dorian in action!

    Still a long way to go, but we are getting there.

    I know writing Dorian seems like a diversion, but Ionian which is the engine used in Sojour cannot be used in conjunction with the latest technologies hence the re-write. (To be fair, Ionian lasted over twenty years, so it has had a great run for its money!)

    Have Fun!

    RobP

  • Sojour 2.0?

    Work has been underway on Sojour 2.0 for quite some time now — most of it focused on the new 64‑bit graphics engine, Dorian.

    The video linked above walks through the high‑level plan for Sojour 2.0 and should give you a clearer picture of what’s coming next.

    Key Points

    • Development has been ongoing for a while, with the majority of work centred on the new Dorian 64 bit graphics engine.
    • This is a full rewrite, so it won’t be quick — current estimates put the timeline at around two years.
    • When Sojour reaches version 2.0, the price will increase to a one‑time cost of $20 USD. The video explains the reasoning behind this.
    • Until 2.0 is released, Sojour will remain at $10 USD.
    • Existing customers will receive Sojour 2.0 for free.
    • The 1.6.x branch will continue to receive bug fixes and small quality‑of‑life improvements.
    • Bug fixes for 1.6.x will take priority over 2.0 development.

    If you have any questions, feel free to post them here, on Reddit r/Sojour, or on the YouTube video — I’ll do my best to answer everything.

    That’s all for now.

    Have fun!

    RobP