New Release D3D9Client Development

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,651
Reaction score
785
Points
128
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.
Yes, there is something odd. I also noticed that the sun is a little brighter in the build-in engine. It might have some effects. I'll take a beter look tomorrow.

You can invert it by replacing the following section from PlanetTech.fx but it will make it worse.
Code:
float4 HazeTechPS(float4 color : TEXCOORD0, float2 tex0 : TEXCOORD1) : COLOR
{
    return color * (1.0f-tex2D(Tex0S, tex0).a);
}
What is the currently supported maximum planetary textures resolution level?
It was 14 a while ago but it seems to be broken.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,429
Reaction score
680
Points
203
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 ?
The launch pad is a normal Orbiter vessel where each element is loaded as it's own mesh (FSS, RSS, water tower and hardstand).

Could this be the problem? That the client can't handle multi-mesh vessels with animations yet?

---------- Post added at 02:59 AM ---------- Previous post was at 02:33 AM ----------

Another problem that you might have noticed in the log is that the client fails to render the SSU orbiter VC. It's just black, nothing there.
 

Thorton

sense offender
Addon Developer
Joined
Mar 31, 2008
Messages
330
Reaction score
1
Points
0
Location
Tomsk
That the client can't handle multi-mesh vessels with animations yet?
I highly doubt that, my ISS is also multi mesh vessel with various animations and it works fine with D3D9 client.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,429
Reaction score
680
Points
203
I highly doubt that, my ISS is also multi mesh vessel with various animations and it works fine with D3D9 client.
Then I don't know. It's a perfectly normal Orbiter vessel with perfectly normal animations (rotations and translations).

If wanted, I could provide a debug package with the pad meshes, textures and latest module for analysis. It works perfectly fine without the SSU shuttle.
 

Thorton

sense offender
Addon Developer
Joined
Mar 31, 2008
Messages
330
Reaction score
1
Points
0
Location
Tomsk
Ok, i was wrong. :(
There is the problem with complex animation, but the cause is unclear. I have this particular problem with Soyuz launchpad too, but it's Ok with ISS.




Looks like i've found roots of the problem:

When i need to animate whole mesh and avoid to list all groups in code i'm using this consruction:
Code:
PlatformTransl = new MGROUP_TRANSLATE(PlatformMesh, [B]NULL, 0,[/B] PLATFORM_SHIFT);
It seems that that client process this line wrong, maybe it considers that there is no group to animate.
I listed directly all groups, replaced line above by following code and now animation works:
Code:
static UINT plat01[2] = {0, 1};
PlatformTransl = new MGROUP_TRANSLATE(PlatformMesh, plat01, 2, PLATFORM_SHIFT);
 
Last edited:

dumbo2007

Crazy about real time sims
Joined
Nov 29, 2009
Messages
675
Reaction score
0
Points
0
Location
India
I have an unrelated question about the D3D9 client. How intensive is rendering to a texture in external views with D3D9. Suppose I wanted to render panels so that they would be visible to UMMUs inside a vessel-base for example. Further suppose I wanted to change the contents of these panels in real time - using something like dynamic textures. Would the frame rate take a big hit ?
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,651
Reaction score
785
Points
128
I have an unrelated question about the D3D9 client. How intensive is rendering to a texture in external views with D3D9. Suppose I wanted to render panels so that they would be visible to UMMUs inside a vessel-base for example. Further suppose I wanted to change the contents of these panels in real time - using something like dynamic textures. Would the frame rate take a big hit ?
It would be pretty small texture, so, it shouldn't cause a framerate impact.


Here is a new release.

- Camera near clipping plane issue addressed.
- SSU virtual cockpit issue fixed.
- SSU texture problem fixed
- SSU launch pad animation issue fixed.
- Virtual cockpit MFD related "turn-off" bug fixed.

I am getting a CTD with SSU when using D3D9ClientRelease.dll and I am not exactly sure is it caused by D3D9Client or SSU. It seems to be executing SSU related code before the CTD. The CTD doesn't happen with debug build.
 
Last edited:

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,429
Reaction score
680
Points
203
- SSU virtual cockpit issue fixed.
- SSU texture problem fixed
- SSU launch pad animation issue fixed.
Can confirm this here. Although, it doesn't load the correct orbiter texture. It loads our default orbiter texture MGAtlantis.dds when it should load whatever texture is specified in the mission config file.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,651
Reaction score
785
Points
128
Can confirm this here. Although, it doesn't load the correct orbiter texture. It loads our default orbiter texture MGAtlantis.dds when it should load whatever texture is specified in the mission config file.
The Orbiter should assign a proper texture by calling clbkSetMeshTexture(). The Client doesn't have enough information to load any specific textures.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,429
Reaction score
680
Points
203
Getting this washout effect in the SSU VC:
 

Attachments

  • SSU_VC_washout_D3D9.jpg
    SSU_VC_washout_D3D9.jpg
    232 KB · Views: 66

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
Hi Jarmo,

thanks for the new alpha 14, vessel and base rendering is working very well! :thumbup:

However in this version I get errors when switching between panels ([ERROR] .\D3D9Surface.cpp Line:174 Error: -2005532292 pDevice->CreateOffscreenPlainSurface..., see logfile), I can't remember getting this error with alpha 11 or 12.

Also, the MFDs in the generic glass cockpit seem to have a sizing problem, see screenshot.

Thanks
Tschachim
 

Attachments

  • D3D9ClientLog.zip
    46 KB · Views: 7
  • GenericCockpit.jpg
    GenericCockpit.jpg
    134.4 KB · Views: 52

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,651
Reaction score
785
Points
128
Also, the MFDs in the generic glass cockpit seem to have a sizing problem, see screenshot.
I haven't been able to reproduce this. Is this a new problem or has it existed in older versions ?

The other error is caused by running out of video memory. I did change the memory allocation behaviour for Alpha14 but it was a bad idea.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,651
Reaction score
785
Points
128
Ok, Here is alpha 15. It's almost ready for beta testing only a few issues remains.

- Geometry culling algorithm implemented. This should increase especially a virtual cockpit framerates.
- Local light sources are online.
- Cloud shadows are online.
- Vessel shadows are online.
- Some z-buffer related bugs are fixed.
- Planet rings are now working.
- The "washout" effect reduced by reducing sunlight in virtual cockpit. Separate VCTech section now exists in MeshTech.fx for rendering adjustments.


Not yet implemented:
- Particle effects
- Planetarium mode labels and markers
- Building shadows
- Celestial sphere background images

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)
 
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,922
Reaction score
789
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
Some tests:

