Volumetric cloud data storage method, device and storage medium

By combining the high-precision first 3D map and the low-precision second 3D map in volume cloud rendering, the problem of high resource consumption of volume cloud data storage is solved, and high-precision and non-surface mapping near the surface of the volume cloud are achieved. Efficient storage of nearby points reduces storage requirements and improves rendering performance.

CN114332347BActive Publication Date: 2024-10-11BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111162609.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2024-10-11
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

Existing volumetric cloud rendering methods consume high storage resources and are difficult to effectively reduce the storage requirements of volumetric cloud data.

Method used

By obtaining the distance field information of the target scene, the distance field information of points near the surface of the volume cloud is saved in a high-precision first 3D map, and the distance field information of points not near the surface is compressed and stored, using the second 3D The map stores information common to multiple points in low precision, and reads high-precision data from the first 3D map when necessary.

Benefits of technology

It greatly reduces the number of points that require high-precision storage, reduces the consumption of storage resources, and improves rendering performance. It is especially suitable for smooth rendering of large volume cloud scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114332347B_ABST
    Figure CN114332347B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method, device and storage medium for storing volumetric cloud data. After obtaining the distance field information of the target scene containing the volumetric cloud, the distance field information of each point in the target scene located near the surface of the volumetric cloud is stored in the storage unit of the first 3D map, and the distance field information of the target scene is compressed by a specified multiple and stored in the second 3D map; wherein, in the second 3D map, each map unit stores the distance field information shared by the compressed multiple points, and the map unit corresponding to the point near the surface of the volumetric cloud stores the index of the storage unit in the first 3D map. Thus, the distance field information of the points in the target scene that are not near the surface of the volumetric cloud can be compressed and stored, and the distance field information of the main points of interest near the surface of the volumetric cloud can be stored with high precision, which greatly reduces the number of points that need to be stored with high precision and reduces the consumption of storage resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a volume cloud data storage method, device and storage medium. Background Art

[0002] Volumetric Cloud is also called volumetric cloud or volumetric fog. When rendering virtual scenes (such as game scenes), a graphics engine is usually used to simulate the translucent and irregular effects of real clouds and fog.

[0003] In existing volumetric cloud rendering methods, data structures such as octrees are usually used to store the data required for rendering volumetric clouds. However, this storage method consumes a lot of storage resources. Therefore, a solution needs to be proposed. Summary of the invention

[0004] Multiple aspects of the present application provide a volumetric cloud data storage method, device, and storage medium to reduce the consumption of storage resources by data required for rendering the volumetric cloud.

[0005] An embodiment of the present application provides a method for storing volumetric cloud data, comprising: acquiring distance field information of a target scene; the distance field information comprising a minimum distance from a point in the target scene to a surface of a volumetric cloud in the target scene; the distance field information comprising a minimum distance from a point in the target scene to the surface of the volumetric cloud; storing the distance field information of each point in the target scene near the surface of the volumetric cloud in a storage unit of a first 3D map; compressing the distance field information of the target scene by a specified multiple and storing it in a second 3D map; wherein, in the second 3D map, each map unit stores distance field information shared by a plurality of compressed points, and the map units corresponding to the points near the surface of the volumetric cloud store indexes of the storage units in the first 3D map.

[0006] Further optionally, compressing the distance field information of the target scene by a specified multiple and saving it in the second 3D map includes: compressing each N*N*N point in the target scene into a map unit in the second 3D map; for any map unit, blurring the distance field information of each of the N*N*N points corresponding to the map unit to obtain the distance field information shared by the N*N*N points; and saving the distance field information shared by the N*N*N points in the first channel of the map unit.

[0007] Further optionally, the method also includes: if the N*N*N points are located near the surface of the volumetric cloud, saving the index of the storage unit corresponding to the N*N*N points in the first 3D map in the second channel and the third channel of the map unit; wherein, in the corresponding storage unit in the first 3D map, N*N*N voxels are used to save the distance field information of each of the N*N*N points.

[0008] Further optionally, the distance field information of each point in the target scene located near the surface of the volume cloud is stored in a storage unit of the first 3D map, including: obtaining a 3D noise map of the points located near the surface of the volume cloud; and superimposing the first 3D map and the 3D noise map to obtain an eroded first 3D map.

[0009] Further optionally, it also includes: in response to an instruction to render the volumetric cloud in the target scene, emitting a ray from the position of the virtual camera in the target scene to multiple pixel points on the screen respectively; controlling the multiple rays corresponding to the multiple pixel points to step along the line of sight direction respectively, and at each step, determining the distance field information of the stepping points reached by the multiple rays respectively according to the first 3D map and / or the second 3D map as the stepping distances of the multiple rays respectively, until the multiple rays respectively reach the surface of the volumetric cloud; determining the shape of the volumetric cloud in the three-dimensional space where the target scene is located according to the lengths of the multiple rays; and rendering the volumetric cloud according to the shape of the volumetric cloud in the three-dimensional space.

[0010] Further optionally, at each step, determining the distance field information of the stepping points reached by each of the multiple rays according to the first 3D map and / or the second 3D map, includes: for any one of the multiple rays, when the ray reaches any stepping point, determining the target map unit corresponding to the stepping point from the second 3D map; if the index in the target map unit does not point to the storage unit in the first 3D map, using the distance field information stored in the target map unit as the distance field information of the stepping point; if the index in the target map unit points to the target storage unit in the first 3D map, determining the target storage unit from the first 3D map according to the index of the target storage unit; and determining the distance field information of the stepping point from the target storage unit according to the coordinates of the stepping point.

[0011] Further optionally, according to the distance field information, the multiple rays corresponding to the multiple pixel points are controlled to step along the line of sight direction respectively until the multiple rays reach the surface of the volume cloud respectively, including: for any one of the multiple rays, according to the minimum distance from the point where the virtual camera is located to the surface of the volume cloud, light stepping is performed along the line of sight direction corresponding to the ray to reach a stepping point; according to the minimum distance from the stepping point to the surface of the volume cloud, it is judged whether the stepping point is located on the surface of the volume cloud; if the stepping point is located on the surface of the volume cloud, the stepping operation of the ray is stopped, and according to the distance from the virtual camera to the stepping point, the distance between the virtual camera and the surface of the volume cloud in the line of sight direction corresponding to the ray is determined.

