12345678910111213141516 |
- #include "client/rendering/NoiseTexture.h"
- #include "gaming-core/utils/Array.h"
- #include "gaming-core/utils/Random.h"
- NoiseTexture::NoiseTexture() : texture(TextureFormat::float32(3)) {
- 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());
- }
- void NoiseTexture::bindTo(int index) const {
- texture.bindTo(index);
- }
|