hottub.patents
US 12,469,200 B2#3396714 Most CitedActiveUnited States (USPTO)Utility

Method, apparatus and device for processing shadow texture, computer-readable storage medium, and program product

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

Abstract

A method for processing a shadow texture can compute data concurrently to improve computation density, reduce data transmission batches, and improve shadow texture processing efficiency. Model data and light source information of at least one object in a virtual scene is acquired. A shadow with a first resolution corresponding to each object is acquired. A second resolution is determined based on the model data of each object. A shadow edge formed by each object under the influence of the light source information is determined in parallel by utilizing rasterized pixels of the model data. The distance from the rasterized pixels to the shadow edge corresponding to each object is computed, and the corresponding distance data is stored.

Interactive Citation Constellation Global Citation Ranking

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

Claims (20 — 3 Independent, 17 Dependent)

  1. Claim 1Independent Claim

    A method for processing a shadow texture comprising: acquiring model data and light source information of at least one object in a virtual scene; acquiring a shadow texture with a first resolution corresponding to each of the at least one object; determining a corresponding second resolution based on the model data of each of the at least one object, the second resolution representing a resolution of expanding the model data based on a surface area, the second resolution being higher than the first resolution; determining a shadow edge formed by each of the at least one object under an influence of the light source information in parallel by utilizing rasterized pixels of the model data under the second resolution; computing a distance from the rasterized pixels to the shadow edge corresponding to each of the at least one object in parallel to obtain a distance data corresponding to each of the at least one object of the shadow texture with the first resolution; and storing the distance data to the shadow texture with the first resolution to obtain a distance field shadow texture corresponding to each of the at least one object.

  2. Claim 2Depends on #1

    The method according to claim 1, the light source information comprising a plurality of pieces of sub-light source information, and the method further comprising: screening out corresponding matched sub-light source information for each of the at least one object from the plurality of pieces of sub-light source information, the matched sub-light source information representing information of sub-light sources causing lighting influence on the at least one object; and rasterizing the model data of each of the at least one object under the second resolution to obtain the rasterized pixels of the model data under the second resolution.

  3. Claim 3Depends on #2

    The method according to claim 2, the determining the shadow edge further comprising: extracting the shadow edge formed by each of the at least one object under the influence of light source information from the rasterized pixels in parallel based on positions of texels corresponding to the rasterized pixels and the matched sub-light source information, the positions of the texels obtained by performing texture coordinate expansion on the model data of each of the at least one object.

  4. Claim 4Depends on #3

    The method according to claim 3, the extracting the shadow edge further comprising: emitting rays to the matched sub-light source information from the positions of the texels to perform parallel shadow coverage judgment on the rasterized pixels of each of the at least one object to obtain a shadow coverage information, the shadow coverage information representing whether the rasterized pixels are within a shadow; and determining the shadow edge formed by each of the at least one object under the influence of the light source information using the shadow coverage information.

  5. Claim 5Depends on #4

    The method according to claim 4, the determining the shadow edge using the shadow coverage information further comprising: classifying the rasterized pixels into shadow covered pixels and shadow uncovered pixels based on the shadow coverage information; screening to obtain edge pixels with adjacent rasterized pixels differentiating the shadow uncovered pixels and the shadow covered pixels; and simultaneously splicing the edge pixels to obtain the shadow edge of each of the at least one object.

  6. Claim 6Depends on #4

    The method according to claim 4, performed by an electronic device, the electronic device comprising a central processing unit and a graphics processing unit; wherein the rasterizing the model data further comprising: rasterizing the model data under the second resolution using the central processing unit to obtain the rasterized pixels of each of the least one object; the extracting the shadow edge further comprising: extracting the shadow edge formed by each of the at least one object under the influence of light source information from the rasterized pixels in parallel based on the positions of the texels corresponding to the rasterized pixels and the matched sub-light source information using the graphics processing unit; and the computing the distance from the rasterized pixels to the shadow edge further comprising: computing the distance from the rasterized pixels to the shadow edge corresponding to each of the at least one object in parallel to obtain the distance data corresponding to each of the at least one object of the shadow texture with the first resolution using the graphics processing unit.

  7. Claim 7Depends on #6

    The method according to claim 6, further comprising: transmitting the rasterized pixels of each of the at least one object, the second resolution corresponding to each of the at least one object, the first resolution of each of the at least one object and the matched sub-light source information to the graphics processing unit using the central processing unit.

  8. Claim 8Depends on #6

    The method according to claim 6, the storing the distance data further comprising: receiving the distance data of each of the at least one object from the graphics processing unit; and coding the distance data of each of the at least one object using the central processing unit, and storing a corresponding coding result into pixels of the shadow texture with the first resolution to obtain the distance field shadow texture corresponding to each of the at least one object.

  9. Claim 9Depends on #1

    The method according to claim 1, the computing the distance from the rasterized pixels to the shadow edge further comprising: defining a super-sampling parameter as a ratio of the second resolution to the first resolution, the super-sampling parameter representing a pixel conversion relationship between the first resolution and the second resolution; screening out a plurality of sub-pixel blocks for pixels of the shadow texture with the first resolution from the rasterized pixels rasterized under the second resolution based on the super-sampling parameter; extracting a plurality of matched pixels corresponding to each of the plurality of sub-pixel blocks from the rasterized pixels based on the pixels of the shadow texture with the first resolution; screening out a shadow pixel which corresponds to each of the plurality of sub-pixel blocks and belongs to the shadow edge of each of the at least one object from the plurality of matched pixels; computing in parallel a shadow distance corresponding to each of the plurality of sub-pixel blocks based on a distance from each of the plurality of sub-pixel blocks to the shadow pixel; and determining a minimum shadow distance corresponding to the plurality of sub-pixel blocks as the distance data of each of the at least one object of the shadow texture with the first resolution.

  10. Claim 10Depends on #9

    The method according to claim 9, the computing in parallel the shadow distance further comprising: computing in parallel the distance from each of the plurality of sub-pixel blocks to the shadow pixel to obtain the shadow distance corresponding to each of the plurality of sub-pixel blocks; and determining a pixel distance corresponding to each of the plurality of sub-pixel blocks respectively as the shadow distance when obtaining the pixel distance for each of the plurality of sub-pixel blocks respectively.

  11. Claim 11Depends on #10

    The method according to claim 10, the extracting the plurality of matched pixels further comprising: selecting adjacent pixels for the pixels of the shadow texture with the first resolution; extracting a pixel set corresponding to the adjacent pixels from the rasterized pixels; determining a position of each of the plurality of sub-pixel blocks in the pixels of the shadow texture with the first resolution; and processing each of the plurality sub-pixel blocks by extracting a plurality of pixels with a same position as the sub-pixel block from the pixel set, and using the extracted plurality of pixels as the plurality of matched pixels corresponding to each of the plurality of sub-pixel blocks.

  12. Claim 12Depends on #1

    The method according to claim 1, wherein the at least one object is a plurality of objects, the first resolution comprising a plurality of sub-resolutions, and the method further comprising: classifying the plurality of objects by utilizing the plurality of sub-resolutions and the second resolution corresponding to the model data of each of the plurality of objects to obtain a plurality of object sets, the plurality of objects with a same sub-resolution and a same second resolution belonging to a same object set; processing the plurality of object sets in parallel by: rasterizing the model data corresponding to the plurality of objects based on the second resolution corresponding to the plurality of object sets to obtain rasterized pixels corresponding to the model data; determining shadow edges formed by the plurality of objects under the influence of the light source information in parallel by utilizing the rasterized pixels of the model data; computing a distance from the rasterized pixels to shadow edges corresponding to the plurality of objects in parallel to obtain the distance data corresponding to the plurality of objects; and respectively storing the distance data corresponding to the plurality of objects with the plurality of sub-resolutions corresponding to the plurality of object sets to obtain the distance field shadow texture corresponding to the plurality of objects.

  13. Claim 13Depends on #12

    The method according to claim 12, the classifying the plurality of objects further comprising: classifying the plurality of objects by utilizing the plurality of sub-resolutions to obtain a plurality of initial sets; defining a classification coefficient of the plurality of objects in each of the plurality of initials sets as a ratio of the second resolution corresponding to the plurality of objects in each of the plurality of initials sets to the plurality of sub-resolution corresponding to each of the plurality of initials sets; classifying the plurality of objects in each of the plurality of initial sets based on the classification coefficient to obtain a plurality of intermediate sets corresponding to each of the plurality of initial sets; and defining the plurality of object sets as the plurality of intermediate sets corresponding to each of the plurality of initial sets.

  14. Claim 14Depends on #1

    The method according claim 1, the method further comprising: rendering a corresponding model effect for the model data of each of the at least one object; sampling from the distance field shadow texture to obtain the distance data corresponding to each of the at least one object; performing shadow rendering on the model data using the distance data to obtain a shadow effect corresponding to each of the at least one object; and displaying the model effect and the shadow effect.

  15. Claim 15Independent Claim

    An apparatus for processing a shadow texture comprising at least one processor and at least one memory, the at least one memory storing computer-readable instructions, the computer-readable instructions, when executed by the at least on processor, causing the at least one processor to: acquire model data and light source information of at least one object in a virtual scene; acquire a shadow texture with a first resolution corresponding to each of the at least one object; determine a corresponding second resolution based on the model data of each of the at least one object, the second resolution representing a resolution of expanding the model data based on a surface area, the second resolution being higher than the first resolution; determine a shadow edge formed by each of the at least one object under an influence of the light source information in parallel by utilizing rasterized pixels of the model data under the second resolution; computing a distance from the rasterized pixels to the shadow edge corresponding to each of the at least one object in parallel to obtain a distance data corresponding to each of the at least one object of the shadow texture with the first resolution; and store the distance data to the shadow texture with the first resolution to obtain a distance field shadow texture corresponding to each of the at least one object.

  16. Claim 16Independent Claim

    A non-transitory computer-readable storage medium, storing at least one instruction, at least one program, a code set, or an instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by at least one processor, causing the at least one processor to perform a method for processing a shadow texture comprising: acquiring model data and light source information of at least one object in a virtual scene; acquiring a shadow texture with a first resolution corresponding to each of the at least one object; determining a corresponding second resolution based on the model data of each of the at least one object, the second resolution representing a resolution of expanding the model data based on a surface area, the second resolution being higher than the first resolution; determining a shadow edge formed by each of the at least one object under an influence of the light source information in parallel by utilizing rasterized pixels of the model data under the second resolution; computing a distance from the rasterized pixels to the shadow edge corresponding to each of the at least one object in parallel to obtain a distance data corresponding to each of the at least one object of the shadow texture with the first resolution; and storing the distance data to the shadow texture with the first resolution to obtain a distance field shadow texture corresponding to each of the at least one object.

  17. Claim 17Depends on #16

    The non-transitory computer-readable storage medium of claim 16, the method further comprising: the light source information comprising a plurality of pieces of sub-light source information, and the method further comprising: screening out corresponding matched sub-light source information for each of the at least one object from the plurality of pieces of sub-light source information, the matched sub-light source information representing information of sub-light sources causing lighting influence on the at least one object; and rasterizing the model data of each of the at least one object under the second resolution to obtain the rasterized pixels of the model data under the second resolution.

  18. Claim 18Depends on #17

    The non-transitory computer-readable storage medium of claim 17, the determining the shadow edge further comprising: extracting the shadow edge formed by each of the at least one object under the influence of light source information from the rasterized pixels in parallel based on positions of texels corresponding to the rasterized pixels and the matched sub-light source information, the positions of the texels obtained by performing texture coordinate expansion on the model data of each of the at least one object.

  19. Claim 19Depends on #16

    The non-transitory computer-readable storage medium of claim 16, wherein the at least one object is a plurality of objects, the first resolution comprising a plurality of sub-resolutions, and the method further comprising: rendering a corresponding model effect for the model data of each of the at least one object; sampling from the distance field shadow texture to obtain the distance data corresponding to each of the at least one object; performing shadow rendering on the model data using the distance data to obtain a shadow effect corresponding to each of the at least one object; and displaying the model effect and the shadow effect.

  20. Claim 20Depends on #16

    The non-transitory computer-readable storage medium of claim 16, wherein the at least one object is a plurality of objects, the first resolution comprising a plurality of sub-resolutions, and the method further comprising: classifying the plurality of objects by utilizing the plurality of sub-resolutions and the second resolution corresponding to the model data of each of the plurality of objects to obtain a plurality of object sets, the plurality of objects with a same sub-resolution and a same second resolution belonging to a same object set; processing the plurality of object sets in parallel by: rasterizing the model data corresponding to the plurality of objects based on the second resolution corresponding to the plurality of object sets to obtain rasterized pixels corresponding to the model data; determining shadow edges formed by the plurality of objects under the influence of the light source information in parallel by utilizing the rasterized pixels of the model data; computing a distance from the rasterized pixels to shadow edges corresponding to the plurality of objects in parallel to obtain the distance data corresponding to the plurality of objects; and respectively storing the distance data corresponding to the plurality of objects with the plurality of sub-resolutions corresponding to the plurality of object sets to obtain the distance field shadow texture corresponding to the plurality of objects.

