Image display method and device, computing equipment and computer readable storage medium

By obtaining the target area of ​​pixels and querying voxel data in the three-dimensional game scene, the problem of poor shadow display is solved, higher quality and flexible shadow display is achieved, and the overall display effect of the game scene is improved.

CN118691731APending Publication Date: 2024-09-24ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410786161.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-10-20
Filing Date
2024-06-18
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

The existing technology has low display effect and flexibility of shadows in three-dimensional game scenes, resulting in the display effect of game scene images also need to be improved.

Method used

By obtaining the information of the target image, the target area of ​​the pixel in the three-dimensional scene is determined, and the target voxel data in the area is queried to obtain the shadow information for rendering and display. This method uses voxel data to carry more information, is more accurate than the two-dimensional depth map, and improves the display quality and flexibility of shadows.

Benefits of technology

It improves the display quality and flexibility of shadows in three-dimensional scenes, improves the display effect of game scenes, reduces the consumption of computing resources, and ensures running smoothness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691731A
    Figure CN118691731A
Patent Text Reader

Abstract

The embodiment of the invention provides an image display method and device, computing equipment and a computer readable storage medium. The method comprises the following steps: acquiring information of a target image; according to the position information of pixel points in the target image, determining a target area where the pixel points are located in a target scene, the target scene being a three-dimensional scene corresponding to the target image; target voxel data of the target area are inquired, the target voxel data are analyzed to obtain shadow information of the pixel points, and the target voxel data are determined in advance based on area information and light source information of the target scene; performing rendering display on the target image based on the shadow information; the method can improve the display effect of the shadow in the scene image, and correspondingly improves the display effect of the scene image.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on October 20, 2023, with application number "202311368577.3" and invention name "Image display method and device, computing device, computer-readable storage medium", all contents of which are incorporated by reference in this application. Technical Field

[0002] The embodiments of this specification relate to the field of computer technology, and in particular to an image display method; they also relate to an image display device, a computing device, and a computer-readable storage medium. Background Art

[0003] With the development of computer technology, various online games emerge in an endless stream, and the requirements for the display effects of game scenes are getting higher and higher.

[0004] In order to improve the realism of the game scene, corresponding shadows will be displayed for each object in the game scene. When the game is running, the display device needs to generate a depth map corresponding to the entire screen for each frame of the game scene to be displayed. Then, based on the depth map and the position of the light source in the game scene, the positions in the game scene that cannot be illuminated are determined, and shadows are displayed accordingly at these positions.

[0005] However, the display effect of shadows in the current game scenes still needs to be improved, and accordingly the display effect of the game scene pictures also needs to be improved. Summary of the invention

[0006] In view of this, an embodiment of the present specification provides an image display method. One or more embodiments of the present specification also relate to an image display device, a computing device, a computer-readable storage medium and a computer program, which can solve the technical defects existing in the prior art.

[0007] According to one aspect of an embodiment of this specification, there is provided an image display method, the method comprising:

[0008] Get the information of the target image;

[0009] Determining a target area where the pixel point is located in a target scene according to position information of the pixel point in the target image, wherein the target scene is a three-dimensional scene corresponding to the target image;

[0010] Querying target voxel data of the target area, and parsing the target voxel data to obtain shadow information of the pixel point, wherein the target voxel data is pre-determined based on area information and light source information of the target scene;

[0011] Based on the shadow information, the target image is rendered and displayed.

[0012] According to another aspect of the embodiments of this specification, there is provided an image display device, the image display device comprising:

[0013] A first acquisition module, used to acquire information of a target image;

[0014] A first determination module, configured to determine a target area where the pixel point is located in a target scene according to position information of the pixel point in the target image, wherein the target scene is a three-dimensional scene corresponding to the target image;

[0015] A query module, used for querying target voxel data of the target area, and parsing the target voxel data to obtain shadow information of the pixel point, wherein the target voxel data is determined in advance based on area information and light source information of the target scene;

[0016] A display module is used to render and display the target image based on the shadow information.

[0017] According to another aspect of the embodiments of this specification, there is provided a computing device, including: a memory and a processor;

[0018] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the above method are implemented.

[0019] According to another aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and the instructions implement the steps of the above method when executed by a processor.

[0020] According to another aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above method.

[0021] In one embodiment of the present specification, the target area where the pixel is located in the three-dimensional scene can be determined based on the position information of the pixel in the target image to be displayed, and then the shadow information of the pixel can be obtained from the target voxel data of the target area to display the shadow in the scene image. In this way, for different pixels in the target image, the shadow information of the pixel can be obtained directly based on the target voxel data of the corresponding area in the three-dimensional scene, and the shadows of different areas can be displayed in different states, which improves the flexibility of shadow display and thus improves the display effect of the scene image. In addition, the shadow information is carried in the target voxel data of the target area. Since the voxel data can represent more information than the data in the two-dimensional depth map, the shadow information can be more accurate than the shadow information determined based on the two-dimensional depth map, which can improve the display quality of the shadow in the scene image. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is a flow chart of an image display method provided by an embodiment of this specification;

[0023] Figure 2 is a flow chart of another image display method provided by an embodiment of this specification;

[0024] Figure 3 This is a simple flowchart of determining target voxel data provided by an embodiment of this specification;

[0025] Figure 4 is a schematic diagram of a partial area of ​​a target scene provided in an embodiment of this specification;

[0026] Figure 5 This is a simple flow chart of displaying a target image provided by an embodiment of this specification;

[0027] Figure 6 is a schematic diagram of a target image provided in an embodiment of this specification;

[0028] Figure 7 is a schematic diagram of another target image provided by an embodiment of this specification;

[0029] Figure 8 This is a setting page diagram of an image display device provided by an embodiment of this specification;

[0030] Fig. 9 is a structural schematic diagram of an image display device provided by an embodiment of this specification;

[0031] Fig.10 It is a structural block diagram of a computing device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0032] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0033] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms of "one", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items. The term "at least one" in one or more embodiments of this specification refers to "one or more", and "multiple" refers to "two or more". The term "including" is an open description and should be understood as "including but not limited to", and may include other content on the basis of the content already described.

[0034] It should be understood that although the terms "first", "second", etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, "first" may also be referred to as "second", and similarly, "second" may also be referred to as "first". Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0035] With the development of computer technology, the display of various three-dimensional scenes is increasing, and the requirements for the display effect of three-dimensional scenes are also getting higher and higher. For example, in a three-dimensional online game, it is necessary to display a three-dimensional scene, and it is required that the shadows of objects (such as buildings, mountains, and trees, etc.) in the three-dimensional scene can also be displayed well to ensure that the display effect of the three-dimensional scene is good. At present, when displaying the shadows in a three-dimensional scene, the depth map (English: Shadowmap) is used as the basis, and the shadow is drawn based on the visibility of the light in the scene in combination with the information of the light source. The display flexibility of the shadow is low, and the display quality of the shadow needs to be improved. Correspondingly, the display effect of the image of the three-dimensional scene is also relatively low.

[0036] In this specification, an image display method is provided, which can improve the display flexibility and display quality of shadows in an image corresponding to a three-dimensional scene, and accordingly can improve the display effect of the image corresponding to the three-dimensional scene. This specification also relates to an image display device, a computing device, and a computer-readable storage medium, which will be described in detail one by one in the following embodiments. The image display method can be used in the controller in the image display device and the computing device.

[0037] Figure 1 FIG. 1 is a flowchart of an image display method provided by an embodiment of the present specification, and the method can be applied to an image display device. Figure 1 As shown, the image display method comprises the following steps:

[0038] Step 102: Obtain information of the target image.

[0039] The image display device can obtain information about an image of a three-dimensional scene to be displayed. In the embodiments of this specification, the three-dimensional scene is taken as a target scene and the image is taken as a target image. The target image includes a plurality of pixels, each of which may correspond to a pixel on a display screen of the image display device, and each pixel in the target image is displayed by a corresponding pixel on the display screen. The information of the target image may include information about the object to be presented, such as the information of the target image indicating that the target image is an image of mountains and rivers, or the information of the target image may include pixel value information of each pixel therein.

