- m4x4_mul( projection, view, projection );
-
- render_world( projection, cam_new );
- render_water_texture( cam_new );
- glBindFramebuffer( GL_FRAMEBUFFER, grender.fb );
- render_water_surface( projection );
- glBindFramebuffer( GL_FRAMEBUFFER, 0 );
-
- shader_gate_use();
-
- m4x3f full;
- m4x3_copy( gate->to_world, full );
- m4x3_scalev( full, (v3f){ gate->dims[0], gate->dims[1], 1.0f } );
-
- shader_gate_uPv( vg_pv );
- shader_gate_uMdl( full );
-
- glActiveTexture( GL_TEXTURE0 );
- glBindTexture( GL_TEXTURE_2D, grender.rgb );
- shader_gate_uCam( viewpos );
- shader_gate_uTexMain( 0 );
- shader_gate_uTexWater( 1 );
- shader_gate_uTime( vg_time*0.25f );
- shader_gate_uInvRes( (v2f){
- 1.0f / (float)vg_window_x,
- 1.0f / (float)vg_window_y });
-
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
- glBlendEquation(GL_FUNC_ADD);