Project D3D11Client Development

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
There seems to be a rather weird occurence with Greg Burch's modules. Looks like a Normals issue to me, but the modules work perfectly fine in vanila as well as in d3d9 client, so I guess you would want to know about it:

picture.php



Also, another issue: Meshes added to a vessel with VESSEL::AddMesh() during runtime don't seem to be visible.
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
There seems to be a rather weird occurence with Greg Burch's modules. Looks like a Normals issue to me, but the modules work perfectly fine in vanila as well as in d3d9 client, so I guess you would want to know about it:

picture.php



Also, another issue: Meshes added to a vessel with VESSEL::AddMesh() during runtime don't seem to be visible.
Thanks for the report. Can you please post a detailed instructions on how to reproduce that (and links to any addons/modules required) so I would be able to check it out?
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
For reproducing what's in the picture, get greg burch's [ame="http://www.orbithangar.com/searchid.php?ID=3177"]space station building blocks[/ame], spawn a module and Bob's your uncle. The particular example in the screeny is BM201.

As for the other, that is a bit more complicated, as the add-on that has the issue is still in development (but works fine in vanilla and D3D9, at least this specific part of it). I could give you a build, but it would still be a bit tedious to reproduce. I'll see if I can find an easier way (in theory, UCGO cargoes should have the same issue. I'll get someone to check it out).
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
For reproducing what's in the picture, get greg burch's space station building blocks, spawn a module and Bob's your uncle. The particular example in the screeny is BM201.
Ok I will take a look at this.

As for the other, that is a bit more complicated, as the add-on that has the issue is still in development (but works fine in vanilla and D3D9, at least this specific part of it). I could give you a build, but it would still be a bit tedious to reproduce. I'll see if I can find an easier way (in theory, UCGO cargoes should have the same issue. I'll get someone to check it out).
UCGO has been tested by several users in D3D11CLient and there have been no issues. I can't fix this issue unless there is a way to reliably reproduce it...
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
UCGO has been tested by several users in D3D11CLient and there have been no issues.

Interesting. The same core mechanics should aply. Maybe there's something more to it.

I can't fix this issue unless there is a way to reliably reproduce it...

Understood, will call in again when we found the simplest method to reproduce. I wouldn't want to put you through the whole current procedure...
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
For reproducing what's in the picture, get greg burch's space station building blocks, spawn a module and Bob's your uncle. The particular example in the screeny is BM201.
This one should be fixed now - please download latest version and confirm if it indeed is fixed.

As for VESSEL::AddMesh() - please provide a repro-case and I'll check it out.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
Ok, here we go.

The problem manifests itself in two ways. One is vanishing visuals when AddMesh is performed during runtime, the other is meshes not getting rotated correctly when they are added before PostCreation finishes.

The first is currently difficult to reproduce, because it requires acces to the IMS engineering panel, and that runs still on sketchpad, which does not work so well. It'll have to wait until I redo the engineering panel (2 weeks max I hope), but the other problem can be replicated very well.

go here and download IMS DX11 debug.rar, put into orbiter root directory and run the scenario twisted_meshes.scn. That is, assuming you still have the space station building blocks in there, they'll be needed.

This is what you'll see in DX11 client:

picture.php


This is what it should look like in vanilla orbiter (and, after fixing the bug, preferably in DX11 too):

picture.php
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Ok, here we go.

I'm sorry but I can't see what exactly is wrong :rolleyes: Can you please mark on the screenshots what is wrong? Is is the issue with incorrect solar arrays rotation? Or something else?

Also please download yesterday's build and check the problem with transparency so I can strike it off my TODO list if it's fixed.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
Also please download yesterday's build and check the problem with transparency so I can strike it off my TODO list if it's fixed.

Sorry, forgot to mention that. Yes, that issue is fixed, thanks a lot!

Is is the issue with incorrect solar arrays rotation?