[0040] The image display device may be installed with a target application, and when the target application is running, the image display device may display a target image, thereby executing the image display method provided in the embodiment of this specification. For example, the target application is a three-dimensional online game.

[0041] Step 104: determine the target area where the pixel point is located in the target scene according to the position information of the pixel point in the target image, wherein the target scene is a three-dimensional scene corresponding to the target image.

[0042] In an embodiment of the present specification, at least one area can be set for the target scene when designing the target scene, and the features in the area can be designed separately. For ease of description, each area set for the target scene is referred to as a set area below. The following is an introduction taking the at least one set area including multiple set areas as an example. Optionally, a variety of different designs can also be performed for each set area. Each set area can be a three-dimensional space in the target scene, and each set area can be composed of multiple voxels. Each set area can be a space surrounded by a bounding box in the target scene. For example, a set area in the target scene can include a space where a building is located, or a space where a park is located, or a space where a mountain range is located. Optionally, a smaller area can also be set for the target scene, such as a set area can include a space where a tree is located, or a space where a house is located.

[0043] The multiple set areas of the target scene can be obtained by dividing the target scene, or can be obtained by dividing a part of the area in the target scene. The multiple set areas can be sub-areas in the target scene that do not overlap with each other, or there can be two set areas that overlap, or there can be a set area that includes another set area. Optionally, there can be a set area that includes all areas of the target scene, and the data of the set area can be used as a catch-all data, and the area that does not need special settings in the target scene can be displayed using the catch-all data.

[0044] Each pixel in the target image is used to display information of some positions in the target scene. The image display device can determine the position (such as called auxiliary position) corresponding to the content of the pixel in the target scene based on the position information of the pixel in the target image. The position of the set area in the target scene can be known, and the image display device can determine the area in the set area that contains the auxiliary position corresponding to the pixel as the target area. The image display device can determine the pixel in the target image corresponding to the pixel based on the position of the pixel in the display screen.

[0045] In an embodiment of the present specification, if there is overlap among all the set areas of the target scene, when determining the target area for a target image, the set areas where the pixel points are located can be determined among all the set areas, and then a target area can be screened out based on the priority of each set area.

[0046] In the embodiment of the present specification, the image display device may perform step 104 and subsequent steps for each pixel in the target image. Each pixel in the target image may determine its corresponding target area in the target scene, or there may be a pixel that has no corresponding target area in the target scene. In the case where the corresponding target area is not determined, shadow information may be determined for the pixel in a manner different from step 106 described below.

[0047] Step 106 : querying the target voxel data of the target area, and parsing the target voxel data to obtain the shadow information of the pixel, wherein the target voxel data is determined in advance based on the area information and light source information of the target scene.

[0048] In an embodiment of the present specification, during the development of the target application, target voxel data of a set area in the target scene can be determined based on the area information and light source information of the target scene. The target voxel data of each set area may include shadow information of each voxel in the set area, and the shadow information of the voxel reflects whether the voxel is in a shadow area or in an illuminated area. In an embodiment of the present specification, the shadow information determined in the voxel dimension may also be referred to as voxel shadow, and the voxel data includes voxel shadow.

[0049] The target voxel data of the set area in the target scene can be generated offline in advance. When the target program is installed on the image display device and runs, the target voxel data of the set area generated offline can be directly obtained to obtain the shadow information of the voxels in the set area. For example, based on the pixel points in the target image, the target voxel data of the target area is queried, and then the shadow information of the pixel point is parsed from the target voxel data. The shadow information of the pixel point includes the shadow information of at least one voxel in the target area. In this way, there is no need to consume the computing resources of the image display device in real time to generate the shadow information. Therefore, the efficiency of obtaining the shadow information can be improved, and then the display efficiency of the shadow in the target image can be improved, ensuring that the target program runs smoothly.

[0050] Step 108: Render and display the target image based on the shadow information.

[0051] After obtaining the shadow information of each pixel, the image display device can render the shadow in the target image based on the shadow information. Other information in the target image other than the shadow can be directly rendered based on the information of the target image obtained in step 102.

[0052] In summary, in the image display method provided in the embodiment of the present specification, the target area where the pixel point is located in the three-dimensional scene can be determined based on the position information of the pixel point in the target image to be displayed, and then the shadow information of the pixel point can be obtained from the target voxel data of the target area to display the shadow in the scene image. In this way, for different pixels in the target image, the shadow information of the pixel point can be obtained directly based on the target voxel data of the corresponding area in the three-dimensional scene, and different states of shadows in different areas can be displayed, which improves the flexibility of shadow display and thus improves the display effect of the scene image. In addition, the shadow information is carried in the target voxel data of the target area. Since the voxel data can represent more information than the data in the two-dimensional depth map, the shadow information can be more accurate than the shadow information determined based on the two-dimensional depth map, which can improve the display quality of the shadow in the scene image.

[0053] Figure 2 is a flowchart of another image display method provided by an embodiment of this specification, such as Figure 2 As shown, the image display method may include the following steps:

[0054] Step 202: Acquire region information of a target scene, wherein the region information includes a depth map of a target region in the target scene.

[0055] In the embodiment of this specification, in the process of developing an application that needs to display a three-dimensional scene (such as a target application that displays a target scene), at least one area can be set for the target scene. Each set area (i.e., set area) can be a sub-area of ​​the target scene, i.e., includes at least a portion of the target scene. The target area is an area in the at least one area. In this embodiment, for the target scene, set area, and target area, please refer to the above description of the target scene. Figure 1 For the related introduction, the previously introduced content will not be repeated here.

[0056] The developer of the target application can input the location or range information of at least one area to the development device (such as an image display device) to set the at least one area for the target scene, that is, determine the set area in the target scene. The development device of the target application can determine the area information of the target scene based on each set area in the target scene, and the area information includes information of each set area. For example, the area information can include the location information of each set area.

[0057] For example, a depth map of each set area can be determined for the set area, and the area information of the target scene can include the depth map of each set area. Since the target area is a set area in the target scene, the area information of the target scene can include the depth map of the target area. The depth map can be a depth map taken by orthogonal projection, and the depth map is a two-dimensional image, and the data included is two-dimensional data. The image display device can obtain the morphological information of each object in the target scene (such as vertex information of the triangular mesh constituting each object model). The depth map in the embodiment of this specification can include not only the depth information of the surface of the object in the target scene, but also the depth information of the back of the object in the target scene. The depth map can reflect information such as the approximate shape and volume of the object in the target scene.

[0058] In an embodiment of the present specification, the image display device may also obtain corresponding shadow parameters for each set area. If the shadow parameters include shadow projection direction and / or shadow resolution, the shadow resolution may characterize the display accuracy of the shadow. Each set area may correspond to only one shadow parameter, or may correspond to multiple shadow parameters. A corresponding depth map may be generated for each set area based on each corresponding shadow parameter, so at least one depth map may be generated for each set area. The position or range information, shadow projection direction and shadow resolution of the above-mentioned set area may belong to the baking information of the shadow.

[0059] The target scene in the embodiments of this specification can be a large world scene, an open world scene, or a non-open world scene. A large world scene refers to a scene with a large map size; an open world scene refers to a scene in which the displayed scene image is naturally adjusted as the character moves or changes in line of sight, allowing the character to freely explore the scene; a non-open world scene refers to a scene that does not change as the character moves or changes in line of sight.

[0060] In the embodiment of the present specification, after obtaining the depth map of the target area in the target scene, the image display device can determine the shadow information in the target area based on the depth map and the corresponding light source information. For example, through the following steps 204 to 206, a three-dimensional voxel world can be constructed for the shadow of the target area based on the depth map to determine whether each voxel is in the shadow, and obtain the shadow information of each voxel in the target area.

[0061] Step 204: Process the depth map of the target area to obtain auxiliary depth maps at multiple hierarchical and refined texture levels.

