Shadow rendering method and apparatus, computer device, and storage medium
AssigneeTencent Technology (Shenzhen) Company Limited
InventorCangjian HOU
Life of this patent
Estimating the term…
Abstract
This application discloses a shadow rendering method and apparatus, a computer device, and a storage medium, the method including: obtaining at least one rendering structure in a virtual scene according to an illumination direction in the virtual scene; obtaining model coordinates of a plurality of pixels according to a current viewing angle associated with the virtual scene and depth information of the plurality of pixels; sampling at least one shadow map according to the model coordinates of the plurality of pixels to obtain a plurality of sampling points corresponding to the plurality of pixels; and rendering the plurality of sampling points in the virtual scene to obtain at least one shadow associated with the at least one virtual object.
Claims20
A shadow rendering method, performed by a computer device, the method comprising:
- obtaining at least one rendering structure in a virtual scene according to an illumination direction in the virtual scene, the at least one rendering structure comprising a plurality of pixels in the virtual scene;
- obtaining world coordinates of the plurality of pixels in the virtual scene according to the illumination direction and depth information of the plurality of pixels;
- obtaining model coordinates of the plurality of pixels by left multiplying a view matrix of the illumination direction by the world coordinates of the plurality of pixels;
- sampling at least one shadow map according to the model coordinates of the plurality of pixels to obtain a plurality of sampling points corresponding to the plurality of pixels;
- and
- rendering the plurality of sampling points in the virtual scene to obtain a shadow of the at least one rendering structure.
A computer device, comprising a memory and a processor, the memory storing computer-readable instructions, and the computer-readable instructions, when executed by the processor, causing the processor to perform the following operations:
- obtaining at least one rendering structure in a virtual scene according to an illumination direction in the virtual scene, the at least one rendering structure comprising a plurality of pixels in the virtual scene;
- obtaining world coordinates of the plurality of pixels in the virtual scene according to the illumination direction and depth information of the plurality of pixels;
- obtaining model coordinates of the plurality of pixels by left multiplying a view matrix of the illumination direction by the world coordinates of the plurality of pixels;
- sampling at least one shadow map according to the model coordinates of the plurality of pixels to obtain a plurality of sampling points corresponding to the plurality of pixels;
- and
- rendering the plurality of sampling points in the virtual scene to obtain a shadow of the at least one rendering structure.
One or more non-transitory computer-readable storage media storing computer-readable instructions, the computer-readable instructions, when executed by one or more processors of a computer device, causing the computer device to perform a plurality of operations including:
- obtaining at least one rendering structure in a virtual scene according to an illumination direction in the virtual scene, the at least one rendering structure comprising a plurality of pixels in the virtual scene;
- obtaining world coordinates of the plurality of pixels in the virtual scene according to the illumination direction and depth information of the plurality of pixels;
- obtaining model coordinates of the plurality of pixels by left multiplying a view matrix of the illumination direction by the world coordinates of the plurality of pixels;
- sampling at least one shadow map according to the model coordinates of the plurality of pixels to obtain a plurality of sampling points corresponding to the plurality of pixels;
- and
- rendering the plurality of sampling points in the virtual scene to obtain a shadow of the at least one rendering structure.
Dependencies are inferred from the claim text.