The author has simulated behavior of geomaterials based on the modified models of Drucker-Prager-Nikolaevski and Rudnicki. It is shown how fractures extend under stresses applied on a section of a specimen surface. The characteristic patterns are obtained for deformation localization in low porosity and high porosity sandstone under biaxial compression, and the stress-to-strain curves are plotted.