Voxelization Model Construction Method, Device, Storage Medium, and Electronic Device

By determining the hit mark and direction mark of voxel units, and splitting the object into two-dimensional plane textures, a voxelization model is constructed, the problem of low voxelization efficiency is solved and an efficient voxelization process is achieved.

CN114972680BActive Publication Date: 2025-07-04NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210531373.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-16
Publication Date
2025-07-04
Estimated Expiration
2042-05-16

AI Technical Summary

Technical Problem

In the prior art, the voxelization process is relatively inefficient, and each triangle needs to be rendered separately from three different directions, resulting in excessive rendering times.

Method used

By determining the hit marks and direction marks of each voxel unit when the object to be constructed is illuminated by a virtual light source, and splitting the object into two-dimensional plane textures of multiple pixel units, a voxel model is constructed based on the hit marks and direction marks of the two-dimensional plane texture to avoid the rasterization process.

Benefits of technology

Improves voxelization efficiency, reduces rendering times, and improves construction speed and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114972680B_ABST
    Figure CN114972680B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, apparatus, storage medium, and electronic device for constructing a voxelization model, which relates to the technical field of image processing. The method for constructing a voxelization model includes: determining a hit identifier and a direction identifier of each voxel unit when the object to be constructed is irradiated by a virtual light source; splitting the object to be constructed into a two-dimensional planar texture including a plurality of pixel units, where each of the pixel units includes the corresponding hit identifier and the direction identifier; and constructing a voxelization model of the object to be constructed based on the hit identifiers and the direction identifiers corresponding to the plurality of pixel units in the two-dimensional planar texture. The technical problem of low efficiency of current voxelization is solved, and the technical effect of improving the voxelization efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] The voxelization of three-dimensional meshes is widely used in the fields of graphics rendering and physical simulation. For example, in graphics rendering, the scene is simplified by voxelizing it into voxels, and in physical simulation, the interacting objects in the scene are voxelized into the boundaries of fluids for fluid collision simulation, such as Figure 1 In [reference], from left to right are the original geometry and gradually finer voxelization models in sequence.

[0003] Currently, most voxelizations rely on rasterization. However, during the rasterization process, each minimum unit in the original geometry, that is, each triangle, needs to be rendered once from three different directions respectively, and there are countless triangles in the entire original geometry, resulting in too many rendering times and thus low efficiency of current voxelization. Summary of the Invention

[0004] The present disclosure provides a method, apparatus, storage medium, and electronic device for constructing a voxelization model, thereby improving the voxelization efficiency.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for constructing a voxelization model, including:

[0006] Determining the hit identifier and direction identifier of each voxel unit when the object to be constructed is irradiated by a virtual light source;

[0007] Splitting the object to be constructed into a two-dimensional planar texture containing multiple pixel units; wherein, each pixel unit contains a corresponding hit identifier and direction identifier;

[0008] Constructing a voxelization model of the object to be constructed based on the hit identifiers and direction identifiers corresponding to multiple pixel units in the two-dimensional planar texture.

[0009] In an optional embodiment of the present disclosure, determining the hit identifier and direction identifier of each voxel unit when the object to be constructed is irradiated by a virtual light source includes:

[0010] Determining the shape parameters and object position parameters of the object to be constructed;

[0011] Determining a virtual light source based on the shape parameters and object position parameters; wherein, the virtual light source includes multiple virtual sub-light sources for emitting virtual rays;

[0012] Based on the virtual rays emitted by the virtual light source irradiating the object to be constructed, determining the hit identifier and direction identifier of each voxel unit when the object to be constructed is irradiated by the virtual rays.

[0013] In an optional embodiment of the present disclosure, determining the hit identifier and direction identifier of each voxel unit when the object to be constructed is irradiated by a virtual ray includes:

[0014] Determine the light origin position parameter of the virtual light ray and the irradiation direction of the virtual light ray;

[0015] Determine the hit flag and direction flag of each voxel unit according to the light origin position parameters of each light ray and the irradiation direction of the virtual light ray.

[0016] In an optional embodiment of the present disclosure, determining the hit flag and direction flag of each voxel unit according to the light origin position parameters of each light ray and the irradiation direction of the virtual light ray includes:

[0017] For each voxel unit, determine whether the voxel unit is hit by the virtual light ray according to the light origin position parameter and the irradiation direction of the virtual light ray;

[0018] If the voxel unit is hit by the virtual light ray, mark the hit flag of the voxel unit as an occupied flag;

[0019] If the voxel unit is not hit by the virtual light ray, mark the hit flag of the voxel unit as an empty flag.

[0020] In an optional embodiment of the present disclosure, determining the hit flag and direction flag of each voxel unit according to the light origin position parameters of each light ray and the irradiation direction of the virtual light ray further includes:

[0021] If the voxel unit is hit by the virtual light ray, determine whether the surface where the voxel unit is hit by the virtual light ray is the incident light surface or the outgoing light surface of the virtual light ray;

[0022] If the surface where the voxel unit is hit by the virtual light ray is the incident light surface of the virtual light ray, determine the direction flag of the voxel unit as a forward flag;

[0023] If the surface where the voxel unit is hit by the virtual light ray is the outgoing light surface of the virtual light ray, determine the direction flag of the voxel unit as a reverse flag.

[0024] In an optional embodiment of the present disclosure, determining the light origin position parameter of the virtual light ray includes:

[0025] Determine the light source position parameters corresponding to each virtual sub-light source;

[0026] Determine the center position parameter of the object to be constructed;

[0027] According to the light source position parameter, the center position parameter and the preset boundary parameter, determine the light origin position parameter of the virtual light ray emitted by each virtual sub-light source.

[0028] In an optional embodiment of the present disclosure, splitting the object to be constructed into a two-dimensional plane texture including a plurality of pixel units includes:

