123456789101112131415161718 |
- #include "client/rendering/NoiseTexture.h"
- #include "utils/Array.h"
- #include "utils/Random.h"
- bool NoiseTexture::init() {
- texture.init(TextureFormat::float32(3), 0);
- Random r(1);
- Array<float, 48> data;
- for(int i = 0; i < 48; i++) {
- data[i] = r.nextFloat() * 2.0f - 1.0f;
- }
- texture.setData(4, 4, data.begin());
- return false;
- }
- void NoiseTexture::bindTo(int index) const {
- texture.bindTo(index);
- }
|