The invention discloses a real-time soft shadow realization method based on an image
screen space. The method comprises the following steps that: A, all objects in a
visible range of a
virtual camera in a scene are traversed; B, a
light source space is built, a
vein used for storing the depth in a
screen space is created, and a shadow map is generated; C, a world position coordinate is converted into a lamp light space through projection conversion, and a
depth map of new positions of pixels is obtained; D, the depth of the new positions of the pixels is compared with the shadow map to judge which pixels are positioned in the shadow, so that a
shadow mask is obtained; E, the
shadow mask is subjected to
Gaussian blur
processing; and F, the shadow mark subjected to the
Gaussian blur
processing is overlaid with the scene color, and a soft
shadow effect is achieved. The real-time soft shadow realization method has the advantages that the traditional PCF (Percentage Closer Filtering) based on sampling veins is improved; the problem of the phenomenon of saw tooth generation on the boundary of a scene model is effectively solved; a better soft
shadow effect is achieved; in addition, the effect of realizing the soft
shadow effect on complicated scenes is also very good; and the drawing efficiency is high.