[0029] Split the object to be constructed into dimension units of a preset splitting dimension;

[0030] Determine the texture units corresponding to each dimensional unit in the two-dimensional plane texture;

[0031] Determine the pixel units corresponding to each voxel unit in each texture unit;

[0032] Synchronize the hit flag and direction flag corresponding to each voxel unit to the corresponding pixel unit, and obtain a two-dimensional plane texture containing multiple pixel units.

[0033] In an optional embodiment of the present disclosure, determining the pixel units corresponding to each voxel unit in each texture unit includes:

[0034] Determine the voxel position information of each voxel unit in the object to be constructed;

[0035] Determine the tiling offset of each texture unit;

[0036] For each voxel unit, determine the pixel position corresponding to the voxel unit according to the world coordinate information and the tiling offset corresponding to the texture unit where the voxel unit is located;

[0037] Determine the pixel unit where the pixel position is located as the pixel unit corresponding to the voxel unit in the texture unit.

[0038] In a second aspect, an embodiment of the present disclosure provides a voxelization model construction device, and the device includes:

[0039] A determination module, configured to determine the hit flag and direction flag of each voxel unit when the object to be constructed is irradiated by a virtual light source;

[0040] A splitting module, configured to split the object to be constructed into a two-dimensional plane texture containing multiple pixel units; wherein, each pixel unit contains a corresponding hit flag and direction flag;

[0041] A construction module, configured to construct a voxelization model of the object to be constructed based on the hit flags and direction flags corresponding to multiple pixel units in the two-dimensional plane texture.

[0042] In a third aspect, an embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.

[0043] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, including: a processor; and a memory, configured to store executable instructions of the processor; wherein, the processor is configured to execute the above method by executing the executable instructions.

[0044] The technical solution of the present disclosure has the following beneficial effects:

[0045] The above voxelization model construction method first determines the hit identification and direction identification of each voxel unit when the object to be constructed is irradiated by a virtual light source, and then splits the object to be constructed into a two-dimensional plane texture containing multiple pixel units. Recently, it only needs to construct the voxelization model of the object to be constructed based on the hit identification and direction identification corresponding to the multiple pixel units in the two-dimensional plane texture. The whole process does not require rasterization, and only needs to be rendered once when finally constructing from the two-dimensional plane texture to the three-dimensional voxelization model, avoiding the step of separately rendering each triangle in the original geometry of the object to be constructed from three different directions in the traditional method, thus solving the technical problem of low voxelization efficiency at present and achieving the technical effect of improving voxelization efficiency.

[0046] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure. Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.

[0048] Figure 1 Showing the schematic process of a voxelization method in this exemplary embodiment;

[0049] Figure 2 Showing the flowchart of a voxelization model construction method in this exemplary embodiment;

[0050] Figure 3 Showing the schematic diagram of virtual light rays penetrating the model to be constructed in this exemplary embodiment;

[0051] Figure 4 Showing the flowchart of a voxelization model construction method in this exemplary embodiment;

[0052] Figure 5 Showing the schematic diagram of the virtual light source and the model to be constructed in this exemplary embodiment;

[0053] Figure 6 Showing the flowchart of a voxelization model construction method in this exemplary embodiment;

[0054] Figure 7 Showing the flowchart of a voxelization model construction method in this exemplary embodiment;

[0055] Figure 8Schematic diagram showing virtual light penetrating voxel units in this exemplary embodiment;

[0056] Figure 9 Flowchart showing a voxelization model construction method in this exemplary embodiment;

[0057] Figure 10 Flowchart showing a voxelization model construction method in this exemplary embodiment;

[0058] Figure 11 Flowchart showing a voxelization model construction method in this exemplary embodiment;

[0059] Figure 12 Schematic diagram showing splitting an object to be constructed into two - dimensional plane textures in this exemplary embodiment;

[0060] Figure 13 Flowchart showing a voxelization model construction method in this exemplary embodiment;

[0061] Figure 14 Schematic diagram showing generating a voxelization model based on two - dimensional plane textures in this exemplary embodiment;

[0062] Figure 15 Schematic diagram showing scanning two - dimensional plane textures in this exemplary embodiment;

[0063] Figure 16 Schematic diagram showing another scanning of two - dimensional plane textures in this exemplary embodiment;

[0064] Figure 17 Schematic diagram showing the structure of a voxelization model construction device in this exemplary embodiment;

[0065] Figure 18 Schematic diagram showing the structure of an electronic device in this exemplary embodiment. Detailed implementation mode

[0066] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present disclosure. However, those skilled in the art will realize that the technical solutions of the present disclosure can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring the various aspects of the present disclosure.

[0067] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0068] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all the steps. For example, some steps can be further decomposed, while some steps can be combined or partially combined, so the actual execution order may be changed according to the actual situation.

[0069] In the related art, the voxelization of three-dimensional meshes is widely used in the fields of graphics rendering and physical simulation. For example, in graphics rendering, the scene is simplified by voxelizing it into voxels, and in physical simulation, the interaction objects in the scene are voxelized into the boundaries of fluids to perform fluid collision simulations, as Figure 1 shown, from left to right are the original geometry to the increasingly refined voxelization model. Most current voxelizations rely on rasterization. However, in the rasterization process, each smallest unit in the original geometry, that is, each triangle, needs to be rendered separately from three different directions once, and there are countless triangles in the entire original geometry, resulting in too many rendering times and thus low efficiency of current voxelization.

