# New ReleaseD3D9Client Development

#### Wishbone

##### Clueless developer
Okay, with MemAllocationLogic=0 it disappeared, it seems. Haven't tried with RC2.

But there is one more item: the Surface MFD has moving indicator strips painted red instead of blue.

#### Shokus

##### New member
Many thanks for RC3, it has fixed the colour and menu issue that I was facing.
It seems that there is a crash each time I quit orbiter now, and this is new to RC3. RC2 didn't have this issue.
Using Windows 7 x64.

#### Wishbone

##### Clueless developer
Playing it out with XR5 Vanguard doesn't seem to work, is there any way to log error messages to Orbiter.log instead of these incessant popups? My congratulations to you: more and more players start using the client, expect more bugs to be uncovered.

#### Tschachim

Donator
Beta Tester
Hi Jarmo,

the RC3 (with MemAllocationLogic=1 as by default) is working very well on my side. I found a small rendering glitch: When starting the Delta-glider/Cape Canaveral scenario, there's another vessel parking nearby you can see from the panel view. When switching to VC, the vessel is hidden by a kind of "shadow". When changing the viewing direction, it reappears behind that shadow as shown in the attached screenshot.

Cheers
Tschachim

#### Attachments

• 143.7 KB Views: 72

#### luki1997a

##### New member
This client is very very good, but doesn't work for me! I've installed final BETA first, then RC1, test2, test3, RC2 and RC3, and none of those work for me. Do you know why? Can you help me?
Sorry for my very bad english.

EDIT: It will be good to make website of a project.

Last edited:

#### orb

This client is very very good, but doesn't work for me! I've installed final BETA first, then RC1, test2, test3, RC2 and RC3, and none of those work for me. Do you know why? Can you help me?
What do the log files - Orbiter.log and D3D9ClientLog.html say? Can you post contents of at least Orbiter.log?

#### jarmonik

Beta Tester
Playing it out with XR5 Vanguard doesn't seem to work, is there any way to log error messages to Orbiter.log instead of these incessant popups? My congratulations to you: more and more players start using the client, expect more bugs to be uncovered.
There is no configuration option for it. But it is possible to remove it via code modification. The popups are caused by a critical error and the Orbiter should shutdown immediately, however, there exists no oapiCall to do the shutdown.

About 95% of the popups are caused by two reasons:
-System has run out of video memory.
-FX script complier has failed due to error in a *.fx script. (These popups will appear immediately after launching the orbiter).

I have found an issue that is cunsuming the video memory. High resolution textures are pre-loaded for all planets and moons into the video memory. We are talking about 50-200MB. Removing this load should help a lot in the future.

Could you set the maximum texture level to 6 from Visual Effects tab and retry the XR5 Vanguard. I haven't done much testing with it but it runs fine here.

---------- Post added at 19:34 ---------- Previous post was at 19:17 ----------

the RC3 (with MemAllocationLogic=1 as by default) is working very well on my side. I found a small rendering glitch: When starting the Delta-glider/Cape Canaveral scenario, there's another vessel parking nearby you can see from the panel view. When switching to VC, the vessel is hidden by a kind of "shadow". When changing the viewing direction, it reappears behind that shadow as shown in the attached screenshot.
I can reproduce the problem. But I have no idea what is causing the shadow. At first, I thought it was a bad window reflection or something. But I can't see it in the inline engine or D3D7Client, so, I must have done something wrong in the D3D9Client.

During the last few days I have been reading the documents about the atmospheric scattering and it's starting to make some sence. I try to fix the shadow, color and planetary texture issues before starting to implement the scattering effects. The lighting environment must be rewritten so I leave the ambient light issue, reported by FordPrefect, in that process.

Normal Mapping:
Does anyone know how to get a normal or height maps for the Earth, Moon and Mars ? :hmm:

#### luki1997a

