unai: Use 8.8 RGB triplet format for gouraud shading
authorPaul Cercueil <paul@crapouillou.net>
Tue, 31 Oct 2023 17:11:39 +0000 (18:11 +0100)
committerPaul Cercueil <paul@crapouillou.net>
Thu, 2 Nov 2023 09:50:59 +0000 (10:50 +0100)
commitebcd59b7ac1170dda42b7352ffdc1289f60ad174
tree014698a2928a9f549266c48eb15d6976f2e3c6cc
parent0c3991955794fe1e0159b62839af1f683a23a981
unai: Use 8.8 RGB triplet format for gouraud shading

Use a new 'gcol_t' type which fits in 64 bits, and encode each color
component into a 8.8 fixed-point format.

This boosts the precision of the gouraud shading algorithm, at almost
zero cost.

Fixes #320.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
plugins/gpu_unai/gpu_inner.h
plugins/gpu_unai/gpu_inner_light.h
plugins/gpu_unai/gpu_unai.h