New Release D3D9Client Development

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,917
Reaction score
2,921
Points
188
Website
github.com
Seems good to me yes !

Also is there currently a way to dynamically set the transparency (alpha channel) of a mesh in Orbiter D3D9 ? That one would really help me with engine exhaust effects and such things (because, IMHO, the glorious days of 2D exhaust textures have come and gone). Probably can be done with the current D3D9 client but I have no idea how.

You can edit materials in a mesh from the code... works both in MOGE and D3D9.
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,286
Reaction score
3,255
Points
203
Location
Toulouse
You can edit materials in a mesh from the code... works both in MOGE and D3D9.

Thanks that's a misconception I had, its not the mesh itself that is transparent but its material. The mesh is "only" a set of geometric coordinates. ?
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Thinking about the dynamic pressure shock effect...maybe a semi-transparent torus as a first try (on cylindrical rockets) that appears and fades away might be a first step
- just to see how it looks.
Making it "more fancy" might not be needed in the first iteration(s).
Just a thought.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
@N_Molson : I think you have to have a mesh(-cone) for the exhaust ...probably even more - one for the outer flame several for the inner mach-diamonds - to make it look right.

Something like this:
Exhaust.png

I've tried some time ago to just place a transparent flame-texture onto a "flame-cone" mesh ...and it looked horrible :/
A multi-mesh solution (see image above) seems to be necessary.
The textures however need to be "just gradients", else you would have that ugly wrap-around effect which I had when I tried the simple approach (y)
 
Last edited:

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
Yeah! Exactly! Can he provide some coding insights?
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,286
Reaction score
3,255
Points
203
Location
Toulouse
Yeah! Exactly! Can he provide some coding insights?

Looks good but I'd say the exhaust mesh cuts a bit too much on the blue sky... So the alpha gradient has to start very low (or high, correct me). Also the "moving texture" part seems a bit unnecessary to me, in reality those (beautiful) patterns really look plain and stable (that's how flames behave in general, unless wind sends dust into them). But I think it would work very well on the aforementionned aerodynamics or reentry effects.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
This is what I got from Donamy a long time ago, just the mesh+texture.
 

Attachments

  • donamy_launch_flame.zip
    226.1 KB · Views: 5

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,286
Reaction score
3,255
Points
203
Location
Toulouse
OK so the texture manages the flame mesh transparency and has small "artefacts" on it to achieve the "glittering" effect. Now was he rotating the mesh directly (animation), or did he manipulate the UV coordinates, we can't guess. But very roughly it seems to be the same approach mentionned by Jarmo a few posts above on the aerodynamic effects, so I think we're on a good track. ?
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
Looks good but I'd say the exhaust mesh cuts a bit too much on the blue sky... So the alpha gradient has to start very low (or high, correct me). Also the "moving texture" part seems a bit unnecessary to me, in reality those (beautiful) patterns really look plain and stable (that's how flames behave in general, unless wind sends dust into them). But I think it would work very well on the aforementionned aerodynamics or reentry effects.
Actually, the flames are not static at all. See the close-ups in this excellent NASA compilation:
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
OK so the texture manages the flame mesh transparency and has small "artefacts" on it to achieve the "glittering" effect. Now was he rotating the mesh directly (animation), or did he manipulate the UV coordinates, we can't guess. But very roughly it seems to be the same approach mentionned by Jarmo a few posts above on the aerodynamic effects, so I think we're on a good track. ?
From what I remember, he used Spacecraft3.dll so nothing fancy, so most likely a simple rotation animation.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
Something else to keep in mind is that the distance between the blue mach diamond and the nozzle base varies depending on throttle level. The closer to minimum throttle level, the closer the mach diamond is to the nozzle. This is an effect that can clearly be seen in various SSME/RS-25 static tests.
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,286
Reaction score
3,255
Points
203
Location
Toulouse
Well IMHO the first step would be to make a good-looking stable exhaust flame / aerodynamic effect / reentry effect. That's not a small task. From there we could explore how to improve each one, "improving" meaning "making it closer from reality".

Scaling through throttle-ing is pretty easy to do right now - its a "scaling" animation where the "animation state" is relative to the thrust level. Of course it would be even better to get (and translate in C++) the real equations that describe this phenomenon, but this is quite high-level maths/physics.

