New Release D3D9Client Development

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,910
Reaction score
206
Points
138
Location
Cape
Is the Yahoo in Dx9 just for today ?
 

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,910
Reaction score
206
Points
138
Location
Cape
Never mind. It was a message from Orbiter 2016 sound file for New years Day.
Sorry !!
 

Ripley

Tutorial translator
Donator
Joined
Sep 12, 2010
Messages
3,133
Reaction score
407
Points
123
Location
Rome
Website
www.tuttovola.org
...Also a small teaser of an upcoming project OrbiterGUI is uploaded...
For those who have tested it, may I ask what is it about?
(I can't test it myself, pc not working)

---------- Post added at 11:04 ---------- Previous post was at 10:46 ----------

I won't be able to upload the latest releases to Tuttovola.org for the next days, so grab your D3D9 from Jarmonik's post above.
Client uploaded to Tuttovola.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
D3D9 client causes Orbiter to not display scenarios description. Orbiter 2016 with latest D3D9 client (r1038M).
The M indicates that this is not a reproducible build (M for Modified)!
This should never have been released, although it might have been.
But that's possibly not the biggest issue here as others do not have that problem with that release.

The problem occurs only on startup, which means if I started Orbiter with D3D9 de-activated then I activated it later, it works. It doesn't work only if D3D9 client is enabled on startup.
D3D9Client only accesses anything from the scenario folder to read information it can not get via the API Orbiter provides.
It never purposely changes the display of scenario information in the Launchpad dialog.
Nevertheless could any incorrect programming in the client "shoot" into the routines of the main (Orbiter) program and change its behavior.
I took a very close look into that code parts that might be responsible and can not see anything obvious.

Just to make sure what's on your side:
Do you have anything "out of the normal" with your "Orbiter 2016" installation?
Like symbolic links to "shared folders" or folders that are shared between any two Orbiter installations (Orbiter BETA and Orbiter 2016 for example).
Is your Orbiter 2016 installation located in the "Program Files (x86)" or "Program Files" folder and you have not set the access rights (recursively) on all the sub-folder (UAC)?

---------- Post added at 21:04 ---------- Previous post was at 17:18 ----------

...and:
Can you reproduce the startup issue when D3D9Client is the only Module active?
 

Mojave

60% Ethanol
Moderator
Addon Developer
Joined
Apr 6, 2010
Messages
1,647
Reaction score
132
Points
78
Location
Somewhere, but not here.
Hiya Gents,

I am writing this post as a potential bug report for the newest version of the D3D9 client for Orbiter 2016. I am not sure if this has been posted about yet, but this is a brand new installation of Orbiter 2016 and the D3D9 Client version R3.4.

I was pitching down in the stock DG when I noticed the sun shines through 3D cockpit elements including the top panel. Attached below is a screenshot of the bug(?) and one of my current D3D9 settings.

eir4rtk.png

EdgYyJw.png


I am running Orbiter on an nVidia GeForce GTX 1060 if that information is at all necessary.

Thanks for looking into this and for developing this amazing graphics client,

Samuel
 

clipper

Well-known member
Joined
Feb 27, 2018
Messages
256
Reaction score
388
Points
63
I believe that this is a result of LensFlare post processing option and is a known issue, so the easy fix is to simply switch to another option or turn off post processing altogether in your D3D9 Advanced Setup menu.
 

Abdullah Radwan

Addon Developer
Addon Developer
Joined
Aug 20, 2017
Messages
314
Reaction score
284
Points
78
Location
Cairo
The M indicates that this is not a reproducible build (M for Modified)!
This should never have been released, although it might have been.
But that's possibly not the biggest issue here as others do not have that problem with that release.


D3D9Client only accesses anything from the scenario folder to read information it can not get via the API Orbiter provides.
It never purposely changes the display of scenario information in the Launchpad dialog.
Nevertheless could any incorrect programming in the client "shoot" into the routines of the main (Orbiter) program and change its behavior.
I took a very close look into that code parts that might be responsible and can not see anything obvious.

Just to make sure what's on your side:
Do you have anything "out of the normal" with your "Orbiter 2016" installation?
Like symbolic links to "shared folders" or folders that are shared between any two Orbiter installations (Orbiter BETA and Orbiter 2016 for example).
Is your Orbiter 2016 installation located in the "Program Files (x86)" or "Program Files" folder and you have not set the access rights (recursively) on all the sub-folder (UAC)?

---------- Post added at 21:04 ---------- Previous post was at 17:18 ----------

...and:
Can you reproduce the startup issue when D3D9Client is the only Module active?
I've installed this version: https://www.orbiter-forum.com/showthread.php?p=586107&postcount=4699


My Orbiter installation is working without any problems. Just this problem with D3D9. I've fixed Lua interpreter problem.


There are no symbolic links in both (2016 and Beta), just linking Beta texture directory to 2016 one. Nothing else.


Both are installed in D (Another hard drive), away from Program Files.


The problem happens also with all add-ons disabled except D3D9.


When I open Orbiter, it lags a few seconds on this view:


3DIPhCs.png



Then it doesn't show the scenario description. Disabling D3D9, the lag doesn't happen and I have the description.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
I've installed this version: https://www.orbiter-forum.com/showthread.php?p=586107&postcount=4699

My Orbiter installation is working without any problems. Just this problem with D3D9. I've fixed Lua interpreter problem.

There are no symbolic links in both (2016 and Beta), just linking Beta texture directory to 2016 one. Nothing else.

Both are installed in D (Another hard drive), away from Program Files.
That seems to be all fine so far:thumbup:


The problem happens also with all add-ons disabled except D3D9.

When I open Orbiter, it lags a few seconds on this view:
[...]
Then it doesn't show the scenario description. Disabling D3D9, the lag doesn't happen and I have the description.
That is a very strange behavior...and I can't see why D3D9Clients activation has such an impact.
I've created a local setup here to re-create your "installation" and I can not reproduce anything like that.

Is there any Virus-scanner blocking the DLL from being loaded?
Any graphic-card special settings for the Orbiter_ng executable?

I'm out of ideas to be honest :idk::shrug:

I would recommend to make a complete clean 2016 setup with only D3D9Client as extra add-on[1] and see what happens.


[1] not even installing Textures, as the issue already starts waaaaay earlier at the launchpad dialog
 

Abdullah Radwan

Addon Developer
Addon Developer
Joined
Aug 20, 2017
Messages
314
Reaction score
284
Points
78
Location
Cairo
That seems to be all fine so far:thumbup:



That is a very strange behavior...and I can't see why D3D9Clients activation has such an impact.
I've created a local setup here to re-create your "installation" and I can not reproduce anything like that.

Is there any Virus-scanner blocking the DLL from being loaded?
Any graphic-card special settings for the Orbiter_ng executable?

I'm out of ideas to be honest :idk::shrug:

I would recommend to make a complete clean 2016 setup with only D3D9Client as extra add-on[1] and see what happens.


[1] not even installing Textures, as the issue already starts waaaaay earlier at the launchpad dialog

I am using Windows Defender, with Orbiter directory excluded. There are no specified settings for Orbiter, just setting it to run on Nvidia card in Nvidia Control Panel.


I don't have any idea as well. It never happened before.


I'll try a clean Orbiter installation ASAP.


I didn't install high-res textures, just the normal 'Texture' folder.
 

Mojave

60% Ethanol
Moderator
Addon Developer
Joined
Apr 6, 2010
Messages
1,647
Reaction score
132
Points
78
Location
Somewhere, but not here.
I believe that this is a result of LensFlare post processing option and is a known issue, so the easy fix is to simply switch to another option or turn off post processing altogether in your D3D9 Advanced Setup menu.

Thanks for the information, Clipper!

Samuel
 

Abdullah Radwan

Addon Developer
Addon Developer
Joined
Aug 20, 2017
Messages
314
Reaction score
284
Points
78
Location
Cairo
I found the problem. It's all from ReShade preset. After removing d3d9.dll, the scenario description comes again. I am so sorry for wasting your time.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
Is there any way to control specular reflections using a roughness map? I'm thinking intensity as well as color. Or are those limited to actual specular reflection maps?
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
I found the problem. It's all from ReShade preset. After removing d3d9.dll, the scenario description comes again. I am so sorry for wasting your time.
No worries. :thumbup: Glad that you've found the root cause!
:cheers:
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Is there any way to control specular reflections using a roughness map? I'm thinking intensity as well as color. Or are those limited to actual specular reflection maps?

If you want to control sunlight and planet reflections independently from each-other then you do need a specular map *_spec.dds in addition to _rghn.dds and _refl.dds.

From a material perspective, a light is reflected in a sameway regardless of it's source. Therefore, separate maps for sunlight and planet reflections are non-realistic. But since we don't have a proper HDR and Fresnel implementation (Yet) the _spec map is the only way right now.

Current shaders are likely going to stay as they are. When a new shaders are ready, the name of the shader would need to be defined in a mesh file to enable it for a meshes those are ready/designed for it, that should avoid breaking current/older mesh models.

---------- Post added at 17:38 ---------- Previous post was at 17:32 ----------

No worries. :thumbup: Glad that you've found the root cause!
:cheers:


PHP:
D3D9: D3DDTCAPS_FLOAT16_4..... : Yes
D3D9: Runs under WINE......... : No
D3D9: Available Texture Memory : 4080 MB
We probably should add "Runs under genuine D3D...: ?" but I haven't found a way to do a CRC check for the libraries. Digital signature checks are looking pretty complicated.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
We probably should add "Runs under genuine D3D...: ?" but I haven't found a way to do a CRC check for the libraries. Digital signature checks are looking pretty complicated.

The best I could come up with is something like this:
Code:
**** Orbiter.log
000000.000: Build Sep  5 2018 [v.180905]
000000.000: Timer precision: 1e-07 sec
000000.000: Found 0 joystick(s)
000000.000: Module AtlantisConfig.dll .... [Build 180905, API 180811]
000000.000: Module AtmConfig.dll ......... [Build 180905, API 180811]
000000.000: Module DGConfigurator.dll .... [Build 180905, API 180811]
000000.000: Module Meshdebug.dll ......... [Build 180905, API 180811]
000000.000: Module DX9ExtMFD.dll ......... [Build 170903, API 170827]
000000.000: Module OrbiterSound.dll ...... [Build 121120, API 100830]
000000.000: Module CameraMFD.dll ......... [Build 181011, API 180811]
000000.000: ---------------------------------------------------------------
000000.000: BaseDir    : C:\Program Files (x86)\Orbiter\D3D9ClientDev_180905 (BETA r84)\
000000.000: ConfigDir  : C:\Program Files (x86)\Orbiter\D3D9ClientDev_180905 (BETA r84)\Config\
000000.000: MeshDir    : C:\Program Files (x86)\Orbiter\D3D9ClientDev_180905 (BETA r84)\Meshes\
000000.000: TextureDir : C:\Program Files (x86)\Orbiter\D3D9ClientDev_180905 (BETA r84)\Textures\
000000.000: HightexDir : C:\Program Files (x86)\Orbiter\D3D9ClientDev_180905 (BETA r84)\Textures2\
000000.000: ScenarioDir: C:\Program Files (x86)\Orbiter\D3D9ClientDev_180905 (BETA r84)\Scenarios\
000000.000: [B]---------------------------------------------------------------
000000.000: D3D9 DLLs  : C:\WINDOWS\SYSTEM32\d3d9.dll [v 10.0.17763.1]
000000.000:            : C:\WINDOWS\SYSTEM32\d3dx9_43.dll [v 9.29.952.3111]
000000.000: ---------------------------------------------------------------[/B]
000000.000: Module D3D9Client.dll ........ [Build 190111, API 180811]
000000.000: Module DockingCamera.dll ..... [Build 181227, API 180811]

Where I enumerate all the current loaded modules (DLLs), filter them by containing something like "d3d" and then getting the file information from these.
At least we might be able to detect the setup better with this...

It really is a PITA to get this information ;)