[0012] Further optionally, it also includes: if the stepping point is not on the surface of the volume cloud, then according to the minimum distance from the stepping point to the surface of the volume cloud, continuing to step the light along the line of sight direction corresponding to the ray until the new stepping point reached by the ray is located on the surface of the volume cloud.

[0013] Further optionally, the shape of the volumetric cloud in the three-dimensional space where the target scene is located is determined based on the lengths of the multiple rays, including: calculating the depth values ​​from multiple pixel points on the screen to the surface of the volumetric cloud based on the lengths of the multiple rays and the angles corresponding to the respective line of sight directions of the multiple rays; determining the shape of the volumetric cloud in the three-dimensional space based on the depth values ​​from the multiple pixel points on the screen to the surface of the volumetric cloud.

[0014] An embodiment of the present application also provides an electronic device, including: a memory and a processor; the memory is used to store one or more computer instructions; the processor is used to execute the one or more computer instructions to: execute the steps in the volumetric cloud data storage method provided in the embodiment of the present application.

[0015] The embodiment of the present application also provides a computer-readable storage medium storing a computer program, which can implement the steps in the method provided in the embodiment of the present application when the computer program is executed.

[0016] The embodiment of the present application also provides a computer program product, including a computer program / instructions. When the computer program is executed by a processor, the processor is caused to implement the steps in the method provided in the embodiment of the present application.

[0017] In the volume cloud data storage method provided in the embodiment of the present application, after obtaining the distance field information of the target scene containing the volume cloud, the distance field information of each point in the target scene located near the surface of the volume cloud is stored in the storage unit of the first 3D map, and the distance field information of the target scene is compressed by a specified multiple and stored in the second 3D map; wherein, in the second 3D map, each map unit stores the distance field information shared by the compressed multiple points, and the map unit corresponding to the point near the surface of the volume cloud stores the index of the storage unit in the first 3D map. Thus, the distance field information of the points in the target scene that are not near the surface of the volume cloud can be compressed and stored, and the distance field information of the main points of interest near the surface of the volume cloud can be stored with high precision, which greatly reduces the number of points that need to be stored with high precision and reduces the consumption of storage resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1a A schematic diagram of a flow chart of a volume cloud data storage method provided by an exemplary embodiment of the present application;

[0020] Figure 1b A schematic diagram of a first 3D map provided by an exemplary embodiment of the present application;

[0021] Figure 1c A schematic diagram of a second 3D map provided by an exemplary embodiment of the present application;

[0022] Figure 1d A schematic diagram of querying a storage unit in a first 3D map according to an index in a second 3D map provided by an exemplary embodiment of the present application;

[0023] Figure 2 A schematic flow chart of a volume cloud rendering method provided by another exemplary embodiment of the present application;

[0024] Figure 3 A schematic diagram of a virtual camera emitting rays to a plurality of pixels on a screen provided by an exemplary embodiment of the present application;

[0025] Figure 4 A schematic diagram of ray stepping based on a distance field provided for an exemplary embodiment of the present application;

[0026] Figure 5 A schematic diagram of the structure of an electronic device provided as an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0028] Volumetric Cloud is also called volumetric cloud or volumetric fog. When rendering virtual scenes (such as game scenes), a graphics engine is usually used to simulate the translucent and irregular effects of real clouds and fog.

[0029] In some solutions, data structures such as octrees are usually used to store the data (such as texture data) required for rendering volume clouds. However, this storage method is complex, requires support from the underlying framework, and is difficult to use on some devices.

[0030] In view of the above technical problems, a solution is provided in some embodiments of the present application. The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0031] Figure 1a A flow chart of a volume cloud data storage method provided by an exemplary embodiment of the present application is shown in FIG. Figure 1a As shown, the method includes:

[0032] Step 101: Acquire distance field information of a target scene; the distance field information includes a minimum distance from a point in the target scene to a surface of a volume cloud in the target scene.

[0033] Step 102: Save the distance field information of each point in the target scene that is located near the surface of the volume cloud in a storage unit of the first 3D map.

[0034] Step 103: compress the distance field information of the target scene by a specified multiple and save it in a second 3D map; wherein, in the second 3D map, each map unit stores distance field information shared by a plurality of compressed points, and the map unit corresponding to the point near the surface of the volume cloud stores the index of the storage unit in the first 3D map.

[0035] This embodiment can be implemented by an electronic device, which can be a terminal device such as a smart phone, a tablet computer, a computer, or a server device, and this embodiment does not limit it. Among them, the target scene can include any virtual 3D (3-dimensional) scene obtained by scene modeling, which can be a game scene (such as a large map scene), or an animation scene, etc., and this embodiment does not limit it. The target scene includes a volume cloud.

[0036] Among them, the distance field (Signed Distance Field) is a function that calculates the distance. The position of a point is input, and based on the distance field function, the minimum distance from the point to the surface of any object in the scene can be output. When the point is inside the object, the value output by the distance field is negative; when the point is outside the object, the value output by the distance field is positive; when the point is on the surface of the object, the value output by the distance field is 0.

[0037] In this embodiment, the distance field information in the target scene refers to the distance field information of the point in the target scene, which is calculated based on the relative position relationship between the point in the target scene and the volume cloud in the target scene. The distance field information includes the minimum distance from any point in the target scene to the surface of the volume cloud in the target scene. That is, the distance field information of the target scene includes the distance field information of each of the multiple points in the target scene. The point in the target scene refers to the sampling point obtained by sampling the three-dimensional space corresponding to the target scene.

[0038] When calculating the minimum distance from any point to the surface of the volume cloud, the calculation can be performed based on the distance field function. The value of the distance field output of the point located inside the volume cloud model is negative; the value of the distance field output of the point located on the surface of the volume cloud model is 0.

[0039] For points outside the volume cloud model, when calculating the distance field of the external points based on the distance field function, the coordinates of each point on the surface of the volume cloud in the target scene can be determined according to the position of the volume cloud in the target scene and the shape information of the volume cloud model. For any position point A outside the volume cloud, the distance between the position point A and each point on the surface of the volume cloud can be calculated according to the coordinates of the position point A and the coordinates of each point on the surface of the volume cloud in the target scene. Based on the above method, multiple distances between the position point A and the surface of the volume cloud can be calculated, and the minimum distance can be selected from the multiple distances to obtain the output value of the distance field of the position point.

