orbitersim / orbiter

Open-source repository of Orbiter Space Flight Simulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shuttle-A Payload shadows wrong in initial (landed) state

schnepe2 opened this issue · comments

Initial rendering of the shadows seem to behave very odd.
When you run the attached scenario and rotate a bit around you will see what I mean.
It first looked like a rendering issue, but it seems more a "initial-vessel-state" issue.

Scenario: ShadowIssueTest.scn.txt [*]
[*] had to rename it to .txt

Further investigation (by Jarmo) found the following:

It looks like the problem could be in Orbiter Core. Surface normals don't match, for some reason the normals for payload canisters are misplaced. Problem seems to be in HorizonInvRot().

The problem mentioned above is tied to vessel status. As long as it remains "landed" HorizonInvRot() is incorrect for attachments but becomes correct when vessel status changes to "active".

Images of issue / behaviour

The following images show the normals as vectors from Vessel-Shadow-Render code (something like):

	VECTOR3 hn, hnp = vessel->GetSurfaceNormal();
	vessel->HorizonInvRot(hnp, hn);
	AddDebugVector(hn, name); // <= debugging

Initial (direct after scenario start):
0000

Once you apply a little thrust (to shake the ship and exit "landed" state) the normals snap into correct place:
0001

For reference see https://www.orbiter-forum.com/threads/d3d9client-development.16787/post-604662 and following posts.

I was looking into this and couldn't reproduce the problem anymore. Could someone double check ?

Correction. I can reproduce the problem with "Stencil" shadows. Looking into it.