[0062] In the embodiments of this specification, the target area is used as an example for introduction. For each set area in the target scene, the same processing flow as the target area can be executed. For the sake of distinction, the depth map determined in step 202 is referred to as the initial depth map below. The image display device can process the initial depth map of the target area to obtain auxiliary depth maps at multiple mipmap levels.

[0063] The initial depth map of the target area can be a depth map with the smallest texture granularity of the target area, which is equivalent to a depth map with the highest resolution. The image display device obtains auxiliary depth maps at multiple mipmap levels based on the initial depth map, which is equivalent to diluting the initial depth map at multiple levels to increase the texture granularity of the initial depth map and reduce the resolution of the initial depth map. The determination of the auxiliary depth map can facilitate the construction of subsequent target voxel data to be completed faster.

[0064] Step 206 : construct a sparse voxel octree of the target area based on each auxiliary depth map and the light source information, and generate target voxel data of the target area, wherein the target voxel data of the target area represents the shadow information of each voxel in the target area.

[0065] The light source information may include information such as the position of the light source and the direction of light irradiation. The image display device can determine information such as the positional relationship of each object in the target area based on the auxiliary depth map, and can also determine the relative relationship between each object and the light source based on the light source information. Next, the depth comparison of each object in the target area can be performed according to the visibility of the light to determine whether each voxel in the target area can receive light, so as to determine whether each voxel is in the illuminated area or the shadow area, and then generate the shadow information of each voxel. If the shadow information of the voxel is 1, it means that the voxel is in the shadow area, and if the shadow information of the voxel is 0, it means that the voxel is in the lit area.

[0066] The image display device can analyze each auxiliary depth map in order from large to small texture granularity, and then construct a sparse voxel octree in combination with the light source information. In this process, the image display device can determine whether there is an object in the target area based on the depth information reflected by the auxiliary depth map with the largest texture granularity. When it is determined that there is an object in the target area, the target area is divided into eight subspaces, and the subspace where the object exists is determined based on the depth information reflected by the auxiliary depth map of the next texture granularity. Then, the subspace where the object exists is further divided into eight subdivided spaces, and the space where the object exists in the eight subdivided spaces is determined based on the depth information reflected by the auxiliary depth map of the next texture granularity. In this way, the space of the target area is gradually subdivided until there are objects in each subdivided space obtained after a space is subdivided, or each auxiliary depth map is used. Each subdivided space can correspond to a voxel unit in the target area, and each voxel unit can also be called a node in the sparse voxel octree.

[0067] Afterwards, the depth of each voxel unit in the target area can be compared with the depth of the corresponding pixel of the voxel unit in the auxiliary depth map based on the light source information and the visibility of the light. If the depth of the voxel unit is greater than the depth of the corresponding pixel in the auxiliary depth map, it can be determined that the voxel unit is in the shadow area, and the voxel data of the voxel unit can be set to 1. If the depth of the voxel unit is less than or equal to the depth of the corresponding pixel in the auxiliary depth map, it can be determined that the voxel unit is in the illuminated area, and the voxel data of the voxel unit can be set to 0. In this way, the construction of a sparse voxel octree of the target area can be achieved, and the sparse voxel octree represents the shadow information of each voxel unit in the target area, that is, whether each voxel unit is in the shadow area.

[0068] In the implementation of this specification, the voxel data representing the shadow information of the target area is referred to as the target voxel data in the target area. In this way, it is not necessary to represent the shadow of each position in the target area with the data with the smallest texture granularity, and the amount of data related to the shadow of the voxel in the target area is small, avoiding excessive occupation of storage space.

[0069] Optionally, in the process of constructing a sparse voxel octree, after obtaining the voxel data of each voxel unit, the voxel data of every two voxel units that are adjacent in the target direction and belong to the same texture granularity level can also be compared. The target direction is the illumination direction indicated by the light source information. If the voxel data of the two voxel units are both 0 (that is, the two voxel units are both in the illumination area), the two voxel units can be merged into one voxel unit, and then only one voxel data is needed to represent the shadow information of the merged voxel unit. Afterwards, a sparse voxel octree is obtained based on the voxel data of each voxel unit obtained after the merger, which can further reduce the amount of data required for the storage of the sparse voxel octree.

[0070] If the target area corresponds to a shadow parameter, the image display device can also generate an auxiliary depth map of the target area under the shadow parameter based on the shadow parameter corresponding to the target area and based on the initial depth map of the target area under each shadow parameter. The image display device also generates shadow information of each voxel in the target area under the shadow parameter based on the auxiliary depth map to obtain target voxel data of the target area under the shadow parameter. The method of generating the auxiliary depth map and target voxel data refers to the above-mentioned generation method when the shadow parameter is not involved, and will not be repeated here.

[0071] Optionally, the image display device may generate an auxiliary depth map using a graphics processing unit (GPU) and construct a sparse voxel octree using a central processing unit (CPU).

[0072] In some embodiments, the image display device may divide the target scene into a plurality of plots, each of which may be divided into a plurality of voxels. The size of each plot may be a default size, or may be manually set, and the sizes of each plot may be the same. The image display device may generate corresponding voxel data for each plot, respectively. For the method of generating voxel data, please refer to the aforementioned related introduction to step 204 and step 206. The image display device may generate voxel data for each plot based on the depth map and light source information of each plot. Each set area (such as the target area) in the aforementioned target scene may include at least one plot of the plurality of plots. Accordingly, after generating the voxel data of each plot, the target voxel data of the target area may be obtained, and the target voxel data is the voxel data of at least one plot included in the target area.

[0073] Optionally, the image display device may divide the target scene into multiple plots when the size of the target scene is larger than a size threshold. The size of the target scene may refer to the area corresponding to the target scene. For example, the size threshold may be 1 km*1 km, the size of each plot may be 1 km*1 km, and the number of voxels in a plot of this size may be 1024*1024*1024 (before compression), which may characterize the voxel resolution (i.e., voxel accuracy) of the target scene. The image display device divides a target scene of a larger size into multiple plots and generates corresponding voxel data for each plot. In this way, when it is necessary to render shadows, the voxel data of each plot may be loaded separately according to the display requirements, without having to load all the voxel data at once, thereby avoiding excessive occupation of memory and video memory.

[0074] In some embodiments, there may be an association relationship between adjacent plots, such as multiple plots may constitute the same object, such as multiple plots constitute a complete mountain. When the image display device generates voxel data of any of the multiple plots, the information of the multiple plots may be loaded into the virtual scene, and a depth map may be generated. Based on the association relationship between the multiple plots, corresponding voxel data may be generated for each plot. That is, when baking the voxel shadows of the plots, the image display device may load multiple blocks to bake a single block.

[0075] In the embodiments of the present specification, shadow information corresponding to a plurality of shadow parameters can be generated for the target scene to apply different shadow information in different situations. For example, when the target scene is displayed in different display devices, or when the target scene is displayed using different display qualities, different shadow information is applied. The shadow parameter includes a shadow resolution, and the image display device can generate target voxel data of a plurality of shadow resolutions for the target area based on the depth map and light source information of the target area. For each shadow resolution, the image display device can use the aforementioned voxel data generation method to generate voxel data for each area in the target scene, which will not be described in detail here. The shadow resolution can correspond to the voxel resolution, such as a 1 km*1 km area including 1024*1024*1024 (before compression) voxels can correspond to a higher shadow resolution, and a 1 km*1 km area including 512*512*512 (before compression) voxels can correspond to a lower shadow resolution.

[0076] At different shadow resolutions, there may be differences in the objects in the target scene that need to generate shadow information. For lower shadow resolutions, some objects may be hidden and not displayed, and accordingly, there is no need to generate shadow information for these objects. For example, objects that may be hidden may include some static objects that are damaged or missing, as well as some dynamic objects. The image display device may exclude objects that need to be hidden at each shadow resolution in the target scene, and then generate corresponding shadow information for the remaining objects. Taking the target area as an example, the image display device may determine the objects to be excluded in the target area for each shadow resolution based on the object screening rules corresponding to a plurality of shadow resolutions. Then, for objects other than the objects to be excluded in the target area, target voxel data for the target area corresponding to each shadow resolution is generated.