[0040] After the distance field information of the target scene is calculated, the distance field information can be stored as a rendering resource file of the target scene. In a subsequent rendering process, the volume cloud can be rendered according to the distance field information of the target scene.

[0041] In some scenarios, when the target scene is a large scene, or the volumetric cloud is a large or giant volumetric cloud, storing the distance field information of the target scene will occupy more storage resources. In practice, when observing a volumetric cloud, people are more visually interested in the information near the surface of the volumetric cloud, and less interested in other information outside the surface of the volumetric cloud. Therefore, when rendering a volumetric cloud, the accuracy requirements for points near the surface of the volumetric cloud (main points of interest) are higher, and the accuracy requirements for other points (non-main points of interest) other than near the surface are lower. Among them, the points near the surface of the volumetric cloud refer to the points within a specified distance range from the surface of the volumetric cloud.

[0042] Based on this, in this embodiment, the distance field information of non-main interest points in the target scene can be compressed and stored, and the distance field information of the main interest points near the surface can be stored with high precision. In this way, only the distance field information of the points near the surface of the volume cloud needs to be stored with high precision, thereby reducing the number of points that need to be stored with high precision and reducing the consumption of storage resources.

[0043] When compressing and storing the distance field information, the distance field information may be discretely sampled. In this embodiment, the distance field information of the points in the target scene may be sampled according to the set sampling accuracy, and the sampling results may be stored using a 3D map. The 3D map may be used to store distance field information of different accuracy as SDF (Signed Distance Functions) values. SDF is a method of representing a geometric body using a distance equation, and is used to determine the position of a point inside or outside a boundary.

[0044] The distance field information corresponding to points near the surface of the volume cloud can be stored in a 3D map (i.e., the first 3D map), such as Figure 1b The distance field information stored in the first 3D map is the distance field information initially calculated, which is sampled with a higher sampling accuracy and has not been blurred, so it has a higher accuracy.

[0045] The distance field information in the target scene can be compressed and stored in another 3D texture (i.e., the second 3D texture), such as Figure 1c As shown. Compressed storage refers to sampling the distance field information of the target scene with a lower sampling accuracy, and obtaining low-precision distance field information. The second 3D map includes multiple map units (i.e., the smallest storage unit), and each map unit is used to compress and store the distance field information of multiple points. After compressed storage, multiple points in the target scene are downsampled to one point, and multiple points share one distance field information, which has lower accuracy.

[0046] In this embodiment, the mapping unit in the first 3D mapping is divided into a plurality of storage units with a certain volume, each storage unit is composed of a plurality of voxels, such as Figure 1b As shown in FIG. 1 , each voxel is used to store the distance field information of a point near the surface of the volume cloud. The volume of the storage unit is associated with the compression storage multiple of the distance field information. If the distance field information is compressed N times, the volume of the storage unit is N*N*N, that is, the storage unit contains N*N*N voxels.

[0047] Among them, any storage unit in the first 3D map corresponds to a map unit in the second 3D map, and the distance field information of multiple points stored in the storage unit is compressed and stored in the map unit.

[0048] In order to facilitate the use of high-precision distance field information of points near the surface of the volume cloud, for some of the mapping units in the second 3D map corresponding to the points near the surface of the volume cloud, the index of the storage unit corresponding to this part of the mapping unit in the first 3D map can be saved in this part of the mapping unit. That is, if in the second 3D map, the mapping unit K1 is used to compress and store the low-precision distance field information of the point [P1] near the surface of the volume cloud, and in the first 3D map, the storage unit V1 is used to store the high-precision distance field information of the point [P1] near the surface of the volume cloud, then the index of the storage unit V1 can be stored in the mapping unit K1 for subsequent reading.

[0049] Based on the above method, when the distance field information of a point in the target scene is subsequently read, if the point is not near the volume cloud surface, the low-precision distance field information of the point can be read from the second 3D map. If the point is near the volume cloud surface, the index of the storage unit corresponding to the point can be read from the second 3D map, and according to the index of the storage unit, the high-precision distance field information corresponding to the point can be determined from the first 3D map according to the coordinates of the point (such as uv coordinates), such as Figure 1d shown.

[0050] In this embodiment, after obtaining the distance field information of the target scene including the volume cloud, the distance field information of each point in the target scene near the surface of the volume cloud is stored in the storage unit of the first 3D map, and the distance field information of the target scene is compressed by a specified multiple and stored in the second 3D map; wherein, in the second 3D map, each map unit stores the distance field information shared by the compressed multiple points, and the map unit corresponding to the point near the surface of the volume cloud stores the index of the storage unit in the first 3D map. Thus, the distance field information of the points in the target scene that are not near the surface of the volume cloud can be compressed and stored, and the distance field information of the main points of interest near the surface of the volume cloud can be stored with high precision, which greatly reduces the number of points that need to be stored with high precision and reduces the consumption of storage resources.

[0051] In some optional embodiments, a point in the target scene located near the volumetric cloud surface may be dynamically changed according to a virtual object dynamically appearing near the volumetric cloud surface.

[0052] When there is a virtual object in the target scene that is located near the volumetric cloud surface or dynamically passes near the volumetric cloud surface, the main points of interest near the volumetric cloud surface can be determined based on the position where the virtual object appears near the volumetric cloud surface and the distance between the virtual object and the volumetric cloud surface, and the distance field information of the main points of interest can be sampled with higher accuracy.

[0053] For example, in some scenarios, when a virtual flying object (such as a bird, airplane, or other flying character) in the target scene flies near a volumetric cloud, the main points of interest near the volumetric cloud surface can be determined based on the path of the flying object and the distance between the flying object and the volumetric cloud surface. Among them, as the flight path of the flying object changes dynamically, the main points of interest near the volumetric cloud surface can change dynamically accordingly. Based on this implementation, the sampling accuracy of different points in the target scene can be flexibly adjusted according to the objects in the target scene, while reducing storage resources and meeting diverse rendering needs.

