New Release D3D9Client Development

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Update:
The exception thrown looks like this
1670876017149.png

And (thanks doctor) I managed to be able to "run-debug" again (y)

The scrambled text at the microtexture error message was due to giving body.first as std::string to the LogErr() function/macro; a simple change to use the const char* fixes that:
C++:
LogErr("Failed to read microtexture [%s] for [%s]", file_path, body.first.c_str());
I will make a note at the PR.
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
The last commit has improved the rendering at the terminator (no longer visible band artefacts), I am still not quite sure about the spectral balance at the terminator, especially the distinct orange of the clouds. In photos, the spectral dispersion seems much less pronounced, and if anything, more towards purple than orange. I guess this may be a result of improving the cloud appearance from the ground during dusk, but from space it looks a bit strange.
terminator.jpg
I guess one can argue that the light arriving in the terminator region is redder because the blue component has been filtered out through the atmosphere by Rayleigh scattering. But then when observing from above the terminator, you would get light primarily composed from Rayleigh in-scattering, so maybe the two effects somewhat cancel.
 
Last edited:

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
I have also noticed the purple color that's often in a real world photographs. This atmospheric model doesn't support multiple scattering which will reduce blue color. There is a simple model that tries to approximate the effect but it's not working that well. Might be worth considering using a manually defined color gradient for orbital view of the clouds. Also, there is a pretty sharp line on the ground which is especially well visible on the ice caps. Lambertian shading term dot(Normal, Sun) creates the terminator region too dark and taking a square-root of that creates sharp lines very easily. I have to think about other options.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Altitude of the clouds is also a factor and a clouds might be shadowed by other clouds.
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
Thinking about it, my above statement that light arriving in the terminator region would be redder is probably wrong, since this only applies to direct (unscattered) light. Considering light from all directions, this would have the blue Rayleigh component added back in, and the two components would mix back together in the clouds by multiple Mie scattering, leaving the cloud white. Except for the lit edge, where the arriving unscattered red light would be single-scattered to the observer.
 
Last edited:

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Yes, that would make sense and since the green is attenuated along both pathways it could give a light purple hue.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
I still can not get Orbiter to start working with the 'D3D9 atmosphere remake PR' :(
Still the same exception (see my post above) at start of rendering.
No luck on any Scenario (Exceptions thrown on different places, but still nothing ot run).

Is there something I have to tweak on my side?
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
I did get crashes before Jarmo's latest commits, but only in the Release builds (both x86 and x64), so I couldn't debug it. This was unrelated to my shader cache issue. In any case it hasn't happened yet with the latest sources.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Thanks for the info.
I am pretty sure I messed up with git - again :D
A clean checkout of "main" does run however.
I'll stop for a while as I'm getting too frustrated and it might be just a matter of "getting a little distance to it".
 

Marg

Active member
Joined
Mar 20, 2008
Messages
483
Reaction score
68
Points
28
And what is the correct way to install new D3D9? It was written about Orbiter itself (github: actions\merge etc.), but with this?
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
If you are talking about the D3D9 atmosphere remake branch (which was the topic of the last few posts here), the only way to test it yourself is to check out the sources from github and compile it yourself.
If you are talking about the main branch: just get the installation package from the assets in the Orbiter development build pre-release (the "latest" tag) here: https://github.com/orbitersim/orbiter/releases
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Hi again,
tried on a completely different machine the following things to get a "clean checkout" of the d3d9_atmosphere_remake PR:
Bash:
/d/Programme/Orbiter/> $ git clone https://github.com/orbitersim/orbiter.git ./WTF/
/d/Programme/Orbiter/> $ cd WTF/
/d/Programme/Orbiter/WTF/> $ git checkout --track origin/d3d9_atmosphere_remake

Then build that with Visual Studio 2019 and still only a crash when trying to run/start "DG Mk4 in orbit.scn" :(
Attached the configurations (just selected D3D9Client on video-tab, then tried to run the scenario...to minimize 'local mistakes')

I'm more and more confused what could be the issue...A DirectX feature, that both machines don't support?
 

Attachments

  • cfgs.zip
    1.1 KB · Views: 0
  • logs.zip
    1.5 KB · Views: 1

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Yesterday, I tested the client on my Intel HD graphics 4000 laptop and I also experienced a crash (x86 release). It works if I disable "sun glare" from the setup dialog. So, something there it doesn't like. It seems that you have tried x64 build ? It's been working fine in a past but I'll test it again.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Thanks a million Jarmo! (y) (y)

Turning off "sun glare" did the trick!
1671571185375.png

Could this part from Glare.hlsl result in a division by zero? And what would the GPU do then?
C-like:
float ilerp(float a, float b, float x)
{
    return saturate((x - a) / (b - a));
}

EDIT:
When looking at the internet it seems this is undefined behavior, but nothing fatal.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Fix for the problem above have been uploaded. This is the first time we are using a texture lookup in vertex shader and the CTD was due to incorrectly configured texture sampler. Also tested the "noise flicker/flashes" issue and doesn't seem to occur on Intel HD Graphics 4000
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Fix for the problem above have been uploaded. This is the first time we are using a texture lookup in vertex shader and the CTD was due to incorrectly configured texture sampler.
I can confirm, I can now run with "sun glare" enabled! (y) (on d3d9_atmosphere_remake that is)


Also tested the "noise flicker/flashes" issue and doesn't seem to occur on Intel HD Graphics 4000
The flickering is still present here (on d3d9_atmosphere_remake), but that is nothing I would have expected to be fixed :D

Thanks again,
Good Night
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
The flickering is still present here (on d3d9_atmosphere_remake), but that is nothing I would have expected to be fixed :D
That problem is really a mystery. But anyway you can disable "dynamic ambient light" feature and it should remove the problem.

Are there any major issues with the d3d9_atmosphere_remake that should be addressed before merge ? I have no more issues on my list.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
That problem is really a mystery. But anyway you can disable "dynamic ambient light" feature and it should remove the problem.
Indeed, it does!

Are there any major issues with the d3d9_atmosphere_remake that should be addressed before merge ? I have no more issues on my list.
I've run a few scenarios and it seems to be pretty fine!
Although I think the micro-textures on the moon do not show up here.
All needed .dds files are in Textures folder[*], so that should be O.K. Have I missed a switch in the options dialog?

Apart from that, "you are GO for the merge!" - from my console here ;)

[*] D3D9Mars_A.dds, D3D9Mars_B.dds, D3D9Moon_A.dds, D3D9Moon_B.dds, D3D9Moon_C.dds & D3D9Moon_C2.dds
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
The branch looks pretty good to me too.
There is one small glitch I noticed: The D3D9 Atmospheric Controls dialog doesn't allow me to switch between Surface / Low orbit / High orbit configurations on the Moon (scenario Delta-glider | Brighton beach). It always shows the Surface configuration. It works fine for Earth and Mars.
I noticed this because I wanted to edit my configurations for the Moon. Similar to what I reported earlier for Earth, there seems to be a very pronounced and very rapid change in albedo for the Moon, from very brightly lit with the camera close to the surface, to very dark at about 10km altitude and above.

Edit: I should note that I don't have the Moon microtextures installed, in case this is relevant for the albedo issue.
 
Top