Optical properties of nanogranular and highly porous TiO2thin films