New Release D3D9Client Development

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
I found a bug that is causing a meshes to be invisible. An uninitialized variable, it will be addressed in the next release. I noticed it when I was testing the FPS with a release build.

So, If you can't see the meshes there is no need to worry about it.
 

Tschachim

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 7, 2008
Messages
300
Reaction score
0
Points
16
Location
nassp.sf.net
Website
nassp.sf.net
This seems to work well with Shuttle-A and XR-vessels. However, the NASSP is not so fortunate...

Thanks for checking NASSP! :)

I also tried it with your latest alpha, using the unsplit main panel I got an error, see 1st screenshot, I assume the panel is just too big for my graphic adapter. Using the split main panel, the panels are working without CTDs, but you can see outside near the switches, see 2nd screenshot.

I think I can explain why this happens in NASSP but not with Shuttle-A: Both NASSP and Shuttle-A create the switch surfaces (to be displayed in the panel areas) with oapiCreateSurface. In NASSP these surfaces are partially transparent by setting a ColorKey using oapiSetSurfaceColourKey, while neither the Shuttle-A nor any other stock Orbiter vessel does that (except the Delta Glider previously, which is using the "new" panel interface now).

What should happen with the parts of the surfaces, which have the color specified with oapiSetSurfaceColourKey, when displayed in a panel area is set with the last parameter of oapiRegisterPanelArea. NASSP is using PANEL_MAP_BACKGROUND, which should show the panel background. Currently the outside world is shown, which is PANEL_MAP_NONE or PANEL_MAP_CURRENT (I not sure right now).

Perhaps this helps to fix that problem. If not my question would be if there's something we can change in NASSP to fix that?

Cheers
Tschachim
 

Attachments

  • DX9 - 0.jpg
    DX9 - 0.jpg
    125.6 KB · Views: 49
  • DX9 - 1.jpg
    DX9 - 1.jpg
    113.7 KB · Views: 49

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
I also tried it with your latest alpha, using the unsplit main panel I got an error, see 1st screenshot, I assume the panel is just too big for my graphic adapter. Using the split main panel, the panels are working without CTDs.

The maximum texture size is shown in the D3D9ClientLog.html if the panel is larger than that it will not work. I supose the Client could give a better error report if a panel is larger than the hardware can support.

but you can see outside near the switches, see 2nd screenshot.
Yes, that's because the ColorKey color is blitted into the panel with the switch and it becomes transparent when the panel is blitted into the backbuffer. This problem is fixed now. The implementation is a bit tricky, so, there may exist some hardware that can't do it.

Perhaps this helps to fix that problem. If not my question would be if there's something we can change in NASSP to fix that?
The panels are outdated but they are working. The bigest problem is the high number of temporary surface. The first half of the main panel has 70 temporary surfaces in use which is causing most of the trouble because the modern hardware doesn't provide a proper sopport for color keying. Also, one pixel can go through three blitting operation before it reaches the back buffer. There are better methods to build a panel but it's not a critical issue at a moment.

Ok, Here is the latest version. There are some color keying related fixes and a few others. I'll start working on the planet rendering...
 
Last edited:

Tschachim

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 7, 2008
Messages
300
Reaction score
0
Points
16
Location
nassp.sf.net
Website
nassp.sf.net
Thanks, with the new version the panels look and work as they should! :thumbup:

However after changing the panel 3-4 times (<ctrl><cursor>), I get the following error:

".\D3D9Surface.cpp Line:231 Error:-2005532292 pDevice->CreateOffscreenPlainSurface(Width, Height, D3DFMT_X8R8G8B8, Pool, &pSurf, NULL)".

Logfile with the error is attached.

Cheers
Tschachim
 

Attachments

  • D3D9ClientLog.zip
    43.6 KB · Views: 7

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
".\D3D9Surface.cpp Line:231 Error:-2005532292 pDevice->CreateOffscreenPlainSurface(Width, Height, D3DFMT_X8R8G8B8, Pool, &pSurf, NULL)".
I'll get that as well, it's caused by the system running out of memory. There is a major memory leak somewhere in the client.

