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
BakedVC Development Patch
 

Attachments

  • BakedVC_Test3.zip
    7.1 MB · Views: 6

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,914
Reaction score
2,908
Points
188
Website
github.com
I didn't create a ticket (yet) for this as I find it a bit hard to believe that nobody has had this issue, so the problem must be me.
So, the latest test package (Feb 1 2024 [v.602931718]) is pretty much unusable. :confused:

In MOGE there is only a blank window (no splash), and only the GPU load signals when the sim starts. Regular exit returns to launchpad and the "current state" image is that of the situation that should have been shown, with everything were it should (including surface textures... keep reading). Nothing irregular in the log. Tried full-screen and it works... slow and glitchy, and also it went into the second monitor (2016 MOGE stays in monitor 1).

In D3D9, the splash is shown, with all the components loading, then the new warning message is shown "Surface textures are missing for Earth/Moon", sim is shown with no surface textures, 0.25s per frame when the vessel is on the ground and super fast when vessel is airborne, and metallic parts have a greenish/blueish tint to them. Lots of surface texture missing warnings in the main log, and no errors in the D3D9 log (I can post it if needed).

The "old" 2016 installation still works as usual, so that should exclude a H/W issue.... am I missing a new setting somewhere?
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
688
Points
203
I didn't create a ticket (yet) for this as I find it a bit hard to believe that nobody has had this issue, so the problem must be me.
So, the latest test package (Feb 1 2024 [v.602931718]) is pretty much unusable. :confused:
No issues with that version here. Could you try deleting your D3D9Client.cfg and Orbiter_NG.cfg files? I had a problem with the planetary textures being MIA with the same error message and that was due to an overwritten Orbiter_NG.cfg file from jarmonik's BakedVC_testing.zip.
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,914
Reaction score
2,908
Points
188
Website
github.com
No issues with that version here. Could you try deleting your D3D9Client.cfg and Orbiter_NG.cfg files? I had a problem with the planetary textures being MIA with the same error message and that was due to an overwritten Orbiter_NG.cfg file from jarmonik's BakedVC_testing.zip.
That worked, thanks!
In MOGE it didn't work... but then I switched to the iGPU (it was NVIDIA) and it also returned from the dead. Tomorrow I'll do some more digging.
 

Max-Q

99 40
Addon Developer
Joined
Jul 5, 2021
Messages
765
Reaction score
1,183
Points
108
Location
Cislunar Space
Website
www.orbiter-forum.com
Is there any chance we could bring back the raytraced VC from here?
It looked quite amazing, and sadly that patch doesn't work anymore.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Is there any chance we could bring back the raytraced VC from here?
It looked quite amazing, and sadly that patch doesn't work anymore.

There are newer patches available that should work and you can compile the latest "Raytraced VC" feature branch from GitHub. There's been quite lot of progress since the patch you linked so we are not going to revert back to that revision. Latest patch should have all the functionality that the old one had. Have you done some work with ray-traced VC ? If yes, then could you share some screen shots, it would be interesting to see it in operation.
 

Max-Q

99 40
Addon Developer
Joined
Jul 5, 2021
Messages
765
Reaction score
1,183
Points
108
Location
Cislunar Space
Website
www.orbiter-forum.com
There are newer patches available that should work and you can compile the latest "Raytraced VC" feature branch from GitHub. There's been quite lot of progress since the patch you linked so we are not going to revert back to that revision. Latest patch should have all the functionality that the old one had. Have you done some work with ray-traced VC ? If yes, then could you share some screen shots, it would be interesting to see it in operation.
Sorry if I worded it badly, I wasn't saying go back to the old one I was just asking about the feature.
I installed this patch from a few days ago over my latest release OO x86 install, and there were no window shadows. The new options for cockpit shadows, etc were in the settings menu and the in-sim debug window, so I know it was installed.

I don't believe I have any screenshots sadly, I tested it briefly when the old patch was released here with the intent of using it with NASSP but NASSP+OO wasn't really stable then so I never pursued it.
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,914
Reaction score
2,908
Points
188
Website
github.com
The promised continuation on the report of yesterday's problems: 2016 MOGE also doesn't work with the NVIDIA in window mode... not sure how it switched GPUs in the new version. In full screen with the NVIDIA, the 2016 MOGE works well with just a few visual glitches and white image instead of splash screen. In the new version it only shows white. Both work in window mode with the iGPU.

On D3D9, comparing my "old" and "new" Orbiter_NG.cfg files, I think I found the culprit for the missing planetary textures: "PlanetTexDir = C:\Software\Orbiter2016-SVN-Clean\Textures\", which is not a path in my system.

D3D9: OK on NVIDIA and iGPU.
D3D9on12Client: kaput just after selection. Log: "Failed to create DirectX9".




One thing I've been meaning to ask for a while now: can a SURFHANDLE be saved to a JPG or PNG file? I remember seeing some functions in the code when Orbiter first went public (and there has to be something to save the scenario images that are shown in the launchpad), but I don't think that feature is "exposed" in the API. If work needs to be done, then let's leave this for a later Orbiter version.