[0054] The following will take the compression of the distance field information of the target scene by N times as an example for further explanation, wherein N may be 4, 5, 6 or other values, which are not limited in this embodiment.

[0055] In some optional embodiments, when the distance field information of the target scene is compressed N times, each N*N*N point in the target scene can be compressed into a mapping unit in the second 3D mapping. For any mapping unit, the distance field information of each of the N*N*N points corresponding to the mapping unit can be fuzzy processed to obtain the distance field information shared by the N*N*N points. The fuzzy processing may include calculating the average value of the distance field information of multiple points or selecting the minimum value from multiple values, which is not limited in this embodiment. Next, the distance field information shared by the N*N*N points is saved in the first channel (e.g., B channel) of the mapping unit.

[0056] Optionally, if the N*N*N points are located near the surface of the volume cloud, the index of the storage unit corresponding to the N*N*N points in the first 3D map is saved in the second channel (e.g., R channel) and the third channel (e.g., G channel) of the map unit. The storage unit corresponding to the N*N*N points in the first 3D map stores the distance field information of each of the N*N*N points.

[0057] In some embodiments, if the multiple points corresponding to the mapping unit in the second 3D map are not near the surface of the volume cloud, the values ​​of the R channel and the G channel of the mapping unit may be stored as 0. If the multiple points corresponding to the mapping unit in the second 3D map are near the surface of the volume cloud, the R channel of the mapping unit may store the row coordinates of the storage unit corresponding to the mapping unit in the first 3D map, and the G channel may store the column coordinates of the storage unit corresponding to the mapping unit in the first 3D map.

[0058] In subsequent inquiries, if the values ​​of the R and G channels of the mapping unit corresponding to a certain point in the second 3D map are 0, the distance field information stored in the corresponding mapping unit in the second 3D map can be queried as the distance field information of the point. If the values ​​of the R and G channels of the mapping unit corresponding to a certain point in the second 3D map are not 0, the corresponding storage unit in the first 3D map can be queried according to the values ​​of the R and G channels, and the distance field information of the point can be obtained from the storage unit.

[0059] In some embodiments, when generating the first 3D map, a bilinear filtering method may be used to sample the smoothed result of the distance field of points near the surface of the volume cloud. For example, when sampling an area of ​​4*4*4 pixels, if the sampling result is desired to be continuous, the value of the boundary between every two adjacent voxels may be set to a repeated value, and a sampling value of 5*5*5 pixels may be obtained. When querying a voxel based on its index, the query index may be scaled to avoid reading a mixed result of the voxel and other surrounding voxels, which will not be described in detail.

[0060] In some optional embodiments, in order to further enrich the details near the surface of the volumetric cloud, noise can be superimposed in the first 3D map. Optionally, when the distance field information of each point near the surface of the volumetric cloud in the target scene is saved in the storage unit of the first 3D map, the 3D noise map of the points near the surface of the volumetric cloud can be obtained, and the first 3D map and the 3D noise map are superimposed to obtain the first 3D map after erosion. The first 3D map after erosion = the first 3D map + the set coefficient * 3D noise map. Among them, the setting coefficient can be set according to the demand, and this embodiment is not limited. When the storage unit is queried according to the index later, the query can be performed in the first 3D map after erosion to obtain the distance field information after the superimposed noise. Based on this embodiment, the detailed information of the volumetric cloud can be designed by setting the 3D noise map, so as to render a volumetric cloud with higher authenticity.

[0061] In some embodiments, the distance field information of the target scene may be calculated based on a model of the volumetric cloud and a position of the volumetric cloud in the target scene.

[0062] The electronic device may provide an operation interface, and one or more controls may be displayed on the operation interface. The one or more controls include a control for uploading a volume cloud model and a control for triggering a distance field conversion operation of the volume cloud. The user may upload a pre-customized volume cloud model through the above controls according to actual needs, and control the electronic device to perform a distance field conversion operation on the volume cloud model.

[0063] In other embodiments, the electronic device may provide one or more open interfaces (APIs), and the user may use the distance field conversion function provided by the electronic device by calling these open interfaces. In response to the calling operation of the open interface, the electronic device may obtain the customized designed volume cloud model from the interface parameters, and perform the distance field conversion operation on the volume cloud model.

[0064] The customized volume cloud model may be designed according to the requirements during the modeling process of the target scene, or may be personalized by an art producer, which is not limited in this embodiment.

[0065] Custom designed volumetric cloud models for display in target scenes.

[0066] In this embodiment, when rendering a customized volumetric cloud in a target scene, the model of the volumetric cloud can be obtained, and the distance field information of the target scene can be calculated based on the model of the volumetric cloud and the position of the volumetric cloud in the target scene; the distance field information includes the minimum distance from a point in the target scene to the surface of the volumetric cloud. The distance field information of the target scene can be used as a rendering resource file of the target scene, so that when rendering the target scene, the volumetric cloud can be rendered based on the distance field information of the target scene. In this embodiment, the shape of the cloud in the target scene can be specified based on the model of the volumetric cloud and the distance field information, and the cloud of the specified shape can be rendered, which meets the customized rendering requirements of the volumetric cloud. At the same time, the modeling of the volumetric cloud and the modeling of the target scene can be performed independently, which is conducive to improving the modeling efficiency of the virtual three-dimensional space.

[0067] Figure 2 A flow chart of a volume cloud rendering method provided by another exemplary embodiment of the present application is shown as follows: Figure 2 As shown, the method includes:

[0068] Step 201: Acquire distance field information of a target scene; the distance field information includes a minimum distance from a point in the target scene to a surface of a volume cloud in the target scene.

[0069] Step 202: Save the distance field information of each point in the target scene that is located near the surface of the volume cloud in a storage unit of the first 3D map.

[0070] Step 203: compress the distance field information of the target scene by a specified multiple and save it in a second 3D map; wherein, in the second 3D map, each map unit stores distance field information shared by a plurality of compressed points, and the map unit corresponding to the point near the surface of the volume cloud stores the index of the storage unit in the first 3D map.

[0071] Step 204 , in response to an instruction to render the volume cloud in the target scene, emit a ray from the position of the virtual camera in the target scene to each of the plurality of pixel points on the screen.

