New Release D3D9Client Development

Say, I installed the latest revision of D3D9 client (for r.48), and I'm getting trouble with animations again. Specifically, it seems we're back to the old crash that happened when animations are added after clbPostCreation... If I check out the trunk now, which version of the code do I get?
 
Here is a snapshot of the current repo history since a commit marked "Beta16 release":
repo.png

The top selected entry is what you'd get if you checkout the trunk at the time of my posting. Since Jarmo's Beta17f post was at 09-02-16 04:04, I think that the corresponding code version is around #487 in that snapshot above.

Since then, the following files have changed:
Code:
changeset:   488:1181a8a4f13a
user:        Kuddel@c0f5cd98-1510-604a-8459-bf7538b8c9c2
date:        Wed Feb 10 22:23:01 2016 +0000
summary:     Visual Studio 2015

 Orbitersdk/D3D9Client/D3D9ClientVS2015.sln             |   19 ++
 Orbitersdk/D3D9Client/D3D9ClientVS2015.vcxproj         |  288 +++++++++++++++++++++++++++++++++++++++++++
 Orbitersdk/D3D9Client/D3D9ClientVS2015.vcxproj.filters |  347 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 Orbitersdk/D3D9Client/Junction.cpp                     |    2 +-
 Orbitersdk/D3D9Client/VectorHelpers.h                  |    4 +-
 5 files changed, 657 insertions(+), 3 deletions(-)

changeset:   489:7e0db0c53c08
user:        Kuddel@c0f5cd98-1510-604a-8459-bf7538b8c9c2
date:        Fri Feb 12 21:18:00 2016 +0000
summary:     - 'build_release.bat' now works with Visual Studio 2015.

 Utils/D3D9Client/build_release.bat |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

changeset:   490:16f64f8f6b79
user:        jarmonik@c0f5cd98-1510-604a-8459-bf7538b8c9c2
date:        Sat Feb 13 04:36:07 2016 +0000
summary:     - Minor mesh debugger UpdateSurface

 Orbitersdk/D3D9Client/D3D9Surface.cpp   |  16 ----------------
 Orbitersdk/D3D9Client/D3D9Util.cpp      |   9 +++++++++
 Orbitersdk/D3D9Client/D3D9Util.h        |   2 ++
 Orbitersdk/D3D9Client/DebugControls.cpp |   4 ++--
 4 files changed, 13 insertions(+), 18 deletions(-)

