Closed dsvensson closed 4 months ago
Thanks for resurrecting this.
I think it's pretty close to good to merge, I've got a small docs update:
diff --git a/docs/light.rst b/docs/light.rst
index 2454c6c3..810ce0e2 100644
--- a/docs/light.rst
+++ b/docs/light.rst
@@ -315,6 +315,14 @@ Experimental options
Writes lux data into the bsp itself.
+.. option:: -hdr
+
+ Write .lit file with e5bgr9 data.
+
+.. option:: -bspxhdr
+
+ Writes LIGHTING_E5BGR9 bspx lump.
+
.. option:: -lmscale n
Equivalent to "_lightmap_scale" worldspawn key.
diff --git a/light/light.cc b/light/light.cc
index 71a4bf14..fbb6edae 100644
--- a/light/light.cc
+++ b/light/light.cc
@@ -322,7 +322,7 @@ light_settings::light_settings()
"writes lux data into the bsp itself"},
hdr{this, "hdr", [&](source) { write_litfile |= lightfile::external; write_litfile |= lightfile::hdr; }, &experimental_group, "write .lit file with e5bgr9 data"},
bspxhdr{this, "bspxhdr", [&](source) { write_litfile |= lightfile::bspx; write_litfile |= lightfile::hdr; }, &experimental_group,
- "writes lux data into the bsp itself"},
+ "writes LIGHTING_E5BGR9 bspx lump"},
bspxonly{this, "bspxonly",
[&](source source) {
write_litfile = lightfile::bspx;
I'd like to add a test or two that lights a map with -bspxhdr
and then e5rgb9 sample back to a float, we have similar tests for decouple LM, regular Q1 .lit, Q2 vanilla lightmaps, etc.
I should also credit Spike in the final merge commit for the initial patch.
I'm doing the last batch of changes I wanted to add to this in my branch https://github.com/ericwa/ericw-tools/tree/hdr
HDR_UnpackE5BRG9
decode function (uint32_t -> qvec3f)HDR_PackE5BRG9
+ HDR_UnpackE5BRG9
HDR_PackE5BRG9
implementation to match opengl specI'll hopefully wrap this up soon + merge!
Thank you so much for picking this up. Was about to return to this after focusing on another project for the past few weeks. Your improvements look much better than what I would have been able to pull off. 🙏
Forward port/adaptation of Spike's work in https://github.com/ericwa/ericw-tools/pull/280 and not really fit for merging. Proposing it as draft in hope of getting help to figure out what needs to be done to get it into a mergable state.
The output of these lightmaps is supported by FTE, QSS, QSS-M.
The primary usecase is HDR and iris adaptation that alters the brightness between scenes with a delay of going from outdoors to indoors, but it also reduces banding due to the float nature. From a multiplayer perspective it allows for kicking up the brightness without lightmaps turning into pure garbage.