[0072] Step 205: Control the multiple rays corresponding to the multiple pixel points to step along the line of sight direction respectively, and at each step, determine the distance field information of the stepping points reached by the multiple rays respectively according to the first 3D map and / or the second 3D map as the stepping distances of the multiple rays respectively, until the multiple rays respectively reach the surface of the volume cloud.

[0073] Step 206: Determine the shape of the volume cloud in the three-dimensional space where the target scene is located according to the lengths of the multiple rays.

[0074] Step 207: Render the volume cloud according to the shape of the volume cloud in the three-dimensional space.

[0075] This embodiment can be implemented by an electronic device, which can be a terminal device such as a smart phone, a tablet computer, a computer, or a server device, and this embodiment does not limit it. Among them, the electronic device can run a component that can perform distance field conversion operations and a rendering engine that performs virtual scene rendering operations. Steps 201 to 203 can refer to the records of the previous embodiment and will not be repeated here.

[0076] Among them, the instruction to render the volumetric cloud in the target scene can be issued by the rendering engine, or it can be issued by an upstream application or component, and this embodiment does not limit it. In the process of rendering the volumetric cloud, a (Spheremarching) algorithm can be used to perform ray marching with the distance field information as the step size. First, a ray can be emitted from the position of the virtual camera in the target scene to multiple pixels on the screen respectively. The ray is used to simulate the light (line of sight) corresponding to the pixel. Among them, the angles of the rays corresponding to different pixels are different, that is, the line of sight directions of different pixels are different, such as Figure 3 Rays L1, L2 and L3 are shown.

[0077] When executing the Sphere marching algorithm, the multiple rays corresponding to the multiple pixel points can be controlled to step along the line of sight according to the distance field information of the points in the target scene, until the multiple rays reach the surface of the volume cloud respectively. The distance of each step can be regarded as the radius of the sphere, and the stepping process can be regarded as the process of drawing the sphere along the line of sight based on the radius. The virtual camera is located in the target scene, and the minimum distance from the position of the virtual camera (i.e., the viewpoint) to the surface of the volume cloud can be obtained from the distance field information of the points in the target scene. When the ray is stepped for the first time, the first step is performed according to the minimum distance from the point where the virtual camera is located to the surface of the volume cloud. The point reached in the target space by each stepping operation can be called a stepping point. Each time a stepping point is reached, the minimum distance from the stepping point to the surface of the volume cloud can be read from the distance field information of the target scene, and the distance can be used to determine whether the ray has stepped to the surface of the volume cloud. If the ray steps to the surface of the volume cloud, the stepping is stopped. If the ray does not step onto the surface of the volume cloud, the stepping continues according to the minimum distance from the stepping point to the surface of the volume cloud until the ray steps onto the surface of the volume cloud.

[0078] Wherein, at each step, the distance field information of the step point reached by each of the multiple rays can be determined according to the first 3D map and / or the second 3D map. Taking any one of the multiple rays as an example, when the ray reaches any step point, the target map unit corresponding to the step point can be determined from the second 3D map. If the index in the target map unit does not point to the storage unit in the first 3D map, it can be considered that the step point is not near the surface of the volume cloud. At this time, the distance field information stored in the target map unit can be used as the distance field information of the step point. That is, for a step point that is not near the surface of the volume cloud, the minimum distance from the step point to the surface of the volume cloud can be determined according to the low-precision distance field information corresponding to the step point.

[0079] Optionally, if the index in the target mapping unit points to the target storage unit in the first 3D mapping unit, the step point can be considered to be near the surface of the volume cloud. At this time, the target storage unit can be determined from the first 3D mapping unit according to the index of the target storage unit, and the distance field information of the step point can be determined from the target storage unit according to the coordinates of the step point. That is, for a step point located near the surface of the volume cloud, the minimum distance from the step point to the volume cloud surface can be determined according to the high-precision distance field information corresponding to the step point.

[0080] Since the distance field information expresses the minimum distance from a point in the target scene to the surface of the volume cloud, when performing ray stepping based on the distance field information, even if the volume cloud is an irregular object, it can ensure that the light will not enter the interior of the volume cloud and will eventually reach the surface of the volume cloud. At the same time, by performing ray stepping based on the distance field information, the appropriate step length can be quickly determined without a lot of calculations, thereby accelerating the speed at which the light steps to the surface of the volume cloud.

[0081] When multiple rays corresponding to multiple pixel points respectively step onto the surface of the volume cloud, the shape of the volume cloud in the three-dimensional space where the target scene is located can be determined according to the lengths of the multiple rays. Based on the shape of the volume cloud in the three-dimensional space, the volume cloud can be rendered.

[0082] In this embodiment, when rendering a volume cloud, the distance field information of the target scene is used during ray stepping to quickly determine the appropriate step length, which can prevent the ray from stepping into the interior of the volume cloud and accelerate the speed of the ray stepping to the surface of the volume cloud. Based on this volume cloud data storage method, the consumption of computing resources can be reduced, which is conducive to improving rendering performance and facilitating smooth operation of large-scale volume clouds on terminal devices.

[0083] The following will take a ray corresponding to any pixel point as an example to exemplarily introduce an implementation method of performing ray stepping according to distance field information.

[0084] Optionally, for any of the multiple rays, first, according to the position of the point where the virtual camera is located (i.e., the viewpoint) in the target scene, the minimum distance from the virtual camera to the surface of the volume cloud can be determined from the distance field information of the target scene. Next, according to the minimum distance from the point where the virtual camera is located to the surface of the volume cloud, the ray is stepped along the line of sight direction corresponding to the ray to reach the stepping point. The line of sight direction corresponding to the ray can be regarded as the direction of the line connecting the virtual camera and the pixel point corresponding to the ray, such as Figure 3 shown.

[0085] After reaching the step point, the minimum distance from the step point to the surface of the volume cloud can be determined from the distance field information of the target scene according to the position of the step point in the target scene. Based on the minimum distance from the step point to the surface of the volume cloud, it can be determined whether the step point is located on the surface of the volume cloud. Based on the definition of the distance field, if the minimum distance from the step point to the surface of the volume cloud is greater than 0, the step point is outside the volume cloud and has not reached the surface of the volume cloud. If the minimum distance from the step point to the surface of the volume cloud is equal to 0, the step point is on the surface of the volume cloud. If the minimum distance from the step point to the surface of the volume cloud is less than 0, the step point is located inside the volume cloud (this situation will not occur in this solution).

