Author Topic: Question about the loadout screen  (Read 1788 times)

0 Members and 1 Guest are viewing this topic.

Offline Solatar

  • 211
Question about the loadout screen
Maybe this belongs in MODing?  :nervous:

So, I've been poking around the interface a bit recently, trying to satisfy my obsession over making my install of FSPort look as much like a modern version of FS1 as possible. My question is, when you have environmental maps turned on, the game uses an actual mission background to determine the environmental map applied in the tech room and loadout screens. I thought it was just a generic color, but you can actually see nebula details and a yellow sun in most models. I thought it would use something obvious like the last loaded mission, or the current in the campaign, or something, but I haven't been able to find it.  Is this background file loaded in a mission somewhere, or is it hard coded?



[attachment DELETED!! by Strong Bad]
« Last Edit: April 28, 2016, 08:28:15 pm by Solatar »

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Question about the loadout screen
From that picture you're talking about just the weapon selection screen?

For the ship selection screen at least, with the FS1 ship selection effect, I think this code controls the lighting:

Code: (https://github.com/scp-fs2open/fs2open.github.com/blob/master/code/missionui/missionscreencommon.cpp#L1891) [Select]
// lighting for techroom
light_reset();
  vec3d light_dir = vmd_zero_vector;
light_dir.xyz.y = 1.0f;
light_add_directional(&light_dir, 0.65f, 1.0f, 1.0f, 1.0f);
light_rotate_all();
// lighting for techroom

So, I don't 100% understand all that, but it doesn't seem to have any nebula effects?
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline DahBlount

  • Moderator
  • 29
  • Alpine ☆ Cancer Tribulation
    • Minecraft
    • Skype
    • Steam
Re: Question about the loadout screen
It looks like a nebula due to the way reflection happens, but in reality, it's a uniform bluish green color.
This one to be exact.


You can determine the color by multiplying the 4 float values after the &light_dir in light_add_directional() by 255 (the maximum RGB color channel value) where the values in order are Red, Green, Blue, and Alpha. The reason it appears darker than the color in the RGB picker is because it gets mixed in a specific manner with the diffuse and spec color of the ships textures in the shaders.
« Last Edit: April 28, 2016, 10:03:02 pm by DahBlount »
<Axem> yet still more insightful than #hard-light

<Axem> jad2.23 will just be cat videos

<DahBlount> So
<DahBlount> JAD2.2 is like that
<Axem> maybe
<Axem> it can be whatever you like!
<DahBlount> A Chocolate Sundae?
<Axem> sure

My models: GTF Gilgamesh - GTD Nuadha [Redesigning] - Ningirama [WIP] - GTG Zephyrus

 

Offline Solatar

  • 211
Re: Question about the loadout screen
The tech room version definitely has identifiable nebula and sun features (it looks almost like a skybox) if you drag the ships around so you can control what part of the reflection you can see, so I thought the weapon select screen was the same. In the techroom, especially with the Centaur's big window, you can clearly see green nebula, and a yellow sun.

I went and changed the color in missionscreencommon.cpp (that line shows up in two places, one for each screen), and it seems to have odd effects. If I change it to all red (for an easy to identify contrast, to see if it's working), the light coming from the direction specified in that code turns blue ( :confused:), and the green "nebula" stays on the sides.  The bottom attachment is what it looks like in the ship selection screen if I change the values to the equivalent of 255, 51, 51, 255. It looks the same in the weapon select screen, but since the "light" comes from .000001 off the X axis, it only recolors the nose of the ship (it colors the rendered weapon model, though). It's almost like whatever effect that's shown in the techroom is being applied, and then additional directional lighting is being applied on top of that in the loading screens.

I'm messing around with the PBR branch, btw, but I don't know if that matters?

My "coding" knowledge pretty much tops out at helping 7th graders to make games in Scratch (I'm not even the computer science teacher), so this is at least kinda fun figuring it out. Thanks for your replies :p

EDIT: Figured out the color discrepancy. The first value is the intensity, THEN RGB. According to this documentation, I can mess with specular coloring too, so I'll try that next.

[attachment DELETED!! by Strong Bad]
« Last Edit: April 29, 2016, 08:01:45 pm by Solatar »

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Question about the loadout screen
I'm messing around with the PBR branch, btw, but I don't know if that matters?

It might, I only looked at the current master branch so it's possible there's something in the PBR branch that has added a nebula effect to the tech room.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...