News Vostok-1 for Flightgear

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
Next to the Space Shuttle, Vostok is the second rocket in the Flightgear repository. I haven't developed it myself (the developer would be Viktor Slavutinsky), but I'm now maintainer and have been busy over the last days moving the visuals to the next level.

(I've thought I'd separate Vostok from the FG Shuttle thread next door, since it's really a different project with different internals, different philosophy and different look and feel.)

One problem I had to solve for the ballistic entry is that the visuals and reflectivity of the capsule change quite a bit due to the fierce heat (the entry scorches are visible on the Shuttle TPS, but the effect is far less drastic there). I am moderately happy with the solution.

Here we go, the capsule and TDU in space, all shiny metal:

vostok-glow01.jpg


TDU separated and entering the atmosphere, glow just starting at the stagnation point:

vostok-glow02.jpg


Now the capsule heat shield starts to glow in earnest:

vostok-glow03.jpg


The plasma tail hides what I want to show, so here's around Mach 6 after the plasma has disappeared, still glowing...

vostok-glow04.jpg


... and a close-up reveals that the metal is no longer shiny but charred by the fierce heat, changing the reflection to something pretty dull...

vostok-glow06.jpg


... and braking parachute out, ready to deploy main chute:

vostok-glow05.jpg


---------- Post added 06-15-17 at 09:24 AM ---------- Previous post was 06-14-17 at 12:59 PM ----------

Celestial ballet - the Vostok capsule has been separated from the TDU in preparation for entry and is slowly drifting away.

vostok-orbit01.jpg
 

Loru

Retired Staff Member
Retired Staff
Addon Developer
Donator
Joined
Sep 30, 2008
Messages
3,731
Reaction score
6
Points
36
Location
Warsaw
You can introduce some small bumps in the "after reentry" material via normal and specular texture maps.
 

indy91

Addon Developer
Addon Developer
Joined
Oct 26, 2011
Messages
1,225
Reaction score
583
Points
128
Could the Apollo program be simulated in Flight Gear? I'd imagine it doesn't natively come with a Moon that can be landed on...

But I've been impressed by how well spacecrafts can be simulated with a flight simulator not specifically for spaceflight. :thumbup:
 

boogabooga

Bug Crusher
Joined
Apr 16, 2011
Messages
2,999
Reaction score
1
Points
0
Does the Earth actually rotate in FlightGear? It's going to be hard to get to proper landing zone if not.

Also, is there a maximum altitude in Flightgear?
 

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
But I've been impressed by how well spacecrafts can be simulated with a flight simulator not specifically for spaceflight.
(...)
Does the Earth actually rotate in FlightGear? It's going to be hard to get to proper landing zone if not.

:)

You're probably picturing an OpenSource variant of a desktop sim for entertainment, say, FSX. That's not what the project is.

While the vast majority of FG users uses it as desktop simulator for entertainment, it's OpenSource, and that means it's the developers who shape it (there's no market, the number of users doesn't generate any bonus for the sim). And lots of the developers are from aerospace research or (to a lesser degree) industry who need FG for some purpose.

For example, you can, out of the box, render FG via three graphics cards and nine connected screens. No desktop user needs that, but the big 3-axis motion simulators running FG do. You can connect to a running instance with a tablet and set weather, or cause aircraft failures - again, the casual user doesn't need that, but flight instructors do. There's FAA certified simulation stations running with FG for instance - something e.g. X-plane can't claim so far.

The trajectory computation code (JSBSim) we use for spaceflight has been developed with air and space in mind - it has passed NASA benchmark tests for numerical stability and is a tool used by aerospace departments in several universities around the world. Out of the box, there's for instance a flag to let it simulate the minute torque by gravity differentials on a spacecraft - because some past researcher happened to need that for his PhD (or so).

Of course Earth rotates, and it has a non-spherical gravity field, and there's Coriolis forces, and so on... it's on par with other professional 6 DoF simulation codes (I can probably dig up the link to the NASA numerical benchmark tests if you really care), it's not a quickly rigged game - if you insert the Shuttle aerodynamics tables, it will do what NASA's Shuttle sims do to the letter (actually, the developers typically cringe when someone calls it a game - that's not how we see what we're doing).

As for Apollo... people talk about it. If someone becomes really interested (or has it as PhD project) and dumps a year of work in, it can actually happen. Right now the coordinate systems are earth-centered, might lead to numerical stability issues - I don't think that's been tested, just orbital and entry dynamics.