[0086] Therefore, based on the minimum distance from the stepping point to the surface of the volume cloud, it can be determined whether the stepping point is located on the surface of the volume cloud, and whether the minimum distance is greater than 0. If it is greater than 0, it is determined that it has not stepped onto the surface of the volume cloud. If it is equal to 0, it is determined that it has stepped onto the surface of the volume cloud.

[0087] If the stepping point is located on the surface of the volume cloud, the stepping operation of the ray can be stopped, and the distance between the virtual camera and the surface of the volume cloud in the line of sight direction corresponding to the ray can be determined based on the distance from the virtual camera to the stepping point.

[0088] Optionally, if the step point is not on the surface of the volume cloud, the ray stepping can be continued along the line of sight direction corresponding to the ray according to the minimum distance from the step point to the surface of the volume cloud, until the new step point reached by the ray is located on the surface of the volume cloud. When the ray reaches each step point, it can be determined whether it reaches the surface of the volume cloud according to the distance field information corresponding to the step point, so as to determine whether to continue stepping.

[0089] For example, in some embodiments, Figure 4As shown, during the first step, the step can be made according to the minimum distance between the camera and the surface of the volume cloud, and the ray reaches the first step point A; the distance between the first step point A and the surface of the volume cloud is greater than 0, at this time, the second step can be made according to the minimum distance between the first step point A and the surface of the volume cloud, and the ray reaches the second step point B; the distance between the second step point B and the surface of the volume cloud is greater than 0, at this time, the third step can be made according to the minimum distance between the second step point B and the surface of the volume cloud, and the ray reaches the third step point C; the distance between the third step point C and the surface of the volume cloud is greater than 0, at this time, the fourth step can be made according to the minimum distance between the third step point C and the surface of the volume cloud, and the ray reaches the fourth step point D; the distance between the fourth step point D and the surface of the volume cloud is greater than 0, at this time, the fifth step can be made according to the minimum distance between the fourth step point D and the surface of the volume cloud, and the ray reaches the fifth step point E; the distance between the fourth step point E and the surface of the volume cloud is equal to 0, at this time, it can be determined that the light has stepped to the surface of the volume cloud.

[0090] like Figure 4 As shown, at each step, the distance field of the viewpoint or the distance field of the step point is used as the step distance, which is equivalent to drawing a sphere with the distance field as the radius with the viewpoint or the step point as the center. The drawn sphere is tangent to the volume cloud and generates a new intersection with the ray. If the new intersection is on the surface of the volume cloud, the step is no longer continued. If the new intersection is outside the volume cloud, the new intersection is continued as the center, and a sphere with the distance field of the new intersection as the radius is drawn until the next intersection is on the surface of the volume cloud.

[0091] In this embodiment, the step length used for each step of the light can make the drawn circle tangent to the volume cloud, which can ensure that the light does not enter the interior of the volume cloud, and a suitable step length can be obtained each time the light steps, thereby speeding up the step calculation process.

[0092] In some optional embodiments, in order to further enrich the details of the volumetric cloud surface, noise may be used to erode the surface of the volumetric cloud represented by the distance field, and the erosion result may be used as the distance field sampling result during sphere marching. An exemplary description will be given below.

[0093] Optionally, according to the distance field information of the target scene, when controlling multiple rays corresponding to multiple pixel points to step along the line of sight respectively, the 3D noise map of the target scene can be obtained, and the distance field information of the target scene and the 3D noise map of the target scene are superimposed to obtain the eroded distance field information of the target scene. Next, according to the eroded distance field information, the multiple rays corresponding to the multiple pixel points can be controlled to step along the line of sight respectively until the multiple rays reach the surface of the volume cloud respectively.

[0094] That is to say, the step length of each ray is obtained from the distance field information after erosion of the target scene. When the distance field information is represented by a 3D map, the distance field map after erosion = the distance field map + the setting coefficient * 3D noise map. Among them, the setting coefficient can be set according to the needs, and this embodiment does not limit it. Based on this implementation, by setting the 3D noise map, the detailed information of the volume cloud can be designed, so as to render a volume cloud with higher authenticity.

[0095] Through the distance field and ray stepping method provided in the above embodiment, the distance between the virtual camera and the surface of the volume cloud in the line of sight direction corresponding to each ray can be calculated. Next, the above multiple rays can be spatially transformed to obtain the shape of the volume cloud in the three-dimensional space (i.e., world space) where the target scene is located.

[0096] Optionally, the depth values ​​from multiple pixel points on the screen to the surface of the volumetric cloud can be calculated based on the lengths of the multiple rays and the angles corresponding to the respective line of sight directions of the multiple rays; and the shape of the volumetric cloud in the three-dimensional space can be determined based on the depth values ​​from the multiple pixel points on the screen to the surface of the volumetric cloud.

[0097] by Figure 4 Take a ray L0 in as an example. When the ray corresponding to L0 steps to point E, it reaches the surface of the volume cloud, and the length of L0 D(L0) = OE. Where O represents the viewpoint of the virtual camera, the angle of the line of sight corresponding to ray L0 relative to the vertical direction is α, and the depth from pixel point P to the volume cloud surface is D(PE) = D(L0)*sinα.

[0098] Based on the above method, the depth information of each pixel reaching the surface of the volume cloud can be calculated, so as to determine the shape of the volume cloud in three-dimensional space, and render and display it according to the shape of the volume cloud in three-dimensional space.

[0099] It should be noted that the execution subject of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 201 to 203 can be device A; for another example, the execution subject of steps 201 and 202 can be device A, and the execution subject of step 203 can be device B; and so on.

[0100] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations appearing in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel, and the sequence numbers of the operations, such as 201, 202, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel.

[0101] It should be noted that the descriptions such as “first” and “second” in this article are used to distinguish different messages, devices, modules, etc., and do not represent the order of precedence, nor do they limit “first” and “second” to different types.

