hottub.patents
US 12,229,879 B2#3608654 Most CitedActiveUnited States (USPTO)Utility

Image rendering method and related apparatus, terminal and storage medium

0Forward Citations (#3608654 Global)
0.0/yrCitation Velocity (#3608654 Global)
0.00Citation PageRank (#3608654 Global)
7Prior Art Cited
20Claims (3 Indep. · 17 Dep.)
9Drawings / Sheets

Abstract

An image rendering method and a related apparatus, terminal and storage medium that: obtains a low-resolution first shadow map and a high-resolution second shadow map of a target virtual object, determines a first texel range of each texel and a central point in the first shadow map, performs scaling processing, based on the central point, on the first texel range by using a scaling coefficient to obtain a second texel range, and performs shadow rendering on the target virtual object according to the second texel range. A shadow map-based image rendering process is implemented, and since a calculation amount of determining a map position according to a low-resolution map is relatively small, image rendering efficiency is improved. Additionally, rendering of a high-resolution shadow map is completed, generation of edge aliasing is avoided, and an image rendering effect is improved.

Interactive Citation Constellation Global Citation Ranking

Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 7 · Forward citations: 0.

Claims (20 — 3 Independent, 17 Dependent)

  1. Claim 1Independent Claim

    An image rendering method, performed by a terminal, the method comprising: obtaining a first shadow map and a second shadow map of a target virtual object, a resolution of the first shadow map being less than a resolution of the second shadow map; determining a first texel range of each texel and a central point in the first shadow map, the first texel range being set based on a transition distance of a shadow edge and the transition distance being used for indicating a shadow edge of the target virtual object in the first shadow map; performing, based on the central point, scaling processing on the first texel range by using a scaling coefficient to obtain a second texel range, the scaling coefficient being obtained based on a ratio of the resolution of the first shadow map to the resolution of the second shadow map; and performing shadow rendering on the target virtual object according to the second texel range.

  2. Claim 2Depends on #1

    The image rendering method according to claim 1, wherein after the performing, based on the central point, scaling processing on the first texel range the method further comprises: obtaining a distance set of the central point to texel points in the second texel range; extracting a texel point meeting an extraction condition from the distance set to determine an edge distance; and determining a shadow edge region of the target virtual object according to the edge distance; and the performing shadow rendering on the target virtual object according to the second texel range comprises: rendering a corresponding part of the second shadow map based on the shadow edge region to perform shadow rendering on the target virtual object.

  3. Claim 3Depends on #2

    The image rendering method according to claim 2, wherein the obtaining a distance set of the central point to texel points in the second texel range comprises: determining a first shadow value of the first shadow map, the first shadow value being determined based on an intersection situation of a first ray and the target virtual object, and the first ray being used for indicating a connecting line between the first shadow map and a light source; determining a second shadow value of the second shadow map, the second shadow value being determined based on an intersection situation of a second ray and the target virtual object, and the second ray being used for indicating a connecting line between the second shadow map and the light source; and obtaining the distance set of the central point to the texel points in the second texel range in a case that the first shadow value and the second shadow value are different.

  4. Claim 4Depends on #3

    The image rendering method according to claim 3, wherein the obtaining a distance set of the central point to texel points in the second texel range comprises: determining texel points covered by pixels occupied by the target virtual object in the second texel range; and determining the distance set according to the texel points covered by the pixels.

  5. Claim 5Depends on #1

    The image rendering method according to claim 1, wherein the performing shadow rendering on the target virtual object according to the second texel range comprises: mapping texel points in the second texel range into a texel point in the corresponding first texel range to generate an association texel, the association texel being used for indicating a correspondence between one of the texel points in the first texel range and a plurality of texel points in the second texel range; separately determining distance field values in the association texel; and performing shadow rendering based on the distance field values.

  6. Claim 6Depends on #5

    The method according to claim 5, wherein the performing shadow rendering based on the distance field values comprises: performing iterative calculation based on the distance field values, to determine a change situation of the distance field values; determining a minimum value of the distance field values based on the change situation of the distance field values; and performing shadow rendering based on the minimum value of the distance field values.

  7. Claim 7Depends on #1

    The image rendering method according to claim 1, wherein the performing shadow rendering on the target virtual object according to the second texel range comprises: obtaining shape information of the light source; determining a penumbra parameter according to the shape information and the second texel range; and performing shadow rendering on the target virtual object based on the penumbra parameter.

  8. Claim 8Depends on #1

    The method according to claim 1, wherein the target virtual object is a virtual object in a game.

  9. Claim 9Depends on #1

    The image rendering method according to claim 1, further comprising: obtaining a map packet, the map packet being used for indicating shadow rendering of a target virtual object, and the map packet comprising shadow maps under at least two resolutions; performing preprocessing on the map packet in a central processing unit (CPU); and inputting the preprocessed map packet into a graphics processing unit (GPU).

  10. Claim 10Depends on #9

    The image rendering method according to claim 9, wherein the performing preprocessing on the map packet in a CPU comprises: parsing scene information in the map packet by using the CPU; and converting the shadow maps under at least two resolutions into a same coordinate system according to the scene information.

  11. Claim 11Depends on #9

    The image rendering method according to claim 9, wherein the performing preprocessing on the map packet in a CPU comprises: rasterizing the target virtual object by using the CPU to obtain a plurality of target patches, the target patch being used for indicating a position of a shadow region.

  12. Claim 12Independent Claim

    An image rendering apparatus, comprising: at least one memory configured to store computer program code; at least one processor configured to operate as instructed by the computer program code, the computer program code including: obtaining code configured to cause the at least one processor to obtain a first shadow map and a second shadow map of a target virtual object, a resolution of the first shadow map being less than a resolution of the second shadow map; determining code configured to cause the at least one processor to determine a first texel range of each texel and a central point in the first shadow map, the first texel range being set based on a transition distance of a shadow edge, and the transition distance being used for indicating a shadow edge of the target virtual object in the first shadow map; scaling code configured to cause the at least one processor to perform, based on the central point, scaling processing on the first texel range by using a scaling coefficient to obtain a second texel range, the scaling coefficient being obtained based on a ratio of the resolution of the first shadow map to the resolution of the second shadow map; and rendering code configured to cause the at least one processor to perform shadow rendering on the target virtual object according to the second texel range.

  13. Claim 13Depends on #12

    The image rendering apparatus according to claim 12, wherein the scaling code is further configured to cause the at least one processor: obtain a distance set of the central point to texel points in the second texel range; extract a texel point meeting an extraction condition from the distance set to determine an edge distance; and determine a shadow edge region of the target virtual object according to the edge distance; and the rendering code is configured to cause the at least one processor to: render a corresponding part of the second shadow map based on the shadow edge region to perform shadow rendering on the target virtual object.

  14. Claim 14Depends on #13

    The image rendering apparatus according to claim 13, wherein the obtain a distance set of the central point to texel points in the second texel range comprises: determining a first shadow value of the first shadow map, the first shadow value being determined based on an intersection situation of a first ray and the target virtual object, and the first ray being used for indicating a connecting line between the first shadow map and a light source; determining a second shadow value of the second shadow map, the second shadow value being determined based on an intersection situation of a second ray and the target virtual object, and the second ray being used for indicating a connecting line between the second shadow map and the light source; and obtaining the distance set of the central point to the texel points in the second texel range in a case that the first shadow value and the second shadow value are different.

  15. Claim 15Depends on #14

    The image rendering apparatus according to claim 14, wherein the obtaining a distance set of the central point to texel points in the second texel range comprises: determining texel points covered by pixels occupied by the target virtual object in the second texel range; and determining the distance set according to the texel points covered by the pixels.

  16. Claim 16Depends on #15

    The image rendering apparatus according to claim 15, wherein the rendering code is configured to cause the at least one processor to: map texel points in the second texel range into a texel point in the corresponding first texel range to generate an association texel, the association texel being used for indicating a correspondence between one of the texel points in the first texel range and a plurality of texel points in the second texel range; separately determine distance field values in the association texel; and perform shadow rendering based on the distance field values.

  17. Claim 17Depends on #16

    The image rendering apparatus according to claim 16, wherein the rendering code is further configured to cause the at least one processor to: perform iterative calculation based on the distance field values, to determine a change situation of the distance field values; determine a minimum value of the distance field values based on the change situation of the distance field values; and perform shadow rendering based on the minimum value of the distance field values.

  18. Claim 18Depends on #15

    The image rendering apparatus according to claim 15, wherein the rendering code is configured to cause the at least one processor to: obtain shape information of the light source; determine a penumbra parameter according to the shape information and the second texel range; and perform shadow rendering on the target virtual object based on the penumbra parameter.

  19. Claim 19Independent Claim

    A non-transitory computer-readable storage medium, storing computer code that when executed by at least one processor causes the at least one processor to: obtain a first shadow map and a second shadow map of a target virtual object, a resolution of the first shadow map being less than a resolution of the second shadow map; determine a first texel range of each texel and a central point in the first shadow map, the first texel range being set based on a transition distance of a shadow edge and the transition distance being used for indicating a shadow edge of the target virtual object in the first shadow map; perform, based on the central point, scaling processing on the first texel range by using a scaling coefficient to obtain a second texel range, the scaling coefficient being obtained based on a ratio of the resolution of the first shadow map to the resolution of the second shadow map; and perform shadow rendering on the target virtual object according to the second texel range.

  20. Claim 20Depends on #19

    The non-transitory computer-readable storage medium according to claim 19, wherein after the performing, based on the central point, scaling processing on the first texel range the computer code causes the at least one processor to: obtain a distance set of the central point to texel points in the second texel range; extract a texel point meeting an extraction condition from the distance set to determine an edge distance; and determine a shadow edge region of the target virtual object according to the edge distance; and the perform shadow rendering on the target virtual object according to the second texel range comprises: rendering a corresponding part of the second shadow map based on the shadow edge region to perform shadow rendering on the target virtual object.

Technical Overview & Description

CROSS-REFERENCE TO RELATED APPLICATION(S) This application is a continuation application of International Application No. PCT/CN2020/127667, filed on Nov. 10, 2020, which claims priority to Chinese Patent Application No. 202010081668.9, filed with the China National Intellectual Property Administration on Feb. 6, 2020, the disclosures of which are incorporated by reference in its entireties. FIELD The present disclosure relates to the field of computer technologies, and in particular, to an image rendering method and a related apparatus. BACKGROUND In many application programs constructing a three-dimensional virtual environment, shadow display of a virtual object is an important mean to improve a display effect of the three-dimensional virtual environment. Generally, in game rendering, a shadow map technology is used to calculate a shadow of an object in real time. Shadow map rendering is first performed on a scene in the view of a light source to store distance information of the object to the light source, and normal rendering is then performed from a point of sight on each pixel in the scene to calculate a position of the light source. In addition, the distance information is compared with a distance stored in a shadow map, to determine whether the object is in a shadow, and further calculate the shadow of the object according to a situation of the shadow. However, the shadow map needs to be rendered based on a view of sight of the light source, and sampling need to be performed on the shadow map during normal rendering to perform shadow calculation. When the scene complexity is relatively high, namely, there are a large number of objects and light sources, if shadow calculation of the entire scene is performed on the light sources one by one, a calculation amount is huge, and shadow rendering efficiency is affected, and if shadow calculation is performed through partial sampling, a phenomenon of edge aliasing may be easily generated, and a shadow rendering effe

Cited By — Indexed Forward Citations (0 of 0 total)

No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.

References Cited — Backward Prior Art (7)

PatentTitleYearCitations

Non-Patent Literature (8)

  • International Search Report dated Feb. 18, 2021 issued in International Application No. PCT/CN2020/127667.
  • Written Opinion dated Feb. 18, 2021 issued in International Application No. PCT/CN2020/127667.
  • Extended European Search Report issued Feb. 28, 2023 in European Application No. 20917446.5.
  • Yin Jin,
  • “
  • Research of an Algorithm of Real-time Shadow Rendering Based on Shadow Map Anti-aliasing
  • ”
  • , Chinese Master's Theses Full-Text Database, 2011, pp. 1-40 (48 pages total).