[0077] For example, the object screening rule corresponding to each shadow resolution includes the type of the object to be excluded at the shadow resolution. The object screening rule can be pre-configured by the staff, or automatically generated based on certain set relationships. The information of each object in the target scene can include the type information of the object. The image display device can obtain the corresponding type of the object to be excluded for each shadow resolution, and determine the object of the type in the target scene to exclude the object, and only generate voxel data for other objects in the target scene.

[0078] In the embodiments of the present specification, when baking shadows for a target scene, consideration is given to appropriately excluding some objects in the target scene based on the shadow resolution. This ensures flexibility in shadow baking and ensures compatibility of the generated shadows with the actual display conditions of the scene, thereby improving the display effect of the scene.

[0079] The image display device can store the voxel data of each set area or each block in the target scene after generating it. For example, after obtaining the target voxel data of the target area, the image display device can store the target voxel data of the target area. If the target area corresponds to multiple shadow parameters, the image display device can store the target voxel data under each shadow parameter together. Optionally, the target voxel data under different shadow parameters can be stored in different sub-storage spaces. The image display device can store the generated voxel data in a disk.

[0080] After generating the target voxel data of each set area, the image display device may further generate a configuration file corresponding to the target voxel data of each set area, wherein the configuration file is used to record the storage location of the target voxel data of each set area.

[0081] Optionally, the image display device may organize and merge the target voxel data of each set area in the target scene and then store them together. The target voxel data of different set areas may be stored in different storage spaces. Alternatively, they may be stored in the same storage space, and the target voxel data of the same set area may be stored continuously; in this way, the configuration file may record the location information of the target voxel data of each set area and the segmentation positions of the target voxel data of different set areas.

[0082] Optionally, the image display device may compress the target voxel data of each set area to store the compressed data and reduce the storage space occupied. The number of voxels in the compressed voxel data can be reduced. In the embodiment of the present specification, after obtaining the sparse voxel octree, it can be converted into a directed acyclic graph (DAG) to achieve compression of the target voxel data. Since the data volume of DAG is small, the storage space occupied by the compressed target voxel data can be greatly reduced, and the compressed data volume can be 1 / 4 to 1 / 10 of the data volume of the shadow directly generated in real time using the depth map in the related art.

[0083] The above steps 202 to 206 may be performed during the offline development phase of the target application. Figure 3 2 is a simplified flowchart of determining target voxel data provided by an embodiment of the present specification. The flowchart can illustrate the process from step 202 to step 206. Figure 3 As shown, the page display device can obtain the position information, shadow projection direction and shadow resolution of the set area in the target scene, and input the information as the baking information of the shadow. In the large world scene, before obtaining the position information of the set area, the large world scene can be divided into multiple plots, and then the position information, shadow projection direction and shadow resolution are determined for each plot. After inputting the baking information, the baking object (that is, the object model in the target scene) can also be screened for different shadow resolutions. After that, the vertex information of each triangular mesh in the object model in the target scene can be collected to draw a depth map to obtain an initial depth map. Then, the initial depth map is subjected to mipmap processing to obtain an auxiliary depth map at each mipmap level. Based on each auxiliary depth map and light source information, the voxels in the shadow area of ​​the set area can be calculated. Then, a sparse voxel octree is constructed to obtain the target voxel data of the set area, and the target voxel data may include the shadow information of each voxel in the set area. Then, the target voxel data of each set area is compressed and merged to obtain voxel shadow data that can reflect the shadows of each set area in the target scene.

[0084] Step 208: Obtain information of the target image.

[0085] In the embodiment of this specification, step 208 can refer to the relevant introduction in step 102, which will not be repeated here. The image displayed by the image display device can be considered as an image taken by a virtual camera outside the screen, such as the target image can be considered as an image taken by a virtual camera for the target scene. By adjusting the virtual camera (such as rotating the virtual camera, adjusting the focal length, and adjusting the field of view, etc.), the image displayed on the image display device can be adjusted, such as making the image display device display pictures of different areas in the target scene.

[0086] Step 210: Obtain shadow parameters of a set area corresponding to the target image; wherein the shadow parameters include a shadow projection direction and / or a shadow resolution.

[0087] When the target application runs to different states, the image display device may need to display different target images. Even if the two target images correspond to the same space in the target scene, the display parameters of certain areas in the space may be different, such as different shadow parameters of the target area. For example, the shadow projection direction of the target area in the target scene is east at the first moment, and west at the second moment. In addition, the shadow parameters of different areas in the target image may also be different, such as the shadow projection direction of the first area is east, and the shadow projection direction of the second area is west. Therefore, for the target image to be displayed currently, the shadow parameters of each set area corresponding to the target image can be obtained, so as to display the currently required shadow based on the shadow parameters. The set areas may include the target area.

[0088] Optionally, for other areas outside the set area in the target scene, shadow information may be determined based on default shadow parameters.

[0089] Step 212: Determine the world coordinates corresponding to the pixel point in the world coordinate system of the target scene according to the position information of the pixel point in the target image.

[0090] The target scene may have a corresponding world coordinate system, and each position in the target scene may correspond to a world coordinate in the world coordinate system. A corresponding position in the target scene may be determined based on any world coordinate. The image display device may calculate the world coordinate corresponding to each pixel in the target image in the world coordinate system in the target scene based on the position information of the pixel, so as to determine the position corresponding to the content of the pixel in the target scene, such as determining the voxel at the position. Optionally, a pixel in the target image may correspond to one or more voxels in the target scene.

[0091] In the embodiment of this specification, step 212 can refer to the relevant introduction in the above step 104, and the previously introduced content will not be repeated here. In the embodiment of this specification, the world coordinates corresponding to the pixel point are determined based on the position information of the pixel point in the target image as an example. Optionally, the world coordinates can also be directly input to determine the corresponding shadow information, and then step 214 and subsequent steps are directly executed without executing step 212.

[0092] Step 214: determine the set area where the position indicated by the world coordinates in the target scene is located as the target area where the pixel point is located in the target scene.

[0093] After determining the world coordinates corresponding to a certain pixel point in the target image, the image display device can determine the position indicated by the world coordinates in the target scene, and then determine the set area where the position is located. After that, the display state of the pixel point can be determined based on the feature design pre-performed for the set area.

[0094] In the embodiments of this specification, the determination of the set area in the target scene for any pixel point (such as the target pixel point) in the target image is taken as an example, and the pixel point is located in the target area. For other pixel points and set areas, the relevant processing methods of the target pixel point and the target area can be referred to.

[0095] Step 216: query the target voxel data of the target area under the corresponding shadow parameters, and parse the target voxel data to obtain the shadow information of the pixel.

[0096] After determining the target area where the target pixel point in the target image is located, the image display device can determine the shadow parameters corresponding to the target area from the shadow parameters of each set area corresponding to the target image. Then, the target voxel data of the target area can be queried based on the shadow parameters. Since the target voxel data of the target area includes the shadow information of each voxel in the target area, the target voxel data can be parsed to determine the shadow information of each voxel corresponding to the target pixel point to obtain the shadow information of the target pixel point.

[0097] In the embodiments of the present specification, the pre-generated voxel data may be stored in a disk. The image display device may load the target voxel data of the target area from the disk into a cache in a memory based on the determined shadow parameters. Then, the target voxel data may be loaded from the memory into a video memory and the target voxel data may be parsed in the video memory to display the shadow based on the shadow information obtained by the parsing.

[0098] In some implementations, the display quality of the target image may be associated with the displayed shadow information. When the image display device pregenerates voxel data corresponding to a plurality of shadow resolutions for the target area, the target voxel data of the shadow resolution corresponding to the current display quality may be queried among the target voxel data of the plurality of shadow resolutions of the target area based on the display quality of the target image. Furthermore, the corresponding shadow information of the pixel points in the target area is obtained based on the target voxel data, and subsequent shadow display is performed based on the shadow information. The shadow resolution corresponding to high display quality is higher, and the shadow resolution corresponding to low display quality may be lower.

