P4: Lab: a background mission's $Environment Map is never used
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- Half a day
- Newbie friendliness
- 66/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- computer-graphics, game-dev
Research direction
Start in LabRenderer::useBackground, where the mission's $Environment Map is read into envmap_name but The_mission.envmap_name is loaded instead. Compare with environment_map_gen in starfield.cpp, then check the ENVMAP > 1 test that follows. Done when a ship in the lab takes on the background mission's environment map colors, matching the mission. Testing needs a cubemap mission and an OpenGL debug build.
Written by the indexing model from the issue text.
Description
This is minor: it only affects the F3 lab's preview, not missions.
Problem
When you pick a mission as the lab's background, the lab loads that mission's stars, suns and bitmaps but ignores its $Environment Map. Ships in the lab don't reflect the environment map the mission names, so the lab preview doesn't match what the ship looks like in that mission.
Steps to reproduce
- Current master (8afa31842), debug build, Linux, OpenGL, MediaVPs 5.0.2.
- Use a mission whose
$Environment Mapis a cubemap with obvious colors. I used a test mission with a 64x64 cubemap that has one bright color per face. - Open the lab (F3), show a GTC Fenris, then pick that mission under Mission Background.
- Compare with the same Fenris in that mission.
Expected vs. actual behavior
Expected: the Fenris in the lab picks up the environment map's colors, like it does in the mission.
Actual: the background loads (the stars appear), but the hull stays plain grey. In the mission, the same map tints the whole hull.
From reading the code: LabRenderer::useBackground reads the mission's $Environment Map into a local envmap_name, but then loads The_mission.envmap_name instead, which in the lab is empty or left over from the last mission played. So the background's map is never loaded. I haven't tested the case where the leftover name points at a flat (non-cubemap) texture; by reading, it could hit the same OpenGL crash as #2245.
Proposed fixes
- Load
envmap_name(the name just read) instead ofThe_mission.envmap_name, and change theENVMAP > 1check right after it to>= 0. - Same as 1, plus the cubemap check from #7930, so a flat texture falls back to the generated map in the lab too.
- Share one helper between the lab and
environment_map_genin starfield.cpp, so both load and check the mission's environment map the same way.
- Dominant language
- C++
- Stars
- 488
- Forks
- 184
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 32
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from scp-fs2open/fs2open.github.com
-
P4: Standalone web API can read past its request buffer on a large request bodyPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
scp-fs2open/fs2open.github.com#7965 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
scp-fs2open/fs2open.github.com#7956 ·
Maintainers usually reply within 1 day
-
bug HUD LLM-suggested
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
scp-fs2open/fs2open.github.com#7953 ·
Maintainers usually reply within 1 day
-
bug controls LLM-suggested
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
scp-fs2open/fs2open.github.com#7946 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
scp-fs2open/fs2open.github.com#7924 ·
Maintainers usually reply within 1 day
All issues in scp-fs2open/fs2open.github.com
Similar issues
-
agent:WSL bug LOW security
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
mgradwohl/tasksmack#3290 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mw00/project-maya#743 ·
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
envoyproxy/envoy#48897 ·
Maintainers usually reply within 1 day
-
comp-view potential bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
ClickHouse/ClickHouse#128410 ·
Maintainers usually reply within 1 day