The paper discusses the HDRI usage as daylight light source and background for rendering of scenes containing complex optical materials (cloth, pearlescent paint). Physically correct simulation algorithms for calculation of pixel intensity, sun recognition and shadow generation are described. Available HDRI are analyzed, their drawbacks are described. Modifications of lighting simulation algorithm for HDRI drawbacks compensation are proposed. They are based on standard sky models elaborated by International Illumination Committee (CIE). Modified algorithms produce more correct results. They are automated and stable against HDRI drawbacks. Algorithms are used in several rendering systems for generation of photorealistic images.