[0070] In view of the above problems, embodiments of the present disclosure provide a method for constructing a voxelized model. First, determine the hit flag and direction flag of each voxel unit when the object to be constructed is irradiated by a virtual light source. Then, split the object to be constructed into a two-dimensional plane texture containing multiple pixel units. Recently, only need to construct the voxelized model of the object to be constructed based on the hit flags and direction flags corresponding to the multiple pixel units in the two-dimensional plane texture. The whole process does not require rasterization, and only need to render once when finally constructing from the two-dimensional plane texture to the three-dimensional voxelized model, avoiding the step of separately rendering each triangle in the original geometry of the object to be constructed from three different directions in the traditional method, thus solving the technical problem of low efficiency of current voxelization and achieving the technical effect of improving voxelization efficiency.

[0071] The following briefly elaborates on the voxelization process:

[0072] Voxelization is to convert the geometric form representation of an object into a voxel representation form that is closest to the object, generating a volume dataset, which contains not only the surface information of the model but also the content attributes of the model. It should be noted that the spatial voxels of the model are similar to the two-dimensional pixels representing an image, extending the two-dimensional points to three-dimensional cube units. Voxelization generally includes voxelization of the model surface and voxelization of the model interior.

[0073] Voxelization of the model surface: When voxelizing the model surface, first calculate the bounding box of the 3D model (that is, the outer surface of the model, denoted as AABB), and then divide the bounding box according to the spatial resolution to obtain multiple spatial pixel lists. Then traverse the list of planar polygons or planar triangles of the 3D model on the two-dimensional plane to obtain the bounding boxes corresponding to these basic volume elements. Then, through the intersection operation of the bounding box (AABB), obtain the voxels that can be affected by these basic volume elements, and use these voxels as the basic objects for judging whether they intersect with the virtual ray. To further improve the judgment accuracy, generally use the intersection operation of the triangle and the bounding box (AABB) to determine the final voxels that can be affected by these basic volume elements, and mark these voxels as non-empty or hit.

[0074] Voxelization inside the model: After completing the voxelization operation on the surface of the 3D model to obtain the "outer shell" representing the voxels of the model, for example, first build a spatial octree for the corresponding 3D model, and perform the intersection operation of the basic voxel patches through this octree. Then, two rays are emitted from the center position of all empty voxels in the 3D model in the axis-aligned direction. The directions of these two rays are opposite, but the basic directions are all axis-aligned. For these two rays, use the octree of the spatial model to obtain the intersection positions of each empty voxel, and obtain the normal vector of the intersection point and the distance to the intersection zone. Then, judge whether the current voxel is inside the 3D model or outside the 3D model according to the relationship between the normal vectors of these two points. Applying such an operation to each empty voxel conversion can complete the voxelization operation inside the 3D model.

[0075] The above is the explanation with one pixel as a pixel unit. It should be noted that the voxel unit in the embodiments of the present disclosure can be a single voxel or a voxel region composed of several adjacent voxels, and the embodiments of the present disclosure do not make specific limitations.

[0076] Please refer to Figure 2 , the embodiments of the present disclosure provide a voxelized model construction method, which is applied to a model processing system for voxelizing an original geometric body, that is, an object to be constructed, to generate a corresponding voxelized model. Among them, the voxelized model construction method includes the following steps 201-step 203:

[0077] Step 201, determine the hit flag and direction flag of each voxel unit when the object to be constructed is irradiated by a virtual light source.

[0078] Among them, the hit flag is used to represent whether the voxel unit is hit by the virtual light, and the direction flag is used to represent the orientation of the surface of the voxel unit, such as the incident surface or the exit surface of the virtual light. The object to be constructed, that is, the original geometric body, is generally hollow, including an outer surface and an inner surface, for example Figure 3In this case, when the virtual ray 305 irradiates, it irradiates on the first outer surface 301 - the first inner surface 302 - the second inner surface 303 - the second outer surface 304 in sequence until it exits to the outside. Then both the first outer surface 301 and the second inner surface 303 are light incident surfaces, and this direction identifier is the first direction identifier; both the first inner surface 302 and the second outer surface 304 are light exit surfaces, and this direction identifier is the second direction identifier, and the first direction identifier and the second direction identifier are opposite. Conversely, if the virtual ray irradiates on the second outer surface 304 - the second inner surface 303 - the first inner surface 302 - the first outer surface 301 in sequence until it exits to the outside, then both the first outer surface 301 and the second inner surface 303 are light exit surfaces, and this direction identifier is the second direction identifier; both the first inner surface 302 and the second outer surface 304 are light incident surfaces, and this direction identifier is the first direction identifier.

[0079] Step 202: Split the object to be constructed into a two-dimensional planar texture including multiple pixel units.

[0080] Among them, each pixel unit includes a corresponding hit identifier and direction identifier. The object to be constructed is the original geometric body, and the original geometric body includes multiple voxel units, and each voxel unit is a columnar body composed of multiple pixel units. In the embodiment of the present disclosure, each voxel unit in the object to be constructed in three-dimensional space is mapped to a corresponding pixel unit, and all the pixel units constitute the two-dimensional planar texture corresponding to the object to be constructed. In three-dimensional space, each voxel unit includes its corresponding hit identifier. After it is flattened into a two-dimensional plane, each pixel unit also has the hit identifier and direction identifier that it has in the voxel unit.

[0081] Step 203: Construct a voxelized model of the object to be constructed based on the hit identifiers and direction identifiers corresponding to multiple pixel units in the two-dimensional planar texture.

[0082] Among them, the hit identifier is used to represent whether this pixel unit is a ray hit point in the actual scene. For example, if the point hit by the virtual ray in the actual scene is exactly inside this voxel unit, then the identifier of this voxel unit is the occupied identifier, otherwise it is the unoccupied identifier; this direction identifier is used to represent whether the hit surface is the light incident surface or the light exit surface of the virtual ray. After obtaining these two pieces of information, by scanning the hit identifiers and direction identifiers of each pixel unit, the model unit corresponding to each pixel unit can be determined, and then the voxelized model of the object to be constructed can be obtained by rendering all the model units once.