Also I was thinking about scaling up the flame and making it dimmer as pressure decreases, to simulate expansion. Again its a scaling animation against atmospheric pressure, nothing crazy but getting a decent result is another thing and would take a lot of experimentation.
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,917
Reaction score
2,921
Points
188
Website
github.com
You mean the effects that occur between 0:50 and 1:10 in video's timescale.

So, what would be needed:
  • User supplied mesh and texture like ( 256 x 1024 )
  • Dynamic Pressure for Start and End
  • Visible texture section length in pixels like 128 for ( 256 x 1024 ) texture. Meaning that 256x128 would be visible at a time.
  • Texture roll/slide speed pixels/sec for the Y-coordinate
  • VECTOR3 giving the reference/origin point (could this also be used to move user supplied mesh on the right place ?)
  • VECTOR3 pointing to the direction of slide and the length would control an alpha fade effect.
  • Alpha fade function ? Maybe the following would be sufficient: alpha = pow(distance, x), where "x" would be user supplied variable and "distance" is in range 0.0 to 1.0

Anything else in mind ?
The UV range in the mesh itself could be 0 to 1 for both axies. The client could rescale the UV range as needed.
"How often does it show" could could be a parameter but, IMO it should be a random ocorrence (maybe 10-25%?) as the user doesn't control the atmospheric conditions.

This reminds me, how is this going to work in other atmospheres besides Earth?
 

N_Molson

Addon Developer
Addon Developer
Donator
Joined
Mar 5, 2010
Messages
9,286
Reaction score
3,255
Points
203
Location
Toulouse
This reminds me, how is this going to work in other atmospheres besides Earth?

Well he mentionned dynamic pressure, so that's settles it. AFAIK Dynamic Pressure is relative to atmospheric density.

For engines exhausts, pressure is always an important parameter, because it defines if the exhaust will look "diamond-shaped" or "jellyfish". Now what's in the atmosphere probably shifts colors, but that's another can of worms.
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,917
Reaction score
2,921
Points
188
Website
github.com
Well he mentionned dynamic pressure, so that's settles it. AFAIK Dynamic Pressure is relative to atmospheric density.
Yeah, but AFAIK the condensate is water, so the ppH2O is probably a factor

For engines exhausts, pressure is always an important parameter, because it defines if the exhaust will look "diamond-shaped" or "jellyfish". Now what's in the atmosphere probably shifts colors, but that's another can of worms.
For engines firing in an atmosphere, O2 is a factor in the periferal burning in the plume.


In the end these are questions for the physics engine to answer.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Another factor is the actual thruster level. The more open a valve is the wider the plume is. I've attached two screenshots of the STS-122 External Tank venting gaseous hydrogen from the intertank vent. The first image shows venting at a partial vent valve opening while the second shows venting from a fully open vent valve.
That plume is huge compared to the size of the E.T. How long is that plume visible after the valve is close or it's out of gas. My best guess would be 5-15 seconds. Let's forget this for now and focus on the two other cases. Engine exhaust and aerodynamic condensation effect.
 

Marg

Active member
Joined
Mar 20, 2008
Messages
483
Reaction score
68
Points
28
Tried new version.
1) I noticed when whole stack of rocket (first stage - "landed" status) is selected, it is OK, but selecting (with F3 )orbiter (attached to main stack, so status of vessel in scenario is "orbiting") it gets brighter (~ ambient ligthing increases).
2) Is "metalness" shader applied to a whole mesh? Seems that all groups of mesh have to "share" it. There are meshes, where only part is metallic, but part is just white, etc, where only OLD PBR shader is more appropriate.
3) Was this sunrise improvement thing about surface sunrises\sunsets?
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
689
Points
203
That plume is huge compared to the size of the E.T. How long is that plume visible after the valve is close or it's out of gas. My best guess would be 5-15 seconds. Let's forget this for now and focus on the two other cases. Engine exhaust and aerodynamic condensation effect.
Here's the video where those two screenshots were taken from. ET venting begins at 2:30. And as you can see, the plume doesn't hang around for very long.
 
Top