#include "client/rendering/NoiseTexture.h"
#include "gaming-core/utils/Random.h"
#include "gaming-core/utils/List.h"

NoiseTexture::NoiseTexture() : texture(TextureFormat::float32(3)) {
    Random r(1);
    List<float, 48> data;
    for(int i = 0; i < 48; i++) {
        data.add(r.nextFloat() * 2.0f - 1.0f);
    }
    texture.setData(4, 4, &(data[0]));
}

void NoiseTexture::bindTo(int index) const {
    texture.bindTo(index);
}