## I have succeeded at enabling DirectX 11 support for OGRE 1.10 .

According to This Posting and This Posting, it has proven trying for me to compile OGRE 1.10 with full support for DirectX 11.0 on a Windows 7 machine, even though I have Visual Studio Express 2015 installed.

The trick that finally worked for me, was to install the Legacy DirectX SDK, even though what it has to offer has supposedly already been merged into the Windows SDK, which I already had installed.

This installer, Dated June of 2010, is potentially dangerous to run, even though it is being offered by Microsoft, because its default setting is to reinstall the DirectX Runtime as well. If it was allowed to do so, it would revert some files that are already up-to-date, according to 2016, back to a state which was considered to be correct in 2010. This could damage the O/S or even render some software inoperable. This realization had put fear into me for years, of installing the DirectX SDK. Yet, with the version of the installer I obtained, there is a configuration dialog, from which we can Deselect ‘to install the Runtime’. Doing so also deselects ‘to install the DirectX Utilities’. Running the installer then produces a still-conspicuous delay, where its progress bar shows “Installing Runtime”. Possibly, it just makes sure that the Runtime is installed. Then, it threatens ‘Reinstalling the Visual C++ Runtime’ in a similar fashion, and finally exits with an error code – but apparently, with all the previously-installed DirectX-based software unaffected.

This paved the way for me to be able to compile DirectX 11 support for OGRE 1.10 . I did this just to prove to myself that I could, and do not plan to make this a part of my local SDK, because the way OGRE 1.10 implements it, Dx11 offers no advantages, over using OpenGL3+ .

Dirk

(Edit 09/18/2016 : ) If the reader would like to duplicate this success, then he may also want to read the Topic which I created on the OGRE Forum.

It is a pity that OGRE developers seem to take so little time, with my petty – apparently naive questions there.

## d3dcompiler_47.dll

Microsoft has stipulated, that in the future, all DirectX applications will need to use a DLL named D3DCOMPILER_47, if not of some greater version. What this driver does seems quite useful.

In the past, it had always been a limitation in the design of raster-based graphics, that actual shader code needed to be fed to the graphics drivers directly as text. As an alternative, D3DCOMPILER allows for the shader code to be compiled into bytecode, which DirectX drivers can understand. This also has uses in obfuscating copyrighted content. But mainly, it provides performance improvements in fact, because many games today have highly complex “Compute Shaders” etc..

When we install the Windows SDK on a Windows 7 or a Windows 10 computer, not the same libraries and header files will install each time.

(Some Text Deleted Because Erroneous Before.)

Dirk

(Edit 09/18/2016 : )

I have learned, that the library D3DCOMPILER_47.DLL is supposed to reside in both the System32 and the SysWOW64 folders (on a 64-bit Windows system), and is auto-generated there, much as D3DX9_43.DLL was, by the DirectX system on the computer, which is supposed to be running the game in question.

Because the DirectX system on Windows 7 will generate at maximum, D3DCOMPILER_43.DLL , some game developers have been including their own version of the _47 DLL, in the same directory as the EXE File, which is also the first directory the EXE File tends to search for it.

But a problem with that is, that some version of this library will be built specifically for Windows 8.1 for example, and will therefore not run properly on Windows 7. This produces an obscure error message, which I do not recall the exact spelling of.

Yet, the onus is not on the OGRE developers to supply their own version of this library. They do supply a version with their SDKs specifically, but that one is now built to run on Windows 8.1 as well.

Further, version _47 may only be needed for DirectX 11 applications, while _43 may still be good enough for Legacy DirectX 9. Yet, if OGRE was coded to use _47, then it will use that version throughout, even if I was only to try building their DirectX 9 rendering system.

The correct Path on my Windows 7 box ‘Mithral’ for this DLL, is


C:\Program Files (x86)\Windows Kits\8.1\Redist\D3D\x86



Contrarily to what the spelling of this Path may suggest, the DLL version I find there does load correctly on Windows 7. And, I am based on the conventional 32-bit build of OGRE. The above Path is related to one, which will also reveal the 64-bit DLL.

As for OGRE still requiring the Legacy DirectX SDK to build, this is a question of which version of the header files it has been programmed to expect, as well as of providing both the DXGUID and D3DX Static Libraries, whose file-names end in .LIB, as opposed to any DLL Files, which are the Dynamically Linked Libraries.

It is common, for the compilation of software to rely on such static libraries, whereas to run the software should only require the DLL Files, under Windows.

## 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.