In this study, the depth calculation error caused by thermal effects are estimated for different materials by adopting diffraction optical coding, thermal deformation simulation, and depth calculation model. Temperature increase in a diffractive element leads to microstructure deformation, therefore result in diffractive pattern shift: The displacement of the diffraction spots would result in a depth calculation error. From the simulation results, fused silica at a temperature of 60 degree has the depth error about 0.007 mm, that it is much lower than the IR camera imaging resolution (0.2 mm). Compared to acrylic material, the depth error is approximately 0.885 mm under the same simulation condition. The results indicate that the diffraction components based on fused silica materials are currently the best solution for high precision measurement requirements.