##### New member
What do the log files - Orbiter.log and D3D9ClientLog.html say? Can you post contents of at least Orbiter.log?
There they are.
Orbiter.log:
Code:
**** Orbiter.log
Build Aug 30 2010 [v.100830]
Timer precision: 6.98413e-008 sec
Found 1 joystick(s)
Module AtlantisConfig.dll .... [Build 100830, API 100830]
Module AtmConfig.dll ......... [Build 100830, API 100830]
Module DGConfigurator.dll .... [Build 100830, API 100830]
Module D3D9ClientSL.dll ...... [Build 101208, API 100830]
D3D9Client: [DirectX 9 Initialized]
Module TrackIR.dll ........... [Build 100830, API 100830]
Module ScnEditor.dll ......... [Build 100830, API 100830]
Module Rcontrol.dll .......... [Build 100830, API 100830]
Module Framerate.dll ......... [Build 100830, API 100830]
Module FlightData.dll ........ [Build 100830, API 100830]
Module ExtMFD.dll ............ [Build 100830, API 100830]
Module ScriptMFD.dll ......... [Build 100830, API 100830]
Module LuaConsole.dll ........ [Build 100830, API 100830]
Module transx.dll ............ [Build 100824, API 100823]
Module LuaMFD.dll ............ [Build 100830, API 100830]
Module CustomMFD.dll ......... [Build 100830, API 100830]
Module Meshdebug.dll ......... [Build 100830, API 100830]

**** Creating simulation session
D3D9Client: [3DDevice Initialized]
D3D9ClientLog:
Code:
D3D9Client Log

(Sat Dec 11 17:37:54 2010)(0x920) ================ clbkInitialise ===============
(Sat Dec 11 17:37:54 2010)(0x920) Index:0 640 x 480 60Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:1 640 x 480 70Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:2 640 x 480 73Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:3 640 x 480 75Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:4 720 x 480 60Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:5 800 x 600 60Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:6 800 x 600 70Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:7 800 x 600 72Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:8 800 x 600 75Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:9 1024 x 768 60Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:10 1024 x 768 70Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:11 1024 x 768 72Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:12 1024 x 768 75Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:13 1152 x 864 60Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:14 1152 x 864 70Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:15 1152 x 864 72Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:16 1152 x 864 75Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:17 1280 x 720 60Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:18 1280 x 768 60Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:19 1280 x 768 70Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:20 1280 x 768 72Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:21 1280 x 768 75Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:22 1280 x 800 60Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:23 1280 x 800 70Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:24 1280 x 800 72Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:25 1280 x 800 75Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:26 1280 x 960 60Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:27 1280 x 960 70Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:28 1280 x 960 72Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:29 1280 x 960 75Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:30 1280 x 1024 60Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:31 1280 x 1024 70Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:32 1280 x 1024 72Hz (22)
(Sat Dec 11 17:37:54 2010)(0x920) Index:33 1280 x 1024 75Hz (22)
(Sat Dec 11 17:38:01 2010)(0x920) ================ clbkCreateRenderWindow ===============
(Sat Dec 11 17:38:01 2010)(0x920) [VideoConfiguration] Adapter=0, ModeIndex=33
(Sat Dec 11 17:38:01 2010)(0x920) MaxTextureBlendStages..: 8
(Sat Dec 11 17:38:01 2010)(0x920) MaxTextureWidth........: 8192
(Sat Dec 11 17:38:01 2010)(0x920) MaxTextureHeight.......: 8192
(Sat Dec 11 17:38:01 2010)(0x920) MaxPrimitiveCount......: 8388607
(Sat Dec 11 17:38:01 2010)(0x920) MaxVertexIndex.........: 16777215
(Sat Dec 11 17:38:01 2010)(0x920) MaxSimultaneousTextures: 8
(Sat Dec 11 17:38:01 2010)(0x920) MaxStreams.............: 16
(Sat Dec 11 17:38:01 2010)(0x920) MaxStreamStride........: 255
(Sat Dec 11 17:38:01 2010)(0x920) MaxVertexBlendMatrices.: 4
(Sat Dec 11 17:38:01 2010)(0x920) MaxVShaderInstrExecuted: 65535
(Sat Dec 11 17:38:01 2010)(0x920) VertexShaderVersion....: 0x300
(Sat Dec 11 17:38:01 2010)(0x920) PixelShaderVersion.....: 0x300
(Sat Dec 11 17:38:01 2010)(0x920) NumSimultaneousRTs.....: 4
(Sat Dec 11 17:38:01 2010)(0x920) D3DPTEXTURECAPS_POW2...: 0
(Sat Dec 11 17:38:01 2010)(0x920) NONPOW2CONDITIONAL.....: 0
(Sat Dec 11 17:38:01 2010)(0x920)[ERROR] .\D3D9Pad.cpp Line:386 Error:-2147024770 D3DXCreateEffectFromFileA(pDev, name, 0, 0, D3DXSHADER_DEBUG, 0, &FX, &errors)
(Sat Dec 11 17:38:03 2010)(0x920)[ERROR] Failed to create an Effect (CKBlit.fx)
(Sat Dec 11 17:38:03 2010)(0x920)[ERROR] .\D3D9TextMgr.cpp Line:528 Error:-2147024770 D3DXCreateEffectFromFileA(pDev, name, 0, 0, D3DXSHADER_DEBUG, 0, &FX, &errors)
(Sat Dec 11 17:38:04 2010)(0x920)[ERROR] Failed to create an Effect (CKBlit.fx)
(Sat Dec 11 17:38:04 2010)(0x920) [NEW FONT] ( Courier New), Size=18, Weight=400 Pitch&Family=30
(Sat Dec 11 17:38:04 2010)(0x920) TextMetrics: Ascent = 14
(Sat Dec 11 17:38:04 2010)(0x920) TextMetrics: Descent = 4
(Sat Dec 11 17:38:04 2010)(0x920) TextMetrics: Height = 18
(Sat Dec 11 17:38:04 2010)(0x920) TextMetrics: AvgWidth= 10
(Sat Dec 11 17:38:04 2010)(0x920) TextMetrics: MaxWidth= 12
(Sat Dec 11 17:38:04 2010)(0x920) Font and Charter set creation succesfull