The GLSL shaders operate on floating point precision and definitely have stability issues (actually, they're the first thing that breaks when you leave Earth - at about 12.000 km above the surface the renderer encounters z-fighting between planet surface and cloud layer because it has to deal with differences between two large numbers). I don't know whether there's an altitude beyond which the trajectory computation becomes unstable (which you could call a maximum altitude), so far I've not been interested. Right now the main issue is that there's no work force to do what would be needed.

The 'flightsim' like challenges one has coding spaceflight are rather nuisances - for instance the typical init process tries to 'trim' the aircraft for aerodynamical flight, which for a Shuttle with attached boosters and full tank... doesn't work at all. There's no way in hell the full launch stack flies aerodynamically. So these things have to be tricked and by-passed.

But otherwise, if you have a detailed simulation with atmosphere and weather, going into space is easy - just remove the atmosphere. :lol: The other way is much harder - getting decent weather in the troposphere is a hell of a task (been there, done it).

***

And now to something completely different:

You can introduce some small bumps in the "after reentry" material via normal and specular texture maps.

Sadly not, or at least not easily. The scheme is implemented as gradual transition, the amount of char you get is proportional to the time integral of the glow - for an entry during a launch abort, you wouldn't see much.

Using a normal map gradually has... issues - it'd have to be a heightmap with normals dynamically derived from it in the shader. Fading in a specular map might work better, but it'd probably be easier to just use the char overlay to modulate the surface reflection properties since we have it anyway.

There's nothing insurmountable in there, but I'd have to write a custom shader (which then would use a procedural heightmap to derive the normals...) - which unfortunately would defeat my purpose to deliver effects which can be easily utilized and configured by other developers via a few lines of xml.
 

boogabooga

Bug Crusher
Joined
Apr 16, 2011
Messages
2,999
Reaction score
1
Points
0
Thorsten,

It was X-plane that I was thinking of, where the earth does not rotate in stock. Sorry. I remember now that the architecture of Flightgear has trajectory computed separately (JSBSim, apparently?) so the question really does not make sense.

I had thought that one of the flight sims had a Vostok simulation that was limited to 100 km altitude due to some hard limit in the sim. But, its a fuzzy memory. Must not be Flightgear.
 

Loru

Retired Staff Member
Retired Staff
Addon Developer
Donator
Joined
Sep 30, 2008
Messages
3,731
Reaction score
6
Points
36
Location
Warsaw
Thorsten said:
Sadly not, or at least not easily. The scheme is implemented as gradual transition, the amount of char you get is proportional to the time integral of the glow - for an entry during a launch abort, you wouldn't see much.

Using a normal map gradually has... issues - it'd have to be a heightmap with normals dynamically derived from it in the shader. Fading in a specular map might work better, but it'd probably be easier to just use the char overlay to modulate the surface reflection properties since we have it anyway.

How about preparing let's say 64 levels of normal maps (charing bumps) and applying proper amount depending of time of glow (ablation).?
 

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
I had thought that one of the flight sims had a Vostok simulation that was limited to 100 km altitude due to some hard limit in the sim.

You're correct that this was the case when Vostok first appeared - this was caused by a bug, the atmosphere definition had no 'else' for the density beyond 150 km (that's the atmosphere used for the visuals by the rendering backend, not the JSBSim one for the flight dynamics as far as I remember - there's different ones because you can use FG to render also an external FDM computed on a different computer). The original Vostok author didn't tell the core developers but rather coded an altitude restriction into the spacecraft (something you should not do when you find a bug...). So due to the bug the rendering code ran into a NaN atmosphere density and crashed.

It got fixed pretty soon after I noticed and told the people who need to know, and one of the first things after I took over maintenance of Vostok was to remove the altitude restriction. But all that happened years ago (and really should never have even reached the point where regular users notice - bugs can just be fixed).

---------- Post added at 05:50 AM ---------- Previous post was at 04:53 AM ----------

How about preparing let's say 64 levels of normal maps (charing bumps) and applying proper amount depending of time of glow (ablation).?

Yeah, that'd work, just needs a hefty amount of GPU memory if you want to avoid frame delays whenever a new level is loaded.

After sleeping over this, I'm actually toying with the idea of using gradients on the char overlay itself to derive a normal map and the overlay itself for specular map. This might be good enough, the normals don't need to be exact, just plausible.

---------- Post added at 05:54 PM ---------- Previous post was at 05:50 AM ----------

More work on animating discarded stages. Here's a view of the inside of the spacecraft, looking back at the dropped third stage:

vostok-orbit03.jpg


I've had to maneuver quite a bit to get the view, the windows are tiny. Doing one test from internal view only makes one appreciate the original flight better, and also the difference to the Space Shuttle - crammed into a tiny capsule, initially covered up, you can hardly see anything even after the fairings are dropped, with instruments that don't give you good situational awareness...

That's two minutes before the first scene (before I started rotating the spacecraft) - I include it because it comes out really nice.

vostok-orbit02.jpg
 
Last edited:

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
A few more screenies for the launch (which I've mainly been focusing on over the last days):

Dawn launch across the continental US

vostok-launch01.jpg


vostok-launch02.jpg


That's from a different launch - second stage drop, third stage ignited and blasting away

vostok-launch03.jpg


After a short TDU burst, the spent third stage is drifting off slowly.

vostok-launch04.jpg
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Looks great!
Flightgear is on my "to study" list, but the lack of a decent interface has prevented me from getting into it.
But I think it should be a nice platform for something like the X-20, Buran, etc.
One day ;)
 

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
But I think it should be a nice platform for something like the X-20, Buran, etc.

If you have the aero data, definitely.

The Shuttle lives off NASA public domain data (not sure whether that exists for Buran or the X-20) and Vostok is much simpler in the atmosphere and the original author has run a computational fluid dynamics package over the 3d models of the various stages - the process to get to a good atmosphere flight dynamics isn't particularly simple unfortunately, whereas good spaceflight dynamics is just tedious (measure the position of every thruster with good precision and enter its performance characteristics...).
 
Top