OGRE 1.10 and Geometry Shader Support

On my Debian / Jessie laptop ‘Klystron’, I gave up some time ago, in compiling OGRE 1.10, this just resulting in a mess. Instead, on that platform I was only able to build OGRE 1.9 from source code, which is fully stable, as long as we stick to the OpenGL (2) Render System.

On the Windows 7 desktop ‘Mithral’, my first attempt to build OGRE 1.10 also failed, resulting in a successful compile, but then a silent crash of the Sample Browser, indicating that something was not built right.

If I have OGRE installed on several machines, it makes most sense for them to be the same OGRE version, so next I compiled OGRE 1.9 on ‘Mithral’, successfully, using Visual Studio 2015.

In response to my observation, that I had not set up the dependencies correctly on the ‘Mithral’ build attempt of OGRE 1.10, I now re-attempted that, paying closer attention to all the details, specified within CMake 3.6.2 .

I found that I could not only build OGRE 1.10 on this machine but also run it. And I found, that contrarily to how it was with OGRE 1.9, the OpenGL3+ Render System of OGRE 1.10 is capable of producing working Geometry Shaders. At least this gives me some access to Geometry Shaders, and casts doubt back onto the MESA Drivers of ‘Klystron’, which would cause the X-Server to crash, if I ran the Geometry Shader example of OGRE 1.10 .

What I still cannot do, is build the DirectX 11 Render System that is supposed to work under OGRE 1.10 , due to errors I have not yet pinned down. But what that was supposed to bring me, is now being provided successfully by the OpenGL3+ Render System. Both of these two are stated by the OGRE Team, to be experimental render systems, for version 1.10 still.

I suspect that OGRE 1.10 is being neglected by their team, in favor of OGRE 2.1, which is their effort to port OGRE to Android.

Dirk

 

Caveat in using Visual Studio Express 2015

On my Windows 7 computer ‘Mithral’, I recently installed and started using “Visual Studio Express 2015″, which has Update 3.1, and am happy with it overall.

However, there is a type of malfunction which can take place, and apparently did. This IDE detected that I have 8 cores, and decided as a default that it would try to build as many as 8 targets concurrently, to maximize its speed. It did not detect that my 8 cores are threaded as 4, which is of minor significance. I changed the setting to 6 simultaneous builds, which means to me, that for each of the 6 targets, only one source file should be in the process of being compiled at once.

A type of condition seems to be possible, in which for an unknown reason, the application starts to build an extreme number of targets, which on my system meant maybe 15-20 targets. In the Task Manager, I saw up to 20 ‘cl.exe’ processes running at once. This was what led to an ‘OOM’ (‘Out-Of-memory’) condition, and required me to force the application to close from the Task Manager, as the IDE window had also stopped responding.

After that, I was not sure of the status of my build, so that I Cleaned the build, and also rebooted my machine, because the worst thing to my mind, would have been a not-clean shutdown. It seems that the actual reboot may not have been necessary.

After the reboot, I was able to build my Solution again, with no ill effects.

I am not sure what triggers this error, but do remember that on that occasion, I had Minimized the IDE application window and Restored it again. The whole thing gave me a bigger scare than was necessary, since no long-term corruption resulted.

Dirk

 

I have been test-driving Visual Studio Express 2015.

One of the projects which I attempted today on the Windows 7 desktop computer I name ‘Mithral’, was to compile OGRE 1.10 . This is an unstable build of OGRE, and it would be helpful for me to know whether this instability comes more, from the software, or from the weaker graphics card on my Linux laptop ‘Klystron’, which I have already had to switch to OGRE 1.9 .

My initial attempt to compile OGRE 1.10 failed in a foreboding way: The rendering window would open, and then be black for a second, and then give way to the nondescript Windows Error box, telling me that the program had crashed. There were no traces of error messages in the log to explain why. This is called “a silent crash”. Hypothetically, it could point to a borked compiler setup.

So what I did next was to download an OGRE 1.9 SDK, which had been entirely pre-compiled by OGRE devs. But then I knew this had been a waste of time, because it nowhere proves that my compiler can actually compile. And yes, that SDK was unstable on my stronger graphics card.

I have come to learn something. Even having a Microsoft compiler does not guarantee that I will be able to compile a DirectX rendering engine. The main reason for this, is the fact that DirectX 9 is almost deprecated. The up-to-date Microsoft SDK no longer includes libraries and header files, which legacy DirectX applications linked against – including OGRE. This means that the OGRE SDK can offer DirectX 11 support, not Dx 9, and its DirectX 11 support is unstable out-of-the-box. This is ultimately a fault of the software.

