Issue with moving exhausts

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Issue with moving exhausts

Post by phkb »

Before I log an issue in GitHub, I thought it might be useful to post this here first to hopefully gain some more info.

Issue with moving exhausts in Oolite 1.91

In the above video, I using an external view of a ship that has four exhaust trails, none of which are on the central axis. I move around to view the ship side-on, and then rotate around the ship. Watch the positioning of the exhausts - you'll see them move out and away from the ship, and then back in again as the rotation continues.

I've tested this on the ship in the video and the PitViper MarkII, and both exhibit the same behaviour.

First off, has anyone else noticed something like this before? Second, if you have a ship in your fleet with non-centered exhausts, do you see the same effect when you reproduce the viewing angles from the video? Any information could be useful.

(FYI, the ship in the video is a updated version of the Draven Gunship).
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Issue with moving exhausts

Post by hiran »

TBH I cannot see an issue there.

The ship's back is quite dark so you do not see it. But looking at it's shape I can see the background exhausts following the ship conture where they are obstructed so it is ok for me.

I am using the Imperial Courier and do not see issues there as well.
Sunshine - Moonlight - Good Times - Oolite
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Issue with moving exhausts

Post by phkb »

If you watch the point where the exhausts meet the ship, you should see a pronounced gap develop and then disappear again as the view moves around the ship.

Stop the video at 0:34 and you should see the closest exhaust to you has a gap between where it starts and where the ship is.

You'll also see the exhausts going out of alignment with the engine nacelles as you go around.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Issue with moving exhausts

Post by phkb »

Image
Arrow indicates where the gap has developed
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Issue with moving exhausts

Post by phkb »

Maybe this video demonstrates the issue better. The view is close to the ship, I've turned the ambient level up to max, and I stop rotating around the ship when the effect is at it's worst.

Youtube Moving Exhausts demonstration 2
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Issue with moving exhausts

Post by hiran »

phkb wrote: Sun May 12, 2024 9:24 am
Image
Arrow indicates where the gap has developed
Cannot see that image. But looking again - yes there is something. Much smaller than I had expected when watching first time.
Remains the question whether it is a ship modeling issue or something from the Oolite core.
Sunshine - Moonlight - Good Times - Oolite
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Issue with moving exhausts

Post by phkb »

hiran wrote: Sun May 12, 2024 9:48 am
Cannot see that image. But looking again - yes there is something. Much smaller than I had expected when watching first time.
Second video is clearer.
hiran wrote: Sun May 12, 2024 9:48 am
Remains the question whether it is a ship modeling issue or something from the Oolite core.
True. Core ships all have their exhausts located close to the center line. I suspect the effect is more pronounced the further they are away from the centre, so it's probably only really noticeable with OXP ships. As I mentioned, I have observed the effect in the PitViper Mark II, and on this ship I'm testing, so my guess would be the issue is in the core code, not an OXP.

Also, our control over exhausts is fairly minimal: we specify the x,y,z coords where it starts, and then the x,y of how big the exhaust is. There isn't anything else to mod.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Issue with moving exhausts

Post by phkb »

hiran wrote: Sun May 12, 2024 9:17 am
I am using the Imperial Courier and do not see issues there as well.
I'm guessing, because I haven't looked yet, but if the the Imperial Courier puts the starting point of the exhaust far enough into the nacelle, you won't see the effect. It would only be really evident if the exhaust start point is on the surface of the ship model.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Issue with moving exhausts

Post by another_commander »

There are some z-order issues when in external views with the exhausts. Depending on view angle exhausts sometimes appear behind objects when they should be in front of them.

Image

The Viper in this shot is in front of the Cobra but its exhausts are rendered benind the Cobra.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: Issue with moving exhausts

Post by Griff »

I think the point the laser beam is drawn from drifts a bit too if you rotate the camera in an external view, it's either that or the beam gets drawn after the model has been so it can appear on "top" of geometry it should be "behind" edit: ah what a_c said above with the example of the viper exhausts
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Issue with moving exhausts

Post by phkb »

I understand the z-ordering issue - that's tricky to fix. But I'm not 100% sure this issue is an example of that. The starting point for the exhausts appears to be changing (at least in the current view), which would mean the quaternion position is somehow changing, or isn't being translated correctly as the view changes. But it changes in a uniform way, and then migrates back to the original position. I'm suspecting a rounding issue somewhere - I had a quick look today but couldn't see anything immediately obvious. I'm going to have to put some debug points in the code to see if I can catch an error red handed.
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Issue with moving exhausts

Post by hiran »

phkb wrote: Mon May 13, 2024 7:49 am
I understand the z-ordering issue - that's tricky to fix. But I'm not 100% sure this issue is an example of that. The starting point for the exhausts appears to be changing (at least in the current view), which would mean the quaternion position is somehow changing, or isn't being translated correctly as the view changes. But it changes in a uniform way, and then migrates back to the original position. I'm suspecting a rounding issue somewhere - I had a quick look today but couldn't see anything immediately obvious. I'm going to have to put some debug points in the code to see if I can catch an error red handed.
If you get to some understanding of the code it would be nice if you could add comments - to make it easier in the future.
Sunshine - Moonlight - Good Times - Oolite
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 675
Joined: Sat Aug 09, 2014 4:16 pm

Re: Issue with moving exhausts

Post by Commander_X »

From the picture posted by a_c it doesn't seem to be a "z-order OpenGL issue", at least not the one that involved the need to render objects in a specific order, to properly handle transparency (if I remember correctly).
The missing exhaust trails seem to be intersected and occluded by the Cobra's body, mainly because the Viper is in a turn, and Cobra is crossing them. I am not even sure what would be the expected behavior here.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Issue with moving exhausts

Post by another_commander »

Commander_X wrote: Tue May 14, 2024 2:59 pm
The missing exhaust trails seem to be intersected and occluded by the Cobra's body, mainly because the Viper is in a turn, and Cobra is crossing them. I am not even sure what would be the expected behavior here.
I can assure you that the Cobra and the Viper in that shot are far apart enough to guarantee that there is no chance of one crossing the exhaust trails of the other. It is indeed a render bug, but it occurs only in external views and only after having rotated the camera.
User avatar
hiran
Theorethicist
Posts: 2403
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Issue with moving exhausts

Post by hiran »

another_commander wrote: Tue May 14, 2024 3:20 pm
I can assure you that the Cobra and the Viper in that shot are far apart enough to guarantee that there is no chance of one crossing the exhaust trails of the other. It is indeed a render bug, but it occurs only in external views and only after having rotated the camera.
I would have expected the 3D rendering to be done the same for internal and external views. Only the hud and camera placement/movement should be different.

So it is puzzling to see such effects only in the conditions you mention.
Is it possible to reproduce such a shot from an inside view? Or without having rotated the camera?
Sunshine - Moonlight - Good Times - Oolite
Post Reply