Raytraced VC textures with panel lights

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
I'm starting to work on raytraced VC textures for the Command Module with different lighting configurations. Here are some work-in-progress screenshots:

1.jpg

2.jpg


There's still lots of work to be done.

But I just now realized that the VC meshes that I'm working with (from NASSP build 1684 way back in July 2021) have been updated in the meantime. Oops. I don't want to cause problems for other people who are maintaining/updating the meshes, so what's the best way for me to do it?

Thanks!
 

Thymo

I like breaking things
Addon Developer
Joined
Jun 26, 2016
Messages
120
Reaction score
148
Points
58
Website
nassp.space
Wow! I'm a bit blown away by what I'm seeing, that looks amazing! I love the look of those integral lights.
@jalexb88 is the guy you want to talk to about anything graphics related. It would be very beneficial to both you and us if you come talk with us on IRC to coordinate stuff sometime. We can help you get setup with a development environment so you are always on the bleeding edge where we make changes.
 
Joined
Feb 6, 2022
Messages
19
Reaction score
60
Points
13
Location
Earth
I made a forum account just to say, wow! This looks absolutely stunning, almost like a different game! Wish you the best of luck with improving things even further! I absolutely love the idea of making the simulator experience even more immersive, and this is certainly a way to do it!
 

STS

Well-known member
Joined
Feb 1, 2009
Messages
531
Reaction score
273
Points
78
Location
Vigo
Website
orbisondas.es
Finally! The Integral lights!

But... Isn´t that too dark? I tried Reentry, the other sim, and had the same thought. Was the CM really dark? Or that is because we are used to the "bright" 2D views?

Best regards,
 

abr35

Member
Joined
Sep 5, 2011
Messages
44
Reaction score
7
Points
23
I think the lighting depended a lot on unfiltered sunlight - in the sun the cabin looks like it was completely flooded with light, and in the shade it was pitch black. I included some examples below from the Apollo Flight Journal.

Will the lighting be able to be changed by the setting of the flood and integral knobs?

Lighted: Lunar Module, Command Module
Darkness: Command Module
 
Last edited:

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
Part of the reason it looks so dark is because there are still many objects in the VC which haven't been illuminated correctly, and are confusing to the eye when trying to determine how much light there is in the scene. That being said, this is is one of the darker lighting setups, and I plan to also bake some with brighter illumination.

Since these are static textures, it should be possible to programmatically switch out the VC textures when adjusting the lighting controls in the VC. BrianJ was able to do it in the Dragon DM2 addon (https://orbithangar.com/showAddon.php?id=06e64e6a-53e0-45ba-8aa4-2adf6a7fa792). But I don't know if there's a way to incrementally blend two different sets of textures to allow fine control over brightness.
 

jarmonik

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 28, 2008
Messages
2,651
Reaction score
785
Points
128
That looks pretty good there, nice work. There were some discussion few years ago about using a pre-baked light maps for a cockpit illumination.

Out.rgb = Texture.rgb * HDR( LightGroup1.rgb * LightMap.r + LightGroup2.rgb * LightMap.g + LightGroup3.rgb * LightMap.b )

So this would allow to control color and intensity of three light groups while having pre-computed falloff and shadow in a lightmap. Do you think that this would work ?
Also I can enable sunlight shadows for a cockpit if you got an idea how to bake in the light properly.
 

jalexb88

Addon Developer
Addon Developer
Joined
Aug 11, 2008
Messages
152
Reaction score
154
Points
43
Location
Canada
@Felix24 Looks very impressive! Are you modifying the mesh in your work or just the textures? If its just the textures then there hasn't been any changes to them since July, but
in any event, is it possible for you to work from the latest NASSP version? There has been murmurous small fixes to the VC meshes since July and it would be better to work with the latest one :)
 

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
It's a combination of texture and mesh work. For the raytracing to look correct, I'm having to fix all of the overlapping UV maps as I go along, and then bake the original textures onto new UV-mapped textures. Once that step is complete, then I'm able to bake new textures with raytraced lighting.

At some point I'll try to add new 3D light fixtures to the mesh (as accurately as I can, using the Apollo 11 CM 3D model provided by the Smithsonian for reference: https://3d.si.edu/object/3d/command-module-apollo-11:d8c63e8a-4ebc-11ea-b77f-2e728ce88125) so that the cockpit light sources actually have their own objects.

I'm using Blender 3.0, and I just restarted the project using the meshes from the latest NASSP version (1819). I'm getting faster as I do it over the 2nd time. :)

Do you recommend I use GitHub Desktop?
 

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
That looks pretty good there, nice work. There were some discussion few years ago about using a pre-baked light maps for a cockpit illumination.

Out.rgb = Texture.rgb * HDR( LightGroup1.rgb * LightMap.r + LightGroup2.rgb * LightMap.g + LightGroup3.rgb * LightMap.b )

So this would allow to control color and intensity of three light groups while having pre-computed falloff and shadow in a lightmap. Do you think that this would work ?
Also I can enable sunlight shadows for a cockpit if you got an idea how to bake in the light properly.
Thanks! In pseudocode, what do you think about this? This would allow direct sun shadows in cockpit, ambient sunlight through windows, and multiple baked lightmaps for different sets of cabin/panel lights:

