New Release D3D9Client Development

When I did some troubleshooting on a possible issue with SSU with the default D3D7Client I noticed that the emissive elements in it looked different. It as rendered with a shaded look while it in D3D9Client has a bland look. Here's two images of the effect. The top one is default, while the second is D3D9Client.

Would it be possible to change it so it looks like in the default D3D7 render engine?

D3D7Client_emissive_elements.jpg


D3D9Client_emissive_elements.jpg
 
I found a typo from SimpleMeshTechVS() section located in Mesh.fx

Could you replace this line:
Code:
float3 nrmW = mul(float4(posX, 0.0f), gW).xyz;              // Apply world transformation matrix
With this one:
Code:
float3 nrmW = mul(float4(nrmX, 0.0f), gW).xyz;              // Apply world transformation matrix
And see if it works correctly.

Using emissive materials like that in a VC might cause problems in the future. For an example if we implement ambient occulusion calculatios then emissive matirials would become light sources and they would cast light in the surrounding vertices as well. As far as I can tell, currently emissive materials are used to "fix" otherwise unsufficient interior lighting model.

---------- Post added at 20:14 ---------- Previous post was at 20:06 ----------

I made the cloud addon using texbuild (http://www.orbithangar.com/searchid.php?ID=4486) so it may be a problem with its code, which, if true, would be a headache for me.

The creator of the texbuild should write a valid data in dwLinearSize field which is sadly missing. If the creator cares about his addon then he might fix-it. The following information might help.

Code:
if (header->ddpfPixelFormat.dwFourCC==MAKEFOURCC('D','X','T','5')) header->dwLinearSize = header->dwHeight * header->dwWidth;
else if (header->ddpfPixelFormat.dwFourCC==MAKEFOURCC('D','X','T','3')) header->dwLinearSize = header->dwHeight * header->dwWidth;
else if (header->ddpfPixelFormat.dwFourCC==MAKEFOURCC('D','X','T','1')) header->dwLinearSize = header->dwHeight * header->dwWidth / 2;
else header->dwLinearSize = header->dwHeight * header->dwWidth * header->ddpfPixelFormat.dwRGBBitCount/8;
 
I found a typo from SimpleMeshTechVS() section located in Mesh.fx

Could you replace this line:
Code:
float3 nrmW = mul(float4(posX, 0.0f), gW).xyz;              // Apply world transformation matrix
With this one:
Code:
float3 nrmW = mul(float4(nrmX, 0.0f), gW).xyz;              // Apply world transformation matrix
And see if it works correctly.
Thanks, that worked nicely. Makes the switch guards look alot better!
 
We at FOI have 2 animation issues: both only happen with D3D9 graphics client, while with the inline D3D7 engine everything looks perfect.
The first problem is with Antares' VC, the second concerns the glowing heat shield animation of both Antares and Eridanus.

These problems should be reported to the add-on developper. He might have some insight and ideas what could be wrong.

Any addon that is linking into a following oapi functions are potentially unstable in a graphics client environment.

- oapiMeshGroup()
- oapiMeshMaterial()

However, there is an api function VESSEL::MeshModified(MESHHANDLE hMesh, UINT grp, DWORD modflag) that should notify a graphics client about a change in a mesh. Currently it's not implemented and I am not aware of any add-ons using this. But, with a proper use of this method the above functions could be get working again.

Does anyone know any add-ons using VESSEL::MeshModified(). If used then an error message "EVENT_VESSEL_MODMESHGROUP Not Implemented" should appear in the D3D9ClientLog.
 
The creator of the texbuild should write a valid data in dwLinearSize field which is sadly missing. If the creator cares about his addon then he might fix-it.
But how should he fix it in his code, if converting to DDS is done by external and not his tool, called Texconv? Texbuild only crops source image into patches and saves them as TGA files, which are then converted by Texconv to DDS, and only after that, the DDS files are copied to .tex file back by Texbuild without changing their content. But maybe replacing the included Texconv with newer version would help. :shrug:
 
Are there any errors in the D3D9ClientLog after you have attempted to play recorded text ?

No error. It still records but the text at the bottom of the screen does not appear. I have had many occasions where i was wondering why i could not control my ship later finding outbitbwas on playback mode
 
But how should he fix it in his code, if converting to DDS is done by external and not his tool, called Texconv? :shrug:
Sorry, I didn't know that. The DDS header is lacking a data that is required by the build in routines of DirectX to read the dds files. Maybe it would be better to use nVidia texture tools for the conversion. I don't know, just an idea.

---------- Post added at 02:53 ---------- Previous post was at 02:52 ----------

No error. It still records but the text at the bottom of the screen does not appear. I have had many occasions where i was wondering why i could not control my ship later finding outbitbwas on playback mode
Will be fixed in R9

---------- Post added at 03:02 ---------- Previous post was at 02:53 ----------

But he is the add on dev.
Ok, Then.

Is the addon using oapiMeshGroup() to edit vertices directly ?
Is the addon using oapiMeshMaterial() to change material properties ?

If something has been working better in older versions then what kind of changes has been made ?

Are there any errors/warnings in the D3D9ClientLog ? (After changing debug level to 2 or 3 from Advanced setup menu from a launchpad)
 
D3D9 Client Compiled shader code uses too many arithmetic instruction slots

Just a quick question to tell me if I'm wasting my time on this machine?

Machine name: R4218EA
Operating System: Windows XP Home Edition (5.1, Build 2600) Service Pack 3 (2600.xpsp_sp3_gdr.120504-1619)
Language: English (Regional Setting: English)
System Manufacturer: Hewlett-Packard
System Model: Compaq Presario R4100 (EK866EA#ABU)
BIOS: Ver 1.00PARTTBL
Processor: AMD Athlon(tm) 64 Processor 3200+, MMX, 3DNow, ~2.0GHz
Memory: 1278MB RAM
Page File: 741MB used, 1666MB available
Windows Dir: C:\windows
DirectX Version: DirectX 9.0c (4.09.0000.0904)
DX Setup Parameters: Not found
DxDiag Version: 5.03.2600.5512 32bit Unicode

I was using the R5 version of the D3D9 client, updated to day with the version 8, and the Feb 2010 runtime files as per the .pfd manual.

now get this this message during start-up.

**** Orbiter.log
Build Aug 30 2010 [v.100830]
Timer precision: 2.79365e-007 sec
Found 0 joystick(s)
Module AtlantisConfig.dll .... [Build 100830, API 100830]
Module AtmConfig.dll ......... [Build 100830, API 100830]
Module DGConfigurator.dll .... [Build 100830, API 100830]
Module D3D9Client.dll ........ [Build 130116, API 100830]
**** Creating simulation session
D3D9Client: [DirectX 9 Initialized]
D3D9Client: Sytem has XNA math support
D3D9Client:WARNING: [Hardware has only a limited non-power of 2 texture support]
D3D9Client: [3DDevice Initialized]
D3D9Client: [Compiling Effects for Shader Model 2.0]
.\D3D9Effect.cpp Line:229 Error:-2147467259 D3DXCreateEffectFromFile(pDev, name, macro, 0, 0, 0, &FX, &errors)
Effect Error: NormalMap.fx(100,6): error X5608: Compiled shader code uses too many arithmetic instruction slots (66). Max. allowed by the target (ps_2_0) is 64.
Mesh.fx(519,24): ID3DXEffectCompiler::CompileEffect: There was an error compiling expression
ID3DXEffectCompiler: Compilation failed

Looks serious to me, but Im not a guru!

Not a problem, got another machine I can play Orbiter_ng on. Just wan't to make sure that Dxd9 won't ever be usable on this machine?

Thanks, N.
 
Thanks Ripley, yes it was, didn't seem particularly faster than the normal Orbiter version though. Maybe this machne just can't handle it, must be 10 years old I think.

N
 
I'll fix it from the next release.

If you change this line from /Modules/D3D9Client20/NormalMap.fx

nrmT.b = sqrt(1.0 - nrmT.g*nrmT.g - nrmT.r*nrmT.r);

to this one

nrmT.b = 1.0;

it should work then.
 
Maybe this machne just can't handle it, must be 10 years old I think.
The problem is not the machine, but as the error report states, the updated shader code, which now has more than 64 arithmetic instructions allowed by Pixel Shader 2.0 specification.


(Merging with D3D9Client development thread.)
 
Thanks Jarmonik, I'll give it a go and report back.


EDIT OK Orb, thanks for that, I thought this was a developement thread rather than an individual error problem.
N.
 
Last edited:
Jarmonik, the orbiter log has changed:

**** Orbiter.log
Build Aug 30 2010 [v.100830]
Timer precision: 2.79365e-007 sec
Found 0 joystick(s)
Module AtlantisConfig.dll .... [Build 100830, API 100830]
Module AtmConfig.dll ......... [Build 100830, API 100830]
Module DGConfigurator.dll .... [Build 100830, API 100830]
Module D3D9Client.dll ........ [Build 130116, API 100830]

**** Creating simulation session
D3D9Client: [DirectX 9 Initialized]
D3D9Client: Sytem has XNA math support
D3D9Client:WARNING: [Hardware has only a limited non-power of 2 texture support]
D3D9Client: [3DDevice Initialized]
D3D9Client: [Compiling Effects for Shader Model 2.0]
D3D9Client: [Loading Stars]
D3D9Client: [Loading Constellations]
D3D9Client: [D3D9Client Initialized]
Module Sun.dll ............... [Build 100830, API 100830]
VSOP87(E) Sun: Precision 1e-006, Terms 554/6634
Module Mercury.dll ........... [Build 100830, API 100830]
VSOP87(B) Mercury: Precision 1e-005, Terms 167/7123
Module Venus.dll ............. [Build 100830, API 100830]
Module VenusAtm2006.dll ...... [Build 100830, API 100830]
VSOP87(B) Venus: Precision 1e-005, Terms 79/1710
Module Earth.dll ............. [Build 100830, API 100830]
Module EarthAtmJ71G.dll ...... [Build 100830, API 100830]
VSOP87(B) Earth: Precision 1e-008, Terms 2564/2564

Still get CTD, but I'm not sure its related to the Orbiter_NG. The standard Orbiter has CTD now.
this machine was always twtchy with Orbiter, so I would disregard these as bugs.
I was curious about the d9/d11 clients, and I'll use my more modern machine in future!

N.
 
...Ok, Then.

Is the addon using oapiMeshGroup() to edit vertices directly ?
Is the addon using oapiMeshMaterial() to change material properties ?

If something has been working better in older versions then what kind of changes has been made ?

Are there any errors/warnings in the D3D9ClientLog ? (After changing debug level to 2 or 3 from Advanced setup menu from a launchpad)
Thanks Jarmo for looking into this.
As I'm not a FOI developer I'll just translate what has been posted over at our forum:

Is the addon using oapiMeshGroup() = NO
Is the addon using oapiMeshMaterial() = NO

Main change in this latest release was the addition of RCS control buttons, plus other minor tweaks not VC-related.
The method used for RCS ON/OFF change is a texture swap (made from bmp files), as already stated.

About the DebugLevel, this is the produced log (same error repeating over and over):

Code:
7467: 35.98s 9us)(0x8F0)[ERROR] GPU ColorFill Failed
(7468: 35.98s 633us)(0x8F0)Surface name is Antares\Time.dds Handle=0x3B54808 (256,256)
(7469: 35.98s 670us)(0x8F0)Surface is a Texture
(7470: 35.98s 695us)(0x8F0)Surface has texture inteface
(7471: 35.98s 720us)(0x8F0)Surface has surface interface
(7472: 35.98s 745us)(0x8F0)Surface is in a DefaultPool
(7473: 35.98s 769us)(0x8F0)Surface Format is 894720068
(7474: 35.98s 795us)(0x8F0)Surface Has 9 MipMaps
(7475: 35.98s 820us)(0x8F0)InitialFlags( MANAGED )
(7476: 36.00s 9us)(0x8F0)[ERROR] GPU ColorFill Failed
(7477: 36.00s 641us)(0x8F0)Surface name is Antares\Time.dds Handle=0x3B54808 (256,256)
(7478: 36.00s 677us)(0x8F0)Surface is a Texture
(7479: 36.00s 702us)(0x8F0)Surface has texture inteface
(7480: 36.00s 727us)(0x8F0)Surface has surface interface
(7481: 36.00s 752us)(0x8F0)Surface is in a DefaultPool
(7482: 36.00s 776us)(0x8F0)Surface Format is 894720068
(7483: 36.00s 801us)(0x8F0)Surface Has 9 MipMaps
(7484: 36.00s 826us)(0x8F0)InitialFlags( MANAGED )
(7485: 36.01s 9us)(0x8F0)[ERROR] GPU ColorFill Failed
(7486: 36.01s 632us)(0x8F0)Surface name is Antares\Time.dds Handle=0x3B54808 (256,256)
(7487: 36.01s 676us)(0x8F0)Surface is a Texture
(7488: 36.01s 701us)(0x8F0)Surface has texture inteface
(7489: 36.01s 726us)(0x8F0)Surface has surface interface
(7490: 36.01s 750us)(0x8F0)Surface is in a DefaultPool
(7491: 36.01s 774us)(0x8F0)Surface Format is 894720068
(7492: 36.01s 799us)(0x8F0)Surface Has 9 MipMaps
(7493: 36.01s 824us)(0x8F0)InitialFlags( MANAGED )
(7494: 36.03s 9us)(0x8F0)[ERROR] GPU ColorFill Failed
(7495: 36.03s 629us)(0x8F0)Surface name is Antares\Time.dds Handle=0x3B54808 (256,256)
(7496: 36.03s 675us)(0x8F0)Surface is a Texture
(7497: 36.03s 706us)(0x8F0)Surface has texture inteface
(7498: 36.03s 731us)(0x8F0)Surface has surface interface
(7499: 36.03s 756us)(0x8F0)Surface is in a DefaultPool
(7500: 36.03s 780us)(0x8F0)Surface Format is 894720068
(7501: 36.03s 806us)(0x8F0)Surface Has 9 MipMaps
(7502: 36.03s 830us)(0x8F0)InitialFlags( MANAGED )
(7503: 36.05s 9us)(0x8F0)[ERROR] GPU ColorFill Failed
(7504: 36.05s 639us)(0x8F0)Surface name is Antares\Time.dds Handle=0x3B54808 (256,256)
(7505: 36.05s 675us)(0x8F0)Surface is a Texture
(7506: 36.05s 700us)(0x8F0)Surface has texture inteface
(7507: 36.05s 725us)(0x8F0)Surface has surface interface
(7508: 36.05s 750us)(0x8F0)Surface is in a DefaultPool
(7509: 36.05s 774us)(0x8F0)Surface Format is 894720068
(7510: 36.05s 799us)(0x8F0)Surface Has 9 MipMaps
(7511: 36.05s 824us)(0x8F0)InitialFlags( MANAGED )
(7512: 36.06s 8us)(0x8F0)[ERROR] GPU ColorFill Failed
(7513: 36.06s 628us)(0x8F0)Surface name is Antares\Time.dds Handle=0x3B54808 (256,256)
(7514: 36.06s 672us)(0x8F0)Surface is a Texture
(7515: 36.06s 698us)(0x8F0)Surface has texture inteface
(7516: 36.06s 723us)(0x8F0)Surface has surface interface
(7517: 36.06s 748us)(0x8F0)Surface is in a DefaultPool
(7518: 36.06s 773us)(0x8F0)Surface Format is 894720068
(7519: 36.06s 798us)(0x8F0)Surface Has 9 MipMaps
(7520: 36.06s 823us)(0x8F0)InitialFlags( MANAGED )
(7521: 36.08s 9us)(0x8F0)[ERROR] GPU ColorFill Failed
(7522: 36.08s 626us)(0x8F0)Surface name is Antares\Time.dds Handle=0x3B54808 (256,256)
(7523: 36.08s 661us)(0x8F0)Surface is a Texture
(7524: 36.08s 687us)(0x8F0)Surface has texture inteface
(7525: 36.08s 711us)(0x8F0)Surface has surface interface
(7526: 36.08s 736us)(0x8F0)Surface is in a DefaultPool
(7527: 36.08s 761us)(0x8F0)Surface Format is 894720068
(7528: 36.08s 786us)(0x8F0)Surface Has 9 MipMaps
(7529: 36.08s 811us)(0x8F0)InitialFlags( MANAGED )
 
About the DebugLevel, this is the produced log (same error repeating over and over):

I made a small change that might fix this issue. Let's just hope it doesn't break anything else.

Here is a beta for testing.

- GPU Color Fill should be fixed
- Some Virtual Cockpit shading issues fixed
- Replay/Recording texts added
- Hires saturn rings implemented
- Scenario path issues should be fixed
- Shader Model 2.0 instruction slot issue should be fixed
- In a D3D9 Debug Controls camera speed is relative to object size. Can explore bases and planets now.

EDIT: Binaries for Orbiter 2010-P1 ONLY
 
Last edited:
Thanks Ripley, yes it was, didn't seem particularly faster than the normal Orbiter version though. Maybe this machne just can't handle it, must be 10 years old I think.
N

If you have an old machine with Win XP then you don't really benefit from DX9.
 
No, it dosen't do a lot for this machine. But, I'm used to it!

N.
 
...
- Scenario path issues should be fixed
...
I'll test this issue and let you know as well.

---------- Post added at 19:07 ---------- Previous post was at 18:56 ----------

Ok, "alternative scenario path issue" fixed! Thanks again.

This is the log that was full of errors, same scenario.
Now it's neat & clean.

Code:
**** Orbiter.log
Build Aug 30 2010 [v.100830]
Timer precision: 2.79365e-007 sec
Found 0 joystick(s)
Module AtlantisConfig.dll .... [Build 100830, API 100830]
Module AtmConfig.dll ......... [Build 100830, API 100830]
Module DGConfigurator.dll .... [Build 100830, API 100830]
Module ExtMFD.dll ............ [Build 100830, API 100830]
Module ScnEditor.dll ......... [Build 100830, API 100830]
Module D3D9Client.dll ........ [Build 130205, API 100830]
Module transx.dll ............ [Build 110130, API 100830]
Module Framerate.dll ......... [Build 100830, API 100830]
Module Rcontrol.dll .......... [Build 100830, API 100830]
Module OrbiterSound.dll ...... [Build 121120, API 100830]
Module Map3DMFD.dll .......... [Build 101102, API 100830]
---------------------------------------------------------------
>>> WARNING: Obsolete API function used: oapiRegisterMFDMode
At least one active module is accessing an obsolete interface function.
Addons which rely on obsolete functions may not be compatible with
future versions of Orbiter.
---------------------------------------------------------------
Module LunarTransferMFD.dll .. [Build 100621, API 100603]
Module LaunchMFD.dll ......... [Build 121020, API 100830]
Module HoverMFD.dll .......... [Build 120505, API 100830]
Module ChecklistMFD.dll ...... [Build ******, API 050206]
Module BaseSyncMFD.dll ....... [Build 100616, API 100603]
Module baseland.dll .......... [Build 120512, API 100830]
Module AbsoluteKillrot.dll ... [Build ******, API 060425]
Module autotime.dll .......... [Build 120401, API 100830]
Module FlightData.dll ........ [Build 100830, API 100830]
Module InterMFD55.dll ........ [Build 100826, API 100704]
Module NAVSET.dll ............ [Build 100724, API 100606]
Module AeroBrakeMFD.dll ...... [Build ******, API 100830]

**** Creating simulation session
D3D9Client: [DirectX 9 Initialized]
D3D9Client: Sytem has XNA math support
D3D9Client:WARNING: [Hardware has only a limited non-power of 2 texture support]
D3D9Client: [3DDevice Initialized]
D3D9Client: [Compiling Effects for Shader Model 3.0]
D3D9Client: [Loading Stars]
D3D9Client: [Loading Constellations]
D3D9Client: [D3D9Client Initialized]
Module Sun.dll ............... [Build 100830, API 100830]
VSOP87(E) Sun: Precision 1e-006, Terms 554/6634
Module Mercury.dll ........... [Build 100830, API 100830]
VSOP87(B) Mercury: Precision 1e-005, Terms 167/7123
Module Venus.dll ............. [Build 100830, API 100830]
Module VenusAtm2006.dll ...... [Build 100830, API 100830]
VSOP87(B) Venus: Precision 1e-005, Terms 79/1710
Module Earth.dll ............. [Build 100830, API 100830]
Module EarthAtmJ71G.dll ...... [Build 100830, API 100830]
VSOP87(B) Earth: Precision 1e-008, Terms 2564/2564
Module Moon.dll .............. [Build 100830, API 100830]
ELP82: Precision 1e-005, Terms 116/829
Module Mars.dll .............. [Build 100830, API 100830]
Module MarsAtm2006.dll ....... [Build 100830, API 100830]
VSOP87(B) Mars: Precision 1e-005, Terms 405/6400
Module Phobos.dll ............ [Build ******, API 060425]
Module Deimos.dll ............ [Build ******, API 060425]
Module Galsat.dll ............ [Build 100217, API 100215]
Module Jupiter.dll ........... [Build 100830, API 100830]
VSOP87(B) Jupiter: Precision 1e-006, Terms 1624/3625
Module Io.dll ................ [Build 100217, API 100215]
Module Europa.dll ............ [Build 100217, API 100215]
Module Ganymede.dll .......... [Build 100217, API 100215]
Module Callisto.dll .......... [Build 100217, API 100215]
Module Satsat.dll ............ [Build 100215, API 100212]
Module Saturn.dll ............ [Build 100830, API 100830]
VSOP87(B) Saturn: Precision 1e-006, Terms 2904/6365
Module Mimas.dll ............. [Build 100215, API 100212]
SATSAT Mimas: Terms 113
Module Enceladus.dll ......... [Build 100215, API 100212]
SATSAT Enceladus: Terms 33
Module Tethys.dll ............ [Build 100215, API 100212]
SATSAT Tethys: Terms 101
Module Dione.dll ............. [Build 100215, API 100212]
SATSAT Dione: Terms 59
Module Rhea.dll .............. [Build 100215, API 100212]
SATSAT Rhea: Terms 68
Module Titan.dll ............. [Build 100215, API 100212]
SATSAT Titan: Terms 100
Module Iapetus.dll ........... [Build 100215, API 100212]
SATSAT Iapetus: Terms 605
Module Uranus.dll ............ [Build 100830, API 100830]
VSOP87(B) Uranus: Precision 1e-006, Terms 1827/5269
Module Miranda.dll ........... [Build ******, API 060425]
Module Ariel.dll ............. [Build ******, API 060425]
Module Umbriel.dll ........... [Build ******, API 060425]
Module Titania.dll ........... [Build ******, API 060425]
Module Oberon.dll ............ [Build ******, API 060425]
Module Neptune.dll ........... [Build 100830, API 100830]
VSOP87(B) Neptune: Precision 1e-006, Terms 391/2024
Finished initialising world
Module DeltaGliderIV.dll ..... [Build 121226, API 100830]
Finished initialising status
Finished initialising camera
Finished initialising panels
Finished setting up render state
D3D9Client: [Scene Initialized]
D3D9Client: [Session Closed. Scene deleted.]
UnDeleted Surface(s) Detected
Surface 0x14D48C8 (DGIV\skin\esa\DGIII_4.dds) (1024,1024) Type=2, Creation=1
Surface 0x14D49A8 (DGIV\skin\esa\DGIII_3.dds) (1024,1024) Type=2, Creation=1
Surface 0x14D4A88 (DGIV\skin\esa\DGIII_5.dds) (1024,1024) Type=2, Creation=1
**** Closing simulation session
 
Back
Top