         bone.load_from_lists(d, [0,1,0,2,0,3,0,4,1,2,2,3,3,4,4,1,
                            5,1,5,2,5,3,5,4])
 
+        @color = color4.create()
         @material = mat = new Material @context, '_debug', {
             material_type: 'PLAIN_SHADER'
             vertex: plain_vs,
             fragment: plain_fs,
-            uniforms: [{varname:'color', value: color4.create()}],
+            uniforms: [{varname:'color', value: @color}],
         }
 
         for ob in [box, cylinder, cone, sphere, arrow, bone]
             ob.elements = []
             ob.stride = 4
             ob.materials = [mat]
-            ob.color = color4.new 1,1,1,1
             ob.data.draw_method = @context.render_manager.gl.LINES
             ob.scale = {x: 1, y:1, z:1}
             ob.rotation_order = 'Q'

        mesh.load_from_va_ia va, ia
        mesh.elements = []
        mesh.materials = [@material]
        mesh.color = color4.new 1,1,1,1 # TODO FIXME plain shader
        mesh.data.draw_method = render_manager.gl.LINES
        mesh.scale = vec3.new 1,1,1
        mesh._update_matrices()

        # Debug physics and vectors (TODO: move vector to debug properties?)
        if @context.MYOU_PARAMS.debug
            mm4 = mat4.create()
            {color} = @debug
            for ob in scene.children
                dob = ob.phy_debug_mesh
                if dob
                    if dob!=ob
                        ob.get_world_position_rotation_into dob.position, dob.rotation
                        vec3.copy dob.scale, ob.phy_he
                        dob._update_matrices()
                        # TODO: It's better to have a separate debug mesh
                        # than recalculating the matrices of the same mesh

                    # occluded pass
                    color4.set color, 1, 1, 1, .2
                    gl.enable gl.BLEND
                    gl.disable gl.DEPTH_TEST
                    @draw_mesh dob, dob.world_matrix