Radiators, but that's nitpicking. Anyways, yes, it's that, but when you look closer you'll see that it's not just those. A lot of modules are rotated the wrong way (most prominently visible with the cupola at the nose and the radiators, but also easily discernible with the two modules mounted to the side in the front (their docking ports look up instead of towards the module their connected to) and the RCS thrusters (who are attached at one of their thruster nozzles instead of their base).
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Radiators, but that's nitpicking. Anyways, yes, it's that, but when you look closer you'll see that it's not just those. A lot of modules are rotated the wrong way (most prominently visible with the cupola at the nose and the radiators, but also easily discernible with the two modules mounted to the side in the front (their docking ports look up instead of towards the module their connected to) and the RCS thrusters (who are attached at one of their thruster nozzles instead of their base).

Ok I'll take a look tonight.

---------- Post added at 20:12 ---------- Previous post was at 15:55 ----------

Ok, here we go.

The problem manifests itself in two ways. One is vanishing visuals when AddMesh is performed during runtime, the other is meshes not getting rotated correctly when they are added before PostCreation finishes.
I looked at this problem and wasn't able to identify issue. Can you please tell me what function do you use to rotate meshes?
Also, I've noticed that camera rotation is behaving rather weird - and the same happens in inline client. And loading this scenario reduced the FPS from ~90 to 8 in Debug build =)
 
Last edited:

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
It uses MeshGroupTransform at clbkVisualCreated to rotate the meshes correctly... wait a minute. I'm just looking this up for the first time in the documentation in a long while, and see "not yet supported by orbiter_ng". Bummer.

But how can it work in D3D9 client, then, I wonder??

And as for the FPS, my tester noticed that they went through the floor. I'm not sure why, but there's a lot of different meshes in there, so the overall polycount and texture area is terribly high. I think that's one of the reasons. That, plus many small meshes need more processing than one big one.
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
It uses MeshGroupTransform at clbkVisualCreated to rotate the meshes correctly... wait a minute. I'm just looking this up for the first time in the documentation in a long while, and see "not yet supported by orbiter_ng". Bummer.

But how can it work in D3D9 client, then, I wonder??
That was my point :) I dunnow why and how it works in D3D9 client, but I do know that Dan is manually transforming vertices for rotation in UCGO - I know this because he has asked me to assist in this issue, and I've developed a function for him to do such transformations.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
turns out I misinterpreted my tester, the same problem applies to D3D9 client. So that settles that, then. No compatibility without a custom function for rotating the stuff...

Will have to wait for an update after release, I'm afraid, as I have no idea how long it would take me to figure that out...
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
turns out I misinterpreted my tester, the same problem applies to D3D9 client. So that settles that, then. No compatibility without a custom function for rotating the stuff...

Will have to wait for an update after release, I'm afraid, as I have no idea how long it would take me to figure that out...
Here is a function that builds rotation matrix for rotation along arbitrary axis (rotationAxis has to be a unit-vector, angle is in radians):
Code:
void BuildRotationMatrix(MATRIX3& result, const VECTOR3& rotationAxis, double angle)
{
	auto c = cos(angle);
	auto s = sin(angle);
	auto t = 1.0 - c;
	auto x = rotationAxis.x, y = rotationAxis.y, z = rotationAxis.z;
	result = _M(t * x * x + c,	t * x * y - s * z,	t * x * z + s * y,
		t * x * y + s * z,	t * y * y + c,		t * y * z - s * x,
		t * x * z - s * y,	t * y * z + s * x,	t * z * z + c);
}
Usage is straightforward:
Code:
MATRIX3 rotMat;
BuildRotationMatrix(rotMat, _V(0.0, 1.0, 0.0), M_PI / 2);
auto srcVector = _V(1.0, 0.0, 0.0);
auto res = mul(rotMat, srcVector);
If you need a set of rotations along different axises, here is how you can do that:
Code:
MATRIX3 total = identity(); //identity matrix
MATRIX3 matRot;
//roration along X axis
BuildRotationMatrix(rotMat, _V(1.0, 0.0, 0.0), angle_X);
total = mul(total, matRot);
//roration along Y axis
BuildRotationMatrix(rotMat, _V(0.0, 1.0, 0.0), angle_Y);
total = mul(total, matRot);
//roration along Z axis
BuildRotationMatrix(rotMat, _V(0.0, 0.0, 1.0), angle_Z);
total = mul(total, matRot);
And then just multiply vertices by that total matrix.

Also, if you have normals (which I guess you do), you'll need to rotate them as well.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,451
Reaction score
707
Points
203
How hard would it be to implement plant-shine? It would be really nice to have it as for example, earth-shine is really bright. To see it in action, see this photo from STS-107: s107e05359. In this photo the entire payload bay lit up only by earth-shine as the sun shining on the bottom of the orbiter, not the top where the payload bay is.
 

Cras

Spring of Life!
Donator
Joined
Apr 13, 2011
Messages
2,215
Reaction score
0
Points
36
Location
Los Angeles
Website
www.youtube.com
Planet shine would be very very cool. And I would add if it is possible to incorporate planet shine with the ability to wash out the stars.
 

luki1997a

Active member
Joined
Dec 9, 2010
Messages
314
Reaction score
0
Points
31
Location
Biłgoraj
sorry for my dumb question, but my Orbiter with latest D3D11Client just hangs after loading some of moon textures. I have to froce close it. I'm sure I installed it properly. The only warnings I get in Orbiter.log are:

Code:
---------------------------------------------------------------
>>> WARNING: Obsolete API function used: oapiBlt
Colour key argument not supported by graphics client
---------------------------------------------------------------
Finished initialising panels
D3D11Client::clbkGetViewportSize
Finished setting up render state
D3D11Client::clbkPostCreation

Code:
---------------------------------------------------------------
>>> WARNING: Obsolete API function used: oapiRegisterMFDMode
At least one active module is accessing an obsolete interface function.
Addons which rely on obsolete functions may not be compatible with
future versions of Orbiter.
---------------------------------------------------------------

and some "texture not found" errors
 

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
How hard would it be to implement plant-shine? It would be really nice to have it as for example, earth-shine is really bright. To see it in action, see this photo from STS-107: s107e05359. In this photo the entire payload bay lit up only by earth-shine as the sun shining on the bottom of the orbiter, not the top where the payload bay is.
As we all know, planets and moon don't actually emit light - they just reflect sun light. So this is how that could be approximated for atmosphereless bodies:
attachment.php

attachment.php

As you can see, we can fairly realistically approximate it with a simple directional light (this is OK since vessels are generally many many many times smaller than celestials), and shadows will be more or less correct.
However things gets complicated when atmosphere comes into play. Here is how:
attachment.php

As you can see, it's not a simple directional light anymore, infact it's closer to an omnidirectional point light, and using the same approach as for atmosphereless bodies will produce artefacts (false shadows). In fact, if you'll look closely at the photo you've posted, you'll see almost absolutely NO shadows, which means light is coming from all directions at the same time.

So, I can fairly easily and quickly implement a directional light approximation, but I can't even think of any more or less realistic implementations that could property handle the second case (celestials with atmosphere)... If you could help me to come up with some model that would more or less realistically reflect this case - I would be able to implement it, otherwise I'll have to stick to a simple one. Right now there are no vessel self-shadowing implemented, but it's going to come soon enough to worry about shadowing artefacts now...
 

Attachments

  • Planet Reflections.png
    Planet Reflections.png
    16.8 KB · Views: 215
  • Planet Reflections 2.png
    Planet Reflections 2.png
    19.8 KB · Views: 209
  • Planet Reflections 3.png
    Planet Reflections 3.png
    65.4 KB · Views: 214
Last edited:

asmi

Addon Developer
Addon Developer
Joined
Jan 9, 2012
Messages
350
Reaction score
0
Points
0
Location
Ontario
Planet shine would be very very cool. And I would add if it is possible to incorporate planet shine with the ability to wash out the stars.
I have a new HDR post-processing engine almost ready (actually two engines - one is based on Compute Shaders, and another one is based on Pixel Shaders), so this could be solved by that. The reason I'm planning to put on two engines is that on different hardware these approaches give different results - on some HW PS-based engine is faster, on others - CS-based. So I've decided to let user play with them and choose the one that is faster for his hardware.

sorry for my dumb question, but my Orbiter with latest D3D11Client just hangs after loading some of moon textures. I have to froce close it. I'm sure I installed it properly. The only warnings I get in Orbiter.log are:
What version do you have? Please post here a full orbiter's window header.
 

Dores

New member
Joined
May 22, 2008
Messages
87
Reaction score
0
Points
0
Location
Scotland
Looks great!

Looking forward to the finish article!

Will the new orbiter patch include the client as an option?

Best,

D
 
Top