  The process of the gravitational collapse might lead not only to a black hole
but also to naked singularity formation. In this paper, we consider the
generalized Vaidya spacetime with polytropic and generalized polytropic
equations of state. We solve the Einstein and Einstein-Maxwell equations to
obtain the explicit form of a mass function. We consider the limiting cases of
solutions and find out, that generalized Vaidya spacetime might behave like
Vaidya-de Sitter and Bonnor-Vaidya-de sitter solutions. Moreover, we explicitly
show, that the part of solution, which depends on the polytropic index, is
similar to cosmological fields surrounding both Vaidya and Bonnor-Vaidya black
holes. The process of the gravitational collapse has been then considered. We
have found out that the conditions of the naked singularity formation don't
depend on the polytropic index.