There are also some errror reports in the log about a blitting operation where the target rectangle is outside the target surface. It doesn't cause any harm except that some graphics may not show up as they should.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Ok, here is yet an other alpha package.

- The memory leak issue is fixed.
- Planet rendering is online but will still require some optimizations.

Todo:
- Surface bases.
- Atmospheric haze.
- Vessel and Base shadows.
- Labels in planetarium mode.
- Celestial sphere background images.
- Particle effects/streams.
- Planet rings.
 
Last edited:

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Ok, here is a new version. Everything that's needed to play the Orbiter is implemented. Particle effects and shadows are still offline and I still need to think about how to implement them. I suppose the particle effects could be moved over to the GPU somehow but I have never done anythink like that so ideas are welcome.
So far, the frame rate seems to be pretty good. It's about 30% to 400% over the build-in engine. The HUD is causing a terrible impact for unknown reason. Also the CPU seems to be the bottle neck.

- Atmospheric haze is now online.
- Surface base rendering is online.
- Cloud layer rendering improved.
- Planetary ring rendering is online but it's not working properly.
- High resolution terrain is online.
- Fog is online.
 
Last edited:

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
Ok, here is a new version. Everything that's needed to play the Orbiter is implemented. Particle effects and shadows are still offline and I still need to think about how to implement them. I suppose the particle effects could be moved over to the GPU somehow but I have never done anythink like that so ideas are welcome.
So far, the frame rate seems to be pretty good. It's about 30% to 400% over the build-in engine. The HUD is causing a terrible impact for unknown reason. Also the CPU seems to be the bottle neck.

- Atmospheric haze is now online.
- Surface base rendering is online.
- Cloud layer rendering improved.
- Planetary ring rendering is online but it's not working properly.
- High resolution terrain is online.
- Fog is online.
What are the requirements to run the D3D9Client? When I activate it in Orbiter_ng it complains about d3dx9_42.dll is missing. Do I need to install a runtime package?
 

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,926
Reaction score
794
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
Progress, for sure - I have a vessel which I can't see definitely in Orbit (It was pre-put there by the scenario editor) - but no control over it, no fuel in it for some reason. Neither RCS fuel, so presumably the small tank it uses is also empty.

nocontrol.png

Pressing F1 reveals no visible vessel mesh - because of this in Orbiter.log, which I'm not sure about at all:

Code:
---------------------------------------------------------------
>>> ERROR: Could not load vessel module: DeltaGlider
>>> [Vessel::LoadModule | .\Vessel.cpp | 5442]
---------------------------------------------------------------

Did something change in the DG's .dll? At any rate, the planet looks beautiful. As you can see in the screenie, the MFD buttons in the glass cockpit are partially obscured while in space - this wasn't the case on land.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
Ok, here is a new version. Everything that's needed to play the Orbiter is implemented. Particle effects and shadows are still offline and I still need to think about how to implement them. I suppose the particle effects could be moved over to the GPU somehow but I have never done anythink like that so ideas are welcome.
So far, the frame rate seems to be pretty good. It's about 30% to 400% over the build-in engine. The HUD is causing a terrible impact for unknown reason. Also the CPU seems to be the bottle neck.

- Atmospheric haze is now online.
- Surface base rendering is online.
- Cloud layer rendering improved.
- Planetary ring rendering is online but it's not working properly.
- High resolution terrain is online.
- Fog is online.
Can confirm the significant FPS boost here! Over 100 FPS with the very poly-heavy SSU on the launch pad! With the DX7 client it was a challenge to get it over 30.

So fantastic job so far! Keep it and this one will be a winner for sure! BTW, are animations implemented yet? Just checking to be sure.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Progress, for sure - I have a vessel which I can't see definitely in Orbit (It was pre-put there by the scenario editor) - but no control over it, no fuel in it for some reason. Neither RCS fuel, so presumably the small tank it uses is also empty.