Something that might be fixable for the current version is the glowing DIFFUSE particles in D3D9.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
The promised continuation on the report of yesterday's problems: 2016 MOGE also doesn't work with the NVIDIA in window mode... not sure how it switched GPUs in the new version. In full screen with the NVIDIA, the 2016 MOGE works well with just a few visual glitches and white image instead of splash screen. In the new version it only shows white. Both work in window mode with the iGPU.
On D3D9, comparing my "old" and "new" Orbiter_NG.cfg files, I think I found the culprit for the missing planetary textures: "PlanetTexDir = C:\Software\Orbiter2016-SVN-Clean\Textures\", which is not a path in my system.
D3D9: OK on NVIDIA and iGPU.
D3D9on12Client: kaput just after selection. Log: "Failed to create DirectX9".
One thing I've been meaning to ask for a while now: can a SURFHANDLE be saved to a JPG or PNG file? I remember seeing some functions in the code when Orbiter first went public (and there has to be something to save the scenario images that are shown in the launchpad), but I don't think that feature is "exposed" in the API. If work needs to be done, then let's leave this for a later Orbiter version.
Something that might be fixable for the current version is the glowing DIFFUSE particles in D3D9.

D3D9on12Client shouldn't exists anymore. Likely left behind from an older release/patch. Those problems related to MOGE are likely something that nobody can do anything about it. Functions to save and load jpg and png files do exists in D3D9Client but I don't remember if those are exposed to API. I can take a look.
 
  • Like
Reactions: GLS

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Sorry if I worded it badly, I wasn't saying go back to the old one I was just asking about the feature.

You need to open D3D9DebugControls select the VC mesh and then apply "This is VC Mesh" and "Cast VC Shadows" options. You may need to apply "Cast VC Shadows" to exterior mesh too. I don't know how it's going to work without ambient probe. In a stock Atlantis it's done like this: Coordinates are in a local vessel coords. Open space with good visibility to everywhere in a cockpit.

Code:
void Atlantis::clbkVisualCreated (VISHANDLE _vis, int refcount)
{
    if (refcount > 1) return; // we don't support more than one visual per object
    vis = _vis;
    SetVisualProperty(vis, VisualProp::CREATE_VC_PROBE, 0, typeid(FVECTOR3), &FVECTOR3(0.0f, 2.6f, 14.0f));
    // make sure the RMS attachment point is in sync with the animation state of the visual
    SetAttachmentParams (rms_attach, arm_tip[0], arm_tip[1]-arm_tip[0], arm_tip[2]-arm_tip[0]);
}
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Where do we stand on getting this issue from 2020 properly addressed: https://www.orbiter-forum.com/threads/d3d9client-development.16787/post-263061
Almost there, latest VC rendering experiments could ALMOST get the job done. Interior parts of the Payload bay should be a separate mesh like the VC is. Bay doors should also belong into that mesh. There are some details that are not so clear yet. After the release of Orbiter 2024 these modifications should be made to Stock Atlantis so that I have a model I can work (experiment) with.
 

Max-Q

99 40
Addon Developer
Joined
Jul 5, 2021
Messages
765
Reaction score
1,183
Points
108
Location
Cislunar Space
Website
www.orbiter-forum.com
You need to open D3D9DebugControls select the VC mesh and then apply "This is VC Mesh" and "Cast VC Shadows" options. You may need to apply "Cast VC Shadows" to exterior mesh too. I don't know how it's going to work without ambient probe. In a stock Atlantis it's done like this: Coordinates are in a local vessel coords. Open space with good visibility to everywhere in a cockpit.
Ah ok, I got it to show shadows in both the DeltaGlider and NASSP.
The only issue I have now is that as soon as I set the shader to BakedVC the entire mesh goes metallic with ugly reflections.
 

misha.physics

Well-known member
Joined
Dec 22, 2021
Messages
394
Reaction score
513
Points
108
Location
Lviv
Preferred Pronouns
he/him
Sorry, I'm just interested, could you show a couple of screenshots from Delta Glider cockpit with the default shadows and "these new ones" ("BakedVC patch" if I understand correctly) for comparison? I'm just wondering what these shadows are and how they look (I haven't tried it yet). VC means virtual cockpit, yes?
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
[...] Functions to save and load jpg and png files do exists in D3D9Client but I don't remember if those are exposed to API. I can take a look.
The GraphicsClient base class[*] has the virtual method clbkSaveSurfaceToImage (SURFHANDLE surf, const char *fname, ImageFileFormat fmt, float quality=0.7f)
Most Graphic Clients should have implemented it, so code like this is used:
C++:
gclient->clbkSaveSurfaceToImage (0, "Images\\CurrentState", oapi::IMAGE_JPG);

[*] defined in Orbitersdk\include\GraphicsAPI.h
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
688
Points
203
It's been noted. D3D9 is falling apart, newer laptop computers can't run it anymore. New replacement is planned and we need a better GUI, before that happens, I don't think I'll start working on any new graphics features.
Isn't more a case of that Windows 11 can't run it? Also, what about the Terrain Toolkit guide?
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
688
Points
203
Is there a way to tweak the distance haze in OpenOrbiter D3D9Client? I tried playing with the various sliders in the Atmospheric Controls dialog, but none of them had any effect on the distance haze. Is this something that needs to be from the cfg file?
 

Attachments

  • OO_D3D9_distance_haze.jpg
    OO_D3D9_distance_haze.jpg
    104.9 KB · Views: 6

misha.physics

Well-known member
Joined
Dec 22, 2021
Messages
394
Reaction score
513
Points
108
Location
Lviv
Preferred Pronouns
he/him
It seems to be some elevation issue in the new v240310 build. Compare these two picture of an island for the prievious build and the new one (linear interpolation is used for both, but in the new build that island seems to be flat from the distance):

sun1.pngsun2.png

Also, there're texture black gaps, and here the DG is under texture (only part of the DG roof is visible), but if we zoom in a little then DG is on the runway, although these black gaps remain:

1.png2.png
3.png
 
Top