[0083] In the embodiments of the present disclosure, first, the hit identification and direction identification of each voxel unit when the object to be constructed is irradiated by a virtual light source are determined. Then, the object to be constructed is split into a two-dimensional planar texture including a plurality of pixel units. Recently, only based on the hit identification and direction identification corresponding to the plurality of pixel units in the two-dimensional planar texture, a voxelized model of the object to be constructed is constructed. The whole process does not require rasterization, and only needs to be rendered once when finally constructing from the two-dimensional planar texture to the three-dimensional voxelized model, avoiding the step of separately rendering each triangle in the original geometry of the object to be constructed from three different directions in the traditional method, thereby solving the technical problem of low voxelization efficiency at present and achieving the technical effect of improving voxelization efficiency.

[0084] Please refer to Figure 4 , in an optional embodiment of the present disclosure, the above step 202, determining the hit identification and direction identification of each voxel unit when the object to be constructed is irradiated by a virtual light source, includes the following steps 401-step 403:

[0085] Step 401, determining the shape parameters and object position parameters of the object to be constructed.

[0086] Please refer to Figure 5 , if the object to be constructed is Figure 5 a three-dimensional sphere in, then first determine the shape parameters of the three-dimensional sphere. The shape parameters can be the three-dimensional coordinates of the contour or the resolution, which are not specifically limited in this embodiment. The object position parameter refers to the position coordinates of the object to be constructed, which can be ordinary three-dimensional space coordinates or world coordinates, and are not specifically limited in this embodiment.

[0087] Step 402, determining a virtual light source based on the shape parameters and object position parameters.

[0088] Among them, the virtual light source includes a plurality of virtual sub-light sources for emitting virtual light rays. According to the shape parameters, a contour matching the shape of the object to be constructed is determined, and then according to the object position parameters, the black shadow part is moved to the position corresponding to the object to be constructed. For example Figure 5 in, by translating a plurality of units in the +Y direction from the position of the object to be constructed, the virtual light source 502 of the object to be constructed 501 is obtained, such as Figure 5 the black shadow part in. At the same time, in an optional embodiment of the present disclosure, a preset range box can also be preset in advance to limit the outer contour range of the generated virtual light source to avoid the generated virtual light source range being too large and affecting the voxelization efficiency. For example Figure 5 in, through the preset rectangular box, the range of the virtual light source is limited to the external white area part.

[0089] Step 403: Based on the virtual light rays emitted by the virtual light source irradiating the object to be constructed, determine the hit flag and direction flag of each voxel unit when the object to be constructed is irradiated by the virtual light rays.

[0090] After determining the virtual light source based on Step 402, control the virtual light source to emit virtual light rays. It should be noted that in the embodiments of the present disclosure, the virtual light rays generated by the virtual light source are all parallel light rays. Please continue to refer to Figure 5 , by irradiating each virtual light ray parallel to the object to be constructed, whether the current voxel unit is hit can be determined by whether the optical path of the virtual light ray hits the object to be constructed, and thus the corresponding hit flag can be obtained. In the case of a hit, please continue to refer to the above Figure 3 , and determine the corresponding direction flag according to whether the hit surface is the incident surface or the exit surface of the virtual light ray.

[0091] In the embodiments of the present disclosure, first determine the shape parameters and object position parameters of the object to be constructed, then determine the virtual light source based on the shape parameters and object position parameters. The determined virtual light source has a higher adaptability to the object to be constructed. Finally, based on the virtual light rays emitted by the virtual light source irradiating the object to be constructed, the hit flag and direction flag of each voxel unit when the object to be constructed is irradiated by the virtual light rays can be determined, avoiding the complex algorithms in the traditional method. The method for determining the hit flag and direction flag is simpler and more efficient, greatly improving the efficiency on the premise of ensuring its reliability, and further improving the reliability and efficiency of the voxelization in the embodiments of the present disclosure.

[0092] Please refer to Figure 6 , in an optional embodiment of the present disclosure, the above Step 403, determining the hit flag and direction flag of each voxel unit when the object to be constructed is irradiated by the virtual light rays, includes the following Steps 601 - 602:

[0093] Step 601: Determine the light origin position parameter of the virtual light ray and the irradiation direction of the virtual light ray.

[0094] Among them, the light origin position parameter refers to the specific coordinate position of the virtual light ray in each sub - virtual light source of the virtual light source. Since each sub - virtual light source is a light - emitting pixel, and the light - emitting is a specific light - emitting point, rather than the entire light - emitting pixel, that is, the origin corresponding to the virtual light ray refers to a specific light - emitting origin. By determining the hit flag of the virtual light ray and the voxel unit in this way, the reliability and accuracy of the hit flag can be greatly improved. The irradiation direction of the virtual light ray can be specifically set according to the actual situation. For example Figure 5 the - Y direction in

[0095] Step 602: Determine the hit flag and direction flag of each voxel unit according to the position parameters of each light origin and the irradiation direction of the virtual light.

[0096] After obtaining the position parameters of the light origin corresponding to each virtual light and the irradiation direction, the hit flag and direction flag of each voxel unit can be quickly determined by means of geometric simulation or coordinate calculation.

[0097] In the embodiment of the present disclosure, the position parameters of the light origin of the virtual light and the irradiation direction of the virtual light are first determined, and then the hit flag and direction flag of each voxel unit can be quickly determined according to the position parameters of each light origin and the irradiation direction of the virtual light, which is simple and convenient, can greatly reduce the difficulty of determining the hit flag and direction flag, and improve the determination efficiency.

[0098] Please refer to Figure 7 , in an optional embodiment of the present disclosure, the above step 602: Determine the hit flag and direction flag of each voxel unit according to the position parameters of each light origin and the irradiation direction of the virtual light, includes the following steps 701-step 703:

