void GetMaterials(out float smoothness,out float metalness,out float f0,out float skymapMod,
out vec3 normal,out vec3 spec,vec2 coord){
    vec3 specularData=texture2D(colortex3,coord).rgb;
    
    #if MATERIAL_FORMAT==0
    smoothness=specularData.r;
    
    f0=specularData.g;
    metalness=f0>=.9?1.:0.;
    #endif
    
    #if MATERIAL_FORMAT==1
    smoothness=specularData.r;
    
    metalness=specularData.g;
    f0=.78*metalness+.02;
    #endif
    
    normal=DecodeNormal(texture2D(colortex6,coord).xy);
    
    spec=texture2D(colortex7,coord).rgb;
    
    skymapMod=specularData.b;
}