bvh interface and high perf gate
[carveJwlIkooP6JGAAIwe30JlM.git] / main.c
diff --git a/main.c b/main.c
index 6b9e4d9ab8a978c55a0cc19073170bad4c648557..6b38fc5401b69366bb36a1872d3b81c7c4451b06 100644 (file)
--- a/main.c
+++ b/main.c
@@ -68,14 +68,6 @@ rigidbody mrs_box = {
    .bbx = {{ -0.5f, -0.25f, -0.25f }, { 0.5f, 0.25f, 0.25f }}
 };
 
-teleport_gate gate_a = {
-   .co = { 0.0f, -3.0f, -15.0f },
-   .q = { 0.0f, 0.0f, 0.0f, 1.0f }
-}, 
-gate_b = {
-   .co = { -8.0f, -3.0f, -17.0f },
-   .q = { 0.0f, 0.0f, 0.0f, 1.0f }
-};
 #endif
 
 static int playermodel( int argc, char const *argv[] )
@@ -172,7 +164,7 @@ void vg_render(void)
 
    glDisable( GL_DEPTH_TEST );
    glClearColor( 0.11f, 0.35f, 0.37f, 1.0f );
-   glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+   glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
 
    float speed = freecam? 0.0f: v3_length( player.v );
    v3f shake = { vg_randf()-0.5f, vg_randf()-0.5f, vg_randf()-0.5f };
@@ -205,7 +197,7 @@ void vg_render(void)
    m4x4f world_4x4;
    m4x3_expand( player.camera_inverse, world_4x4 );
 
-   gpipeline.fov = freecam? 60.0f: 100.0f; /* 120 */
+   gpipeline.fov = freecam? 60.0f: 120.0f; /* 120 */
    m4x4_projection( vg_pv, gpipeline.fov, 
          (float)vg_window_x / (float)vg_window_y, 
          0.025f, 1000.0f );
@@ -228,10 +220,12 @@ void vg_render(void)
    glBindFramebuffer( GL_FRAMEBUFFER, 0 );
    render_water_surface( vg_pv );
 
-#if 0
    vg_tex2d_bind( &tex_water, 1 );
-   render_gate( &gate_a, cam_transform );
-#endif
+
+   for( int i=0; i<world.gate_count; i++ )
+   {
+      render_gate( &world.gates[i], player.camera );
+   }
 
    
    /* Copy the RGB of what we have into the background buffer */