[0099] Step 701: For each voxel unit, determine whether the voxel unit is hit by the virtual light according to the position parameter of the light origin and the irradiation direction of the virtual light.

[0100] Step 702: If the voxel unit is hit by the virtual light, mark the hit flag of the voxel unit as an occupied flag.

[0101] Step 703: If the voxel unit is not hit by the virtual light, mark the hit flag of the voxel unit as an empty flag.

[0102] Please refer to Figure 8 , for the voxel unit 810, the position parameter of the light origin is (x0, y0, z0), and the irradiation direction of the virtual light is the -Y direction. Then, a ray is emitted along the -Y direction with (x0, y0, z0) as the origin. The ray hits the voxel unit 810 and sequentially penetrates its first surface 811, second surface 812, third surface 813 and fourth surface 814. Then, the voxel unit is hit by the virtual light, and the voxel unit is marked as an occupied flag to indicate that the voxel unit is hit. At the same time, the voxel unit 820 is not hit by the virtual light, and the voxel unit is marked as an empty flag to indicate that the voxel unit is not hit.

[0103] Based on whether the voxel unit is hit by the virtual ray, the voxel unit is marked with an occupancy identifier and a duty ratio identifier in the embodiments of the present disclosure, which can facilitate subsequent scanning of the hit results of the pixel units corresponding to each voxel unit to quickly determine the ray hit results of each pixel unit, greatly improving the scanning efficiency and further improving the voxelization efficiency of the embodiments of the present disclosure.

[0104] Please refer to Figure 9 In an optional embodiment of the present disclosure, the above step 602, determining the hit identifier and the direction identifier of each voxel unit according to the light origin position parameter of each ray and the irradiation direction of the virtual ray, further includes the following steps 901-step 903:

[0105] Step 901: If the voxel unit is hit by the virtual ray, determine whether the surface of the voxel unit hit by the virtual ray is the incident light surface or the outgoing light surface of the virtual ray.

[0106] Step 902: If the surface of the voxel unit hit by the virtual ray is the incident light surface of the virtual ray, determine the direction identifier of the voxel unit as the forward identifier.

[0107] Step 903: If the surface of the voxel unit hit by the virtual ray is the outgoing light surface of the virtual ray, determine the direction identifier of the voxel unit as the reverse identifier.

[0108] For example, please continue to refer to the above Figure 8 The virtual ray hits the voxel unit 810 and sequentially penetrates its first surface 811, second surface 812, third surface 813 and fourth surface 814. Among them, the first surface 811 and the third surface 813 are the incident light surfaces of the virtual ray, so the direction identifiers of the first surface 811 and the third surface 813 are marked as the forward identifier; correspondingly, the second surface 812 and the fourth surface 814 are the outgoing light surfaces of the virtual ray, so the direction identifiers of the second surface 812 and the fourth surface 814 are marked as the reverse identifier.

[0109] Based on whether the surface of the voxel unit hit by the virtual ray is the incident light surface or the outgoing light surface of the virtual ray, the direction identifiers of each voxel unit are marked as the forward identifier and the reverse identifier in the embodiments of the present disclosure, which can greatly improve the scanning speed of the hit direction of each voxel unit, quickly determine the hit direction of each pixel unit, greatly improve the scanning efficiency, and further improve the voxelization efficiency of the embodiments of the present disclosure.

[0110] Please refer to Figure 10 In an optional embodiment of the present disclosure, the above step 601, determining the light origin position parameter of the virtual ray, includes the following steps 1001-step 1003:

[0111] Step 1001: Determine the light source position parameter corresponding to each virtual sub-light source.

[0112] The virtual sub-light sources are the respective light-emitting pixels, that is, the respective light source position parameters are the position coordinates corresponding to the respective light-emitting pixels.

[0113] Step 1002: Determine the central position parameter of the object to be constructed.

[0114] Among them, the central position parameter can be determined according to the voxel unit coordinates of the object to be constructed, or can be determined according to a preset range box, for example, determined according to the Figure 5 rectangular box in, which is not specifically limited in this embodiment.

[0115] Step 1003: Determine the light origin position parameter of the virtual light rays emitted by the respective virtual sub-light sources according to the light source position parameter, the central position parameter, and the preset boundary parameter.

[0116] The light origin position parameter can be calculated through the following formula (1):

[0117]

[0118] In formula (1), Pos represents the central position parameter, Size represents the preset boundary parameter, PixelCoord is the light source position parameter, and x, y, and z are the spatial coordinate axes respectively.

[0119] In the embodiment of the present disclosure, the light source position parameters corresponding to the respective virtual sub-light sources and the central position parameter of the object to be constructed are first determined, and then the light origin position parameters of the virtual light rays emitted by the respective virtual sub-light sources are determined according to the light source position parameter, the central position parameter, and the preset boundary parameter. The virtual light rays determined by the light origin position are more reliable, and the hit identification and direction identification of each voxel unit determined by the virtual light rays are also more reliable, further improving the reliability of the voxelization in the embodiment of the present disclosure.

[0120] Please refer to Figure 11 , in an alternative embodiment of the present disclosure, the above step 202 of splitting the object to be constructed into a two-dimensional plane texture including a plurality of pixel units includes the following steps 1101-step 1104:

[0121] Step 1101: Split the object to be constructed into a preset number of dimension units according to the preset splitting dimension.

[0122] Please refer to Figure 12 , the 4×4×4 rectangular geometric body on the left is the object to be constructed, and the preset splitting dimension is 4, that is, the rectangular geometric body is split into four dimension units 1201a, 1202a, 1203a, and 1204a.

[0123] Step 1102: Determine the texture units corresponding to the respective dimension units in the two-dimensional plane texture.