[0099] In one example, the image display device generates voxel data corresponding to high and low shadow resolutions for the target scene, and the target image can be displayed using four different display qualities (such as low quality, medium quality, high quality and ultra-high quality). Low quality and medium quality can both correspond to low shadow resolution, and high quality and ultra-high quality can both correspond to high shadow resolution. As another example, when the size of the target scene is large (such as the target scene is a large world scene), high quality and ultra-high quality can adopt a mixed resolution mode, that is, different areas in the target scene correspond to different shadow resolutions. For example, the area in the target scene that is closer to the virtual camera corresponds to a high shadow resolution, and the area farther from the virtual camera corresponds to a low shadow resolution.

[0100] Optionally, the shadow resolution corresponding to the target image may also be related to the hardware features of the image display device, and the quality of the hardware features is positively correlated with the shadow resolution. For example, the application that displays the target image may determine the capacity of the central processing unit (CPU) and the graphics processing unit (GPU) of the image display device to determine the shadow resolution corresponding to the target image based on the capacity. The application may directly determine the shadow resolution, or the application may also determine a recommended shadow resolution for the user to select based on the hardware features.

[0101] The image display device may draw shadows for all areas in the target image, or may draw shadows for only part of the target image. In one implementation, the drawing distance of the shadow in the target image may be related to the hardware characteristics of the image display device. The shadow drawing distance refers to the farthest distance between the position where the shadow is drawn in the target scene and the virtual camera.

[0102] In the embodiments of this specification, compared with the cost of traditional shadow drawing using Shadowmap solution, shadow drawing based on voxel shadow can make the shadow drawn in the target scene farther at the same cost. Different drawing distances can be set according to the performance of the device. For example, the shadow distance can reach 3000 meters on high-end devices and 1000 meters on low-end devices.

[0103] Optionally, if the target voxel data of each set area is compressed in advance, the image display device can query the compressed target voxel data of the target area. Optionally, the image display device can determine the storage location corresponding to the target voxel data of the target area based on the configuration file, and then query the target voxel data of the target area at the storage location.

[0104] In the embodiment of the present specification, before step 216 (such as when the target application starts running), the image display device may first load the target voxel data of each set area of ​​the target scene for subsequent use. Optionally, the image display device may also load the target voxel data of the target area after determining the target area. Optionally, the image display device may also load the voxel data of each area in the target image after determining the target image.

[0105] In the embodiments of the present specification, the image display device may load the voxel data of each area in the target scene by streaming loading. Optionally, the image display device may use streaming loading when the size of the target scene is greater than the size threshold. Streaming loading means that the voxel data of the target scene is not loaded into the memory and video memory at one time, but the currently required data is loaded based on the needs at different times.

[0106] For example, after obtaining the information of the target image in step 208, the image display device can load the voxel data of each block within the shooting distance around the virtual camera position into the memory and the video memory based on the virtual camera position in the target scene and the shooting distance of the virtual camera. Correspondingly, in step 216, the image display device can query the target voxel data of the target area in the voxel data of each block loaded into the memory and the video memory. The image display device can load the corresponding voxel data for different images, and can also unload the unnecessary voxel data in the memory and the video memory to avoid excessive occupation of the memory and the video memory.

[0107] The shooting distance refers to the current maximum shooting distance of the virtual camera; the area around the virtual camera within the shooting distance may refer to: a circular area with the location of the virtual camera as the center and the shooting distance as the radius. The voxel data of each block in the area may include the voxel data of each area in the target image, and may also include the voxel data of some areas outside the target image in the target scene. Optionally, the shooting distance may be set manually, or may be automatically set by the image display device, and the shooting distance may be fixed or adjustable.

[0108] Figure 4 is a schematic diagram of a partial area of ​​a target scene provided in an embodiment of this specification. Figure 4 The center of the circle shown in the figure is the location of the virtual camera. The shooting distance of the virtual camera is 1000 meters, which is equal to the length of 1.5 plots. The current field of view of the virtual camera is a triangular area. Based on this assumption, the target image displayed on the image display device can be each object in the target scene located in the triangular area. The image display device can load Figure 4The voxel data of the 3*3 plot shown in FIG. If the shooting distance of the virtual camera is greater, the field of view of the virtual camera will also be greater, and the image display device needs to load voxel data of more plots. Since there is a high probability that the virtual camera needs to be rotated at a certain position to view the surrounding environment, in the embodiment of this specification, the voxel data of the plots around the virtual camera are loaded into the memory and the video memory, which can ensure that the displayed information is quickly changed when the virtual camera is rotated, thereby improving the picture display effect.

[0109] The instantaneous maximum data volume required by the image display device each time to load voxel data is positively correlated with the number of plots loaded and the shooting distance. For example, the size of each plot is 1 km*1 km, and the instantaneous maximum data volume of the image display device when loading 3*3 plots can be less than or equal to 16.29 Mbits, the instantaneous maximum data volume when loading 4*4 plots can be less than or equal to 26.82 Mbits, the instantaneous maximum data volume when loading 5*5 plots can be less than or equal to 41.44 Mbits, and the instantaneous maximum data volume when loading 6*6 plots can be less than or equal to 70.02 Mbits. The amount of data for different plots may also vary. Table 1 below shows the corresponding relationship between the number of plots corresponding to a type of voxel data and the estimated data volume (i.e., memory usage).

[0110] Table 1

[0111] Number of plots 9*9 7*7 5*5 4*4 3*3 Memory Estimation 96MB 72MB 42MB 27MB 17MB

[0112] In some embodiments, after acquiring information of the target image, the image display device may unload redundant voxel data from the memory and the video memory, wherein the plot to which the redundant voxel data belongs is located outside the shooting distance of the virtual camera. For example, after acquiring each frame of the image to be displayed, the image display device may determine whether there is voxel data of the plot required to be loaded for the image in the memory. For ease of description, the voxel data of the plot required to be loaded for the image is directly written as the plot corresponding to the image, and the voxel data of the plot is directly written as the plot data. The image display device may delete the plot data (i.e., the redundant voxel data) other than the plot corresponding to the image in the memory, and load the unloaded plot data in the plot corresponding to the image. Optionally, the image display device may also delete the plot corresponding to the image in the memory after each frame of the image is displayed, and reload the plot corresponding to the next frame of the image.

[0113] Step 218: Render and display the target image based on the shadow information of each pixel.

[0114] In the embodiment of this specification, step 218 can refer to the relevant introduction in step 108, and the previously introduced content will not be repeated here.

[0115] Figure 5 2 is a simplified flowchart of displaying a target image provided by an embodiment of this specification. The flowchart can illustrate the process from step 208 to step 218. Figure 5 As shown, when the target application starts running, the target voxel data can be loaded into the GPU of the image display device. If the target application is a game program, the target voxel data is loaded when the game starts. In the case where voxel data corresponding to a plurality of shadow resolutions are pre-generated, the target application can determine the appropriate shadow resolution based on the hardware characteristics of the image display device or the display quality of the image, and then load the voxel data of the shadow resolution. When displaying each frame of the target image, the screen pixel coordinates corresponding to the target image (that is, the position information of the pixel point) can be obtained, and then the corresponding world coordinates can be obtained; or the world coordinates of the constituent vertices of each object in the target area can be directly obtained, and the constituent vertices refer to the vertices of the triangular mesh constituting the object. Combined with the area information of the target scene (that is, the position information of each set area), the target voxel data of the target area where the pixel point is located is determined in the loaded target voxel data, and then the shadow information (that is, lit / shadow) of the pixel point is parsed therefrom, and then the shadow is drawn in the target image based on the shadow information.

[0116] By using the image display method provided in the embodiments of this specification, different areas in the target image can display different shadows, thereby improving the flexibility of shadow display. Figure 6 is a schematic diagram of a target image provided in an embodiment of this specification, Figure 7 is a schematic diagram of another target image provided by an embodiment of this specification. Figure 6 As shown in FIG. 1 , the shadow projection angles of two regions (such as region Q1 and region Q2) in the same layer of terrain in the target scene corresponding to the target image are different. Figure 7 As shown, the target scene corresponding to the target image may include two layers of terrain, such as the two layers of terrain include region Q3 and region Q4, and region Q3 is superimposed on region Q4, and the projection directions of shadows in region Q3 and region Q4 are opposite.

