NoiseTexture.cpp 411 B

12345678910111213141516
  1. #include "client/rendering/NoiseTexture.h"
  2. #include "common/utils/Random.h"
  3. #include "common/utils/List.h"
  4. NoiseTexture::NoiseTexture() {
  5. Random r(1);
  6. List<float, 48> data;
  7. for(uint i = 0; i < data.getCapacity(); i++) {
  8. data.add(r.nextFloat() * 2.0f - 1.0f);
  9. }
  10. texture.setRGBFloatData(4, 4, data.getData());
  11. }
  12. void NoiseTexture::bind(uint index) const {
  13. texture.bind(index);
  14. }