Logo About  Screenshots  Using  Developing  Blog  Forum  Download
openBVE 2 Renderer Demo 

Date2010-03-14 (Sunday)

Thank you for being interested in visiting this page. It should be noted from the start that this demo is intended for advanced users and developers. The computer-illiterate of you will not find any fun in here. Please take the time to read this page entirely before downloading anything and potentially being disappointed.

 Contents 
Introduction
About this demo
Instructions
Download
Screenshots
Credits
Want to contribute?


 Introduction 

A successor to openBVE has been in the works for some time now, and few has been said about what has been accomplished so far.

First of all, let me say that what has been dubbed so far as "openBVE 2" will eventually bear a new name (to be announced). The reason for this is that the new train simulator has architecturally nothing in common any more with openBVE 1.x (nor with BVE Trainsim for that matter).

The new program is built around the idea to make the simulator as modularized as possible, with core components such as the renderer built-in, but with all simulation-related components such as engines and brake systems being exposed via plugins. Also, loading content in the form of textures, objects, sounds, routes and trains is carried out via plugins. None of these things have a built-in counterpart.

The choice to do things this way was twofold. First of all, the current source code of openBVE 1.x has become too large and unorganized to maintain by a single person any longer. Splitting the project into multiple independent parts allows to jointly develop the new simulator by multiple persons who focus on writing one plugin each.

Second of all, while add-ons can be currently created in the form of routes and trains, the new architecture gives add-on developers the ability to write their own file format parsers and simulation components. It is also possible that valuable add-ons developed by third-party developers be given official endorsement and be shipped with the program, provided that the developer agrees to this.

As far as the anticipated set of functions itself is concerned, those of you who have read the homepage article
The potential future of openBVE should have somewhat of a clear idea of where this train simulator is heading to eventually.


 About this demo 

At the moment, there is actually no fully-fledged train simulator. All there is now is a fast renderer and the ability to load CSV/RW routes along with B3D/CSV/X objects in some sort of a route viewer. There is no support for trains yet, so the main point of this release is actually just to impress you with performance and to show you that development has not stalled.

You might want to ask what the difference between the old and the new renderer is. Well, in openBVE 1.x, every object is attached to a "track position" as this reflects the way the CSV/RW route formats work. The camera can only move relative to the track, so the renderer only needs to keep track of objects that are behind or in front of the camera, measured in track positions. This disallows things such as track looping back on itself.



The new renderer does not associate objects to track positions, but manages them in a quadtree structure on a two-dimensional grid (see illustration). This allows objects to be freely placed anywhere in the world. The renderer only needs to figure out in which underlying 2D block it is and which other blocks from this one are visible given the constraint of the viewing distance. This allows for a free-roving camera compared to one that is forcibly track-bound. It also means that any object associated to a particular world coordinate will be visible when within the viewing distance.



You will notice this difference because you are able to move around freely in the demo. This is an important feature, because otherwise, we would be bound to a single rail for all time just because the renderer would be unable to handle anything else. With this new renderer, we can have any number of interconnected rails we want - the renderer itself does not care because objects are handled independently from the rails.

The second important difference is that openBVE 1.x uses immediate mode rendering. This means that for each frame, the whole object geometry, including vertices, texture coordinates, normals and colors, is sent to the graphics card for all faces currently visible in the world. This is a lot of data and means that the system bus is the main limitation in what performance you can achieve - the faster the system can transfer data from the RAM to the graphics card, the better.

The new renderer stores object geometry on the card and only sends in new geometry if things actually change, e.g. when a new 2D block becomes visible. This means that the new renderer is basically fillrate-limited - the more horsepower the card has, the better.

I observed that the new renderer in this demo is about ten times faster that the old renderer in openBVE 1.x. This figure might even improve over time, but will certainly not hold true for every system.


 Instructions 

You can find the download below. Extract the archive it into a new folder. Windows users should copy over a few DLL files from their openBVE folder, namely SDL.dll, Tao.OpenGL.dll and Tao.SDL.dll. Linux and Mac OS X users will hopefully be able to figure out what they need to do on their own.

You will find a settings.cfg file where you can configure a series of options and also which route or object to load. The options are explained briefly via the comments in the settings.cfg file itself. Select any route or object you want, but mind the following limitations:

  Background images and fog are not yet supported. Only a background color will be shown.
  Animated objects are not yet supported. This includes signals. These objects are not shown at all.
  Glow is not yet supported. All objects using glow will always show at full intensity instead of fading in.
  The legacy visibility system (where objects are disposed of as soon as the CSV/RW block the object was placed in has been passed by the camera) is not yet supported, only the new 2D grid is.

In-game, you can use the arrow, the WASD and the PageUp and PageDown keys to move and rotate around. Hold down the shift, control or alt key for faster movement. There is no way for you to jump to specific "track positions" as the new program does not have something like them internally. Also, you cannot jump to stations in any way at the moment. The initial position of the camera is the first stop point, though.

In order to make somewhat fair framerate comparisons between openBVE 1.x and this demo release, you should choose identical configurations, including:

  the same width and height for the output window
  the same texture interpolation mode
  the same viewing distance
  disabling vsync
  disabling motion blur in openBVE 1.x
  setting the transparency mode to Sharp in openBVE 1.x

You can report your feedback in
this thread on the forum.


 Download 

The download contains both the source code and the binaries. The external dependencies are not included. Please do not extract this to your existing openBVE folder - create a new folder instead and copy over the dependencies if required.

Please ensure that you have proper hardware support for OpenGL. The default device drivers that ship with Windows are usually not properly hardware-accelerated. Without hardware-accelerated graphics, performance will likely be at one or two frames per second.

Download the openBVE 2 renderer demo (1.07 MiB)


 Screenshots 

Here, the
Ferrovia Genova-Casella route is shown with the viewing distance set to 3000 meters:





Rendering the entire route in a single scene this way produced a frame rate of around 250-300 fps on my machine.


 Credits 

The new train simulator is being co-developed by me,
Anthony Bowden and other persons yet to be announced.


 Want to contribute? 

At the moment, we don't need any help with the core functionality as a few preparations need to be made first before development on simulation-related components can really start (maybe in a month or two).

However, given the plugin-based architecture of the new program, there are already a few things that could be worked on independently. More specifically, if you are interested in contributing support for additional texture, object or sound file formats, and are willing to release your code without restrictions or requirements (e.g. public domain), then we might be interested in working with you.

Of particular value to us would be support for any popular 3D object format that is well supported by existing open source modelling software, as well as support for the OGG Vorbis or FLAC sound formats. If interested, please write a mail to: