New Release D3D9Client Development

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
Points
43
Location
Happy Wherever
Hi Abdullah Radwan.
Appreciate your work for CameraMfd.
Here is an answer that is for way previous versions but might give you a start....

Part quote:
:tiphat:
SOURSE: Decompiling by IDA...
ANSWER: In the "device" night vision is realized by means of ambient_color change. Easily and simply :). Only it is necessary to reach orbiter's call IDirect3DDevice7::SetRenderState function interception .
Substitution

Code:
DWORD __stdcall fqSetRenderState (DWORD p,D3DRENDERSTATETYPE dwRenderStateType,  DWORD dwRenderState)
{
 if(dwRenderStateType == D3DRENDERSTATE_AMBIENT)
 {
  ISC.d3dcol_ambient_Save = dwRenderState;
  if(ISC.sToPoR &&  ISC.bSubstRwork && ISC.bStep2)
   if(ISC.d3dcol_ambient)
    dwRenderState =ISC.d3dcol_ambient; //0x0FF00FF00;
 }
 LPDIRECT3DDEVICE7 tr = (LPDIRECT3DDEVICE7)((DWORD*)p)[1];
 return tr->SetRenderState(dwRenderStateType,dwRenderState);
}
Return of old value
Code:
DWORD __stdcall fqEndScene(DWORD p)
{
 LPDIRECT3DDEVICE7 tr = (LPDIRECT3DDEVICE7)((DWORD*)p)[1];
 LPDIRECT3DDEVICE7 fq = (LPDIRECT3DDEVICE7)p; 
 if (ISC.sToPoR && ISC.bSubstRwork)
 {
  DWORD rez;
  rez = tr->EndScene();
  fq->SetRenderTarget(ISC.CorePr_RenSurf,0);
  fq->SetViewport(&ISC.ViewPort_Save);
  tr->SetTransform(D3DTRANSFORMSTATE_VIEW,&ISC.ViewTransformMatrix_Save);
  tr->SetRenderState(D3DRENDERSTATE_AMBIENT,ISC.d3dcol_ambient_Save);
  return rez;
 }
 return tr->EndScene();
}
PS Core principle of work of the CameraMFD - interception DX calls.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Trying to use the Beta version ( for Orbiter beta ;) ) and I get an error:
Orbiter opens a windows error window, with:

can't find entry point
?TextW@Sketchpad@oapi@@UAE_NHHQA_WH@Z in DLL
(dynamic-link library)
...\modules\plugin\D3D9Client.dll

Any clue ?
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
The unmangled name of that symbol is

public: virtual bool __thiscall oapi::Sketchpad::TextW(int,int,wchar_t *const,int)

That was added recently to accommodate extended character sets for labels. Maybe you need a more recent D3D9 client for Orbiter beta.
 

jarmonik

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

Here's a latest version of the client. It's build by using an automated build script, so, let's hope the automatics got it right.


- There are vessel and ground shadow quality improvements.
- In external view mode a focus vessel can be changed by [LMB + Ctrl + Shift] (i.e. Left clicking the vessel while holding [Ctrl + Shift])
- All custom cameras are now operational near the main camera. (i.e. No longer tied to a focus vessel). "near" is 15km at sea level and 500km at orbit.
- Felix24's translucency effects are updated to support vessel shadowing.

Prebuild binary of the DockingCamera only works with Orbiter BETA. Can be attached to Shutte arm and Docking ports of focus or remote vessel.
.
 

Attachments

  • DockingCamera.zip
    215.2 KB · Views: 32
  • D3D9ClientR3.2-forOrbiter2016(r995).zip
    1.5 MB · Views: 116
  • D3D9ClientBeta28.0-forBETA r84(r996M).zip
    1.7 MB · Views: 43

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,906
Reaction score
201
Points
138
Location
Cape
I'm using the 2016 D9, but the 2016 cameraMFD crashes when I try to select it. When I choose the Betacamera cameraMFD, it works.

What is LMB ?
 
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'm using the 2016 D9, but the 2016 cameraMFD crashes when I try to select it. When I choose the Betacamera cameraMFD, it works.


It doesn't work due to virtual table missmatch. But here's build for Orbiter 2016.
 

Attachments

  • DockingCamera2016.zip
    215.4 KB · Views: 48

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,906
Reaction score
201
Points
138
Location
Cape
Could you put the cross hairs back ?:hail:
 

Abdullah Radwan

Addon Developer
Addon Developer
Joined
Aug 20, 2017
Messages
314
Reaction score
284
Points
78
Location
Cairo
Hi Abdullah Radwan.
Appreciate your work for CameraMfd.
Here is an answer that is for way previous versions but might give you a start....

Sadly I don't have any experience in DirectX 9 programming. I am not sure if this way can work on D3D9. I hope that someone from D3D9 team would help.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Could you put the cross hairs back ?:hail:
The one with the cross, that was probably my "Camera MFD", not Jarmonik's "DockingCamera" MFD...
I know it starts getting confusing, and to add more to it, there is abdullah radwan's one which is just another one...