[0124] Please continue to refer to Figure 12 , where the dimension unit 1201a in the left figure corresponds to the texture unit 1201b in the right figure, the dimension unit 1202a corresponds to the texture unit 1202b in the right figure, the dimension unit 1203a corresponds to the texture unit 1203b in the right figure, and the dimension unit 1204a corresponds to the texture unit 1204b in the right figure.

[0125] Step 1103: Determine the pixel units corresponding to each voxel unit in each texture unit.

[0126] Please continue to refer to Figure 12 , for example, each voxel unit in the black shaded part in the left figure is in the right Figure 2 The pixel units corresponding to the black shaded parts in the dimension plane respectively. For example Figure 12 , in the "L"-shaped voxel unit in the dimension unit 1201a in the left figure corresponds to an "L"-shaped one in the texture unit 1201b in the right figure, occupying the pixel units in the corresponding "L"-shaped area.

[0127] Step 1104: Synchronize the hit flag and direction flag corresponding to each voxel unit to the corresponding pixel unit to obtain a two-dimensional plane texture containing multiple pixel units.

[0128] For example Figure 12 , the voxel units in the left figure and the pixel units in the right figure correspond one by one. Synchronize the hit flag and direction flag in each voxel unit to the corresponding pixel unit in the two-dimensional plane texture in the right figure, and a two-dimensional plane texture that can be used to represent the geometric shape of the object to be constructed can be obtained.

[0129] The embodiment of the present disclosure first splits the object to be constructed into dimension units of a preset split dimension, and then synchronizes the hit flag and direction flag corresponding to each voxel unit to the corresponding pixel unit, so that a two-dimensional plane texture containing multiple pixel units can be obtained, which can ensure the one-to-one correspondence between the hit flag and direction flag of each voxel unit in the two-dimensional plane, with higher reliability, and the method is simple and fast, and further can improve the reliability and efficiency of the voxelization of the embodiment of the present disclosure.

[0130] Please refer to Figure 13 , in an optional embodiment of the present disclosure, the above step 1103, determining the pixel units corresponding to each voxel unit in each texture unit, includes the following steps 1301-step 1304:

[0131] Step 1301: Determine the voxel position information of each voxel unit in the object to be constructed.

[0132] Among them, the voxel position information is used to represent the specific positions of the voxels. For example, it can be world coordinates or three-dimensional coordinates, etc., and this embodiment does not make specific limitations.

[0133] Step 1302: Determine the tiling offset of each texture unit.

[0134] The tiling offset refers to the offset of each voxel unit in the voxel coordinate system mapped to the two-dimensional plane, with a certain point in the two-dimensional plane as the reference. The tiling offset can be determined based on the depth of the object to be constructed, for example, the depth on the Z axis. For example Figure 12 if the object to be constructed is a 4×4×4 rectangular geometric body in the left figure, then the corresponding offset can be set to 4. That is, based on 1201b in the right figure, other dimensional units are mapped to each texture unit or pixel unit with an offset of 4 pixel units one by one.

[0135] Step 1303: For each voxel unit, determine the pixel position corresponding to the voxel unit according to the world coordinate information and the tiling offset corresponding to the texture unit where the voxel unit is located.

[0136] After determining the offsets corresponding to each voxel unit and the original voxel position information, the corresponding time position information, that is, the above-mentioned pixel position, can be obtained based on this offset.

[0137] Step 1304: Determine the pixel unit where the pixel position is located as the pixel unit corresponding to the voxel unit in the texture unit.

[0138] After calculating the pixel positions corresponding to each voxel unit in the two-dimensional plane through position calculation, the pixel unit corresponding to this position can be determined as the pixel unit corresponding to the voxel unit. At the same time, the hit flag and direction flag obtained through the above steps can be synchronized to the corresponding pixel unit.

[0139] In the embodiment of the present disclosure, first, the tiling offset of each texture unit is determined, and then based on the voxel position information of each voxel unit in the object to be constructed and this tiling offset, the actual pixel positions corresponding to each pixel unit can be calculated, and the pixel units corresponding to each voxel unit in the two-dimensional plane texture can be quickly determined, which is efficient, fast, and highly reliable.

[0140] In an optional embodiment of the present disclosure, after obtaining the two-dimensional plane texture containing each pixel unit, a corresponding voxelized model can be generated by scanning the hit flag and direction flag corresponding to each pixel unit. For example Figure 14After obtaining the two-dimensional planar texture in the left figure, a voxel model in the right figure is generated based on techniques such as raymarch. The entire process only requires rendering once at this node, avoiding the step of separately rendering each triangle in the original geometry of the object to be constructed from three different directions in the traditional method, and greatly improving the voxelization efficiency.

[0141] In an alternative embodiment of the present disclosure, when scanning the hit flag and direction flag of each pixel unit, it can be done in the following way:

[0142] Please refer to Figure 15 , for example, the hit flag is the occupancy flag "1", the duty flag is "0", the forward flag is "1", and the direction flag is "0". Scan each pixel unit in turn to obtain Figure 14 the hit flag and direction flag in. It should be explained that since the model is generally hollow, in the embodiment of the present disclosure, the first hit pixel unit is marked as "1", and the subsequent consecutive pixel units are all marked as "0" until the last hit pixel unit is marked as "1". Among them, the first hit pixel unit is the first surface of the model, and the last hit pixel unit is the second surface of the model. The space between the first surface and the second surface is hollow, that is, marked as "0", so as to form a closed loop for convenient scanning and calculation.

[0143] In an alternative embodiment of the present disclosure, please refer to Figure 16 , for the case of partial voxel unit overlap, such as Figure 16 the intersection point 1601 in, and the sharp corners of the boundary, such as Figure 16 the inflection point 1602 in, for this situation, the embodiment of the present disclosure uniformly marks them as duty marks to prevent repeated processing of the same pixel unit, and greatly improves the reliability of voxelization.