Top left: Issue with Delta Glider VC - not sure what that panel is meant to look like but it looks odd

Top Right: Looking upwards in the DG VC - looks like the top of the pilot mesh is cutting in above the camera

Bottom Left: Camera cutting through the seat in the DG VC

Bottom Right: Better framerates in D3D9 than in D3D7. :D

D3D9tests.jpg
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,651
Reaction score
785
Points
128
Some tests:
Top Right: Looking upwards in the DG VC - looks like the top of the pilot mesh is cutting in above the camera
Bottom Left: Camera cutting through the seat in the DG VC
The top right problem is caused by the near clipping plane being too close to the camera and the other one is caused by near clipping plane being too far from the camera. The only way to fix the issue is to remove the pilot's head. There might be a way to do that if the head is in a different mesh group than the rest of the body.


Here is a minor update. Should fix some SSU VC/MFD related issues and local light source related issues.
 
Last edited:

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,429
Reaction score
680
Points
203
Thanks for all of your hard work on this jarmonik! Just two questions: has the number of local lights supported been increased or is it still maxed out at 8? Also would it be possible to add a configurable clipping plane distance?
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,651
Reaction score
785
Points
128
Thanks for all of your hard work on this jarmonik! Just two questions: has the number of local lights supported been increased or is it still maxed out at 8? Also would it be possible to add a configurable clipping plane distance?

The maximum light count is currently 4 but there shouldn't be any problems to increase it to 12-24 lights. And I am talking about active light source, a scenario could contain alot more like 100-200 light sources but only 12-24 closest to the camera would actually emit light. Also should be noted that every lightsource will reduce the framerate a bit. Most of these light sources are using so called "per vertex lighting" where light intensity is computed for every vertex and is then interpoleted across the face. This works pretty well when used for a high resolution mesh like a vessel. But it won't work at all with a low resolution mesh like a runway. That would require "per pixel lighting" and there could be only about 2-4 light sources for that. Currently Orbiter's API doesn't allow to configure light sources like that.

If you are talking about the clipping plane in the virtual cockpit view then I can make it configurable via D3D9Client.cfg and the Extra tab. However, the exterior view clipping plane is dynamically updated based on the camera position and direction.
 

Thorton

sense offender
Addon Developer
Joined
Mar 31, 2008
Messages
330
Reaction score
1
Points
0
Location
Tomsk
There are a few problems i've noticed with new alpha:
1. MFDs in VC doesnt work (Shuttle fleet and default Atlantis).
2. For both Shuttles i have CTD at booster separation.
3. Seems MESHVIS_NEVER in SetMeshVisibilityMode() doesnt work at all.
4. There is an issue with animation for dynamically loaded meshes, here is the example:
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,429
Reaction score
680
Points
203
The maximum light count is currently 4 but there shouldn't be any problems to increase it to 12-24 lights. And I am talking about active light source, a scenario could contain alot more like 100-200 light sources but only 12-24 closest to the camera would actually emit light. Also should be noted that every lightsource will reduce the framerate a bit. Most of these light sources are using so called "per vertex lighting" where light intensity is computed for every vertex and is then interpoleted across the face. This works pretty well when used for a high resolution mesh like a vessel. But it won't work at all with a low resolution mesh like a runway. That would require "per pixel lighting" and there could be only about 2-4 light sources for that. Currently Orbiter's API doesn't allow to configure light sources like that.
If you could amp up the limit to 12 that should be sufficient for the SSU needs!

If you are talking about the clipping plane in the virtual cockpit view then I can make it configurable via D3D9Client.cfg and the Extra tab. However, the exterior view clipping plane is dynamically updated based on the camera position and direction.
Yes, I was talking about the clipping plane distance in the VC mode. I just want to eliminate the annoying clipping of the RMS grapple fixtures.

Also, BTW, have you found a solution to the VC polar singularity problem? The polar singularity problem is the twist of the camera that occurs when the camera goes near the 90° point in either direction.
 
Top