Working on a messaging system for sf events

This commit is contained in:
MitchellHansen
2017-01-10 08:46:12 -08:00
parent 475a879b51
commit 3c91614f45
10 changed files with 249 additions and 29 deletions

View File

@@ -99,12 +99,13 @@ __kernel void raycaster(
global int* seed_memory
){
int global_id = get_global_id(1) * get_global_size(0) + get_global_id(0);
// Get and set the random seed from seed memory
int global_id = get_global_id(0);
int seed = seed_memory[global_id];
int random_number = rand(&seed);
seed_memory[global_id] = seed;
size_t id = get_global_id(0);
int2 pixel = {id % (*resolution).x, id / (*resolution).x};
float3 ray_dir = projection_matrix[pixel.x + (*resolution).x * pixel.y];