PHP:
// ===========================================================================
// Logs loaded D3D9 DLLs and their versions to Orbiter.log
//
void OapiExtension::LogD3D9Modules(void)
{
	HMODULE hMods[1024];
	HANDLE hProcess;
	DWORD cbNeeded;

	// Get a handle to the process.
	hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, GetCurrentProcessId());
	if (NULL == hProcess) {
		return;
	}

	// Get a list of all the modules in this process.
	if (EnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded))
	{
		for (unsigned int i = 0, n = 0; i < (cbNeeded / sizeof(HMODULE)); ++i)
		{
			TCHAR szModName[MAX_PATH];

			if (GetModuleBaseName(hProcess, hMods[i], szModName, ARRAYSIZE(szModName)))
			{
				std::string name = std::string(szModName); toLower(name);
				// Module of interest?
				if (name == "d3d9.dll" || 0 == name.compare(0, 6, "d3dx9_"))
				{
					// Get the full path to the module's file.
					if (GetModuleFileNameEx(hProcess, hMods[i], szModName, ARRAYSIZE(szModName)))
					{
						TCHAR versionString[128] = "";
						DWORD dummy = 0;
						LPDWORD pDummy = 0;
						DWORD versionInfoSize = GetFileVersionInfoSize(szModName, pDummy);
						if (versionInfoSize) {
							char *data = new char[versionInfoSize]();
							if (GetFileVersionInfo(szModName, dummy, versionInfoSize, data))
							{
								UINT size = 0;
								VS_FIXEDFILEINFO *verInfo;

								if (VerQueryValue(data, "\\", (LPVOID*)&verInfo, &size) && size)
								{
									sprintf_s(versionString, ARRAYSIZE(versionString),
										" [v %d.%d.%d.%d]",
										HIWORD( verInfo->dwProductVersionMS ),
										LOWORD( verInfo->dwProductVersionMS ),
										HIWORD( verInfo->dwProductVersionLS ),
										LOWORD( verInfo->dwProductVersionLS )
									);
								}
							}
							delete[] data;
						}

						// Print the module name.
						auto prefix = (n++ ? "         " : "D3D9 DLLs");
						oapiWriteLogV("%s  : %s%s",	prefix, szModName, versionString);
					}
				}
			}
		}
	}

	// Release the handle to the process.
	CloseHandle( hProcess );
}

