marker improvement
authorhgn <hgodden00@gmail.com>
Mon, 27 Mar 2023 11:15:16 +0000 (12:15 +0100)
committerhgn <hgodden00@gmail.com>
Mon, 27 Mar 2023 11:15:16 +0000 (12:15 +0100)
render.h
shaders/scene_scoretext.h
skaterift.c
world_gate.h
world_render.h
world_routes.h
world_water.h

index 44414ea5f63dd2bea0e808b5df4867fd47e7c19e..f17018bb2e767006dbd6701c355a7f5e9dd5b33b 100644 (file)
--- a/render.h
+++ b/render.h
 #include "shaders/vblend.h"
 #endif
 
-VG_STATIC void render_water_texture( world_instance *world, camera *cam );
+VG_STATIC void render_water_texture( world_instance *world, camera *cam,
+                                     int layer_depth );
 VG_STATIC void render_water_surface( world_instance *world, camera *cam );
-VG_STATIC void render_world( world_instance *world, camera *cam );
+VG_STATIC void render_world( world_instance *world, camera *cam,
+                             int layer_depth );
 VG_STATIC void render_world_depth( world_instance *world, camera *cam );
 
 #ifndef RENDER_H
index dcefedbd46e540e0494f48c71c6b01936258e78e..417cc2a008b0deb5fbf527d7df964513fb4cd2a1 100644 (file)
@@ -72,7 +72,7 @@ static struct vg_shader _shader_scene_scoretext = {
 "\n"
 "   gl_Position = vproj0;\n"
 "\n"
-"   aUv = a_uv;\n"
+"   aUv = a_uv + vec2( floor(uInfo.z+0.5)*(1.0/64.0), yoff );\n"
 "   aNorm = vec4( mat3(uMdl) * mat3(mlocal) * a_norm.xyz, a_norm.w );\n"
 "   aCo = a_co;\n"
 "   aWorldCo = world_pos0;\n"
index 6343098c874d59ef03c12fe2426c7a6232f7986e..e50c1e5bb2263147aab50a7490775b210d42e5d9 100644 (file)
@@ -498,7 +498,7 @@ VG_STATIC void render_scene(void)
       return;
    }
 
-   render_world( view_world, &main_camera );
+   render_world( view_world, &main_camera, 0 );
 
    int player_transparent = 1,
        player_draw        = 1;
@@ -513,10 +513,13 @@ VG_STATIC void render_scene(void)
       player__render( &main_camera, &localplayer );
 
 
-   render_water_texture( view_world, &main_camera );
+   render_water_texture( view_world, &main_camera, 0 );
    render_fb_bind( gpipeline.fb_main );
    render_water_surface( view_world, &main_camera );
-   render_world_gates( view_world, &main_camera );
+
+   int depth = 1;
+   if( localplayer.gate_waiting ) depth = 0;
+   render_world_gates( view_world, &main_camera, depth );
 
    if( player_transparent && player_draw )
       render_player_transparent();
index f2a383c1f2856aea16a060f686d9e2f638bb52fa..93322aaa0af11392955e34af7f6d604b671f7e3b 100644 (file)
@@ -67,7 +67,7 @@ VG_STATIC void world_gates_init(void)
 }
 
 VG_STATIC int render_gate( world_instance *world_inside,
-                           ent_gate *gate, camera *cam )
+                           ent_gate *gate, camera *cam, int layer_depth )
 {
    v3f viewdir, gatedir;
    m3x3_mulv( cam->transform, (v3f){0.0f,0.0f,-1.0f}, viewdir );
@@ -151,12 +151,12 @@ VG_STATIC int render_gate( world_instance *world_inside,
       glStencilMask( 0x00 ); 
    }
 
-   render_world( world_inside, &gate_camera );
+   render_world( world_inside, &gate_camera, layer_depth );
 
    {
       glDisable( GL_STENCIL_TEST );
 
-      render_water_texture( world_inside, &gate_camera );
+      render_water_texture( world_inside, &gate_camera, layer_depth );
       render_fb_bind( gpipeline.fb_main );
 
       glEnable( GL_STENCIL_TEST );
index 517c19fa067c7243a00660a36f9e2ac6b47f6c34..811e6a447bf5cd4e287d75c3bf5a46375fdaa042 100644 (file)
@@ -346,7 +346,8 @@ VG_STATIC void render_sky( world_instance *world, camera *cam )
    glDepthMask( GL_TRUE );
 }
 
-VG_STATIC void render_world_gates( world_instance *world, camera *cam )
+VG_STATIC void render_world_gates( world_instance *world, camera *cam,
+                                   int layer_depth )
 {
    float closest = INFINITY;
 
@@ -371,18 +372,19 @@ VG_STATIC void render_world_gates( world_instance *world, camera *cam )
    if( gate ){
 #if 0
       world_instance *dest_world = &world_global.worlds[ gate->world_index ];
-      render_gate( dest_world, gate, cam );
+      render_gate( dest_world, gate, cam, layer_depth );
 #else
-      render_gate( world, gate, cam );
+      render_gate( world, gate, cam, layer_depth );
 #endif
    }
 }
 
-VG_STATIC void render_world( world_instance *world, camera *cam )
+VG_STATIC void render_world( world_instance *world, camera *cam,
+                             int layer_depth )
 {
    render_sky( world, cam );
 
-   render_world_routes( world, cam );
+   render_world_routes( world, cam, layer_depth );
    render_world_standard( world, cam );
    render_world_vb( world, cam );
    render_world_alphatest( world, cam );
index 05ef3c9586a8094634ed20e448ca6236d4b5b72a..91456aa0afdbde6bb4f42937aceaab8399a06a79 100644 (file)
@@ -564,7 +564,8 @@ VG_STATIC void world_bind_light_index( world_instance *world,
                                        GLuint shader, GLuint location, 
                                        int slot );
 
-VG_STATIC void render_world_routes( world_instance *world, camera *cam )
+VG_STATIC void render_world_routes( world_instance *world, camera *cam, 
+                                    int layer_depth )
 {
    m4x3f identity_matrix;
    m4x3_identity( identity_matrix );
@@ -626,8 +627,9 @@ VG_STATIC void render_world_routes( world_instance *world, camera *cam )
 
          shader_model_gate_uColour( colour );
 
-         u32 next = route->checkpoints_start +
-                   (route->active_checkpoint+1) % route->checkpoints_count;
+         u32 next = route->active_checkpoint+1+layer_depth;
+             next = next % route->checkpoints_count;
+             next += route->checkpoints_start;
 
          ent_checkpoint *cp = mdl_arritm( &world->ent_checkpoint, next );
          ent_gate *gate = mdl_arritm( &world->ent_gate, cp->gate_index );
index 22de2c9bfb01ee4c9b5c37ce0f55adf18277a403..f44d265aa5a6e0271ae625af3f473ae741b8b351 100644 (file)
@@ -48,7 +48,8 @@ VG_STATIC void world_bind_light_index( world_instance *world,
 /*
  * Does not write motion vectors
  */
-VG_STATIC void render_water_texture( world_instance *world, camera *cam )
+VG_STATIC void render_water_texture( world_instance *world, camera *cam,
+                                     int layer_depth )
 {
    if( !world->water.enabled || (vg.quality_profile == k_quality_profile_low) )
       return;
@@ -91,7 +92,7 @@ VG_STATIC void render_water_texture( world_instance *world, camera *cam )
     * Draw world
     */
    glCullFace( GL_FRONT );
-   render_world( world, &water_cam );
+   render_world( world, &water_cam, layer_depth );
    glCullFace( GL_BACK );
    
    /*