the present invention not only can shield light efficiently but also has the advantage of low fabrication cost in other words fabricating the shielding layer according to the present invention needs fewer masks no black photoresist and thus is able to avoid the contamination of black pigment consider a cmos image sensor for example regarding the preferred embodiment of the present invention please refer to fig2 to fig4 fig2 to fig4 are sectional views of the cmos image sensor fig2 to fig4 illustrate a preferred embodiment for fabricating the according to the method of the present invention as shown in fig2 the cmos image sensor can be divided into a sensing region i that senses incident lights and a peripheral circuit region ii outside the sensing region i the sensing region i includes color filter array cfa and sensing elements 232 234 236 on the substrate 240 before fabricating the shielding layer according to the present invention the sensing elements 232 234 236 and other elements under the cfa are formed among those elements a patterned metal layer 214 is formed under where the cfa will be formed the patterned metal layer 214 is used to prevent light from being scattered through the intervals of the cfa therefore the pattern of the metal layer is dependent on the pattern of the cfa and metal only exists in areas under the intervals of the cfa in addition a metal pad 204 may be formed on the peripheral circuit region ii according to requirements after.