#### Tschachim

Donator
Beta Tester
I can reproduce the problem. But I have no idea what is causing the shadow.
Me, too. Perhaps a part of the VC mesh itself like the HUD or the cockpit windows?

During the last few days I have been reading the documents about the atmospheric scattering and it's starting to make some sence...
Thanks a lot for looking at that! I assume it's too early for fine tuning like that, but I'd like you to know that the Cape Canaveral surface tiles are rendered slightly different that the Earth surface itself, causing a seam, which is there in the inline client, too, but not that prominent, see screenshot.

Does anyone know how to get a normal or height maps for the Earth, Moon and Mars ? :hmm:
There are height maps for Orulex and OGLA on Artlav's site: http://orbides.1gb.ru/ogla.php, but I don't know if they are useful for you (nor why OLGA is denoted as obsolete and if there's a successor with more/less features and/or height maps :shrug

Cheers
Tschachim

#### Attachments

• 112.7 KB Views: 50

#### jarmonik

Beta Tester
This client is very very good, but doesn't work for me! I've installed final BETA first, then RC1, test2, test3, RC2 and RC3, and none of those work for me. Do you know why? Can you help me?
Sorry for my very bad english.

EDIT: It will be good to make website of a project.
I am not sure about the error. The description of -2147024770 is ERROR_MOD_NOT_FOUND

But, make sure you have a correct version of DirectX runtime libraries installed. Please, report if this will fix the problem.

Also, check that all *.fx files are installed into the root folder of the Orbiter.

---------- Post added at 00:34 ---------- Previous post was at 00:30 ----------

Here are great height/normal maps of Moon:
http://imbrium.mit.edu/DATA/LOLA_GDR/
That's LRO's Laser Altimeter measurements. It should be pretty easy to derive Lvl 10 normal map from it. Thank you.

---------- Post added at 00:39 ---------- Previous post was at 00:34 ----------

Thanks a lot for looking at that! I assume it's too early for fine tuning like that, but I'd like you to know that the Cape Canaveral surface tiles are rendered slightly different that the Earth surface itself, causing a seam, which is there in the inline client, too, but not that prominent, see screenshot.
I'll try to do something about it.

#### FordPrefect

Donator
During the last few days I have been reading the documents about the atmospheric scattering and it's starting to make some sence. I try to fix the shadow, color and planetary texture issues before starting to implement the scattering effects. The lighting environment must be rewritten so I leave the ambient light issue, reported by FordPrefect, in that process.​

Jarmonik, thank you already for looking into the atmospheric scattering subject. I very much hope that the information from Eric Bruneton is something you can "translate" (sort of) into your D3D9 Client. That would be so unspeakable awesome...:thumbup: In my opinion, Mr. Bruneton's work is the most convincing atmospheric visuals I've ever seen.
Good to hear the ambient light issue will most probably be solved along the way.

Normal Mapping:
Does anyone know how to get a normal or height maps for the Earth, Moon and Mars ? :hmm:
I'll have a look again through all my bookmarks with great websites containing such data. Will post it here when I find them again.
:tiphat:

#### luki1997a

##### New member
Has somebody tried to run ENB Series with this client? Maybe it can help you to make orbiter graphics better:thumbup:

#### Frankynov

##### Member
I can't wait to see progress on the atmosphere !

In the future, do you think shadows casting on the vessels would be possible with DX9 ? Like this :

or

In OGLA, it's possible but very performance killing.

#### jarmonik

Beta Tester
In the future, do you think shadows casting on the vessels would be possible with DX9 ? Like this :

In OGLA, it's possible but very performance killing.
I was about to implement it but I placed the atmospheric scattering in the front of the queue. But it's time will come some day. The method is called shadow mapping. It's difficult to estimate the frame rate impact but if we limit the shadow mapping for the active vessel and two other vessels. I would expect the frame rate drop to be somewhere around -30%. All vessels in a scene would cast shadows but only a few vessels would receive shadows.

#### Frankynov

##### Member
Thank you for the information.
Exam's will start very soon, so I'm gonna "hibernate" from Orbiter I'm sure there will be a lot of exciting new things here at wake up

---------- Post added 12-16-10 at 05:36 PM ---------- Previous post was 12-15-10 at 11:14 PM ----------

By the way, I tried to run the client on my netbook.
It has a intel GMA950 accelerator, running windows xp and it won't start..

Here is the log :

(Thu Dec 16 17:30:25 2010)(0xA68) ================ clbkInitialise ===============
(Thu Dec 16 17:30:25 2010)(0xA68) Index:0 320 x 200 60Hz (22)
(Thu Dec 16 17:30:25 2010)(0xA68) Index:1 320 x 240 60Hz (22)
(Thu Dec 16 17:30:25 2010)(0xA68) Index:2 400 x 300 60Hz (22)
(Thu Dec 16 17:30:25 2010)(0xA68) Index:3 512 x 384 60Hz (22)
(Thu Dec 16 17:30:25 2010)(0xA68) Index:4 640 x 400 60Hz (22)
(Thu Dec 16 17:30:25 2010)(0xA68) Index:5 640 x 480 60Hz (22)
(Thu Dec 16 17:30:25 2010)(0xA68) Index:6 800 x 600 60Hz (22)
(Thu Dec 16 17:30:25 2010)(0xA68) Index:7 1024 x 600 60Hz (22)
(Thu Dec 16 17:30:25 2010)(0xA68) Index:8 1024 x 768 60Hz (22)
(Thu Dec 16 17:30:48 2010)(0xA68) ================ clbkCreateRenderWindow ===============
(Thu Dec 16 17:30:49 2010)(0xA68) [VideoConfiguration] Adapter=0, ModeIndex=7
(Thu Dec 16 17:30:49 2010)(0xA68) MaxTextureBlendStages..: 8
(Thu Dec 16 17:30:49 2010)(0xA68) MaxTextureWidth........: 2048
(Thu Dec 16 17:30:49 2010)(0xA68) MaxTextureHeight.......: 2048
(Thu Dec 16 17:30:49 2010)(0xA68) MaxPrimitiveCount......: 65535
(Thu Dec 16 17:30:49 2010)(0xA68) MaxVertexIndex.........: 65534
(Thu Dec 16 17:30:49 2010)(0xA68) MaxSimultaneousTextures: 8
(Thu Dec 16 17:30:49 2010)(0xA68) MaxStreams.............: 16
(Thu Dec 16 17:30:49 2010)(0xA68) MaxStreamStride........: 255
(Thu Dec 16 17:30:49 2010)(0xA68) MaxVertexBlendMatrices.: 0
(Thu Dec 16 17:30:49 2010)(0xA68) MaxVShaderInstrExecuted: 0
(Thu Dec 16 17:30:49 2010)(0xA68) VertexShaderVersion....: 0x0
(Thu Dec 16 17:30:49 2010)(0xA68) PixelShaderVersion.....: 0x200
(Thu Dec 16 17:30:49 2010)(0xA68) NumSimultaneousRTs.....: 1
(Thu Dec 16 17:30:49 2010)(0xA68) D3DPTEXTURECAPS_POW2...: 1
(Thu Dec 16 17:30:49 2010)(0xA68) NONPOW2CONDITIONAL.....: 1
(Thu Dec 16 17:30:49 2010)(0xA68)[ERROR] [Pixel/Shader Version 2.0 or better is required]
(Thu Dec 16 17:30:49 2010)(0xA68)[ERROR] ERROR: Failed to initialize 3D Framework
I'm aware that my "card" doesn't have pixel shader 2, but it happens even if i set orbiter video settings to the lowest.

It's not that important because I run Orbiter mainly on my desktop computer with an nvidia card. And if I ever want to run it on my netbook, I switch to the default built in engine with acceptable performance.
But do you think it could be changed or will your client always need a pixel shader compatible card ?

#### jarmonik

Beta Tester
But do you think it could be changed or will your client always need a pixel shader compatible card ?
D3D9Client is going to require DirectX 9.0c compatible hardware. This will mean that Pixed and Vertex shader version 3.0 or better is required after implementing the atmospheric scattering.

There is no need to keep the hardware requirements low because user can always use the inline engine and the inline engine is working very well under Windows XP.

#### luki1997a

##### New member
Editing the .fx files is like a editing source code? Can I add anti-aliasing code to your client, by editing .fx files? If adding it will be sucessfull I'll send you code:tiphat:

#### jarmonik

Beta Tester
Editing the .fx files is like a editing source code?
Yes, the D3D9Client will compile the .fx (HLSL) scripts when the load screen appears.

Can I add anti-aliasing code to your client, by editing .fx files?
I don't know. I have no idea how the .fx script could be used to do anti-aliasing. However, there is already a fullscene anti-aliasing implemented and hardcoded to 4 samples. It can be activated from the video tab. Sample count can be changed from D3D9Frame.cpp

#### luki1997a

##### New member
Thanks. Have you tried to run ENB Series in orbiter? I'm now downloading directX, so I can't tried to do it.

---------- Post added at 07:15 PM ---------- Previous post was at 07:15 PM ----------

Thanks. Have you tried to run ENB Series in orbiter? I'm now downloading directX, so I can't try to do it.

---------- Post added at 10:35 PM ---------- Previous post was at 07:15 PM ----------

I am not sure about the error. The description of -2147024770 is ERROR_MOD_NOT_FOUND

But, make sure you have a correct version of DirectX runtime libraries installed. Please, report if this will fix the problem.

Also, check that all *.fx files are installed into the root folder of the Orbiter.

---------- Post added at 00:34 ---------- Previous post was at 00:30 ----------

That's LRO's Laser Altimeter measurements. It should be pretty easy to derive Lvl 10 normal map from it. Thank you.

---------- Post added at 00:39 ---------- Previous post was at 00:34 ----------

I'll try to do something about it.
Thanks a lot. Now it's working. I tried to run ENB, but it doesn't work:-( I'm starting working on antialiasing(select from video tab), if it's sucessfull I'll send you code.

---------- Post added 12-19-10 at 09:47 AM ---------- Previous post was 12-18-10 at 10:35 PM ----------

I tried to edit source code using VC++ 2008e, but when I'm opening project file, there is an error. Project file is damaged!

---------- Post added at 10:17 AM ---------- Previous post was at 09:47 AM ----------

I've found very good site about 3d graphics. It's Nvidia developer's site at:
http://http.developer.nvidia.com/GPUGems3/gpugems3_pref01.html
There are veery good samples e.g. shadowing, motion blur, lighting and source code:thumbup: