New Release D3D9Client Development

Hey Jarmo, I felt the need to update the documentation a bit, as it -as usual:hmm:- lacked behind.

I had to skip describing some parts due to "not knowing what to say"
(...and I wanted to avoid the obvious "the setting FOO lets you change the setting of FOO" ;) ).

Would you be so kind and fill out some of the gaps?

It's in the 2016 branch (rev. 1308). The missing parts all have "...to be documented..." instead of meaningful documentation.

...and editing \Orbitersdk\D3D9Client\doc\D3D9Client.html is enough, generation of PDF is not needed!

Drop me a note when you've found time to add some content and I'll do the rest -merge to trunk, (page-break) formatting, PDF generation etc. pp.- afterwards.

Cheers :cheers:,
Kuddel​
 
There are new builds 4.0 and 29.0
...
- New version of DX9ExtMFD is made available which is using the swapchain interface. Unzip it in "/Modules/Plugin/" folder.
...
I don't understand if the (then) new DX9ExtMFD attached to that release (post #5062) was an alternative to the one packaged inside the zip itself...
Or if it has now been merged in the latest release.

Thanks.


Edit:
already asked here
https://www.orbiter-forum.com/showthread.php?p=605570&postcount=5174
but with no 100% sure answer
 
Last edited:
Any newer release always includes all previous changes (except when it's found erroneous later on).
So the "new DX9ExtMFD" is in there.
 
I have a bug with the terrains of very non-spherical celestial objects (Phobos, Deimos, Vesta, etc.), as they are rendered partially with the terrain, and partially as spherical objects with the textures wrapped around.
Same problem reported here: https://www.orbiter-forum.com/showthread.php?p=606820#post606820
I searched for a solution, but couldn't find any, so I'm reposting the problem in this thread.

I assume the bug is for all celestial objects, but it's then not as jarring due to their high sphericality.

Works all fine in inline client, as seen in attached images. First image is inline, second D3D9.

I'm using latest R4.4, by the way.
 

Attachments

  • CurrentState – Kopi.jpg
    CurrentState – Kopi.jpg
    33.5 KB · Views: 21
  • CurrentState – Kopi (2).jpg
    CurrentState – Kopi (2).jpg
    160.6 KB · Views: 22
Last edited:
I have a bug with the terrains of very non-spherical celestial objects (Phobos, Deimos, Vesta, etc.), as they are rendered partially with the terrain, and partially as spherical objects with the textures wrapped around.
Same problem reported here: https://www.orbiter-forum.com/showthread.php?p=606820#post606820
I searched for a solution, but couldn't find any, so I'm reposting the problem in this thread.

I assume the bug is for all celestial objects, but it's then not as jarring due to their high sphericality.

Works all fine in inline client, as seen in attached images. First image is inline, second D3D9.

I'm using latest R4.4, by the way.

I have the same problem with R4.4.

Phobos looks completely spherical at certain distance.

ROnjyAc.png


It becomes non-spherical when you get closer.

VkI3tWB.png


But if you look at it from different angle, it becomes partially spherical.

kNevl30.png
 
So Phobos IS an alien reconfigurable spacecraft, as Shklovsky (?) proposed... :)
 
I just got an assert fail, 12** something. tried to screenshot it but failed apparently.

I was in the latest NASSP commit, main 2d pannel, just after the end of the ascent program, and I clicked a MFD button.

Bam, assert fail from D3D9 client. I know you probably need more info, unless this is known and I shouldn't worry about it.
 
Anyway of brightening the ground around sunrise/sunset? As shown in the attached screenshots, the ground gets dark way too early currently. The Orbiter screenshot was taken around the same time on the same day as the video screenshot of the first STS-114 rollout on April 6 2005, from the same vantage point (SE corner of the VAB roof).
 

Attachments

  • D3D9Client_ground_too_dark.jpg
    D3D9Client_ground_too_dark.jpg
    66.5 KB · Views: 28
  • STS114_rollout1.jpg
    STS114_rollout1.jpg
    316 KB · Views: 26
You should try the "D3D9 Atmospheric Controls", this dialog allows to control various atmospheric parameters and effects.
Lots of parameters you can change there (Gamma might be the first to try -from my guess- ).

You'll find in under the "Custom functions" (top-border-menu "function")...

If you save the settings, these will be saved as Config\GC\<Planet>.atmo.cfg and Config\GC\<Planet>.atms.cfg (for orbital resp. surface parameters),
so you might first backup those (in case you totally ruined them ;) )

Of course you can also directly change the values there.

Note: There is currently only one set of atmospheric parameters per planet, so no way to specify a specific set per scenario (yet).
 
Last edited:
You should try the "D3D9 Atmospheric Controls", this dialog allows to control various atmospheric parameters and effects.
Lots of parameters you can change there (Gamma might be the first to try -from my guess- ).

You'll find in under the "Custom functions" (top-border-menu "function")...
I've tried that (it was the first go-to, before I posted), with no appreciable difference. I've attached a screenshot with both the terrain brightness and gamma sliders maxed out. This is something that needs to be altered in code.
 

Attachments

  • D3D9Client_ground_too_dark2.jpg
    D3D9Client_ground_too_dark2.jpg
    109.2 KB · Views: 21
Hmm... strange.

I've just checked Orbiter 2016 (D3D9Client R4.4) and I could "brighten" up the surface.
Is you scenario using a different earth ("SSU-Earth" or something like that?).
I have never tried the dialog in such a scenario, but I would assume that then Config\GC\SSU_Earth.atmo.cfg and Config\GC\SSU_Earth.atms.cfg would get modified...
 
Hmm... strange.

