A method is provided for forming complex tissue using density gradient multilayer polymerization (DGMP) to form strong hydrogels with smooth transitions between layers. The multicompartment hydrogel is formed by co-dissolving a polymer precurser with a constituent in multiple solvent fractions to a create prepolymer solutions with different densities, layering the prepolymer solutions on top of each other from high to low solvent density, and irradiating the prepolymer solutions to form a polymer. The hydrogels may be used as biomimetic matrices.