A method of generating an optical device comprising a germanium structure , the method comprising: providing an assembly comprising a silicon substrate having an oxide layer on a surface thereof, wherein the oxide layer comprises a number of trenches , each trench extending to and exposing a portion of the surface of the silicon substrate , wherein a trench depth is larger than a trench width, the number of trenches being at least one; performing an epitaxial depositing process on the assembly to grow up a germanium crystal of the germanium structure on each exposed portion of the silicon substrate , each germanium crystal being formed in the associated trench and on regions of the oxide layer adjoining the associated trench , wherein the epitaxial depositing process comprises: depositing germanium onto the assembly during a first phase; performing an etch process during a second phase following the first phase in order to remove germanium from the oxide layer ; and repeating the first and second phases; forming electrical connections to parts of the germanium structure and/or the silicon substrate so as to generate a sensor element capable of converting incident light into an electrical signal, wherein at least parts of the silicon substrate and/or the germanium structure are doped so that a pn junction or a pin junction is formed by the silicon substrate and the germanium structure , wherein the germanium structure has a raw textured surface forming a light incidence surface of the optical device without further processing the germanium structure , wherein the orientation of the surface of the silicon substrate on which the germanium structure is formed is <100>, wherein the raw textured surface comprises a pyramid shape associated with the or each germanium crystal. providing an assembly comprising a silicon substrate having an oxide layer on a surface thereof, wherein the oxide layer comprises a number of trenches , each trench extending to and exposing a portion of the surface of the silicon substrate , wherein a trench depth is larger than a trench width, the number of trenches being at least one; performing an epitaxial depositing process on the assembly to grow up a germanium crystal of the germanium structure on each exposed portion of the silicon substrate , each germanium crystal being formed in the associated trench and on regions of the oxide layer adjoining the associated trench , wherein the epitaxial depositing process comprises: depositing germanium onto the assembly during a first phase; performing an etch process during a second phase following the first phase in order to remove germanium from the oxide layer ; and repeating the first and second phases; depositing germanium onto the assembly during a first phase; performing an etch process during a second phase following the first phase in order to remove germanium from the oxide layer ; and repeating the first and second phases; forming electrical connections to parts of the germanium structure and/or the silicon substrate so as to generate a sensor element capable of converting incident light into an electrical signal, wherein at least parts of the silicon substrate and/or the germanium structure are doped so that a pn junction or a pin junction is formed by the silicon substrate and the germanium structure , wherein the germanium structure has a raw textured surface forming a light incidence surface of the optical device without further processing the germanium structure , wherein the orientation of the surface of the silicon substrate on which the germanium structure is formed is <100>, wherein the raw textured surface comprises a pyramid shape associated with the or each germanium crystal. <EOS>