This commit is contained in:
Jack Andersen
2018-01-19 17:02:29 -10:00
parent 3d987b6dc9
commit 337c276ccb
14 changed files with 287 additions and 53 deletions

View File

@@ -0,0 +1,17 @@
#include "Common.hpp"
namespace boo
{
void UpdateGammaLUT(ITextureD* tex, float gamma)
{
void* data = tex->map(65536 * 2);
for (int i=0 ; i<65536 ; ++i)
{
float level = std::pow(i / 65535.f, gamma);
reinterpret_cast<uint16_t*>(data)[i] = level * 65535.f;
}
tex->unmap();
}
}