What determines whether a material is transparent or opaque?

The atomic structure determines that. If light is absorbed by the atoms, then it is opaque.