         if not gl.getShaderParameter(fragment_shader, gl.COMPILE_STATUS) and not gl.isContextLost()
             error_msg = """Error compiling fragment shader of material #{@name}
             #{gl.getShaderInfoLog fragment_shader}"""
+            console.log fs
             # ext = gl.getExtension "WEBGL_debug_shaders"
             # if ext
             #     console.log  '\n' + ext.getTranslatedShaderSource(fragment_shader)).split('\n')

                    attribute_asgn += v+"="+a.varname+";\n"
                    @attrib_locs[a.varname] = -1
                when CD_TANGENT # tangent vectors
                    attribute_decl += "attribute vec4 tangent;\n"\
                        +"varying vec4 "+v+";\n"
                    #attribute_asgn += v+".xyz = normalize("\
                        #+var_model_view_matrix+"*vec4("+a.varname+",0.0)).xyz;\n"
                    attribute_asgn += v+".xyz = normalize(("+var_model_view_matrix+"*vec4(tangent.xyz,0)).xyz);\n"
                    attribute_asgn += v+".w = tangent.w;\n"
                    @attrib_locs["tangent"] = -1
                when 99 # shape key
                    num_shapes = a.count
                    for i in [0...num_shapes]
                        attribute_decl += "attribute vec3 shape"+i+";\n"


        return cloned

module.exports = {Material,
CD_MCOL, CD_MTFACE, CD_ORCO, CD_TANGENT, CD_SHAPE_KEY, CD_ARMATURE_DEFORM,
CD_ARMATURE_DEFORM_6, GPU_DATA_1I, GPU_DATA_1F, GPU_DATA_2F, GPU_DATA_3F,
GPU_DATA_4F, GPU_DATA_9F, GPU_DATA_16F, GPU_DATA_4UB, GPU_DYNAMIC_AMBIENT_COLOR,
GPU_DYNAMIC_GROUP_LAMP, GPU_DYNAMIC_GROUP_MAT, GPU_DYNAMIC_GROUP_MISC,
GPU_DYNAMIC_GROUP_MIST, GPU_DYNAMIC_GROUP_OBJECT, GPU_DYNAMIC_GROUP_SAMPLER,
GPU_DYNAMIC_GROUP_WORLD, GPU_DYNAMIC_HORIZON_COLOR, GPU_DYNAMIC_LAMP_ATT1,
GPU_DYNAMIC_LAMP_ATT2, GPU_DYNAMIC_LAMP_DISTANCE, GPU_DYNAMIC_LAMP_DYNCO,
GPU_DYNAMIC_LAMP_DYNCO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