[0117] Traditional shadow drawing solutions do not support the effect of different areas showing shadows in different projection directions in the same scene without using multiple light sources. In addition, the resolution of shadows in different areas of the same scene is usually the same. In this way, in some games with large open maps, the resolution of shadows in large areas that are not explorable by players will be the same as the resolution of shadows in small explorable areas, which will result in a waste of display device performance.

[0118] In the embodiments of this specification, shadows can be pre-baked offline (that is, target voxel data is obtained). Specifically, multiple areas with different coordinates and different range sizes can be set, and different shadow resolutions and shadow projection directions can be selected for each area to bake the target voxel data (that is, shadow information). The target voxel data is loaded at runtime, and then shadows of different resolutions or directions can be drawn according to the different coordinate ranges in the target image. This supports the effect of different shadow projection directions in different areas under the game perspective of the same scene without using multiple light sources, which allows game makers to have more design space in scene visual design. At the same time, it is also possible to allow different areas to use shadows of different resolutions, reduce the drawing of high-resolution shadows, and achieve the purpose of performance optimization.

[0119] The method of the embodiment of this specification can strip off the lighting part to use the shadow function alone, and can draw shadows of different directions and resolutions in multiple areas without multiple light sources, which will greatly improve the game frame rate and greatly reduce memory usage. The voxel shadows in the embodiment of this specification also have huge data memory advantages and runtime time advantages compared to real-time shadows. At runtime, the call to the image application programming interface will be reduced, and the frame rate of the game will be improved. The shadow quality of voxel shadows is also better.

[0120] It should be noted that the execution subject of steps 202 to 206 is different from the execution subject of steps 208 to 218. Steps 202 to 206 can be executed by the image display device in the application development stage, and steps 208 to 218 can be executed by the image display device in the application application stage. Optionally, steps 202 to 218 can also be executed by the same device, which is not limited in the embodiments of this specification.

[0121] In the embodiments of this specification, it is taken as an example that for each pixel in the target image, its shadow information is determined in the manner of steps 212 to 216 described above. Optionally, the shadow information may be determined in this manner only for some of the pixels in the target image. For example, when the distance between the target area and the virtual camera in the target scene is greater than a distance threshold, the target voxel data of the target area is queried in this manner. Shadow information is determined in other ways for pixels in other positions. For example, when the distance between the target area and the virtual camera in the target scene is less than or equal to the distance threshold, cascade shadow (Cascade Shadow Maps) information of the target area may be generated; and then in step 218, the target image is rendered and displayed based on the cascade shadow information.

[0122] The following is an explanation using an area where the distance between the target area and the virtual camera is less than or equal to the distance threshold as an example. The image display device can mix and process the cascade shadow information of the transition area in the target area and the shadow information of the auxiliary area based on the shadow transition parameter. Among them, the distance between the auxiliary area and the virtual camera is greater than the distance threshold, and the transition area is a partial area of ​​the target area close to the auxiliary area. The image display device can render and display the target image based on the processed cascade shadow information of the target area and the shadow information of the auxiliary area. The image display device can render the transition area in the target image based on the processed cascade shadow information of the transition area; and render the auxiliary area in the target image based on the shadow information of the auxiliary area. In this way, the effect of fading out the shadow edge in the near place and fading in the shadow edge in the far place is achieved, ensuring that the shadow display is more natural.

[0123] For example, the area within a set distance close to the auxiliary area in the target area may belong to the transition area, such as the set distance may be 100 meters, 200 meters or 300 meters. The set distance may be set manually by the user, or may be set automatically by the image display device. The shadow transition parameter may characterize the degree of mixing of the shadow information of the auxiliary area in the cascaded shadow information of the transition area. The closer to the auxiliary area, the greater the corresponding degree of mixing. The shadow information of the auxiliary area may be voxel shadow information. The image display device may process the cascaded shadow information of the transition area using an attenuation algorithm, and the parameter value in the attenuation algorithm may be determined based on the shadow transition parameter. Optionally, there may also be a transition area in the auxiliary area, and the shadow information for the transition area may also be mixed with the cascaded shadow information of the transition area. The transition area may refer to the transition area in the target area.

[0124] In some embodiments, the display quality of the target image is different, and the shadow transition parameter may also be different accordingly. For example, when the display quality is high, the mixing degree represented by the shadow transition parameter may be high. Optionally, the size of the transition area may also be related to the display quality, such as positively correlated.

[0125] In some implementations, the cascaded shadow information and the voxel shadow information may be weakened directly without mixing the cascaded shadow information with the voxel shadow information, which can also ensure the natural display of the shadow to a certain extent and avoid the shadow being displayed too abruptly.

[0126] In a related technology, cascade shadows are used as shadow drawing solutions for each pixel in the target image in real time, but this will cause high memory consumption and reduce the operating efficiency of the device. In addition, due to the hardware limitations of the device, the drawing distance of the cascade shadows cannot be set far enough, resulting in missing or reduced quality of shadows at longer distances.

[0127] In the embodiment of this specification, target voxel data representing shadow information is baked offline, and the target voxel data produced offline can be loaded when the application is running to draw shadows in the distance, while real-time cascade shadows are used in the near distance. This can increase the drawable shadow distance, improve the shadow quality, avoid memory consumption caused by real-time calculation of distant shadows, and optimize the running performance of the device.

[0128] In some embodiments, the image display device uses an anti-aliasing scheme corresponding to the display quality of the target image to perform anti-aliasing processing on the shadow information; based on the shadow information after anti-aliasing processing, the target image is rendered and displayed. For example, the image display device can use the anti-aliasing scheme to blur the shadow information during rendering to avoid the jagged feeling of the shadow and improve the artistic performance. For example, a percentage progressive filtering (PCF, Percentage Closer Filtering) algorithm can be used for anti-aliasing processing to soften the shadow edge.

[0129] Different anti-aliasing schemes can be used for different display qualities. For example, the PCF algorithm parameters corresponding to high display quality are different from the PCF algorithm parameters corresponding to low display quality. The PCF algorithm parameters corresponding to high display quality can have a higher degree of softening for the edge, while the PCF algorithm parameters corresponding to low display quality can have a lower degree of softening for the edge.

[0130] Figure 8 1 is a setting page diagram of an image display device provided in an embodiment of the present specification. The setting page is used to set the shadow display mode in the image. The user can manually adjust the shadow display mode based on the setting page. Figure 8 As shown, the user can select the scene loading mode, such as the large world loading mode or the single scene loading mode. For example, in the large world loading mode, the shadow information can be loaded by streaming loading, and in the single scene loading mode, the shadow information of the entire scene can be loaded at one time. The user can also choose whether to preload voxel data, that is, whether to load the voxel data into the memory in advance before displaying the image. Optionally, the large world loading mode can prohibit preloading of voxel data by default.

[0131] The image display device can use multi-threading to achieve asynchronous loading of shadow information. The user can use the "frame loading granularity" option to set the maximum load corresponding to uploading shadow information from memory to the GPU, that is, the maximum amount of shadow data loaded by the rendering thread at one time. The user can also use the "shadow color depth" setting item to set the color depth when the shadow is displayed to ensure that the shadow display is more in line with the requirements. The shadow color depth can range from 0 to 1, such as the shadow color depth can correspond to the opacity of the shadow.

[0132] The image display device can also make relevant settings for shadows for a single scene. The user can set the shadow compensation distance, through which the original shadow drawing distance can be fine-tuned, such as extending the shadow drawing distance to a certain extent. The user can also set the camera bounding box test multiplier factor, which is used to determine the appropriate shadow drawing distance. The user can also set the shadow fade distance, which can refer to the size of the transition area when different types of shadows are mixed. The user can also set the voxel shadow distance, which is the maximum distance between the area using voxel shadows and the virtual camera.