If you were asking for my "CameraMFD", you might have to wait a little, as my machine is currently not behaving well and I need to fix that first before I can build anything...
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
The unmangled name of that symbol is

public: virtual bool __thiscall oapi::Sketchpad::TextW(int,int,wchar_t *const,int)

That was added recently to accommodate extended character sets for labels. Maybe you need a more recent D3D9 client for Orbiter beta.


With the latest client, I get a similar error window, now mentioning:
?GetSurfaceMarkerLegend@GraphicsClient@oapi@@QBEKPAXPAPBULABELTYPE@12@@Z




I was never able to get the Beta Client to work on the Beta... Not even on the earlier versions.
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
I was never able to get the Beta Client to work on the Beta... Not even on the earlier versions.
Well the general problem here is that whenever I add to the graphics API and reference that addition from Orbiter, some poor soul on the D3D9 team has to implement that as well, which naturally won't be instantaneous - although Jarmo and Kuddel do a pretty marvellous job of keeping things in sync :thumbup:

The D3D9 client releases for Orbiter beta most likely will tell you which Orbiter SVN commit they have been linked against. You just have to make sure that you check out that particular commit from the Orbiter SVN repository, rather than the latest (HEAD) commit.
With the latest client, I get a similar error window, now mentioning:
?GetSurfaceMarkerLegend@GraphicsClient@oapi@@QBEKPAXPAPBULABELTYPE@12@@Z
Just for information, this symbol refers to

public: unsigned long __thiscall oapi::GraphicsClient::GetSurfaceMarkerLegend(void *, struct oapi::GraphicsClient::LABELTYPE const * *) const
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
The latest build (here) of D3D9Client for Orbiter BETA (D3D9ClientBeta28.0-forBETA r84(r996M).zip) was linked against rev 84 of Orbiter (which equals current HEAD).
But that was the case for at least a Month, so you probably have the latest D3D9Client, but haven't the latest Orbiter BETA...

---------- Post added at 14:39 ---------- Previous post was at 14:26 ----------

Easiest to check if Orbiter and D3D9Client fit, is to look for this in your Orbiter.log:
Code:
**** Orbiter.log
000000.000: Build Sep  5 2018 [v.[B][U]180905[/U][/B]]
...
000000.000: Module D3D9Client.dll ........ [Build 181023, API [B][U]180811[/U][/B]]
...
 

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
- All custom cameras are now operational near the main camera. (i.e. No longer tied to a focus vessel). "near" is 15km at sea level and 500km at orbit.

That's a great starting point, the day it will be possible to see what another vessel sees from any distance it would be the most beautiful addition for my work.
keep up the good work
:cheers:
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Thanks for the help, for some reason SVN updates to
000000.000: Build Aug 28 2016 [v.160828]

I have it set to HEAD, it reads revision 84, but I seem to be getting older files.
Anyway the problem is certainty on my end :blush:
 

Ripley

Tutorial translator
Donator
Joined
Sep 12, 2010
Messages
3,133
Reaction score
407
Points
123
Location
Rome
Website
www.tuttovola.org
...I seem to be getting older files.
Anyway the problem is certainty on my end :blush:
Time for a "SVN cleanup"? (from context menu)

---------- Post added at 18:25 ---------- Previous post was at 17:27 ----------

...What is LMB ?
Left Mouse Button.
 
Last edited:

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,906
Reaction score
201
Points
138
Location
Cape
Figuring out this awesome camera. i.e. focused vessel is Cupola, press F1 for cockpit view, select generic camera, change "VES" to TVstanchion1 view. Looks beautiful !! Press F8 for VC view. Camera view reverts back to Cupola attachment.

Could you make it so the camera retains the different vessel view, when switched to VC mode in Spacecraft3/4 ?
 

Chris74

New member
Joined
Sep 15, 2011
Messages
24
Reaction score
0
Points
1
sorry for the noob question.
do celestial bodies cast shadows on each other?
i.e. at solar eclipses, does Moon cast a visible, moving shadow onto Earths surface? :hmm:

thx :thumbup:



Here's a latest version of the client. It's build by using an automated build script, so, let's hope the automatics got it right.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
688
Points
203
sorry for the noob question.
do celestial bodies cast shadows on each other?
i.e. at solar eclipses, does Moon cast a visible, moving shadow onto Earths surface? :hmm:

thx :thumbup:
No, they don't. So no eclipses.
 

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,906
Reaction score
201
Points
138
Location
Cape
These cameras are fun to use. Could you add no near clipping to the cockpit view ?
 

Attachments

  • new camera views.jpg
    new camera views.jpg
    198.8 KB · Views: 77

Chris74

New member
Joined
Sep 15, 2011
Messages
24
Reaction score
0
Points
1
No, they don't. So no eclipses.

lol thx :) meanwhile i figured it out too, after munching thru like 50 threads about REAL solar eclipse observations, which i have absolutely no clue about what on EARTH are those doing in a forum about a spaceflight simulator...

(sorry OP for the off :hailprobe: )


but its kinda weird that no eclipses in 2018, not?
 
Top