[0144] Please refer to Figure 17 , to implement the above voxel model construction method, an embodiment of the present disclosure provides a voxel model construction device 1700. Figure 17 shows a schematic architecture diagram of the voxel model construction device 1700. The voxel model construction device 1700 includes: a determination module 1710, a splitting module 1720, and a construction module 1730, where:

[0145] The determination module 1710 is configured to determine the hit flag and direction flag of each voxel unit when the object to be constructed is irradiated by a virtual light source;

[0146] The splitting module 1720 is configured to split the object to be constructed into a two-dimensional planar texture including a plurality of pixel units; wherein, each pixel unit includes a corresponding hit flag and direction flag;

[0147] The building block 1730 is used to construct a voxel model of an object to be constructed based on the hit identifiers and direction identifiers corresponding to multiple pixel units in a two-dimensional plane texture.

[0148] In an optional embodiment, the determining module 1710 is specifically configured to determine the shape parameters and object position parameters of the object to be constructed; determine a virtual light source based on the shape parameters and object position parameters; wherein the virtual light source includes a plurality of virtual sub-light sources for emitting virtual light rays; and determine the hit identifiers and direction identifiers of each voxel unit when the object to be constructed is irradiated by the virtual light rays emitted by the virtual light source.

[0149] In an optional embodiment, the determining module 1710 is specifically configured to determine the light origin position parameter of the virtual light ray and the irradiation direction of the virtual light ray; and determine the hit identifiers and direction identifiers of each voxel unit according to the light origin position parameters and the irradiation direction of the virtual light ray.

[0150] In an optional embodiment, the determining module 1710 is specifically configured to, for each voxel unit, determine whether the voxel unit is hit by the virtual light ray according to the light origin position parameter and the irradiation direction of the virtual light ray; if the voxel unit is hit by the virtual light ray, mark the hit identifier of the voxel unit as an occupied identifier; if the voxel unit is not hit by the virtual light ray, mark the hit identifier of the voxel unit as an empty identifier.

[0151] In an optional embodiment, the determining module 1710 is further configured to, if the voxel unit is hit by the virtual light ray, determine whether the surface of the voxel unit hit by the virtual light ray is the incident light surface or the outgoing light surface of the virtual light ray; if the surface of the voxel unit hit by the virtual light ray is the incident light surface of the virtual light ray, determine the direction identifier of the voxel unit as a forward identifier; if the surface of the voxel unit hit by the virtual light ray is the outgoing light surface of the virtual light ray, determine the direction identifier of the voxel unit as a reverse identifier.

[0152] In an optional embodiment, the determining module 1710 is specifically configured to determine the light source position parameters corresponding to each virtual sub-light source; determine the center position parameter of the object to be constructed; and determine the light origin position parameter of the virtual light ray emitted by each virtual sub-light source according to the light source position parameters, the center position parameter, and the preset boundary parameters.

[0153] In an alternative embodiment, the splitting module 1720 is specifically configured to split the object to be constructed into dimension units of a preset splitting dimension; determine the texture units corresponding to the dimension units in the two-dimensional plane texture; determine the pixel units corresponding to the voxel units in the respective texture units; and synchronize the hit identification and the direction identification corresponding to the respective voxel units to the corresponding pixel units, so as to obtain a two-dimensional plane texture including a plurality of pixel units.

[0154] In an alternative embodiment, the splitting module 1720 is specifically configured to determine the voxel position information of each voxel unit in the object to be constructed; determine the tiling offset of each texture unit; for each voxel unit, determine the pixel position corresponding to the voxel unit according to the world coordinate information and the tiling offset corresponding to the texture unit where the voxel unit is located; and determine the pixel unit where the pixel position is located as the pixel unit corresponding to the voxel unit in the texture unit.

[0155] Exemplary embodiments of the present disclosure also provide a computer-readable storage medium, which can be implemented in the form of a program product. The program product includes program code. When the program product runs on an electronic device, the program code is used to cause the electronic device to execute the steps according to various exemplary embodiments of the present disclosure described in the "Exemplary Method" section of this specification. In one embodiment, the program product can be implemented as a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, apparatus, or device.

[0156] The program product can adopt any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0157] A computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, carrying readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The readable signal medium may also be any readable medium other than a readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.

[0158] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0159] The program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's device, executed as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., by connecting through the Internet using an Internet service provider). In an embodiment of the present disclosure, when the program code stored in the computer-readable storage medium is executed, any step in the voxelization model construction method described above may be implemented.

[0160] Please refer to Figure 18 , an exemplary embodiment of the present disclosure also provides an electronic device 1800, which may be a background server of an information platform. The following will be described with reference to Figure 18 this electronic device 1800. It should be understood that Figure 18 the electronic device 1800 shown is merely an example and should not impose any limitation on the functions and scope of use of the embodiments of the present disclosure.

[0161] As Figure 18 shown, the electronic device 1800 is presented in the form of a general-purpose computing device. The components of the electronic device 1800 may include but are not limited to: at least one processing unit 1810, at least one storage unit 1820, and a bus 1830 connecting different system components (including the storage unit 1820 and the processing unit 1810).

[0162] Among them, the storage unit stores program code, which can be executed by the processing unit 1810, so that the processing unit 1810 executes the steps according to various exemplary embodiments of the present invention described in the "Exemplary Method" section above of this specification. For example, the processing unit 1810 can execute method steps such as Figure 2 shown.

[0163] The storage unit 1820 may include volatile storage units, such as a random access storage unit (RAM) 1821 and / or a cache storage unit 1822, and may further include a read-only storage unit (ROM) 1823.

[0164] The storage unit 1820 may further include a program / utilities 1824 having a set (at least one) of program modules 1825. Such program modules 1825 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.

[0165] The bus 1830 may include a data bus, an address bus, and a control bus.

