Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
trs:fundamentals [2020/05/19 12:14] – [32 bit Fixed Point Data Type] zdimensiontrs:fundamentals [2020/05/19 12:16] (current) – [Fixed Point Data Types] zdimension
Line 75: Line 75:
  
 ...where $P_{whole}$ is whole part of mixed float (signed for ''fixed'', unsigned for ''ufixed16''), and $P_{frac}$ is fractional part (unsigned). ...where $P_{whole}$ is whole part of mixed float (signed for ''fixed'', unsigned for ''ufixed16''), and $P_{frac}$ is fractional part (unsigned).
 +
 +<note>
 +The reason why such complicated setup was invented is to avoid using floating-point numbers. In 90% of all cases, Tomb Raider engines use integer numbers, even
 +for geometry calculations and animation interpolations. The root of this setup lies in multi-platform nature of the code, which was simultaneously written for PC and PlayStation. While PCs had enough computational power to deal with floats at that time, PlayStation relied only on integers.
 +
 +However, some internal variables and constants (like drawing distance, fog distance constants and some light properties) are PC-specific and stored in floating
 +point numbers. Also, last game in series, TR5, extensively used floating-point numbers for certain data types – like colours, vertices and coordinates.
 +</note>
  
 ==== Data Alignment ==== ==== Data Alignment ====
trs/fundamentals.1589890447.txt.gz · Last modified: 2020/05/19 12:14 by zdimension
Back to top
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0