changeset:   491:77604c195273
tag:         tip
user:        jarmonik@c0f5cd98-1510-604a-8459-bf7538b8c9c2
date:        Sat Feb 13 12:40:58 2016 +0000
summary:     - Included OVP r.47 changes

 Modules/D3D9Client/BeaconArray.fx             |    2 +-
 Modules/D3D9Client/CKBlit.fx                  |    2 +-
 Modules/D3D9Client/D3D9Client.fx              |    2 +-
 Modules/D3D9Client/HorizonHaze.fx             |    2 +-
 Modules/D3D9Client/Mesh.fx                    |    2 +-
 Modules/D3D9Client/Particle.fx                |    2 +-
 Modules/D3D9Client/Planet.fx                  |    2 +-
 Modules/D3D9Client/SceneTech.fx               |    2 +-
 Modules/D3D9Client/Surface.fx                 |   20 +++-----
 Modules/D3D9Client/Vessel.fx                  |    2 +-
 Orbitersdk/D3D9Client/AABBUtil.cpp            |    2 +-
 Orbitersdk/D3D9Client/AABBUtil.h              |    2 +-
 Orbitersdk/D3D9Client/AtmoControls.cpp        |    2 +-
 Orbitersdk/D3D9Client/AtmoControls.h          |    2 +-
 Orbitersdk/D3D9Client/BeaconArray.cpp         |    2 +-
 Orbitersdk/D3D9Client/BeaconArray.h           |    2 +-
 Orbitersdk/D3D9Client/CSphereMgr.cpp          |    4 +-
 Orbitersdk/D3D9Client/CSphereMgr.h            |    4 +-
 Orbitersdk/D3D9Client/CelSphere.cpp           |    4 +-
 Orbitersdk/D3D9Client/CelSphere.h             |    2 +-
 Orbitersdk/D3D9Client/CloudMgr.cpp            |    2 +-
 Orbitersdk/D3D9Client/CloudMgr.h              |    2 +-
 Orbitersdk/D3D9Client/Cloudmgr2.cpp           |    2 +-
 Orbitersdk/D3D9Client/Cloudmgr2.h             |    2 +-
 Orbitersdk/D3D9Client/D3D9Catalog.cpp         |    2 +-
 Orbitersdk/D3D9Client/D3D9Catalog.h           |    2 +-
 Orbitersdk/D3D9Client/D3D9Client.cpp          |    4 +-
 Orbitersdk/D3D9Client/D3D9Client.h            |    4 +-
 Orbitersdk/D3D9Client/D3D9ClientVS2008.vcproj |    4 -
 Orbitersdk/D3D9Client/D3D9Config.cpp          |    4 +-
 Orbitersdk/D3D9Client/D3D9Config.h            |    4 +-
 Orbitersdk/D3D9Client/D3D9ControlPanel.cpp    |   24 +++++++++-
 Orbitersdk/D3D9Client/D3D9Effect.cpp          |    2 +-
 Orbitersdk/D3D9Client/D3D9Effect.h            |    2 +-
 Orbitersdk/D3D9Client/D3D9Frame.cpp           |    4 +-
 Orbitersdk/D3D9Client/D3D9Frame.h             |    4 +-
 Orbitersdk/D3D9Client/D3D9Pad.cpp             |    2 +-
 Orbitersdk/D3D9Client/D3D9Pad.h               |    2 +-
 Orbitersdk/D3D9Client/D3D9Surface.cpp         |  143 ++++++++++++++++---------------------------------------------
 Orbitersdk/D3D9Client/D3D9Surface.h           |    3 +-
 Orbitersdk/D3D9Client/D3D9TextMgr.cpp         |    2 +-
 Orbitersdk/D3D9Client/D3D9TextMgr.h           |    2 +-
 Orbitersdk/D3D9Client/D3D9Util.cpp            |    6 +-
 Orbitersdk/D3D9Client/D3D9Util.h              |    2 +-
 Orbitersdk/D3D9Client/DebugControls.cpp       |    2 +-
 Orbitersdk/D3D9Client/DebugControls.h         |    2 +-
 Orbitersdk/D3D9Client/FileParser.cpp          |    6 +-
 Orbitersdk/D3D9Client/FileParser.h            |    2 +-
 Orbitersdk/D3D9Client/GDIPad.cpp              |    2 +-
 Orbitersdk/D3D9Client/GDIPad.h                |    3 +-
 Orbitersdk/D3D9Client/HazeMgr.cpp             |    4 +-
 Orbitersdk/D3D9Client/HazeMgr.h               |    4 +-
 Orbitersdk/D3D9Client/Junction.cpp            |    2 +-
 Orbitersdk/D3D9Client/Junction.h              |    2 +-
 Orbitersdk/D3D9Client/Log.cpp                 |    2 +-
 Orbitersdk/D3D9Client/Log.h                   |    2 +-
 Orbitersdk/D3D9Client/MaterialMgr.cpp         |    2 +-
 Orbitersdk/D3D9Client/MaterialMgr.h           |    2 +-
 Orbitersdk/D3D9Client/Mesh.cpp                |    4 +-
 Orbitersdk/D3D9Client/Mesh.h                  |    4 +-
 Orbitersdk/D3D9Client/MeshMgr.cpp             |    2 +-
 Orbitersdk/D3D9Client/MeshMgr.h               |    2 +-
 Orbitersdk/D3D9Client/OapiExtension.cpp       |    2 +-
 Orbitersdk/D3D9Client/OapiExtension.h         |    2 +-
 Orbitersdk/D3D9Client/OgciExtensions.cpp      |    2 +-
 Orbitersdk/D3D9Client/Particle.cpp            |    4 +-
 Orbitersdk/D3D9Client/Particle.h              |    4 +-
 Orbitersdk/D3D9Client/PlanetRenderer.cpp      |    2 +-
 Orbitersdk/D3D9Client/PlanetRenderer.h        |    2 +-
 Orbitersdk/D3D9Client/Qtree.h                 |    2 +-
 Orbitersdk/D3D9Client/RingMgr.cpp             |    4 +-
 Orbitersdk/D3D9Client/RingMgr.h               |    2 +-
 Orbitersdk/D3D9Client/RunwayLights.cpp        |    4 +-
 Orbitersdk/D3D9Client/RunwayLights.h          |    4 +-
 Orbitersdk/D3D9Client/Scene.cpp               |    4 +-
 Orbitersdk/D3D9Client/Scene.h                 |    4 +-
 Orbitersdk/D3D9Client/Spherepatch.cpp         |    2 +-
 Orbitersdk/D3D9Client/Spherepatch.h           |    2 +-
 Orbitersdk/D3D9Client/SurfMgr.cpp             |    4 +-
 Orbitersdk/D3D9Client/SurfMgr.h               |    2 +-
 Orbitersdk/D3D9Client/Surfmgr2.cpp            |   28 ++++++-----
 Orbitersdk/D3D9Client/Surfmgr2.h              |    2 +-
 Orbitersdk/D3D9Client/Texture.cpp             |    2 +-
 Orbitersdk/D3D9Client/Texture.h               |    2 +-
 Orbitersdk/D3D9Client/TileMgr.cpp             |    4 +-
 Orbitersdk/D3D9Client/TileMgr.h               |    2 +-
 Orbitersdk/D3D9Client/Tilemgr2.cpp            |    2 +-
 Orbitersdk/D3D9Client/Tilemgr2.h              |    2 +-
 Orbitersdk/D3D9Client/Tilemgr2_imp.hpp        |    2 +-
 Orbitersdk/D3D9Client/VBase.cpp               |    4 +-
 Orbitersdk/D3D9Client/VBase.h                 |    2 +-
 Orbitersdk/D3D9Client/VObject.cpp             |    4 +-
 Orbitersdk/D3D9Client/VObject.h               |    4 +-
 Orbitersdk/D3D9Client/VPlanet.cpp             |    4 +-
 Orbitersdk/D3D9Client/VPlanet.h               |    4 +-
 Orbitersdk/D3D9Client/VStar.cpp               |    2 +-
 Orbitersdk/D3D9Client/VStar.h                 |    2 +-
 Orbitersdk/D3D9Client/VVessel.cpp             |    4 +-
 Orbitersdk/D3D9Client/VVessel.h               |    4 +-
 Orbitersdk/D3D9Client/VectorHelpers.h         |    2 +-
 Orbitersdk/D3D9Client/VideoTab.cpp            |    4 +-
 Orbitersdk/D3D9Client/VideoTab.h              |    4 +-
 Orbitersdk/include/OGCI.cpp                   |    2 +-
 Orbitersdk/include/OGCI.h                     |    2 +-
 104 files changed, 217 insertions(+), 272 deletions(-)