Out.rgb = someBlendingFunction(
FullyLitDiffuseTexture.rgb * directSunlightWithShadows.rgb, <---- sunlight filtered with shadows, color changes w/ sunrise and sunset
BakedDiffuseLightComingThroughWindows.rgb * directSunlightColorWithoutShadows.rgb, <---- ambient sunlight, color changes w/ sunrise and sunset
BakedInteriorLightTexture1.rgb * lightControl1.rgb,
BakedInteriorLightTexture2.rgb * lightControl2.rgb,
BakedInteriorLightTexture3.rgb * lightControl3.rgb,
... (maybe up to 10 different independently controllable lightmaps. 10 should be enough for everyone));

someBlendingFunction() would have to add textures together in a realistic way, not simple addition but something else that doesn't saturate things. Something similar to:
output = input1 + (input2 * (1-input1));

lightControl#.rgb can be float1 instead of float3, and controlled by VC switches or knobs, and/or keyboard combinations.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Just my 2 cents, but if you are going to mess with code, then it's best to simply calculate shadows + light sources on the VC (as already happens with exterior meshes) .

Baking looks good of course, but it's outdated and limited to specific light conditions. Even older 3D cards can do decently fast Screen Space Ambient Occlusion (SSAO), and that's much better because shadows are dynamic (you can turn lights on and off...)
 
Last edited:

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,873
Reaction score
2,868
Points
188
Website
github.com
From the Shuttle point-of-view, just on the flight deck there are (of the top of my head) 13 lights, so that would mean about 8k on/off light combinations + ~25 panel textures = no way ?

I like the "simple textures + user lights + sun + planet glow" solution that currently works great outside.
 

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
It all started when I loaded the Apollo CM VC in Blender, added some lights, and rendered it just to see what would happen. I got sucked into baking the result when I saw how cool it looked. While outdated, baking raytraced textures allows for some extra touches that increase the immersion without requiring modern hardware.

From the Shuttle point-of-view, just on the flight deck there are (of the top of my head) 13 lights, so that would mean about 8k on/off light combinations + ~25 panel textures = no way ?
Each lighting texture would cover a single controllable light (or cluster of lights), allowing them to be on in any combination, mixed in realtime by the graphics client. So instead of requiring 8192 different textures to cover every possible combination, it would only need 13 textures, one for each individually controllable light source.

Just my 2 cents, but if you are going to mess with code, then it's best to simply calculate shadows + light sources on the VC (as already happens with exterior meshes) .

Baking looks good of course, but it's outdated and limited to specific light conditions. Even older 3D cards can do decently fast Screen Space Ambient Occlusion (SSAO), and that's much better because shadows are dynamic (you can turn lights on and off...)

I agree that it's mostly better and easier to add actual light sources to the VC that are dynamically controlled. The only drawbacks I can think of are:
1. limited light sources (i.e. you can't add 100s of light sources, when each illuminated dial and switch label is technically a light source)
2. possible drop in framerate (without modern hardware*)
3. possible lack of VC self-shadowing and SSAO (without modern hardware*)
4. SSAO and self-shadowing doesn't include multiple light bounces illuminating hidden areas

* I'm running Orbiter on a 2013 MacBook Pro with Windows 10, with a GeForce GT 750M. I'm not sure SSAO and VC self-shadowing is possible without a substantial FPS hit.
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,873
Reaction score
2,868
Points
188
Website
github.com
Each lighting texture would cover a single controllable light (or cluster of lights), allowing them to be on in any combination, mixed in realtime by the graphics client. So instead of requiring 8192 different textures to cover every possible combination, it would only need 13 textures, one for each individually controllable light source.
OK, so that would be a big reduction, but still 13 * 25 is a lot of textures, plus a few additional ones, as some panels moved around.

1. limited light sources (i.e. you can't add 100s of light sources, when each illuminated dial and switch label is technically a light source)
For panel backlights (and indicator lights), Martin has (a possible) solution implemented in the DG, so IMO the issue is only the "regular" lights and shadows. As for the limit of lights, I don't really know why it exists.
 

jalexb88

Addon Developer
Addon Developer
Joined
Aug 11, 2008
Messages
152
Reaction score
154
Points
43
Location
Canada
I personally prefer the solution where shadows are not baked in. As said above, D3D9 already does quite a good job at depicting the outside view shadowing so if the same can be brought to the VC that is the best solution in my opinion.
 

Felix24

Active member
Joined
May 13, 2010
Messages
245
Reaction score
95
Points
43
13 * 25 is a lot of textures
Yes, it is. A lot of baking time too, since it takes hours to bake a texture to full quality with no CUDA support. I'm beginning to see that this could get out of hand if I decided to do the same for Space Shuttle Ultra.

If this results in someone adding accurate VC light sources the more accepted way, and enabling sunlight showing through the windows, I'll still be happy. I can go back to working on texturing exteriors again. :)
 

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,687
Reaction score
1,337
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
Hey, this project seems way to cool not to continue with. I think if we did a version with non-baked shadows (just the dark cockpit with a separate backlighting texture) and let the client support internal lights and shadows, it would really add to the atmosphere.
 
Top