I've just checked Orbiter 2016 (D3D9Client R4.4) and I could "brighten" up the surface.
Is you scenario using a different earth ("SSU-Earth" or something like that?).
I have never tried the dialog in such a scenario, but I would assume that then Config\GC\SSU_Earth.atmo.cfg and Config\GC\SSU_Earth.atms.cfg would get modified...
I've attached the scenario I used, it's just a date modified version the standard Delta-glider\DG-S ready for takeoff scenario.


And no, no separate Earth.cfg file used.
 

Attachments

I've just checked with SSU and it worked for me...
Saving the setup with "gamma cranced up" created these two configurations:
Earth.atmo.cfg:
Code:
Red = 0.6517
Green = 0.55
Blue = 0.4816
RWaveDep = 4.08
MWaveDep = 0
ScaleHeight = 8.11965
DepthClamp = 0.99875
Exposure = 1.034
TGamma = 0.7272
OutScatter = 0.682587
InScatter = 1.1285
RayleighPhase = -0.5085
MiePower = 0.070688
MiePhase = 0.924176
Aux1 = 0.3
Aux2 = 0.044521
Aux3 = 0.94
AGamma = 0.6624
HazeClr = 0.765
HazeIts = 1.3912
Earth.atms.cfg:
Code:
Red = 0.6517
Green = 0.559
Blue = 0.4804
RWaveDep = 5.216
MWaveDep = -1.712
ScaleHeight = 8.11965
DepthClamp = 0.99875
Exposure = 1.1045
TGamma = 1.5
OutScatter = 1.04784
InScatter = 1.598
RayleighPhase = 0
MiePower = 0.3872
MiePhase = 0.967558
Aux1 = 0.3
Aux2 = 1
Aux3 = 0
AGamma = 1.5
HazeClr = 0.273
HazeIts = 1.6096


---------- Post added at 23:00 ---------- Previous post was at 22:57 ----------

I've attached the scenario I used, it's just a date modified version the standard Delta-glider\DG-S ready for takeoff scenario.
[...]
And no, no separate Earth.cfg file used.

I figured out already, thanks nevertheless.

So, you don't see any change when sliding the sliders?

---------- Post added at 23:25 ---------- Previous post was at 23:00 ----------

The data flow is: Slider -> ShaderParameter -> Shader -> DISPLAY
So, are you sure your shader (Modules\D3D9Client\Surface.fx) contains some code that uses the shader-parameters fTrGamma and fAtmGamma?
Compare the shader files in your Modules\D3D9Client\ folder with the ones packaged in D3D9ClientR4.4-forOrbiter2016(r1306).zip
 
Tried your scenario and also: everything works as advertised...
(Image is with gammas "full up")
...so: :shrug:
 

Attachments

  • CurrentState.jpg
    CurrentState.jpg
    73.9 KB · Views: 55
By deleting the original Earth.atms.cfg file I managed to fix the ground darkness issue and I now have something that looks authentic. While on the subject, is there anyway by tweaking the shaders to soften the horizon edge? Right now, it's a bit too sharp and well defined.
 
By deleting the original Earth.atms.cfg file I managed to fix the ground darkness issue and I now have something that looks authentic.
Have you restricted write-access to that folder / file(s) ?
I would recommend to allow write-access to the complete Orbiter-folder!

While on the subject, is there anyway by tweaking the shaders to soften the horizon edge? Right now, it's a bit too sharp and well defined.
Short answer: Yes, probably.
Long answer: I believe that this can be done there (at the shaders), but I have no idea how :P "...any shader-tweakers out there that could help?"
 
Would it be possible to implement a shader reload function while the sim is running? That would make tweaking things a bit easier, being able to reload an edited shader during runtime.
 
After looking at things more closely, it seems like D3D9Client lacks a core Orbiter visual feature, which is atmospheric haze. I've attached the explanation of the atmospheric haze configuration parameters from OrbiterConfig.pdf as a screenshot.
 

Attachments

  • Orbiter_atm_haze.jpg
    Orbiter_atm_haze.jpg
    295.8 KB · Views: 25
Playing around with the atmospheric parameters in D39DClient as allowed me to find a rather obscure and hidden bug, and that is that the scale height on orbit can't be higher than the one set for the surface. This presents an issue as the atmosphere limb on orbit is really thin and right now the only way to control the limb thickness is through the scale height parameter.

---------- Post added 07-06-20 at 02:30 AM ---------- Previous post was 07-05-20 at 10:39 PM ----------

Here's what I have come up with so far:
Earth.atmo.cfg:
Code:
Red = 0.6064
Green = 0.5914
Blue = 0.568
RWaveDep = 8
MWaveDep = 0
ScaleHeight = 3.586205
DepthClamp = 1.25
Exposure = 1.3655
TGamma = 0.4404
OutScatter = 1.02317
InScatter = 0.761
RayleighPhase = -0.5085
MiePower = 0.194688
MiePhase = 0.924972
Aux1 = 0.1791
Aux2 = 1
Aux3 = 0
AGamma = 0.5736
HazeClr = 1.5
HazeIts = 1.5228

Earth.atms.cfg:
Code:
Red = 0.6517
Green = 0.5803
Blue = 0.4222
RWaveDep = 5.104
MWaveDep = -1.776
ScaleHeight = 3.586205
DepthClamp = 1.25
Exposure = 1.1045
TGamma = 1.0452
OutScatter = 1.96344
InScatter = 1.3505
RayleighPhase = 0.0045
MiePower = 0.3698
MiePhase = 0.929549
Aux1 = 0.2133
Aux2 = 0.790321
Aux3 = 0.39
AGamma = 0.7632
HazeClr = 1.5
HazeIts = 1.8
 
Back
Top