[0133] The image display device can also set a soft shadow mode, which can correspond to an anti-aliasing solution. For example, you can choose to use the PCF9*9 algorithm to perform anti-aliasing on the shadow information in the setting options of the soft shadow mode. The user can also choose algorithms such as PCF5*5 or PCF3*3. The image display device can also set the GPU default capacity corresponding to the voxel data. The image display device can also set a transition factor, which characterizes the degree of mixing between voxel shadows and cascade shadows. For example, the transition factor can be adjusted to 1.7. The image display device can also set the resource storage path for each area in the scene.

[0134] Table 2 below shows the scene parameter settings under different display qualities. As shown in Table 2 below, directional light source settings can be performed for the target scene. For example, the first row in Table 2 refers to the parameter settings for whether to turn on shadow display under directional light source, the second row in Table 2 refers to the drawing distance for cascade shadows, and the third row refers to the shadow strength adjustment parameters. Voxel shadow settings can also be performed for the target scene, such as whether to turn on voxel shadows for different display qualities, as well as setting different voxel shadow distances, soft shadow modes, low-quality real-time shadow compensation parameters, and data accuracy loading modes.

[0135] Table 2

[0136]

[0137] In the embodiments of this specification, for different display qualities of the target image, shadows of different precisions can be used, and real-time cascade shadows and offline voxel shadows can be combined to draw shadows, and different anti-aliasing schemes can be used, so as to improve the shadow display effect of the image. In addition, for different display qualities, different shadow loading strategies can be used to reduce redundant data in memory and video memory, and reduce the occupancy of memory and video memory.

[0138] In summary, in the image display method provided in the embodiment of the present specification, the target area where the pixel point is located in the three-dimensional scene can be determined based on the position information of the pixel point in the target image to be displayed, and then the shadow information of the pixel point can be obtained from the target voxel data of the target area to display the shadow in the scene image. In this way, for different pixels in the target image, the shadow information of the pixel point can be obtained directly based on the target voxel data of the corresponding area in the three-dimensional scene, and different states of shadows in different areas can be displayed, which improves the flexibility of shadow display and thus improves the display effect of the scene image. In addition, the shadow information is carried in the target voxel data of the target area. Since the voxel data can represent more information than the data in the two-dimensional depth map, the shadow information can be more accurate than the shadow information determined based on the two-dimensional depth map, which can improve the display quality of the shadow in the scene image.

[0139] Corresponding to the above method embodiment, this specification also provides an image display device embodiment, Fig. 9 1 is a schematic diagram of the structure of an image display device provided in one embodiment of this specification. Fig. 9 As shown, the image display device includes:

[0140] The first acquisition module 701 is used to acquire information of a target image;

[0141] A first determination module 702 is used to determine a target area where the pixel point is located in a target scene according to the position information of the pixel point in the target image, wherein the target scene is a three-dimensional scene corresponding to the target image;

[0142] A query module 703 is used to query the target voxel data of the target area and parse the target voxel data to obtain the shadow information of the pixel point, wherein the target voxel data is determined in advance based on the area information and light source information of the target scene;

[0143] The display module 704 is used to render and display the target image based on the shadow information.

[0144] Optionally, the first determining module 702 includes:

[0145] According to the position information of the pixel point in the target image, the world coordinate corresponding to the pixel point in the world coordinate system of the target scene is determined;

[0146] The area where the position indicated by the world coordinates in the target scene is located is determined as the target area where the pixel point is located in the target scene.

[0147] Optionally, the image display device further includes:

[0148] A second acquisition module is used to acquire shadow parameters of the target area corresponding to the target image before querying the target voxel data of the target area; wherein the shadow parameters include shadow projection direction and / or shadow resolution;

[0149] The query module 703 is used to query the target voxel data of the target area under the shadow parameter.

[0150] Optionally, the image display device further includes:

[0151] A third acquisition module is used to acquire the region information of the target scene before querying the target voxel data of the target region, wherein the region information includes a depth map of the target region in the target scene;

[0152] The first generating module is used to determine target voxel data of the target area based on the depth map and light source information of the target area; wherein the target voxel data represents shadow information of each voxel in the target area.

[0153] Optionally, the first generating module is used for:

[0154] Processing the depth map of the target area to obtain auxiliary depth maps at multiple hierarchical and refined texture levels;

[0155] A sparse voxel octree of the target area is constructed based on each auxiliary depth map and light source information to obtain target voxel data of the target area.

[0156] Optionally, the first generating module is used to: generate target voxel data of multiple shadow resolutions for the target area based on the depth map and light source information of the target area;

[0157] The query module 703 is used to query target voxel data of a shadow resolution corresponding to the display quality among target voxel data of multiple shadow resolutions based on the display quality of the target image.

[0158] Optionally, the first generating module is used to: determine the objects to be excluded in the target area for each shadow resolution based on object screening rules corresponding to multiple shadow resolutions; and generate target voxel data of the target area corresponding to each shadow resolution for objects other than the objects to be excluded in the target area.

[0159] Optionally, the image display device further includes:

[0160] a segmentation module, configured to segment the target scene into a plurality of plots before generating target voxel data of the target area based on the depth map and light source information of the target area, if the size of the target scene is greater than a size threshold, wherein the target area includes at least one plot of the plurality of plots;

[0161] The first generating module is used to generate voxel data of each block based on the depth map and light source information of each block, and obtain target voxel data of the target area, wherein the target voxel data includes voxel data of at least one block.

[0162] Optionally, the image display device further includes:

[0163] A loading module, used for loading voxel data of various blocks around the position of the virtual camera within the shooting distance into the memory and the video memory before querying the target voxel data of the target area, based on the position of the virtual camera in the target scene and the shooting distance of the virtual camera;

[0164] The query module 703 is used to query the target voxel data of the target area in the voxel data of each block loaded into the memory.

[0165] Optionally, the image display device further includes:

[0166] The unloading module is used to unload redundant voxel data from the memory and the video memory after acquiring the information of the target image, wherein the land parcel to which the redundant voxel data belongs is located outside the shooting distance of the position of the virtual camera.

[0167] Optionally, the image display device further includes:

[0168] A compression module, used for compressing the target voxel data of the target area after determining the target voxel data of the target area;

[0169] The query module 703 is used to query the compressed target voxel data of the target area.

[0170] Optionally, the image display device further includes:

[0171] A storage module, used for storing the target voxel data of the target area after determining the target voxel data of the target area;

[0172] A second generating module is used to generate a configuration file corresponding to the target voxel data of the target area, wherein the configuration file is used to record the storage location of the target voxel data of the target area;

[0173] The query module 703 is used to query the target voxel data of the target area in the storage location based on the configuration file.

[0174] Optionally, the query module 703 is used to query target voxel data of the target area when the distance between the target area and the virtual camera in the target scene is greater than a distance threshold.

[0175] Optionally, the image display device further includes:

[0176] A third generating module is used to generate cascade shadow information of the target area when the distance between the target area and the virtual camera in the target scene is less than or equal to the distance threshold;

[0177] The display module is used to render and display the target image based on the cascade shadow information.

[0178] Optionally, the display module is used to: based on the shadow transition parameters, mix and process the cascade shadow information of the transition area in the target area and the shadow information of the auxiliary area; wherein the distance between the auxiliary area and the virtual camera is greater than the distance threshold, and the transition area is a partial area of ​​the target area close to the auxiliary area; based on the processed cascade shadow information of the target area and the shadow information of the auxiliary area, render and display the target image.

[0179] Optionally, the display module is used to: adopt an anti-aliasing scheme corresponding to the display quality of the target image to perform anti-aliasing processing on the shadow information; and render and display the target image based on the shadow information after the anti-aliasing processing.

