+ enum font_shader {
+ k_font_shader_default,
+ k_font_shader_world
+ }
+ shader;
+}
+static gui_font3d;
+
+/*
+ * world can be null if not using world shader
+ */
+static void font3d_bind( font3d *font, enum font_shader shader,
+ int depth_compare, world_instance *world,
+ camera *cam ){
+ gui_font3d.shader = shader;
+ gui_font3d.font = font;
+ glActiveTexture( GL_TEXTURE1 );
+ glBindTexture( GL_TEXTURE_2D, font->texture );
+
+ if( shader == k_font_shader_default ){
+ shader_model_font_use();
+ shader_model_font_uColour( (v4f){1.0f,1.0f,1.0f,1.0f} );
+ shader_model_font_uTexMain( 1 );
+
+ shader_model_font_uDepthCompare( depth_compare );
+ if( depth_compare ){
+ depth_compare_bind(
+ shader_model_font_uTexSceneDepth,
+ shader_model_font_uInverseRatioDepth,
+ shader_model_font_uInverseRatioMain, cam );
+ }
+
+ shader_model_font_uPv( cam->mtx.pv );
+ }
+ else if( shader == k_font_shader_world ){
+ assert( world );
+ shader_scene_font_use();
+ shader_scene_font_uTexGarbage(0);
+ shader_scene_font_uTexMain(1);
+
+ shader_scene_font_uPv( skaterift.cam.mtx.pv );
+ shader_scene_font_uTime( vg.time );
+
+ WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( world, scene_font );
+
+ bind_terrain_noise();
+ shader_scene_font_uCamera( skaterift.cam.transform[3] );
+ }