A method for the fabrication of a porous layer with controlled pores distribution in a semiconductor substrate having a free surface by anodic etching, including the steps of: - selecting a desired density of pores; - selecting: ∘ a relative concentration of one or more components of a first etching solution, said components comprising an acid and possibly a surfactant and/or an oxidizing agent, and/or ∘ a parameter of a first current, and/or ∘ an intensity of an electromagnetic radiation impinging on a free surface of the semiconductor substrate, on the basis of said desired density of pores; - contacting the free surface of the semiconductor substrate with the first chemical etching solution, and, during the contact, applying the first current so as to form a first porous layer having substantially the desired density of pores; - changing: ∘ the parameter of the first current, obtaining a second current, and/or ∘ the relative concentration of one or more components of the first etching solution, obtaining a second etching solution, and/or ∘ the intensity of the electromagnetic radiation impinging on the free surface of the semiconductor substrate, so as to continue to etch the semiconductor substrate and form a second porous layer underneath the first porous layer, in such a way that the second porous layer has pores having a mean pore dimension larger than a mean pore dimension of the pores of the first porous layer; - selecting a region of the semiconductor where the first and second porous layer (101, 105) are present; - in that selected region removing: ∘ the first porous layer completely, and ∘ the second porous layer partially, to obtain a new free surface of the semiconductor substrate on which indentations are formed having a controlled distribution; - anodically etching the new free surface to form a third porous layer having a pores distribution function of the distribution of the indentations. - selecting a desired density of pores; - selecting: ∘ a relative concentration of one or more components of a first etching solution, said components comprising an acid and possibly a surfactant and/or an oxidizing agent, and/or ∘ a parameter of a first current, and/or ∘ an intensity of an electromagnetic radiation impinging on a free surface of the semiconductor substrate, on the basis of said desired density of pores; ∘ a relative concentration of one or more components of a first etching solution, said components comprising an acid and possibly a surfactant and/or an oxidizing agent, and/or ∘ a parameter of a first current, and/or ∘ an intensity of an electromagnetic radiation impinging on a free surface of the semiconductor substrate, on the basis of said desired density of pores; - contacting the free surface of the semiconductor substrate with the first chemical etching solution, and, during the contact, applying the first current so as to form a first porous layer having substantially the desired density of pores; - changing: ∘ the parameter of the first current, obtaining a second current, and/or ∘ the relative concentration of one or more components of the first etching solution, obtaining a second etching solution, and/or ∘ the intensity of the electromagnetic radiation impinging on the free surface of the semiconductor substrate, so as to continue to etch the semiconductor substrate and form a second porous layer underneath the first porous layer, in such a way that the second porous layer has pores having a mean pore dimension larger than a mean pore dimension of the pores of the first porous layer; ∘ the parameter of the first current, obtaining a second current, and/or ∘ the relative concentration of one or more components of the first etching solution, obtaining a second etching solution, and/or ∘ the intensity of the electromagnetic radiation impinging on the free surface of the semiconductor substrate, so as to continue to etch the semiconductor substrate and form a second porous layer underneath the first porous layer, in such a way that the second porous layer has pores having a mean pore dimension larger than a mean pore dimension of the pores of the first porous layer; - selecting a region of the semiconductor where the first and second porous layer (101, 105) are present; - in that selected region removing: ∘ the first porous layer completely, and ∘ the second porous layer partially, to obtain a new free surface of the semiconductor substrate on which indentations are formed having a controlled distribution; ∘ the first porous layer completely, and ∘ the second porous layer partially, to obtain a new free surface of the semiconductor substrate on which indentations are formed having a controlled distribution; - anodically etching the new free surface to form a third porous layer having a pores distribution function of the distribution of the indentations.