New Release D3D9Client Development

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
688
Points
203
Could this be a problem with the "Earth" glow. Does the color change if you are over land ?
Can't really tell as Earth glow has now disappeared for me when using the Metalness shader. There's another issue with it as you can see the NASA logo on the left wing through the aft payload bay bulkhead as seen in the second attached screenshot.
 

Attachments

  • D3D9Client_new_shader5.jpg
    D3D9Client_new_shader5.jpg
    1.4 MB · Views: 25
  • D3D9Client_new_shader5B.jpg
    D3D9Client_new_shader5B.jpg
    1.3 MB · Views: 26

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
Frost, that would be interesting to see. I have never given much thought to that but I once thought about rendering of snow and having ice crystals glittering in a different colors. (Not for Orbiter). Right now the Fresnel effect in attenuated by roughness and there is a limit above which the Fresnel in completely off-line. There is no Fresnel texture implemented and I am unsure how to do that properly. Would a coating need it's own roughness ? Also could one of the color channels be used for frost overlay ?

How would you like to implement the frost ?
I think starting out I would implement frost as "baked-in" with the rest of the texture. I would make it opaque white or partially transparent white overlaid on the diffuse color, with high roughness so that there's no environment reflection or Fresnel reflection. I might make a version of the texture with frost and without, and let the vessel decide which to use when, using Spacecraft dll or VesselBuilder, etc. I don't know if it makes sense to have the graphics client decide when to display frost and when not to. Otherwise I might just use a single frosted texture.

So for example, a Falcon9 on the launchpad would have a coating of frost. But during re-entry the frosty texture would disappear and be replaced by a sooty texture.

I think a Fresnel texture would be unnecessary, as the Fresnel values can be generated from the roughness map, and tweaked with metalness if it makes sense. But one way to create a Fresnel texture would be to map each color channel to a different Fresnel control: maximum reflection, angle dependency, and sharpness of reflection.
 

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
One small idea:

I find myself always checking the "Pick" checkbox the first thing every time I open the D3D9 Debug window. Would it be possible to make that box checked by default whenever you start orbiter and open the debug window? Or maybe remember its last state when quitting. Just a thought.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
I don't know if it makes sense to have the graphics client decide when to display frost and when not to.
It would be difficult for a client to know when to render the frost and when not to. So, it would need to be application controlled. I don't know the capabilities of Spacecraft.dll or VesselBuilder if they can swap a texture. A vessel controlled by it's own DLL could open up some other possibilities like an overlay effect being blended in by using using some kind of control variable, could be useful for re-entry heating effects too. Also I have used the Sketchpad to blend/mix textures but, of course, right now there are no interface to access sub-textures.
 
Last edited:

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
One small idea:

I find myself always checking the "Pick" checkbox the first thing every time I open the D3D9 Debug window. Would it be possible to make that box checked by default whenever you start orbiter and open the debug window? Or maybe remember its last state when quitting. Just a thought.

Done
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
There's another issue with it as you can see the NASA logo on the left wing through the aft payload bay bulkhead as seen in the second attached screenshot.
So, there are transparent gaps in the texture ? I suppose a division by zero could feed some NaN's to the pipeline and cause the transparency if that's what it is.
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
688
Points
203
So, there are transparent gaps in the texture ? I suppose a division by zero could feed some NaN's to the pipeline and cause the transparency if that's what it is.
Yes. And it seems to be the normal map that is at fault as I just renamed it to check a hypothesis I had after looking more closely at things. With the normal map "disabled", there's no see-through effect and everything is as it should.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
It would be difficult for a client to know when to render the frost and when not to. So, it would need to be application controlled. I don't know the capabilities of Spacecraft.dll or VesselBuilder if they can swap a texture.
I think it could be handled based on existing particle streams. When the stream touches the mesh, we could add a frost texture.
 

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
Yes. And it seems to be the normal map that is at fault as I just renamed it to check a hypothesis I had after looking more closely at things. With the normal map "disabled", there's no see-through effect and everything is as it should.
Are you able to tell if the see-through effect is a mirror image? Because it might be an environment reflection which only appears when the normal map angle for those pixels is extreme.
 

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
I think it could be handled based on existing particle streams. When the stream touches the mesh, we could add a frost texture.
Frost buildup on rockets is usually gradual as a result of propellant loading and comes from the surrounding air. Are you talking about frost buildup from clouds of condensation touching the rocket?
 

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
688
Points
203
Are you able to tell if the see-through effect is a mirror image? Because it might be an environment reflection which only appears when the normal map angle for those pixels is extreme.
Not a mirror effect, pure see-through as you can see the elevons and flipper doors. If it was reflection, only the payload bay and Earth would be visible as that's how the environment cam on SSU is configured.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
One idea that came into my mind is a use of LUA script. Would it be possible to run LUA script side by side with Spacecraft.dll or VesselBuilder based vessel ?
I have have zero experience about LUA but unless I am mistaking Kuddel is familiar with it.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
507
Points
113
"familiar" is a bit optimistic here ;) But, yes I did some work on interfacing Lua and Orbiter-API.
Running a Lua script in parallel should be no problem (a vessel and the script that should run in one scenario).
But I am not sure whether it is convenient to get vessel specific information from the Spacecraft.dll- rsp. VesselBuilder-vessel.
All the information the script can get are "sqeezed" through the vessel-API calls.
Any specific information from Spacecraft.dll or VesselBuilder vessels are not implemented (yet).
The coders of those DLLs have to provide the Lua interface DLLs for that to happen.

