Shape from shading is an ill-posed inverse problem for which there is no completely satisfactory solution in the existing literature. In this paper, we address shape from shading as an energy minimization problem. We first show that the deterministic approach provides efficient algorithms in terms of CPU time, but reaches its limits since the energy associated with shape from shading can contain multiple deep local minima. We derive an alternative stochastic approach using simulated annealing. The obtained results strongly outperform the results of the deterministic approach. The shortcoming is an extreme slowness of the optimization. Therefore, we propose a hybrid approach which combines the deterministic and stochastic approaches in a multiresolution framework.