Add a Uniform object for RandomAlgorithm

This object contains several random numbers for the GPU kernel to use when generating random points. This isn't right yet (there are still patterns in the generated data) but it's time to move on...
This commit is contained in:
Eryn Wells 2018-11-07 16:47:07 -05:00
parent 76f0065d8b
commit 11b9cba8ac
6 changed files with 66 additions and 6 deletions

16
Terrain2/Uniforms.m Normal file
View file

@ -0,0 +1,16 @@
//
// Uniforms.c
// Terrain2
//
// Created by Eryn Wells on 11/6/18.
// Copyright © 2018 Eryn Wells. All rights reserved.
//
#include <stdio.h>
#include "ShaderTypes.h"
void RandomAlgorithmUniforms_refreshRandoms(RandomAlgorithmUniforms *uniforms) {
for (int i = 0; i < kRandomAlgorithmUniforms_RandomCount; i++) {
uniforms->randoms[i] = arc4random();
}
}