If the information provided via the standard Orbiter-API is enough however, I see no problem.
 

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
could be useful for re-entry heating effects too.
Re-entry heating effects would be awesome. I've done some thinking about it, and think it could be done with a grayscale heatmap texture that we can call _heat.dds. Lighter values mean hotter temperatures, darker values mean colder. Black means no heating at all. When the spacecraft experiences heating, the heatmap determines which parts get hot first and how hot they get as the overall temperature increases.

The calculated temperature of a pixel would then be converted to a black-body radiation color and applied as an emissive value.

This would also be really neat to use for rocket nozzles like the MVac on the Falcon 9 second stage, the OMS nozzles on the Space Shuttle, and even small RCS thrusters. Of course, all of this assumes that we can figure out a way to tell the graphics client how hot a material is getting.

If you can add a heatmap texture to the shader, I can work on coding the heat glow effect.
 

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
Another small idea:

Is it possible for the D3D9 client to reload the shader without having to relaunch the scenario?
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,863
Reaction score
2,127
Points
203
Location
between the planets
Of course, all of this assumes that we can figure out a way to tell the graphics client how hot a material is getting.
That really doesn't sound like a job for the graphics client. The reasonable thing would be to provide a shader that takes an emission map and some convenient way to control its alpha channel, then vessel developers could implement the nozzle glow by themselves. I did something similar with radiators once, though those are easier because they change their color uniformly and so just playing with the emissive property of the entire material was enough.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,666
Reaction score
795
Points
128
Re-entry heating effects would be awesome. I've done some thinking about it, and think it could be done with a grayscale heatmap texture that we can call _heat.dds. Lighter values mean hotter temperatures, darker values mean colder. Black means no heating at all. When the spacecraft experiences heating, the heatmap determines which parts get hot first and how hot they get as the overall temperature increases.
That sounds like a great idea. I have set the texture ready for you and there is a SpecialFX material property to control the heat value. It's currently mapped in range 0 to 1.
I have also added a "Shader Reload" button in debug controls. It takes about 2-3 seconds to recompile the shader.

There is one additional possibility regarding a texture blending. Let's say that you have two 1024x1024 textures for a vessel, then those two could be combined into a single 1024x2048 texture array. Of course, in that case texture "wrap" function would not work along x-axis. If two texture index numbers and a blend factor is provided for a renderer then blending would be possible between multiple textures.
 

Attachments

  • D3D9ClientR4.14-forOrbiter2016(r1380).zip
    6 MB · Views: 4

DaveS

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Feb 4, 2008
Messages
9,434
Reaction score
688
Points
203
Can't really tell as Earth glow has now disappeared for me when using the Metalness shader. There's another issue with it as you can see the NASA logo on the left wing through the aft payload bay bulkhead as seen in the second attached screenshot.
OK, just took a look at this again, with R4.14 and now I can tell that the color of the Earth glow does indeed change as the orbiter is passing over land and ocean.
 

Marg

Active member
Joined
Mar 20, 2008
Messages
483
Reaction score
68
Points
28
I wanted to throw another important thing - cockpit lighting. I know there was a thought about it. I once saw cockpit mesh in a ship looking from outside. There was a window: I saw sunspot on the floor, and realized - switching to a cockpit view there isn't sunspot anymore... Cockpit seem quite static, "unalive". I just looked at "Reentry" program's interiors and, hm, they were quite impressive.
 

Arvil

Well-known member
Joined
Apr 20, 2008
Messages
404
Reaction score
318
Points
78
Location
Pennsylvania, USA
Preferred Pronouns
he/him
I can only imagine the math that have to go into sunshine, earthshine, moonshine and interior reflections. Not to mention interior lighting.
 
Top