[0102] Figure 5 FIG. 1 is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present application, and the electronic device can be used to execute the volume cloud data storage method described in the above embodiments. Figure 5 As shown, the electronic device includes: a memory 501 and a processor 502.

[0103] The memory 501 is used to store computer programs and can be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phone book data, messages, pictures, first resources, etc.

[0104] Among them, the memory 501 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0105] The processor 502 is coupled to the memory 501 and is used to execute the computer program in the memory 501, so as to: obtain distance field information of a target scene; the distance field information includes the minimum distance from a point in the target scene to the surface of a volume cloud in the target scene; the distance field information includes the minimum distance from a point in the target scene to the surface of the volume cloud; the distance field information of each point in the target scene located near the surface of the volume cloud is stored in a storage unit of a first 3D map; the distance field information of the target scene is compressed by a specified multiple and stored in a second 3D map; wherein, in the second 3D map, each map unit stores distance field information shared by a plurality of compressed points, and the map units corresponding to the points near the surface of the volume cloud store indexes of the storage units in the first 3D map.

[0106] Further optionally, when the processor 502 compresses the distance field information of the target scene by a specified multiple and saves it in the second 3D map, it is specifically configured to: compress each N*N*N point in the target scene into a map unit in the second 3D map; for any map unit, blur the distance field information of each of the N*N*N points corresponding to the map unit to obtain the distance field information shared by the N*N*N points; and save the distance field information shared by the N*N*N points in the first channel of the map unit.

[0107] Further optionally, the processor 502 is also used to: if the N*N*N points are located near the surface of the volumetric cloud, save the index of the storage unit corresponding to the N*N*N points in the first 3D map in the second channel and the third channel of the mapping unit; wherein, in the corresponding storage unit in the first 3D map, N*N*N voxels are used to save the distance field information of each of the N*N*N points.

[0108] Further optionally, when the processor 502 saves the distance field information of each point in the target scene located near the surface of the volumetric cloud in the storage unit of the first 3D map, it is specifically used to: obtain a 3D noise map of the points located near the surface of the volumetric cloud; and superimpose the first 3D map and the 3D noise map to obtain an eroded first 3D map.

[0109] Further optionally, the processor 502 is also used to: respond to an instruction to render the volumetric cloud in the target scene, emit a ray from the position of the virtual camera in the target scene to multiple pixel points on the screen respectively; control the multiple rays corresponding to the multiple pixel points to step along the line of sight direction respectively, and at each step, determine the distance field information of the stepping points reached by the multiple rays respectively according to the first 3D map and / or the second 3D map as the stepping distance of the multiple rays respectively, until the multiple rays respectively reach the surface of the volumetric cloud; determine the shape of the volumetric cloud in the three-dimensional space where the target scene is located according to the length of the multiple rays; and render the volumetric cloud according to the shape of the volumetric cloud in the three-dimensional space.

[0110] Further optionally, when the processor 502 determines the distance field information of the stepping points reached by each of the multiple rays according to the first 3D map and / or the second 3D map at each step, it is specifically configured to: for any one of the multiple rays, when the ray reaches any stepping point, determine the target map unit corresponding to the stepping point from the second 3D map; if the index in the target map unit does not point to the storage unit in the first 3D map, use the distance field information stored in the target map unit as the distance field information of the stepping point; if the index in the target map unit points to the target storage unit in the first 3D map, determine the target storage unit from the first 3D map according to the index of the target storage unit; and determine the distance field information of the stepping point from the target storage unit according to the coordinates of the stepping point.

[0111] Further optionally, when the processor 502 controls the multiple rays corresponding to the multiple pixel points to step respectively along the line of sight direction according to the distance field information until the multiple rays respectively reach the surface of the volume cloud, it is specifically used to: for any one of the multiple rays, according to the minimum distance from the point where the virtual camera is located to the surface of the volume cloud, step the light along the line of sight direction corresponding to the ray to reach a stepping point; according to the minimum distance from the stepping point to the surface of the volume cloud, determine whether the stepping point is located on the surface of the volume cloud; if the stepping point is located on the surface of the volume cloud, stop the stepping operation of the ray, and determine the distance between the virtual camera and the surface of the volume cloud in the line of sight direction corresponding to the ray according to the distance from the virtual camera to the stepping point.

[0112] Further optionally, the processor 502 is also used to: if the stepping point is not on the surface of the volumetric cloud, continue to step the light along the line of sight direction corresponding to the ray according to the minimum distance from the stepping point to the surface of the volumetric cloud, until the new stepping point reached by the ray is located on the surface of the volumetric cloud.

[0113] Further optionally, when the processor 502 determines the shape of the volumetric cloud in the three-dimensional space where the target scene is located based on the lengths of the multiple rays, it is specifically used to: calculate the depth values ​​from the multiple pixel points on the screen to the surface of the volumetric cloud based on the lengths of the multiple rays and the angles corresponding to the respective line of sight directions of the multiple rays; determine the shape of the volumetric cloud in the three-dimensional space based on the depth values ​​from the multiple pixel points on the screen to the surface of the volumetric cloud.

[0114] Further, if Figure 5As shown, the electronic device also includes: a display component 503, a communication component 504, a power component 505, an audio component 506 and other components. Figure 5 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 5 Components shown.

[0115] Among them, the display component 503 includes a screen, and the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0116] Among them, the communication component 504 is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component can be implemented based on near field communication (NFC) technology, radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0117] The power supply component 505 provides power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.

[0118] Among them, the audio component 506 can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting an audio signal.

[0119] In this embodiment, after obtaining the distance field information of the target scene including the volume cloud, the distance field information of each point in the target scene near the surface of the volume cloud is stored in the storage unit of the first 3D map, and the distance field information of the target scene is compressed by a specified multiple and stored in the second 3D map; wherein, in the second 3D map, each map unit stores the distance field information shared by the compressed multiple points, and the map unit corresponding to the point near the surface of the volume cloud stores the index of the storage unit in the first 3D map. Thus, the distance field information of the points in the target scene that are not near the surface of the volume cloud can be compressed and stored, and the distance field information of the main points of interest near the surface of the volume cloud can be stored with high precision, which greatly reduces the number of points that need to be stored with high precision and reduces the consumption of storage resources.