Technical Overview & Description

RELATED APPLICATION This application claims priority as a continuation to PCT/CN2022/073534, filed on Jan. 24, 2022, published as WO2022161319A1, and entitled “ SHADOW MAPPING PROCESSING METHOD AND APPARATUS, AND DEVICE, COMPUTER-READABLE STORAGE MEDIUM AND PROGRAM PRODUCT ” which claims priority to Chinese Patent Application No. 202110104608.9, filed on Jan. 26, 2021, each of which are incorporated herein by reference in their entirety. FIELD OF THE TECHNOLOGY This application relates to a graphic processing technology, and particularly relates to a method, an apparatus and a device for processing a shadow texture, a non-transitory computer-readable storage medium and a program product. BACKGROUND OF THE DISCLOSURE Shadow effects can greatly improve the level of images in a virtual scene and enhance the reality sense of the virtual scene. Shadow effects are realized by performing shadow rendering on the corresponding virtual scenes. Shadows are often processed on a texture in advance, that is, a distance field shadow texture is determined for the virtual scene, and the distance field shadow texture is directly utilized for rendering subsequently. However, the computation of the distance field shadow texture mode often takes a long time and the shadow texture processing efficiency is low. SUMMARY An embodiment of this application provides a method, an apparatus and a device for processing a shadow texture, a non-transitory computer-readable storage medium, and a program product, aiming at providing the shadow texture baking efficiency. An embodiment of this application provides a method for processing a shadow texture. The method is performed by an electronic device and includes: acquiring model data and light source information of at least one object in a virtual scene, and acquiring a shadow texture with a first resolution corresponding to each object; determining a corresponding second resolution according to the model data of each object, the second resolution r

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 (11)

PatentTitleYearCitations

Non-Patent Literature (1)

  • International Search Report and Written Opinion for priority application No. PCT/CN2022/073534 dated Apr. 6, 2022, with English translation of the International Search Report, 14p.