What I did next was to compile OGRE 1.9 . When I was setting up the CMake parameters to do so, I realized that when I had been setting up CMake for 1.10 , I had made mistakes that could have led to severe code-linking issues. Specifically, under Windows, it is tedious how we need to link to each core-dependency one-by-one. Under Linux or MinGW these can all get picked up in an automated batch. But with MSVC, it is not so easy.

Compiling OGRE 1.9 with the OpenGL2 and the OpenGL3+ rendering engines was a success, and so finally proved that my new compiler can produce moving, 3D images. Unfortunately though, 1.9 was code that still used the deprecated way of linking to the Windows SDK for Dx 9 and 11 , so that I could not build the DirectX 11 engine after all.

I found that just with OGRE 1.9.0 , and OpenGL2, I was able to get a larger set of animations to run, from the Sample Browser, than I was on my laptop. This proves, that much of the trouble I was having with ‘Klystron’, or before that, ‘Maverick’, were in fact hardware issues.

The Iso-Surface Demo works along a different principle than I had anticipated. It is one of those applications, which use a Fragment Shader, which renders to a Vertex Buffer, set up to look like a Pixel Buffer. The Pixel format output has been cleverly engineered also to correspond to a vertex attribute structure, thus achieving what was once known as ‘a poor mans Geometry Shader’.

The Iso-Surface Demo is supposed to work, even with the OpenGL2 rendering engine. Only, on my laptop, there is no support for Render To Vertex Buffer, aka ‘R2VB’.

With OGRE 1.9 , the OpenGL3+ rendering engine remains unstable as heck, unusable.

There is an issue with how VS 2015 ultimately works. Since ‘Mithral’ possesses 8 cores, threaded as 4, VS will ultimately try to build up to 8 targets at once. This pushes performance to the max, but at the expense of stability. Today I was pushing this compiler for hours and hours – and I later learned that it truly maxes out all 8 cores.

I found a setting to correct this for the future. Given 8 cores, I would like a maximum of 6 compile targets worked on concurrently. This is just, so that the system will have a full CPU left, to work on other tasks, should things go wonky. Because by the end of the day, things did go wonky – for whatever reason.

Dirk

(Edit 09/16/2016 : ) Another disadvantage, If we have an 8-core CPU, and If our compiler wants to build 8 targets concurrently for that reason, is the fact that 1 source file being compiled at a time, for each target, can consume an unpredictable amount of RAM. If the amount of RAM on the system is not taken into consideration, an ‘OOM’ (‘Out Of Memory’) condition can arise, because of the arbitrary 8 jobs running at once.

And I think that last night, such an OOM condition did arise, because I was installing tons of software… I have 8GB of RAM on ‘Mithral’. I performed numerous defragmentations as well, and, because many programs do have memory leaks, everything last night may have led up to an OOM condition by the end of the day.

I also installed Boost 1.61, and Boost 1.59, where before I only had Boost 1.47. And Boost 1.61 may in fact be necessary for OGRE 1.10 to compile, as another reason why my first attempt to compile that had failed.

 

Different Visual Studio versions may be Installed Side-By-Side.

Our world is no longer such, that we need to be privileged, in order to have access to a compiler. While Linux offers us their open-source compilers, even the Windows world allows us to download their Visual Studio Express versions by now, although one down-side of that is, the fact that we do not obtain ‘Microsoft Foundation Classes’ this way. This makes the Visual Studio Express compilers a ‘Freemium’.

Yet, they could still act as a workhorse, for projects that were designed to use or build other libraries. And, there exist projects we cannot build with MinGW.

I have held a paid-for license to “Visual Studio 2005″, which I also beta-tested in 2005 before buying it. But obviously, this is such an old compiler version, that many of the open-source projects we can download, can no longer even be built with VS 2005. Yet, back in 2005 I paid a pretty penny for my copy. It currently remains installed on a Windows 7 computer I name ‘Mithral’.

So I have been stuck in a corner, it seemed. I have many VS 2005 projects which I maintained and compiled meticulously, as well as the old, buggy version of ‘MFC’ that came with it, all of which I stood to lose, if I was going to switch to a new compiler for Windows.

And yet, upgrading to a newer compiler has its obvious benefits.

To my rescue, comes the fact that we can install ‘VS 2005′ and ‘VS 2015′ side-by-side! I now have both installed, and both work. And I have built some projects successfully just this night, using Solution Files generated by a 3rd-party tool named “JUCE“.

The main danger to watch out for, is to keep our ‘VS 2005′ and ‘VS 2015′ projects in completely separate folders, because if we open a VS 2005 solution in VS 2015 by accident, it will get converted, and will then never be compatible with VS 2005 again.

Dirk