Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
trs:miscellany [2017/06/04 19:04]
zdimension [LightMap]
trs:miscellany [2017/06/04 23:42]
zdimension [LightMap]
Line 304: Line 304:
 But the TR series has a more general solution, one that does not require palettes to have colour ramps. It uses precalculated lighting tables, the ''​%%ColourMap%%''​ objects. These contain translations of a colour value and a lighting value, listed by palette index. The translation goes as follows: But the TR series has a more general solution, one that does not require palettes to have colour ramps. It uses precalculated lighting tables, the ''​%%ColourMap%%''​ objects. These contain translations of a colour value and a lighting value, listed by palette index. The translation goes as follows:
  
-$n = ColourMap[256 \times k + i]$+$n = ColourMap[256 \cdot k + i]$
  
-where $i$ is the original palette index, $k$ is determined from the lighting value, and $n$ is the new palette index. The lighting index $k$ varies from $0$ to $31$, and the corresponding lighting value is $2 - k \div 16$ for TR1 and $2 - (k + 1) \div 16$ for TR2 and TR3.+where $i$ is the original palette index, $k$ is determined from the lighting value, and $n$ is the new palette index. The lighting index $k$ varies from $0$ to $31$, and the corresponding lighting value is $2 - k 16$ for TR1 and $2 - (k + 1) 16$ for TR2 and TR3.
  
 This may be associated with the curious fact of the lighting values in the data files increasing in the “wrong” direction in TR1 and TR2, with $0$ being full brightness and greater values being darker. This may be associated with the curious fact of the lighting values in the data files increasing in the “wrong” direction in TR1 and TR2, with $0$ being full brightness and greater values being darker.
trs/miscellany.txt · Last modified: 2017/11/17 12:20 (external edit)
Back to top
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0