mirror of https://github.com/AxioDL/boo.git
18 lines
314 B
C++
18 lines
314 B
C++
|
#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();
|
||
|
}
|
||
|
|
||
|
}
|