That's strange, I have never encountered anything like that. Does the same thing happen with every vessel ? Is anyone else able to reproduce this ? Am I just lucky that it works on my computer ?

Did something change in the DG's .dll?
The D3D9Client doesn't change anything from any DLL.

the MFD buttons in the glass cockpit are partially obscured while in space - this wasn't the case on land.
Yes, I can reproduce that one. It's been around from the begining. It has probably something to do with the implementation of in-surface blitting. DirectX versions from 9 to 11 doesn't support any blitting actions where the target and source surfaces are the one and the same surface. So, the D3D9Client will clone the surface.

Known Bugs:
- MFD buttons in glass cockpit won't always work.
- Meshes in AMSO are currupted. (The same will happen in D3D7Client)
- DeltaGlider IV will CTD. (The same will happen in D3D7Client)
- MFD Power button problems in VC of stock DeltaGlider. (Problem exists in D3D7Client)
- The VC of stock Atlantis doesn't show-up. Only the MFD screens are visible.



---------- Post added at 22:45 ---------- Previous post was at 22:42 ----------

Can confirm the significant FPS boost here! Over 100 FPS with the very poly-heavy SSU on the launch pad! With the DX7 client it was a challenge to get it over 30.

So fantastic job so far! Keep it and this one will be a winner for sure! BTW, are animations implemented yet? Just checking to be sure.

It's good to hear that. The animations are implemented and they are working at least in DeltaGlider and XR2-Ravenstar.
 
Last edited:

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,926
Reaction score
794
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
That's strange, I have never encountered anything like that. Does the same thing happen with every vessel ? Is anyone else able to reproduce this ? Am I just lucky that it works on my computer ?

I think it's because of the deltaglider module not being loaded. I haven't time to test with other vessels right now but I will before the night is over and we'll see what's wrong with it.

The D3D9Client doesn't change anything from any DLL.

Fair enough - Just seemed a little odd, but I recall that my deltaglider DLL is not stock - I swapped it out for one in this thread. I'll slip the stock module back in and see if it helps.


Just out of curiosity, what's your computer specs?
I would absolutely LOVE to have 184 FPS.

Well, remember that's a very basic simulation with no vessel loaded (at all) and in orbit, though I usually grace 90 or so in standard Orbiter.

AMD Athlon XII 250 3GHz, 2GB DDR 2 RAM, Geforce 8600 GT. I want to upgrade the card to a GTX 460 soon though.

It looks like this project is coming along nicely :thumbup:

Agreed, this is making serious progress! :thumbup: :cheers:
 

Thorton

sense offender
Addon Developer
Joined
Mar 31, 2008
Messages
330
Reaction score
1
Points
0
Location
Tomsk
Great work! Even at this stage it looks outstanding, thanks a lot!

Fps are very high with such hi-poly addons like SSU or my ISS.

However it seems i've found a bug with lightning. Looks like there is some problems with animated parts, they dont light properly. According to my observations light is applied to this pats without taking into account its current position.
Here is the example with DG:



As you can see here when DGs nose cone is open and DG is faced to sun, internal parts of cone are in dark and vice versa when DG is faced against sun.
 
Last edited:

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
It's good to hear that. The animations are implemented and they are working at least in DeltaGlider and XR2-Ravenstar.
Then I guess something in SSU is incompatible with the D3D9Client as no pad animations are working.

Also seems like the D3D9Client has several problems with the orbiter mesh. I have attached two screenshots, with the first one showing the problem and the second showing how it is supposed to look like.

I have also attached the D3D9Clientlog file.
 

Attachments

  • SSU_orbiter_D3D9.jpg
    SSU_orbiter_D3D9.jpg
    92.8 KB · Views: 56
  • SSU_orbiter_D3D7.jpg
    SSU_orbiter_D3D7.jpg
    83.8 KB · Views: 50
  • D3D9ClientLog.zip
    3.9 KB · Views: 6

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
However it seems i've found a bug with lightning. Looks like there is some problems with animated parts, they dont light properly. According to my observations light is applied to this pats without taking into account its current position.

