blob: 6bed13cf81e786b5b1612b27aa0a0bfdcf41b004 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include <curand.h>
#include <stdint.h>
#include <stdio.h>
#include "include/helper_math.h"
__global__ void test_image(uint8_t *image) {
int2 unnormalized_coordinates = make_int2(blockDim.x, blockDim.y) * make_int2(blockIdx.x, blockIdx.y) + make_int2(threadIdx.x, threadIdx.y);
int2 img_res = make_int2(blockDim.x, blockDim.y) * make_int2(gridDim.x, gridDim.y); //can move if needed
size_t img_index = ((unnormalized_coordinates.y * img_res.y) + unnormalized_coordinates.x) * 4;
//vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4));
image[img_index] = 0x00;
image[img_index+1] = 0x00;
image[img_index+2] = 0xff;
image[img_index+3] = 0xff;
}
|