One way to handle devices of varying capabilities that works for both meshes & materials is to have separate directories, say desktop & mobile. Each directory has everything required. The script determines which & uses it for loading.
My question is how do you tell?