Move gamma correction to a 2D LUT on all gamma correct shaders

Description

Gamma correction currently uses several pow instructions to convert diffuse textures to linear space. Each pow instruction can extend shader length by two or more instructions, so it would be a good idea to start moving everything over to 2D LUTs to minimize this cost. Could also look into applying the conversion LUT to the diffuse G-Buffer in the deferred renderer to reduce the cost of applying it to all partially visible objects in the scene.

Alternatively, we could just move over to approximating a gamma of 2.0 by multiplying the diffuse texture against its self, or finding a way to approximate a gamma of 2.2 without the use of pow().

Update: Instead, we're going for approximating pow(..., 2.2); and pow(..., 1.0/2.2); using a polynomial function that costs less taxing instructions than a single pow.

Environment

None

Assignee

Geenz Spad

Reporter

Geenz Spad

Labels

None

Fix versions

Priority

Major
Configure