height limit
authorhgn <hgodden00@gmail.com>
Mon, 24 Feb 2025 01:23:03 +0000 (01:23 +0000)
committerhgn <hgodden00@gmail.com>
Mon, 24 Feb 2025 01:23:03 +0000 (01:23 +0000)
shaders/scene_fxglow.fs
src/player.c
src/world_load.c
src/world_render.c

index cebd810961f0e3edf676ee564e7d00cd0a02ff97..fb31506e0918d45aa74e8d63234f0eb0ba4f329d 100644 (file)
@@ -1,11 +1,17 @@
 uniform sampler2D uTexMain;
 uniform vec3 uCamera;
 
-#include "light_clearskies_stddef.glsl"
-#include "common_scene.glsl"
+in vec2 aUv;
+in vec4 aNorm;
+in vec3 aCo;
+in vec3 aWorldCo;
+
+layout (location = 0) out vec4 oColour;
+
 #include "motion_vectors_fs.glsl"
 
-void main(){
+void main()
+{
    oMotionVec = vec2(0.0);
 
    vec4 vsamplemain = texture( uTexMain, aUv );
index 12f53364a144c9bc51221613d896837dea300798..e80430906b7dd394704f0b6c1a349ce01497631f 100644 (file)
@@ -149,9 +149,19 @@ void player__update(void)
    if( player_subsystems[ localplayer.subsystem ]->update )
       player_subsystems[ localplayer.subsystem ]->update();
 
-   if( localplayer.glider_orphan && 
-       (skaterift.activity != k_skaterift_replay) )
+   if( localplayer.glider_orphan && (skaterift.activity != k_skaterift_replay) )
       glider_physics( (v2f){0,0} );
+   
+   
+   if( localplayer.rb.co[1] < _world.main.scene_geo.bbx[0][1] - 40.0f )
+   {
+      ent_spawn *rp = world_find_closest_spawn( &_world.main, localplayer.rb.co );
+      if( rp )
+      {
+         vg_error( "Resetting player because they fell out of the world.\n" );
+         player__spawn( rp );
+      }
+   }
 }
 
 void player__post_update(void)
index 244912dd44f0e3fa1506f2cc7d67a96cb6dd29a5..32329a0da886d4affc05eb402876cb7ec716d5c3 100644 (file)
@@ -59,6 +59,7 @@ static void world_instance_load_mdl( world_instance *world, const char *path, vo
    }
 
    AF_LOAD_ARRAY_STRUCT( af, &world->ent_route,     ent_route,      heap );
+   AF_LOAD_ARRAY_STRUCT( af, &world->ent_region,    ent_region,     heap );
 
    if( load_all )
    {
@@ -77,7 +78,6 @@ static void world_instance_load_mdl( world_instance *world, const char *path, vo
       AF_LOAD_ARRAY_STRUCT( af, &world->ent_cubemap,   ent_cubemap,    heap );
       AF_LOAD_ARRAY_STRUCT( af, &world->ent_miniworld, ent_miniworld,  heap );
       AF_LOAD_ARRAY_STRUCT( af, &world->ent_prop,      ent_prop,       heap );
-      AF_LOAD_ARRAY_STRUCT( af, &world->ent_region,    ent_region,     heap );
       AF_LOAD_ARRAY_STRUCT( af, &world->ent_glider,    ent_glider,     heap );
    }
 
index 3e3e1a6374de20a053fd4bdf63329297899fc28b..c363e35147611623e23d79108be207d390e0e5f5 100644 (file)
@@ -653,8 +653,7 @@ static void world_render_challenges( world_instance *world, struct world_pass *p
    }
 }
 
-static void bindpoint_fxglow( world_instance *world,
-                              struct world_surface *mat )
+static void bindpoint_fxglow( world_instance *world, struct world_surface *mat )
 {
    struct shader_props_standard *props = mat->info.props.compiled;
 
@@ -671,8 +670,7 @@ static void render_world_fxglow( world_instance *host_world,
    shader_scene_fxglow_uUvOffset( (v2f){ 0.0f, 0.0f } );
    shader_scene_fxglow_uTexMain(1);
    shader_scene_fxglow_uPv( cam->mtx.pv );
-   WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_fxglow );
-
+   //WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_fxglow );
    shader_scene_fxglow_uCamera( cam->transform[3] );
    glDisable(GL_CULL_FACE);
 
@@ -688,11 +686,13 @@ static void render_world_fxglow( world_instance *host_world,
    if( generic )
       world_render_both_stages( world, &pass );
 
-   if( regions ){
+   if( regions )
+   {
       mesh_bind( &world->mesh_no_collide );
 
       u32 last_material = 0;
-      for( u32 i=0; i<af_arrcount(&world->ent_region); i ++ ){
+      for( u32 i=0; i<af_arrcount(&world->ent_region); i ++ )
+      {
          shader_scene_fxglow_uUvOffset( (v2f){ 0.0f, 0.0f } );
          ent_region *region = af_arritm( &world->ent_region, i );
 
@@ -1325,6 +1325,8 @@ void render_world_preview( vg_camera *cam )
    mesh_bind( &world->mesh_no_collide );
    pass.geo_type = k_world_geo_type_nonsolid;
    render_world_override_pass( world, &pass, mmdl, mnormal, mpvm_prev );
+   
+   //render_world_fxglow( world, world, cam, mmdl, 0, 0, 1 );
    glEnable( GL_CULL_FACE );
 }