Anyone with an improvement on this? :)


---------- Post added 2019-01-11 at 10:38 ----------------------------------------

...ooops, forgot to include a binary (As this is a pre-release, the version is 28.3.0.1)

@Abdullah Radwan:
Could you please be so kind and reproduce your ReShade issue with this client-build and post the Orbiter.log lines?
I am curious what the results would have been in such a scenario (and if we can actually see any difference in paths and/or versions).​
 

Attachments

  • D3D9ClientBeta28.3.0.1-forBETA r84(r1043).zip
    486.3 KB · Views: 4
Last edited:

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,910
Reaction score
206
Points
138
Location
Cape
Would it be possible to block out the sun, when a mesh is in front of it, in lens flare mode ?
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
@jarmonik: Regarding your r1046 commit message:
- Added a CRC check. Does it work ?
... I can say: 50% :)

This is what my system reports:
Code:
000000.000: ---------------------------------------------------------------
000000.000: D3D9 DLLs  : C:\WINDOWS\SYSTEM32\d3d9.dll [v 10.0.17763.1] CRC=0x95F5 (Fail)
000000.000:            : C:\WINDOWS\SYSTEM32\d3dx9_43.dll [v 9.29.952.3111] CRC=0x6FE6 (Pass)
000000.000: ---------------------------------------------------------------
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
@jarmonik: Regarding your r1046 commit message:

... I can say: 50% :)

This is what my system reports:
Code:
000000.000: ---------------------------------------------------------------
000000.000: D3D9 DLLs  : C:\WINDOWS\SYSTEM32\d3d9.dll [v 10.0.17763.1] CRC=0x95F5 (Fail)
000000.000:            : C:\WINDOWS\SYSTEM32\d3dx9_43.dll [v 9.29.952.3111] CRC=0x6FE6 (Pass)
000000.000: ---------------------------------------------------------------


This is mine, Looks like I got older d3d9.dll. So, I guess it's not very reliable. Might be better to forget it.

Code:
000000.000: ---------------------------------------------------------------
000000.000: D3D9 DLLs  : C:\Windows\SYSTEM32\d3dx9_43.dll [v 9.29.952.3111] CRC=0x6FE6 (Pass)
000000.000:            : C:\Windows\SYSTEM32\d3d9.dll [v 10.0.17134.81] CRC=0xC0CB (Pass)
 
Top