I don't know if this helps answering your question, though. I think it would be good to have the SVN revision somewhere in the distribution files, so this kind of link is deterministic. Perhaps directly in the splash-screen labels?
 
Where do I find the D3D9 for r48 please - last posted I've seen in this thread is 17f for r47.
Is it somewhere else? Thanks

Edit: and now I see there's a r49! and hadn't updated to r48 waiting on the D3D9 g?
 
Last edited:
thanks - saw jedidia mention it couple of posts back - guess he has early access . . .

Everybody can checkout and compile the repository. It could be that Jarmo did something locally without committing to the repo, and compiled a version. But I guess it was just a typo.
 
D3D9ClientBeta18 forRev 49 (svn 487)

Here's a new snapshot. It contains the latest changes in OVP and some changes in surface interface. I haven't had much time to run tests with it. So, it may not be the most stable release.

17f = 481
 

Attachments

Last edited:
Say, I installed the latest revision of D3D9 client (for r.48), and I'm getting trouble with animations again. Specifically, it seems we're back to the old crash that happened when animations are added after clbPostCreation... If I check out the trunk now, which version of the code do I get?

Nothing's been changed since 17f. Well, It did contain some animation code cleanups. Did you test it ?

I suppose we would need some kind of test suite to run test and trials to see if everything is working as expected. Is that add-on you are working on available for download ?
 
Well, after a few quick tests
Positive:
1) CTD with reflective effects for landed vessels on Earth is cured :)
2) Closeup of lunar surface with regolith is impressive, especially small crater inner walls seeing all this "normals" effect.
Negative:
1) pattern of microtextures "midrange distance" is really repetitive...
best would be previous microtextures + closest range "regolith"...
But maybe texture can be made more seamless.

P.S. But I still do not understand details of creation of such microtextures (format, etc...).
 
Last edited:
I made some tests to improve rendering of MFD screens in a virtual cockpits and it seems that there is room for improvements. Currently it requires some dirty hacks to get it working but it could be implemented properly. But it would require some small changes in the Orbiter so that we could identify MFD drawing surfaces and MFD textures.

