Daylight can significantly reduce the need for artificial lighting sources inside a building and save energy for the building. It is of great significance to the practical operation of carbon peak, carbon neutralization and building energy conservation in China. Meanwhile, suitable daylight can bring a comfortable working environment for the building, which has a positive effect on the long-term focus of the indoor human eyes. However, the occurrence of daylight glare seriously affects the comfort of the building in daylight environment. A representative office in Shenyang is chosen to simulate lighting environment under the application of Ladybug and Honeybee plugins for Grasshopper to automate the calculation of the China Daylight Glare Index( DGI China) . Glare influence factors of shading count and shading depth are simulated and analyzed in order to optimize the lighting environment of the office. The light environment simulation shows that shading count and shading depth have a significant impact on the internal glare of office buildings under natural lighting conditions. However, as window height, glass type, indoor layout and other factors all have significant influence on glare generated by daylight, the single effect of shading facilities is not enough to make an accurate decision when determining the scheme to avoid glare, and the uncomfortable light environment under the influence of multiple factors remains to be studied in further study.