Closed uis246 closed 2 weeks ago
Riiight, forgot to rebase.
There is room for improvement, for example texture matrix, but it will require changing rendering code, so it will not be here for sake of simplicity.
Seems good; someone else please test run this before merging though.
I've tested it with Quake. I didn't notice any problems. @uis246 if there's any in particular that might be affected please let me know.
I've used only properties of linear algebra(like elements of normalized vector are always in range of [-1, 1]), basic arithmetics, shuffling between registers, using proper built-ins instead of hacks and assumption of samples being in range of [0, 1]. Seems to be it.
So there should be no existing game being affected
Most optimizations are done by abusing mathematical properties and replacing slow on some hardware(e.g. Inetl) min and max with saturation. For example dot product is in range [-1, 1], so
max(0, dot(...))
=sat(dot(...))
. In places where this potentially can mess with HDR comments were added.