         @background_alpha = if ba? then ba else 1
         @compiled_shaders_this_frame = 0
         @use_frustum_culling = true
+        @unbind_textures_on_draw_mesh = false
+        @unbind_textures_on_draw_wiewport = true
         @probes = []
 
         # Temporary variables

        inv_radius_y = 2/inv_radius_y
        inv_radius_z = 2/inv_radius_z

        # Main routine for each submesh
        submesh_idx = -1

        for mat in amesh.materials
            submesh_idx += 1
            if not (pass_ == -1 or mesh.passes[submesh_idx] == pass_)
                continue


        # For usage outside this render loop
        mat4.mul cam.world_to_screen_matrix, cam.projection_matrix, world2cam

        # TODO: Is this necessary?
        if @unbind_textures_on_draw_wiewport
            # unbind all textures
            for tex, i in @bound_textures when tex?
                tex.bound_unit = -1
                gl.activeTexture gl.TEXTURE0 + i
                gl.bindTexture tex.gl_target, null
            gl.activeTexture gl.TEXTURE0
            @active_texture = @next_texture = 0
            @bound_textures.splice 0

        {mesh_lod_min_length_px} = @context

