Commit d4c3c41
committed
Fix green texmap artifacts on earth render
Turns out the problem has to do with the conversion to gamma-corrected
intensities from the [0,1] values read in from the STB image library.
I thought the range would be [0,1), but instead it's [0,1]. Thus,
intensity values of 1.0 were mapped to 256, which then converted to 0
for unsigned 8-bit chars. Thankfully, I typo'ed the conversion in the
latest book 2 progression, and multiplied intensities by _257_, which
made the problem worse, and enough to to hit me.
This fix makes the conversion bullet-proof, and zero or negative
intensities are now mapped to 0, and values greater than or equal to 1.0
are now mapped to 255.
Resolves RayTracing#14851 parent ed69218 commit d4c3c41
File tree
2 files changed
+18
-2
lines changed- books
- src/TheNextWeek
2 files changed
+18
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1797 | 1797 | | |
1798 | 1798 | | |
1799 | 1799 | | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
1800 | 1808 | | |
1801 | 1809 | | |
1802 | 1810 | | |
| |||
1810 | 1818 | | |
1811 | 1819 | | |
1812 | 1820 | | |
1813 | | - | |
| 1821 | + | |
1814 | 1822 | | |
1815 | 1823 | | |
1816 | 1824 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
105 | 113 | | |
106 | 114 | | |
107 | 115 | | |
| |||
115 | 123 | | |
116 | 124 | | |
117 | 125 | | |
118 | | - | |
| 126 | + | |
119 | 127 | | |
120 | 128 | | |
121 | 129 | | |
| |||
0 commit comments