[0180] In summary, in the image display device provided in the embodiment of the present specification, the target area where the pixel point is located in the three-dimensional scene can be determined based on the position information of the pixel point in the target image to be displayed, and then the shadow information of the pixel point can be obtained from the target voxel data of the target area to display the shadow in the scene image. In this way, for different pixels in the target image, the shadow information of the pixel point can be obtained directly based on the target voxel data of the corresponding area in the three-dimensional scene, and different states of shadows in different areas can be displayed, which improves the flexibility of shadow display and thus improves the display effect of the scene image. In addition, the shadow information is carried in the target voxel data of the target area. Since the voxel data can represent more information than the data in the two-dimensional depth map, the shadow information can be more accurate than the shadow information determined based on the two-dimensional depth map, which can improve the display quality of the shadow in the scene image.

[0181] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the image display device, since it is basically similar to the image display method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the image display method embodiment.

[0182] Fig.10 5 is a block diagram of a computing device provided in an embodiment of the present specification. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and the database 550 is used to store data.

[0183] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).

[0184] In one embodiment of the present specification, the above components of the computing device 500 and Fig.10 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.10 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0185] The computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 500 may also be a mobile or stationary server.

[0186] The processor 520 is used to execute the following computer executable instructions, which, when executed by the processor, implement the above Figure 1 or Figure 2 The method shown.

[0187] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computing device embodiment, since it is basically similar to the image display method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the image display method embodiment.

[0188] One embodiment of the present specification also provides a computer-readable storage medium, which stores computer instructions, and when the computer instructions are executed by the processor, the steps of the above-mentioned image display method are implemented. The computer instructions include computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.

[0189] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computer-readable storage medium embodiment, since it is basically similar to the image display method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the image display method embodiment.

[0190] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned image display method.

[0191] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computer program embodiment, since it is basically similar to the image display method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the image display method embodiment.

[0192] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0193] It should be noted that the above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of the present specification.

[0194] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0195] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. An image display method, characterized in that: The method comprises: Get the information of the target image; Determining a target area where the pixel point is located in a target scene according to position information of the pixel point in the target image, wherein the target scene is a three-dimensional scene corresponding to the target image; Querying target voxel data of the target area, and parsing the target voxel data to obtain shadow information of the pixel point, wherein the target voxel data is pre-determined based on area information and light source information of the target scene; Based on the shadow information, the target image is rendered and displayed.

2. The method according to claim 1, characterized in that The step of determining the target area where the pixel point is located in the target scene according to the position information of the pixel point in the target image includes: Determine the world coordinates of the pixel points in the target scene according to the position information of the pixel points in the target image; The area where the position indicated by the world coordinates in the target scene is located is determined as the target area where the pixel point in the target scene is located.

3. The method according to claim 1, characterized in that Before querying the target voxel data of the target area, the method further includes: Acquire shadow parameters of the target area corresponding to the target image; wherein the shadow parameters include shadow projection direction and / or shadow resolution; The querying of the target voxel data of the target area includes: Query target voxel data of the target area under the shadow parameters.

4. The method according to any one of claims 1 to 3, characterized in that: Before querying the target voxel data of the target area, the method further includes: Acquire area information of a target scene, wherein the area information includes a depth map of a target area in the target scene; Based on the depth map and light source information of the target area, target voxel data of the target area is generated; wherein the target voxel data represents shadow information of each voxel in the target area.

5. The method according to claim 4, characterized in that The step of generating target voxel data of the target area based on the depth map and light source information of the target area comprises: Processing the depth map of the target area to obtain auxiliary depth maps at multiple hierarchical and refined texture levels; A sparse voxel octree of the target area is constructed based on each auxiliary depth map and light source information to obtain target voxel data of the target area.

6. The method according to claim 4, characterized in that The step of generating target voxel data of the target area based on the depth map and light source information of the target area comprises: Based on the depth map and light source information of the target area, generating target voxel data of multiple shadow resolutions for the target area; The querying of the target voxel data of the target area includes: Based on the display quality of the target image, the target voxel data of the shadow resolution corresponding to the display quality is searched among the target voxel data of the multiple shadow resolutions.

7. The method according to claim 6, characterized in that The generating target voxel data with multiple shadow resolutions for the target area includes: Based on object screening rules corresponding to a plurality of shadow resolutions, determining the objects to be excluded in the target area for each shadow resolution; For objects other than the to-be-excluded objects in the target area, target voxel data of the target area corresponding to each shadow resolution is generated.

8. The method according to claim 4, characterized in that Before generating target voxel data of the target area based on the depth map and light source information of the target area, the method further includes: When the size of the target scene is greater than a size threshold, dividing the target scene into a plurality of plots, wherein the target area includes at least one plot among the plurality of plots; The step of generating target voxel data of the target area based on the depth map and light source information of the target area comprises: Based on the depth map and light source information of each block, voxel data of each block is generated to obtain target voxel data of the target area, wherein the target voxel data includes voxel data of the at least one block.

9. The method according to claim 8, characterized in that Before querying the target voxel data of the target area, the method further includes: Based on the position of the virtual camera in the target scene and the shooting distance of the virtual camera, voxel data of blocks around the position of the virtual camera within the shooting distance are loaded into the memory and the video memory; The querying of the target voxel data of the target area includes: The target voxel data of the target area is queried in the voxel data of each block loaded into the memory and the video memory.

10. The method according to claim 9, characterized in that After acquiring the information of the target image, the method further includes: Redundant voxel data is unloaded from the memory and the video memory, wherein the land parcel to which the redundant voxel data belongs is located outside the shooting distance of the virtual camera.

11. The method according to claim 4, characterized in that After generating the target voxel data of the target area, the method further includes: compressing the target voxel data of the target area; The querying of the target voxel data of the target area includes: The compressed target voxel data of the target area is queried.

12. The method according to claim 4, characterized in that After generating the target voxel data of the target area, the method further includes: storing target voxel data of the target area; Generate a configuration file corresponding to the target voxel data of the target area, wherein the configuration file is used to record the storage location of the target voxel data of the target area; The querying of the target voxel data of the target area includes: Based on the configuration file, the target voxel data of the target area is queried in the storage location.

13. The method according to any one of claims 1 to 3, characterized in that: The querying of the target voxel data of the target area includes: When the distance between the target area in the target scene and the virtual camera is greater than a distance threshold, query target voxel data of the target area.

14. The method according to claim 13, characterized in that The method further comprises: When the distance between the target area and the virtual camera in the target scene is less than or equal to the distance threshold, generating cascade shadow information of the target area; Based on the cascaded shadow information, the target image is rendered and displayed.

15. The method according to claim 14, characterized in that The rendering and displaying of the target image based on the cascaded shadow information includes: Based on the shadow transition parameter, the cascade shadow information of the transition area in the target area and the shadow information of the auxiliary area are mixed and processed; wherein the distance between the auxiliary area and the virtual camera is greater than the distance threshold, and the transition area is a partial area of ​​the target area close to the auxiliary area; The target image is rendered and displayed based on the processed cascade shadow information of the target area and the shadow information of the auxiliary area.

16. The method according to any one of claims 1 to 3, characterized in that: Rendering and displaying the target image based on the shadow information includes: Using an anti-aliasing solution corresponding to the display quality of the target image, anti-aliasing processing is performed on the shadow information; Based on the shadow information after anti-aliasing processing, the target image is rendered and displayed.

17. An image display device, characterized in that: The image display device comprises: A first acquisition module, used to acquire information of a target image; A first determination module, configured to determine a target area where the pixel point is located in a target scene according to position information of the pixel point in the target image, wherein the target scene is a three-dimensional scene corresponding to the target image; A query module, used for querying target voxel data of the target area, and parsing the target voxel data to obtain shadow information of the pixel point, wherein the target voxel data is determined in advance based on area information and light source information of the target scene; A display module is used to render and display the target image based on the shadow information.

18. A computing device, characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the method according to any one of claims 1 to 16 is implemented.

19. A computer-readable storage medium, characterized in that: Computer executable instructions are stored, and when the computer executable instructions are executed by a processor, the method according to any one of claims 1 to 16 is implemented.

Citation Information

Patent Citations

  • Image display method and device, computing equipment and computer readable storage medium

    CN117611728A