MFDs in VC should be working fine when the MFD resolution is set to 1024 however other SketchPad drawing surfaces are looking bad.

Any thoughts ?
 

Attachments

Is that add-on you are working on available for download ?

It is, but it's pretty extensive.

I think its' more efficient for me to check out D3D9 client again and see what happened.

---------- Post added at 10:58 PM ---------- Previous post was at 05:50 PM ----------

Aaaand all hilarity ensues!

The reason for the crash is that VESSEL::GetAnimPtr() returns the wrong value when called in vVessel::InitNewAnimation(). The crash happens immediately when I call VESSEL::Createnimation() for the first time in my code. When InitNewAnimation() is invoked during the course of the operation, GetAnimPtr() returns a size of 0.
The pointer passed to it for the actual animation list does seem kind of valid, but on closer inspection probably isn't.

Since the pointer seemed valid enough after the call, I tested to see what happens if I just pass GetAnimPtr() + 1 to GrowAnimStateBuffer(). Result: Perfectly working animations... but the very earth I was orbiting started flashing its textures all over the place. Quite the lightshow. On exiting the simulation it crashed before it even got around to saving the state.

So I must conclude that the pointer is bogus, somehow still makes the animation work, but screws with memory it shouldn't. My guess would be that something in the calling order changed and D3D9client receives the EVENT_VESSEL_NEWANIM before the animation in orbiter is actually allocated. But that's quite a bit of speculation there, maybe you have better means of testing this.

You shouldn't need much code to reproduce the behavior. Just grab the shuttlePB and call CreateAnimation() in the first clbkPreStep(). You don't even have to add any components, just attempting to create the animation once the sim started should be enough.
 
Last edited:
Ok, Thanks.

I have updated the code. New animations are now marked with -1 and initialized in UpdateAnimations when the anim pointer becomes valid.

Here is an update 18b (svn 490)
 

Attachments

Last edited:
Animation creation seems to be working now, but I can't tell for sure, because I'm triggering an assert on line 925 in D3D9Surface.cpp, seemingly right before the first frame. Might be related, or might not. I'm afraid I'm too tired to look into it this evening.
 
Look like the latest modifications in D3D9Surface caused a problem. Does this build work any better ?
 

Attachments

After a bit experimenting with surface.fx, I changed 64.0 to 16.0 and repetiteveness is much less noticable:
float3 cDstA = tex2D(MicroBS, frg.texUV.xy*16.0f).rgb; // High altitude micro texture A
Yeah, resolution is a bit low in some lower altitudes, but look is better.
 
Plz kindly note some preliminary remarks I made in response to a suggestion by Ripley on D3D9Client Beta 18 for .r49 plus the "Feb 16th, 2016" D3D9Client.dll-fix.
Regards - Rob

The micro-texture pattern went broken due to some experimental changes in the shaders. It should work fine if you roll back to 17f (link below). Also, note that micro textures are experimental and created only to test the implementation. We are still hoping for someone to create a proper textures. I am not much of a texture or 3D model artist. I am currently looking into a micro mesh rock formations. We could place about 1000 (visible) rocks there.

http://www.orbiter-forum.com/showthread.php?p=526528&postcount=3429
 
We are still hoping for someone to create a proper textures.
I cannot boast to be an expert either, but back in the days of Orulex I was able to create a seamless surface texture pattern replacement that made low altitude flight a bit more realistic. But that was a simple exchange of dds files. For D3D9Client I assume it needs more than just to swap D3D9Moon_A.dds, D3D9Moon_B.dds, and D3D3MicroBlend.dds for some seamless texture images, does it ? At least a quick attempt of mine to just replace these files in Beta 18 didn't work as it used to function for Orulex, and looking into sources like Surface.fx made it pretty obvious that it is not that simple ("Marg" kindly pointed out some quick fixes to Surface.fx in the Orbiter Screenshot thread).
In case seamless texture patterns are still needed, then just as an idea I'd suggest to use Povray for generating some nicely granular surface texture height fields with random-sized / random-placed rocks and craters, and then apply TextureMaker to automatically convert these results to truly seamless texture images. If some help is needed for this sub-task, I volunteer to give it a try, because I really do like the D3D9Client ... though as I'm not knowledeable in the D3D9Client design I am aware that the microtexture feature might have much more ramifications than just new dds patterns, in which case this would by far exceed my abilities.
Regards - Rob
 
Last edited:
Back
Top