[0166] The electronic device 1800 may also communicate with one or more external devices 2000 (such as a keyboard, a pointing device, a Bluetooth device, etc.), and such communication may be carried out through the input / output (I / O) interface 1840. The electronic device 1800 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 1850. As shown in the figure, the network adapter 1850 communicates with other modules of the electronic device 1800 through the bus 1830. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in combination with the electronic device 1800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0167] In the embodiments of the present disclosure, when the program code stored in the electronic device is executed, any step in the above voxelization model construction method can be implemented.

[0168] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such a division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more of the above-described modules or units may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above may be further divided and embodied by multiple modules or units.

[0169] Those skilled in the art can understand that various aspects of the present disclosure can be implemented as a system, a method, or a program product. Therefore, various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to as "circuitry", "module", or "system" herein. After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present disclosure. The present disclosure aims to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include well-known knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and the embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the claims.

[0170] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only defined by the appended claims.

Claims

1. A voxelization model construction method, characterized in that, Including: Determine the hit identifier and direction identifier of each voxel unit when the object to be constructed is irradiated by a virtual light source; Split the object to be constructed into a two-dimensional plane texture including a plurality of pixel units; wherein, each of the pixel units includes the corresponding hit identifier and direction identifier; Construct a voxel model of the object to be constructed based on the hit identifiers and direction identifiers corresponding to the plurality of pixel units in the two-dimensional plane texture.

2. The voxelization model construction method according to claim 1, wherein The determining the hit identifier and direction identifier of each voxel unit when the object to be constructed is irradiated by a virtual light source includes: Determine the shape parameters and object position parameters of the object to be constructed; Determine a virtual light source based on the shape parameters and the object position parameters; wherein, the virtual light source includes a plurality of virtual sub-light sources for emitting virtual light rays; Based on the virtual light rays emitted by the virtual light source irradiating the object to be constructed, determine the hit identifier and direction identifier of each voxel unit when the object to be constructed is irradiated by the virtual light rays.

3. The voxelization model construction method according to claim 2, wherein The determining the hit identifier and direction identifier of each voxel unit when the object to be constructed is irradiated by the virtual light rays includes: Determine the light origin position parameter of the virtual light ray and the irradiation direction of the virtual light ray; Determine the hit identifier and direction identifier of each voxel unit according to each of the light origin position parameters and the irradiation direction of the virtual light ray.

4. The voxelization model construction method according to claim 3, characterized in that, The determining the hit identifier and direction identifier of each voxel unit according to each of the light origin position parameters and the irradiation direction of the virtual light ray includes: For each voxel unit, determine whether the voxel unit is hit by the virtual light ray according to the light origin position parameter and the irradiation direction of the virtual light ray; If the voxel unit is hit by the virtual light ray, mark the hit identifier of the voxel unit as an occupied identifier; If the voxel unit is not hit by the virtual light ray, mark the hit identifier of the voxel unit as an empty identifier.

5. The voxelization model construction method according to claim 4, wherein The determining the hit identifier and direction identifier of each voxel unit according to each of the light origin position parameters and the irradiation direction of the virtual light ray further includes: If the voxel unit is hit by the virtual light ray, determine whether the surface of the voxel unit hit by the virtual light ray is the incident light surface or the outgoing light surface of the virtual light ray; If the surface of the voxel unit hit by the virtual light ray is the incident light surface of the virtual light ray, determine the direction identifier of the voxel unit as a forward identifier; If the surface of the voxel unit hit by the virtual light ray is the outgoing light surface of the virtual light ray, determine the direction identifier of the voxel unit as a reverse identifier.

6. The voxelization model construction method according to claim 3, wherein The determining the light origin position parameter of the virtual light ray includes: Determine the light source position parameters corresponding to each of the virtual sub-light sources; Determine the center position parameter of the object to be constructed; Determine the light origin position parameter of the virtual light ray emitted by each of the virtual sub-light sources according to the light source position parameters, the center position parameter and a preset boundary parameter.

7. The voxelization model construction method according to claim 1, characterized in that, Said splitting the object to be constructed into a two-dimensional plane texture including a plurality of pixel units includes: Splitting the object to be constructed into a preset number of dimension units in a splitting dimension; Determining the texture units corresponding to each of the dimension units in the two-dimensional plane texture; Determining the pixel units corresponding to each of the voxel units in each of the texture units; Synchronizing the hit flag and the direction flag corresponding to each of the voxel units to the corresponding pixel units, to obtain the two-dimensional plane texture including a plurality of pixel units.

8. The voxelization model construction method according to claim 7, wherein Said determining the pixel units corresponding to each of the voxel units in each of the texture units includes: Determining the voxel position information of each of the voxel units in the object to be constructed; Determining the tiling offset of each of the texture units; For each of the voxel units, determining the pixel position corresponding to the voxel unit according to the voxel position information of the voxel unit and the tiling offset corresponding to the texture unit where the voxel unit is located; Determining the pixel unit where the pixel position is located as the pixel unit corresponding to the voxel unit in the texture unit.

9. A voxelization model construction device, characterized in that The apparatus includes: A determining module, configured to determine the hit flag and the direction flag of each voxel unit when the object to be constructed is irradiated by a virtual light source; A splitting module, configured to split the object to be constructed into a two-dimensional plane texture including a plurality of pixel units; wherein, each of the pixel units includes the corresponding hit flag and the direction flag; A constructing module, configured to construct a voxelization model of the object to be constructed based on the hit flags and the direction flags corresponding to the plurality of pixel units in the two-dimensional plane texture.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 8.

11. An electronic device, characterized in that, Including: A processor; And A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the method according to any one of claims 1 to 8 by executing the executable instructions.

Citation Information

Patent Citations

  • A component-based intelligent generation method of virtual scene light source

    CN109509249A

  • Normal map generation method and device, electronic device and storage medium

    CN114494564A