[0120] At the same time, when rendering volumetric clouds in the target scene, the distance field information of the target scene is used for ray stepping, which can quickly determine the appropriate step length. On the one hand, it can prevent the ray from stepping into the interior of the volumetric cloud, and on the other hand, it can accelerate the speed of ray stepping to the surface of the volumetric cloud. Therefore, the consumption of computing resources can be reduced, which is conducive to improving rendering performance and running large-scale volumetric clouds on terminal devices smoothly.

[0121] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement each step that can be executed by an electronic device in the above method embodiment.

[0122] Accordingly, an embodiment of the present application also provides a computer program product, including a computer program / instructions. When the computer program is executed by a processor, the processor is caused to implement each step in the above method embodiment that can be executed by an electronic device.

[0123] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0124] The present invention is described with reference to the flowchart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the process and / or box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0125] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0126] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0127] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0128] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0129] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0130] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0131] The above is only the embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for storing data in a volume cloud. It is characterized in that include: Get the distance field information of the target scene; The distance field information includes a minimum distance from a point in the target scene to a surface of a volume cloud in the target scene; storing the distance field information of each point in the target scene near the surface of the volume cloud in a storage unit of the first 3D map; Compressing the distance field information of the target scene by a specified multiple and saving it in the second 3D map; In the second 3D map, each mapping unit stores distance field information shared by a plurality of compressed points, and the mapping units corresponding to points near the surface of the volume cloud store indexes of storage units in the first 3D map.

2. The method according to claim 1, It is characterized in that The distance field information of the target scene is compressed by a specified multiple and saved in the second 3D map, including: Compressing each N*N*N point in the target scene into a texture unit in the second 3D texture; For any mapping unit, blurring the distance field information of each of the N*N*N points corresponding to the mapping unit to obtain the distance field information shared by the N*N*N points; The distance field information shared by the N*N*N points is stored in the first channel of the mapping unit.

3. The method according to claim 2, It is characterized in that Also includes: If the N*N*N points are located near the surface of the volume cloud, the indexes of the storage units corresponding to the N*N*N points in the first 3D map are stored in the second channel and the third channel of the map unit; Wherein, in the corresponding storage unit in the first 3D map, N*N*N voxels are used to store the distance field information of each of the N*N*N points.

4. The method according to claim 3, It is characterized in that The method further comprises: storing the distance field information of each point in the target scene near the surface of the volume cloud in a storage unit of the first 3D map, comprising: Obtaining a 3D noise map of points located near a surface of the volumetric cloud; The first 3D map and the 3D noise map are superimposed to obtain an eroded first 3D map.

5. The method according to claim 1, It is characterized in that Also includes: In response to an instruction to render the volume cloud in the target scene, emitting a ray from a position of a virtual camera in the target scene to a plurality of pixel points on the screen respectively; Controlling the plurality of rays corresponding to the plurality of pixel points to step along the line of sight direction respectively, and determining, at each step, distance field information of the stepping points reached by the plurality of rays respectively according to the first 3D map and / or the second 3D map as respective stepping distances of the plurality of rays, until the plurality of rays respectively reach the surface of the volume cloud; Determining, according to the lengths of the plurality of rays, a shape of the volume cloud in the three-dimensional space where the target scene is located; The volume cloud is rendered according to the shape of the volume cloud in the three-dimensional space.

6. The method according to claim 5, It is characterized in that At each step, determining distance field information of the step points reached by each of the plurality of rays according to the first 3D map and / or the second 3D map, including: For any one of the multiple rays, when the ray reaches any step point, determining a target mapping unit corresponding to the step point from the second 3D mapping; If the index in the target mapping unit does not point to a storage unit in the first 3D mapping unit, the distance field information stored in the target mapping unit is used as the distance field information of the step point; If the index in the target mapping unit points to the target storage unit in the first 3D mapping, determining the target storage unit from the first 3D mapping according to the index of the target storage unit; According to the coordinates of the step point, distance field information of the step point is determined from the target storage unit.

7. The method according to claim 5, It is characterized in that According to the distance field information, controlling the plurality of rays corresponding to the plurality of pixel points to step along the line of sight direction respectively until the plurality of rays reach the surface of the volume cloud respectively, including: For any one of the multiple rays, according to the minimum distance from the point where the virtual camera is located to the surface of the volume cloud, light stepping is performed along the line of sight direction corresponding to the ray to reach a stepping point; determining whether the step point is located on the surface of the volume cloud according to the minimum distance from the step point to the surface of the volume cloud; If the stepping point is located on the surface of the volume cloud, the stepping operation of the ray is stopped, and the distance between the virtual camera and the surface of the volume cloud in the line of sight direction corresponding to the ray is determined according to the distance from the virtual camera to the stepping point.

8. The method according to claim 7, It is characterized in that Also includes: If the stepping point is not on the surface of the volume cloud, the ray stepping is continued along the line of sight direction corresponding to the ray according to the minimum distance from the stepping point to the surface of the volume cloud until a new stepping point reached by the ray is located on the surface of the volume cloud.

9. The method according to any one of claims 5 to 8, It is characterized in that Determining the shape of the volume cloud in the three-dimensional space where the target scene is located according to the lengths of the multiple rays includes: Calculating depth values ​​from a plurality of pixel points on the screen to the surface of the volume cloud according to the lengths of the plurality of rays and the angles corresponding to the respective sight lines of the plurality of rays; The shape of the volume cloud in the three-dimensional space is determined according to depth values ​​from a plurality of pixel points on the screen to the surface of the volume cloud.

10. An electronic device, It is characterized in that include: Memory, CPU, and GPU; The memory is used to store one or more computer instructions; The central processing unit is used to execute the one or more computer instructions to: call the graphics processor to execute the steps in any one of the methods of claims 1-9.

11. A computer-readable storage medium storing a computer program, It is characterized in that When the computer program is executed, the steps in the method according to any one of claims 1 to 9 can be implemented.

12. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program is executed by a processor, the processor is caused to implement the steps in the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Virtual reality display method and terminal

    CN108391445A

  • Dynamic volume cloud rendering method and device and electronic equipment

    CN112190935A