mie skybox no longer uses non-standard uniform default value

main
Dominik Madarász 2023-09-11 11:07:59 +02:00
parent 959f988836
commit a20b0b73ad
7 changed files with 17 additions and 8 deletions

View File

@ -32,7 +32,7 @@ exit
:windows
if "%1"=="" MAKE.bat demo_ui.c
if "%1"=="" MAKE.bat demo_collide.c
del index.html 2>NUL >NUL
del index.worker.js 2>NUL >NUL

View File

@ -9,7 +9,6 @@
int paused;
camera_t cam;
skybox_t sky;
void game_loop(void *userdata) {
// key handler
@ -611,8 +610,6 @@ int main(void) {
// camera that points to origin
cam = camera();
sky = skybox(0, 0);
// main loop
window_loop(game_loop, NULL);
}

View File

@ -1,4 +1,4 @@
uniform vec3 uSunPos = vec3( 0, 0.1, -1 ); // = [0, Math.cos(theta) * 0.3 + 0.2, -1];
uniform vec3 uSunPos;// = vec3( 0, 0.1, -1 ); // = [0, Math.cos(theta) * 0.3 + 0.2, -1];
in vec3 v_direction;

View File

@ -333729,7 +333729,7 @@ void vfs_reload() {
array_resize(vfs_entries, 0); // @leak
// mount virtual filesystems later (mounting order matters: low -> to -> high priority)
#if 0
#if defined(EMSCRIPTEN)
for( int i = 0; i < JOBS_MAX; ++i) {
if( vfs_mount(va(".art[%02x].zip", i)) ) continue;
if( vfs_mount(va("%s[%02x].zip", app, i)) ) continue;
@ -341700,6 +341700,10 @@ skybox_t skybox(const char *asset, int flags) {
sky.cubemap = cubemap6( images, 0 );
for( int i = 0; i < countof(images); ++i ) image_destroy(&images[i]);
}
} else {
// set up mie defaults
shader_bind(sky.program);
shader_vec3("uSunPos", vec3( 0, 0.1, -1 ));
}
return sky;

View File

@ -515,7 +515,7 @@ void vfs_reload() {
array_resize(vfs_entries, 0); // @leak
// mount virtual filesystems later (mounting order matters: low -> to -> high priority)
#if 0
#if defined(EMSCRIPTEN)
for( int i = 0; i < JOBS_MAX; ++i) {
if( vfs_mount(va(".art[%02x].zip", i)) ) continue;
if( vfs_mount(va("%s[%02x].zip", app, i)) ) continue;

View File

@ -2395,6 +2395,10 @@ skybox_t skybox(const char *asset, int flags) {
sky.cubemap = cubemap6( images, 0 );
for( int i = 0; i < countof(images); ++i ) image_destroy(&images[i]);
}
} else {
// set up mie defaults
shader_bind(sky.program);
shader_vec3("uSunPos", vec3( 0, 0.1, -1 ));
}
return sky;

View File

@ -4637,7 +4637,7 @@ void vfs_reload() {
array_resize(vfs_entries, 0); // @leak
// mount virtual filesystems later (mounting order matters: low -> to -> high priority)
#if 0
#if defined(EMSCRIPTEN)
for( int i = 0; i < JOBS_MAX; ++i) {
if( vfs_mount(va(".art[%02x].zip", i)) ) continue;
if( vfs_mount(va("%s[%02x].zip", app, i)) ) continue;
@ -12608,6 +12608,10 @@ skybox_t skybox(const char *asset, int flags) {
sky.cubemap = cubemap6( images, 0 );
for( int i = 0; i < countof(images); ++i ) image_destroy(&images[i]);
}
} else {
// set up mie defaults
shader_bind(sky.program);
shader_vec3("uSunPos", vec3( 0, 0.1, -1 ));
}
return sky;