As you can see here when DGs nose cone is open and DG is faced to sun, internal parts of cone are in dark and vice versa when DG is faced against sun.

Thanks for leting me know. I found the bug, the animation matrix (mesh group transformatin matrix) wasn't applied to the normal vectors, this caused a failure in a lighting.

Here is a quick fix. Replace the existing section from MeshTech.fx with this one.
Code:
OutputVS MeshTechVS(float3 posL : POSITION0, float3 normalL : NORMAL0, float2 tex0: TEXCOORD0)
{
    // Zero output.
    OutputVS outVS = (OutputVS)0;
    
    // Apply a mesh group transformation matrix
    float3 posX = mul(float4(posL, 1.0f), gGrpT).xyz;
    float3 nrmX = mul(float4(normalL, 0.0f), gGrpT).xyz;
    float3 posW = mul(float4(posX, 1.0f), gW).xyz;

    // Convert transformed vertex position into a "screen" space using a combined (World, View and Projection) Matrix
    outVS.posH = mul(float4(posW, 1.0f), gVP);
    
    // A vector from the vertex to the camera
    outVS.toCamW = -posW;
    
    // No texture coordinate processing. Pass through.
    outVS.tex0 = tex0;
    outVS.normalW  = mul(float4(nrmX, 0.0f), gW).xyz;
    return outVS;
}


---------- Post added at 23:43 ---------- Previous post was at 23:13 ----------

Then I guess something in SSU is incompatible with the D3D9Client as no pad animations are working.

Also seems like the D3D9Client has several problems with the orbiter mesh. I have attached two screenshots, with the first one showing the problem and the second showing how it is supposed to look like.

I have also attached the D3D9Clientlog file.

I'll install the SSU and take a closer look. Based on the log file it looks like the oapiBlit() is used between oapiGetDC() and oapiReleaseDC(). There is probably a way around this problem so no need to worry about it right now.

There isn't any code in Surface base section that's involved in animations in any way. It's possible that launch pad animations aren't implemented in GraphicsClient interface, yet. Do you know how the launch pad animations are made ?
 

FordPrefect

Addon Developer
Addon Developer
Donator
Joined
Feb 7, 2008
Messages
407
Reaction score
41
Points
28
Great work Jarmo! The quick fix you posted above did it for me. Before that, I had issues with the solar panels on Thorton's ISS, looking good now.

ISS_D3D9Client.jpg



Two observations: distance fog does not seem to work for me, also the horizon haze looks "inverse". It darkens the sky color towards the horizon. See next image:

Horizon_haze_dark_and_no_distance_fog.jpg


Other than this, it runs smooth as silk. Very high FPS, even with high-poly meshes in view. Cannot reproduce the issues with the Delta glider (*.dll) as reported by Xyon.

What is the currently supported maximum planetary textures resolution level? It seems lower than in the standard Orbiter engine.

Very nice work there, Jarmo! :thumbup:
 

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,926
Reaction score
794
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
Testing with an XR1 proved useful, and I thought to test the latest iteration of my own addon off against it, which works fine :)

Three things of note: Ground clipping isn't quite right; Whatever the UMMU did to make the gold visor cockpit thing work isn't working, so the visor is always closed (very hard to see :p); and still getting a CTD on quitting Orbiter. Oh, and the oapiDebugString message space isn't cleared between sessions (When quitting to launchpad and starting a new scenario immediately).

ummuandclearance.png

My control issues were due to the faulty DeltaGlider module I had, slipping the stock module back in fixed that up nicely.
 

FordPrefect

Addon Developer
Addon Developer
Donator
Joined
Feb 7, 2008
Messages
407
Reaction score
41
Points
28
...and still getting a CTD on quitting Orbiter. Oh, and the oapiDebugString message space isn't cleared between sessions (When quitting to launchpad and starting a new scenario immediately)

Here, Orbiter quits as it should (going back to the launchpad), however when restarting the simulation right out of the launch pad again from current state, I get an error messge and subsequent CTD.
 
Top