render: fix skybox_mie_calc_sh cast

main
Dominik Madarász 2023-09-11 15:22:16 +02:00
parent b47c47df54
commit 07b002d536
6 changed files with 7 additions and 7 deletions

View File

@ -2533,7 +2533,7 @@ cubemap_t cubemap;
int flags;
int framebuffers[6];
int textures[6];
unsigned char *pixels;
float *pixels;
} skybox_t;
skybox_t skybox(const char *panorama_or_cubemap_folder, int flags);
int skybox_render(skybox_t *sky, mat44 proj, mat44 view);

View File

@ -16785,7 +16785,7 @@ typedef struct skybox_t {
// mie
int framebuffers[6];
int textures[6];
unsigned char *pixels;
float *pixels;
} skybox_t;
API skybox_t skybox(const char *panorama_or_cubemap_folder, int flags);
@ -341782,7 +341782,7 @@ void skybox_mie_calc_sh(skybox_t *sky, float sky_intensity) {
const vec3 skyY[] = {{ 0, 1, 0},{ 0, 1, 0},{ 0, 0,-1},{ 0, 0, 1},{ 0, 1, 0},{ 0, 1, 0}};
int step = 16;
for (int y = 0; y < HEIGHT; y += step) {
unsigned float *p = (unsigned float*)sky->pixels + y * WIDTH * 3;
float *p = (float*)(sky->pixels + y * WIDTH * 3);
for (int x = 0; x < WIDTH; x += step) {
vec3 n = add3(
add3(

View File

@ -2466,7 +2466,7 @@ void skybox_mie_calc_sh(skybox_t *sky, float sky_intensity) {
const vec3 skyY[] = {{ 0, 1, 0},{ 0, 1, 0},{ 0, 0,-1},{ 0, 0, 1},{ 0, 1, 0},{ 0, 1, 0}};
int step = 16;
for (int y = 0; y < HEIGHT; y += step) {
unsigned float *p = (unsigned float*)sky->pixels + y * WIDTH * 3;
float *p = (float*)(sky->pixels + y * WIDTH * 3);
for (int x = 0; x < WIDTH; x += step) {
vec3 n = add3(
add3(

View File

@ -629,7 +629,7 @@ typedef struct skybox_t {
// mie
int framebuffers[6];
int textures[6];
unsigned char *pixels;
float *pixels;
} skybox_t;
API skybox_t skybox(const char *panorama_or_cubemap_folder, int flags);

View File

@ -12690,7 +12690,7 @@ void skybox_mie_calc_sh(skybox_t *sky, float sky_intensity) {
const vec3 skyY[] = {{ 0, 1, 0},{ 0, 1, 0},{ 0, 0,-1},{ 0, 0, 1},{ 0, 1, 0},{ 0, 1, 0}};
int step = 16;
for (int y = 0; y < HEIGHT; y += step) {
unsigned float *p = (unsigned float*)sky->pixels + y * WIDTH * 3;
float *p = (float*)(sky->pixels + y * WIDTH * 3);
for (int x = 0; x < WIDTH; x += step) {
vec3 n = add3(
add3(

View File

@ -2868,7 +2868,7 @@ typedef struct skybox_t {
// mie
int framebuffers[6];
int textures[6];
unsigned char *pixels;
float *pixels;
} skybox_t;
API skybox_t skybox(const char *panorama_or_cubemap_folder, int flags);