Stored method, apparatus, terminal device, readable storage medium and program product
Patent Information
- Application Number
- CN202310411279.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-17
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-04-17
AI Technical Summary
[0004]然而对于体素模型中的体素对象(比如体素风格的地形数据和模型数据等),由于各每个体素对象具有坐标(x,y,z)、有向距离场(SDF)以及材质等信息,因此直接存储体素对象会消耗大量内存,引起编辑器或者系统的卡顿、崩溃等问题
[0029]本发明提供一种存储的方法、装置、终端设备、计算机可读存储介质以及计算机程序产品,通过在执行针对体素模型的编辑操作过程中,获取被编辑操作所修改的体素对象,针对获得的体素对象进行分段压缩;将分段压缩后的体素对象存储于内存。
Smart Images

Figure CN116540910B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a storage method, apparatus, terminal device, readable storage medium, and program product. Background Technology
[0002] Undo / Redo is a general function that allows users to revert modified content to its previous state.
[0003] Currently, to achieve the above functionality, the data before modification is usually temporarily stored in memory, and then restored when the undo operation is triggered.
[0004] However, for voxel objects in voxel models (such as voxel-style terrain data and model data), since each voxel object has coordinates (x, y, z), directed distance field (SDF), and material information, directly storing voxel objects will consume a lot of memory, causing problems such as editor or system lag and crashes. Summary of the Invention
[0005] The main objective of this invention is to provide a storage method, apparatus, terminal device, computer-readable storage medium, and computer program product, which aims to reduce the memory required to store voxel objects and thereby improve voxel object processing performance.
[0006] To achieve the above objectives, the present invention provides a storage method, the method comprising the following steps:
[0007] During the editing operation on the voxel model, the voxel object modified by the editing operation is obtained, and the obtained voxel object is compressed in segments.
[0008] The segmented and compressed voxel objects are stored in memory.
[0009] Optionally, the step of segmenting and compressing the obtained voxel object includes:
[0010] Import the obtained voxel objects into the processing queue;
[0011] When the amount of data of the voxel objects imported into the processing queue reaches a preset compression threshold, the voxel objects in the processing queue are compressed.
[0012] Optionally, before the step of performing segmented compression on the obtained voxel object, the method further includes:
[0013] Multiple voxel objects that meet preset conditions are merged, wherein the preset conditions include: the voxel material properties and the voxel directional distance fields of each voxel object are consistent and they are in adjacent positions.
[0014] Optionally, the preset compression threshold includes different first compression thresholds and second compression thresholds, the processing queue includes a first processing queue and a second processing queue, and the step of compressing the voxel objects in the processing queue includes:
[0015] The merged voxel objects are marked as the first type and imported into the first processing queue. When the amount of data of the voxel objects in the first processing queue reaches the first compression threshold, the voxel objects in the first processing queue are compressed, and the first type is added after compression.
[0016] Unmerged voxel objects are marked as second type and imported into the second processing queue. When the amount of data of voxel objects in the second processing queue reaches the second compression threshold, the voxel objects in the second processing queue are compressed, and the second type is added after compression.
[0017] Optionally, the processing queue further includes: a third processing queue, wherein the step of merging voxel objects that meet preset conditions includes:
[0018] In the third processing queue, it is determined whether the currently acquired voxel object and the previously acquired voxel object meet the preset conditions.
[0019] If the preset conditions are not met, and the third processing queue contains the plurality of previously acquired voxel objects, then the plurality of previously acquired voxel objects are merged to obtain a first voxel object and imported into the first processing queue; otherwise, the previously acquired voxel object is imported into the second processing queue.
[0020] Optionally, the step of merging voxel objects that meet preset conditions includes:
[0021] Determine the start and end positions of multiple voxel objects that meet preset conditions;
[0022] Based on the starting position and the ending position, the multiple voxel objects are merged to obtain the first voxel object.
[0023] To achieve the above objectives, the present invention also provides a storage device, the storage device comprising:
[0024] The segmented compression module is used to obtain the voxel objects modified by the editing operation during the execution of the voxel model, and to perform segmented compression on the obtained voxel objects.
[0025] The data storage module is used to store the segmented and compressed voxel objects in memory.
[0026] To achieve the above objectives, the present invention also provides a terminal device, the terminal device including a memory, a processor, and a stored program stored in the memory and executable on the processor, wherein the stored program, when executed by the processor, implements the steps of the storage method as described above.
[0027] Furthermore, to achieve the above objectives, the present invention also proposes a computer-readable storage medium on which a stored program is stored, and when the stored program is executed by a processor, it implements the steps of the storage method as described above.
[0028] To achieve the above objectives, the present invention also provides a computer program product comprising a computer program that, when executed by a processor, implements the steps of the storage method as described above.
[0029] This invention provides a storage method, apparatus, terminal device, computer-readable storage medium, and computer program product, which involves obtaining the voxel object modified by the editing operation during the execution of an editing operation on a voxel model, performing segmented compression on the obtained voxel object, and storing the segmented compressed voxel object in memory.
[0030] Compared to the direct storage of voxel objects in existing technologies, this invention can obtain the voxel objects modified by the editing operation during the voxel model editing process. Then, the obtained voxel objects can be segmented and compressed, and the segmented and compressed voxel objects can be stored in memory. Therefore, in this invention, the voxel objects are segmented and compressed before being stored, thus avoiding the stuttering and crashes that occur during voxel model editing operations due to direct large-scale storage of voxel objects. This significantly reduces the storage space required for voxel objects, improves voxel object processing efficiency, and ultimately enhances the user experience. Attached Figure Description
[0031] Figure 1 This is a schematic diagram of the hardware operating environment involved in the embodiments of the present invention;
[0032] Figure 2 This is a flowchart illustrating an embodiment of the storage method of the present invention;
[0033] Figure 3 This is a schematic diagram of the functional modules of an embodiment of the storage device of the present invention.
[0034] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0035] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0036] like Figure 1 As shown, Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention.
[0037] The terminal device in this embodiment of the invention can be a smartphone, tablet computer, computer, server or other network device, etc. The terminal device in this embodiment can be used to implement low-memory storage of voxel objects.
[0038] like Figure 1 As shown, the terminal device may include: a processor 1001, such as a CPU; a network interface 1004; a user interface 1003; a memory 1005; and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard. Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0039] Those skilled in the art will understand that Figure 1 The device structure shown does not constitute a limitation on the storage device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0040] like Figure 1 As shown, the memory 1005, as a computer storage medium, may include an operation module, a network communication module, a user interface module, and stored programs. The operation module is a program that manages and controls the hardware and software resources of the device, supporting the execution of the stored programs and other software or programs. Figure 1 In the device shown, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing a communication connection with the server; and the processor 1001 can be used to call the stored program in the memory 1005 and perform the following operations:
[0041] During the editing operation on the voxel model, the voxel object modified by the editing operation is obtained, and the obtained voxel object is compressed in segments.
[0042] The segmented and compressed voxel objects are stored in memory.
[0043] Furthermore, the processor 1001 can be used to call a stored program in the memory 1005 and perform the following operations:
[0044] Import the obtained voxel objects into the processing queue;
[0045] When the amount of data of the voxel objects imported into the processing queue reaches a preset compression threshold, the voxel objects in the processing queue are compressed.
[0046] Furthermore, prior to the step of segmenting and compressing the obtained voxel object, the processor 1001 may invoke a stored program in the memory 1005 and perform the following operations:
[0047] Multiple voxel objects that meet preset conditions are merged, wherein the preset conditions include: the voxel material properties and the voxel directional distance fields of each voxel object are consistent and they are in adjacent positions.
[0048] Furthermore, the preset compression threshold includes different first compression thresholds and second compression thresholds, the processing queue includes a first processing queue and a second processing queue, and the processor 1001 can be used to call the stored program stored in the memory 1005 and perform the following operations:
[0049] The merged voxel objects are marked as the first type and imported into the first processing queue. When the amount of data of the voxel objects in the first processing queue reaches the first compression threshold, the voxel objects in the first processing queue are compressed, and the first type is added after compression.
[0050] Unmerged voxel objects are marked as second type and imported into the second processing queue. When the amount of data of voxel objects in the second processing queue reaches the second compression threshold, the voxel objects in the second processing queue are compressed, and the second type is added after compression.
[0051] Furthermore, the processing queue also includes a third processing queue, wherein the processor 1001 can be used to call a stored program stored in the memory 1005 and perform the following operations:
[0052] In the third processing queue, it is determined whether the currently acquired voxel object and the previously acquired voxel object meet the preset conditions.
[0053] If the preset conditions are not met, and the third processing queue contains the plurality of previously acquired voxel objects, then the plurality of previously acquired voxel objects are merged to obtain a first voxel object and imported into the first processing queue; otherwise, the previously acquired voxel object is imported into the second processing queue.
[0054] Furthermore, the processor 1001 can be used to call a stored program in the memory 1005 and perform the following operations:
[0055] Determine the start and end positions of multiple voxel objects that meet preset conditions;
[0056] Based on the starting position and the ending position, the multiple voxel objects are merged to obtain the first voxel object.
[0057] Considering that voxel objects in a voxel model have coordinates (x, y, z), directed distance field (SDF), and material information, if the voxel objects modified by editing operations are directly compressed, the voxel objects will occupy a large amount of memory space, consume a lot of memory, and cause the voxel model editor to lag or crash.
[0058] Therefore, in order to solve the above problems, the present invention proposes a storage method aimed at reducing the memory consumption occupied by storing voxel objects.
[0059] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the storage method of the present invention.
[0060] The embodiments of the present invention provide embodiments of storage methods. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0061] Specifically, the storage method in this embodiment includes the following steps:
[0062] Step S10: During the editing operation on the voxel model, obtain the voxel object modified by the editing operation, and perform segmented compression on the obtained voxel object;
[0063] In this embodiment, the voxel model can be composed of voxel objects, and the voxel model can contain multiple cuboid-shaped voxel objects, wherein the size of the voxel objects can be 32×32×32.
[0064] When a user edits a voxel model composed of voxel objects using a modeling tool, executing "press → slide → release" can be considered a complete editing operation.
[0065] During the editing process of the voxel model, the terminal device can obtain the voxel objects modified by the editing operation. The voxel objects can be obtained one by one while the editing operation is being performed.
[0066] Furthermore, the obtained multiple voxel objects can be compressed in segments. Segmented compression can be understood as: first, the obtained multiple voxel objects are divided into segments to obtain multiple voxel objects, and then each segment of the voxel objects is compressed separately.
[0067] This embodiment significantly reduces the amount of data in the voxel objects to be stored by segmenting and compressing only the voxel objects modified by the editing operation. This reduces the storage space occupied by the voxel objects, improves system performance, and avoids system lag and crashes caused by directly storing voxel objects.
[0068] Step S20: Store the segmented and compressed voxel objects in memory.
[0069] In this embodiment, the memory can be the storage space of the terminal device.
[0070] After the terminal device performs segmented compression on the obtained voxel object, it can store the segmented compressed voxel object in memory.
[0071] It should be noted that, in this embodiment, according to the above description, when a user edits a voxel model using the modeling tool, triggering a "press → slide → release" action is considered a complete editing operation. If the user wants to undo this editing operation, they can do so by executing "ctrl+z" or similar methods.
[0072] When the terminal device performs the undo operation, it can decompress the segmented and compressed voxel objects in memory to obtain the restored voxel objects.
[0073] In one embodiment, for a complete editing operation, when storing the segmented compressed voxel objects in memory, a stack can be used for storage. Then, when performing an undo operation, a last-in-first-out (LIFO) operation can be performed on the voxel objects in memory to restore them to their state before the editing operation.
[0074] This embodiment significantly reduces the memory space occupied when storing modified voxel objects by employing a segmented compression method before storage, achieving temporary storage and rapid restoration of voxel objects. Furthermore, this embodiment avoids system lag and crashes caused by direct storage of voxel objects, improving system performance and enhancing the user experience.
[0075] Compared to the direct storage of voxel objects in existing technologies, this invention can obtain the voxel objects modified by the editing operation during the voxel model editing process. Then, the obtained voxel objects can be segmented and compressed, and the segmented and compressed voxel objects can be stored in memory. Therefore, in this invention, the voxel objects are segmented and compressed before being stored, thus avoiding the stuttering and crashes that occur during voxel model editing operations due to direct large-scale storage of voxel objects. This significantly reduces storage space, improves voxel object processing efficiency, and ultimately enhances the user experience.
[0076] In one embodiment, step S10 above, "performing segmented compression on the obtained voxel object," may include:
[0077] Sub-step S101: Import the obtained voxel object into the processing queue;
[0078] In this embodiment, after the terminal device obtains the voxel object modified by the editing operation, it can import the voxel object into a processing queue for subsequent segmented compression operations. The processing queue can be used for temporary storage of the voxel object.
[0079] Sub-step S102: When the amount of data of the voxel objects imported into the processing queue reaches a preset compression threshold, the voxel objects in the processing queue are compressed.
[0080] In this embodiment, no specific limit is set on the preset compression threshold, which can be flexibly set according to the actual voxel model editing scene.
[0081] The terminal device can import the obtained voxel objects into the processing queue, and then monitor in real time whether the data volume of the voxel objects in the processing queue reaches the preset compression threshold. When the data volume of the voxel objects in the processing queue reaches the preset compression threshold, the voxel objects in the processing queue can be compressed.
[0082] It should be noted that in this embodiment, after compressing the voxel objects in the processing queue, the processing queue can be cleared and the process can be repeated: the obtained voxel objects are imported into the cleared processing queue, and when the amount of data of the voxel objects in the processing queue reaches the preset compression threshold, the voxel objects in the processing queue are compressed.
[0083] Repeat the above operations multiple times until the editing operation for the voxel model is completed.
[0084] In another embodiment, if the amount of data of the voxel objects in the processing queue has not reached the preset compression threshold, but the current editing operation on the voxel model has ended, that is, the voxel object currently obtained is the last voxel object modified in this editing operation, then all voxel objects in the current processing queue can be compressed directly (even if the amount of data of the voxel objects in the processing queue has not reached the preset compression threshold at this time).
[0085] This embodiment sets a processing queue and a compression threshold. Once the data volume of voxel objects in the processing queue reaches the compression threshold, compression can be performed. In this way, segmented compression of voxel objects based on the compression threshold is achieved, which greatly reduces storage space, improves the smoothness of voxel model editing, and thus enhances the user experience.
[0086] In one embodiment, prior to step S20 described above, the following may also be included:
[0087] Step S30: Merge multiple voxel objects that meet preset conditions, wherein the preset conditions include: the voxel material properties and the voxel directional distance fields of each voxel object are consistent and located in adjacent positions.
[0088] In this embodiment, the voxel objects in the voxel model possess parameters such as voxel material properties, voxel directed distance fields, and voxel positions. Based on these parameters, a preset condition can be established to determine whether to merge the obtained voxel objects, thereby further reducing the storage space required for modification. The preset condition may include: the voxel material properties and voxel directed distance fields of each voxel object are consistent and they are located in adjacent positions.
[0089] Based on this, multiple voxel objects that meet the above preset conditions can be merged.
[0090] Specifically, for example, if the voxel material properties and voxel directed distance fields of multiple voxel objects are consistent and each pair of voxel objects is in an adjacent position, then the multiple voxel objects are considered to meet the preset conditions, and the multiple voxel objects that meet the preset conditions are merged.
[0091] It is understood that in this embodiment, when merging multiple voxel objects that meet the preset conditions, the multiple voxel objects are actually merged into one voxel object.
[0092] Voxel objects that do not meet the above preset conditions will not be merged.
[0093] Compared to direct segmented compression, this embodiment further reduces storage space by merging voxel objects that meet preset conditions before segmented compression, ensuring smooth and lag-free voxel model editing operations, thereby improving the processing efficiency of voxel objects.
[0094] In one embodiment, the preset compression threshold includes different first compression thresholds and second compression thresholds, and the processing queue includes a first processing queue and a second processing queue. Based on this, the sub-step S102 above, "compressing the voxel objects in the processing queue", may include:
[0095] Sub-step S1021: Mark the merged voxel objects as the first type and import them into the first processing queue. When the data volume of the voxel objects in the first processing queue reaches the first compression threshold, compress the voxel objects in the first processing queue and add the first type of mark after compression.
[0096] Sub-step S1022: Mark the unmerged voxel objects as the second type and import them into the second processing queue. When the data volume of the voxel objects in the second processing queue reaches the second compression threshold, compress the voxel objects in the second processing queue and add the second type of mark after compression.
[0097] In this embodiment, the merged voxel object can be used as the first voxel object, and the unmerged voxel object can be used as the second voxel object. Considering that the first voxel object is obtained by merging multiple voxel objects, and that the first and second voxel objects have differences in data structure, in order to improve the segmented compression performance of voxel objects, optimize segmented compression performance, reduce the storage space of voxel objects, and improve the editing efficiency of voxel models, the aforementioned preset compression threshold can be divided into different first compression thresholds and second compression thresholds. Based on this, when segmenting voxel objects, different types of voxel objects can be imported into different processing queues, and then segmented compression can be performed on voxel objects according to the corresponding compression thresholds.
[0098] Specifically, for example, the terminal device can mark a first voxel object as a first type, and then import the marked first voxel object into a first processing queue. When the amount of data of the first voxel object imported into the first processing queue reaches a first compression threshold, the first voxel object in the first processing queue is compressed, and a first type mark is added after compression. The second voxel object is marked as a second type, and then the marked second voxel object is imported into a second processing queue. When the amount of data of the second voxel object imported into the second processing queue reaches a second compression threshold, the second voxel object in the second processing queue is compressed, and a second type mark is added after compression.
[0099] For example, when the first compression threshold is 1.9K and the second compression threshold is 2.4K, if the amount of data of the first voxel object imported into the first processing queue reaches 1.9K, then all the first voxel objects in the first processing queue can be compressed; if the amount of data of the second voxel object imported into the second processing queue reaches 2.4K, then all the second voxel objects in the second processing queue can be compressed.
[0100] In another embodiment, the first compression threshold and the second compression threshold can also be the same. For example, when both the first compression threshold and the second compression threshold are 2K, if the amount of data of the voxel objects imported into the processing queue reaches 2K, then all voxel objects in the processing queue can be compressed.
[0101] Furthermore, it is understood that in this embodiment, to distinguish different types of voxel objects and facilitate accurate decompression of subsequent voxel objects, type tags need to be added to the first and second voxel objects before importing them into the corresponding processing queues. After compression and before storage, the compressed first voxel object needs to be marked as type one, and the compressed second voxel object as type two. This tagging method accurately distinguishes different types of voxel objects, enabling the decompression and restoration of compressed objects in memory, thus allowing for the undoing of editing operations.
[0102] In this embodiment, segmented compression of voxel objects is achieved through corresponding processing queues and compression thresholds for different types of voxel objects. This enables dual-threaded segmented compression processing of voxel objects, improving both processing accuracy and efficiency. Furthermore, this invention enhances storage efficiency and saves storage space for voxel objects.
[0103] In one embodiment, the processing queue may include a third processing queue in addition to the first and second processing queues. Based on this, step S30, "merging multiple voxel objects that meet preset conditions," may include:
[0104] Sub-step S301: In the third processing queue, determine whether the currently acquired voxel object and the previously acquired voxel object meet the preset conditions.
[0105] In sub-step S302, if the preset condition is not met, and the third processing queue contains the plurality of previously acquired voxel objects, then the plurality of previously acquired voxel objects are merged to obtain a first voxel object and imported into the first processing queue; otherwise, the previously acquired voxel object is imported into the second processing queue.
[0106] It should be noted that, in this embodiment, the voxel object modified by the editing operation can be first imported into the third processing queue, so that different types of first voxel objects and second voxel objects can be determined in the third processing queue.
[0107] Specifically, for example, the terminal device can determine whether the currently acquired voxel object in the third processing queue meets the preset condition with the previously acquired voxel object (the preset condition is that the voxel material properties and voxel directional distance fields of each voxel object in the above embodiment are consistent and are in adjacent positions).
[0108] If it is determined that the currently acquired voxel object does not meet the above preset conditions compared with the previously acquired voxel object, it can be further determined whether there are multiple previously acquired voxel objects in the third processing queue. Among them, multiple previously acquired voxel objects can be understood as voxel objects acquired before the current voxel object.
[0109] If it is determined that there are multiple previously acquired voxel objects in the third processing queue, the multiple previously acquired voxel objects can be directly merged to obtain the first voxel object, and the first voxel object can be imported into the first processing queue for segmented compression processing; if it is determined that there are no multiple previously acquired voxel objects in the third processing queue, that is, the third processing queue only contains the currently acquired voxel object and the previously acquired voxel object, then the terminal device can directly import the previously acquired voxel object into the second processing queue.
[0110] In another embodiment, if it is determined that the currently acquired voxel object and the previously acquired voxel object meet the above-mentioned preset conditions, the import of voxel objects will continue to be waited for in the third processing queue until it is determined that the currently acquired voxel object and the previously acquired voxel object do not meet the preset conditions, and then the following steps are performed: determining whether the currently acquired voxel object and the previously acquired voxel object meet the preset conditions; if the preset conditions are not met, if the third processing queue contains the plurality of previously acquired voxel objects, the plurality of previously acquired voxel objects will be merged to obtain a first voxel object and imported into the first processing queue; otherwise, the previously acquired voxel object will be imported into the second processing queue.
[0111] In this embodiment, multiple voxel objects that meet preset conditions are merged into a first voxel object and imported into a first processing queue via a third processing queue. Voxel objects that do not meet the preset conditions are directly imported into a second processing queue as second voxel objects, so that segmented compression is performed in the first and second processing queues respectively. Therefore, this invention improves the voxel object merging efficiency and thus the segmented compression efficiency by performing segmented compression on different types of voxels through multi-threaded synchronous processing, while also reducing storage space.
[0112] In one embodiment, step S30 above, "merging multiple voxel objects that meet preset conditions," may further include:
[0113] Sub-step S305: Determine the start and end positions of multiple voxel objects that meet the preset conditions;
[0114] Sub-step S306: Merge the multiple voxel objects according to the starting position and the ending position.
[0115] It should be noted that in this embodiment, the voxel objects within the voxel model may differ in terms of coordinates (x, y, z), directed distance field (SDF), and material. However, multiple voxel objects that meet the preset conditions have the same material and directed distance field and are located in adjacent positions.
[0116] Based on this, the terminal device can determine the start and end positions of multiple voxel objects that meet the preset conditions. Then, when merging the multiple voxel objects into one voxel object (i.e., the first voxel object in the above embodiment), the multiple position coordinates of the multiple voxel objects are actually simplified directly into a single position coordinate. That is, the position coordinates of the merged first voxel object can be represented as (start position, end position). At this time, the first voxel object includes voxel parameters such as start position, end position, material, and SDF.
[0117] In another embodiment, a single voxel object that does not meet the preset conditions can be directly used as a second voxel object.
[0118] In this embodiment, by determining the start and end positions of multiple voxel objects that meet preset conditions, the merging of multiple voxel objects that meet preset conditions realizes the classification processing of voxel objects. This facilitates the subsequent segmented compression of different types of first and second voxel objects, enabling precise, smooth, and efficient editing operations for voxel models and improving the user experience.
[0119] Furthermore, embodiments of the present invention also propose a storage device, referring to... Figure 3 The storage device includes:
[0120] The segmented compression module 10 is used to obtain the voxel objects modified by the editing operation during the execution of the editing operation on the voxel model, and to perform segmented compression on the obtained voxel objects.
[0121] Data storage module 20 is used to store the segmented compressed voxel objects in memory.
[0122] Furthermore, the segmented compression module 10 includes:
[0123] The import unit is used to import the obtained voxel objects into the processing queue.
[0124] A compression unit is used to compress the voxel objects in the processing queue when the amount of data of the voxel objects imported into the processing queue reaches a preset compression threshold.
[0125] Furthermore, the storage device further includes:
[0126] The merging module is used to merge multiple voxel objects that meet preset conditions, wherein the preset conditions include: the voxel material properties and the voxel directional distance fields of each voxel object are consistent and they are in adjacent positions.
[0127] Further, the preset compression threshold includes different first compression thresholds and second compression thresholds, the processing queue includes a first processing queue and a second processing queue, and the compression unit includes:
[0128] The first compression subunit is used to mark the merged voxel objects as a first type and import them into the first processing queue. When the data volume of the voxel objects in the first processing queue reaches the first compression threshold, the voxel objects in the first processing queue are compressed, and the first type of mark is added after compression.
[0129] The second compression subunit is used to mark unmerged voxel objects as the second type and import them into the second processing queue. When the amount of data of the voxel objects in the second processing queue reaches the second compression threshold, the voxel objects in the second processing queue are compressed, and the second type is added after compression.
[0130] Furthermore, the processing queue further includes: a third processing queue, and the merging unit includes:
[0131] The first judgment subunit is used to determine, in the third processing queue, whether the currently acquired voxel object and the previously acquired voxel object meet the preset conditions.
[0132] The second judgment subunit is used to, if the third processing queue contains the plurality of previously acquired voxel objects, merge the plurality of previously acquired voxel objects to obtain a first voxel object and import it into the first processing queue when the preset condition is not met; otherwise, import the previously acquired voxel object into the second processing queue.
[0133] Further, the merging unit includes:
[0134] Determine the sub-unit, which is used to determine the start and end positions of multiple voxel objects that meet preset conditions;
[0135] The merging subunit is used to merge the multiple voxel objects according to the starting position and the ending position to obtain the first voxel object.
[0136] The specific implementation details of the storage device of the present invention are basically the same as the various embodiments of the storage method described above, and will not be repeated here.
[0137] Furthermore, embodiments of the present invention also propose a computer-readable storage medium storing a stored program, wherein the stored program, when executed by a processor, implements the steps of the storage method described below.
[0138] The various embodiments of the storage device and computer-readable storage medium of the present invention can be referred to the various embodiments of the storage method of the present invention, and will not be described again here.
[0139] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0140] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0141] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (such as a smartphone or tablet computer) to execute the methods described in the various embodiments of the present invention.
[0142] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A storage method, characterized in that, The method includes: During the editing operation on the voxel model, the voxel object modified by the editing operation is obtained, and the obtained voxel object is compressed in segments. Store the segmented and compressed voxel objects in memory; The step of segmenting and compressing the obtained voxel object includes: Import the obtained voxel objects into the processing queue; When the amount of data of the voxel objects imported into the processing queue reaches a preset compression threshold, the voxel objects in the processing queue are compressed. Prior to the step of segmenting and compressing the obtained voxel object, the method further includes: Multiple voxel objects that meet preset conditions are merged, wherein the preset conditions include: the voxel material properties and voxel oriented distance fields of each voxel object are consistent and they are in adjacent positions; The preset compression threshold includes different first compression thresholds and second compression thresholds; the processing queue includes a first processing queue and a second processing queue; and the step of compressing the voxel objects in the processing queue includes: The merged voxel objects are marked as the first type and imported into the first processing queue. When the amount of data of the voxel objects in the first processing queue reaches the first compression threshold, the voxel objects in the first processing queue are compressed, and the first type is added after compression. Unmerged voxel objects are marked as second type and imported into the second processing queue. When the amount of data of voxel objects in the second processing queue reaches the second compression threshold, the voxel objects in the second processing queue are compressed, and the second type is added after compression.
2. The method as described in claim 1, characterized in that, The processing queue further includes: a third processing queue, wherein the step of merging voxel objects that meet preset conditions includes: In the third processing queue, it is determined whether the currently acquired voxel object and the previously acquired voxel object meet the preset conditions. If the preset conditions are not met, and the third processing queue contains the plurality of previously acquired voxel objects, then the plurality of previously acquired voxel objects are merged to obtain a first voxel object and imported into the first processing queue; otherwise, the previously acquired voxel object is imported into the second processing queue.
3. The method as described in claim 1, characterized in that, The step of merging voxel objects that meet the preset conditions includes: Determine the start and end positions of multiple voxel objects that meet preset conditions; The multiple voxel objects are merged based on the starting position and the ending position.
4. A storage device, characterized in that, The storage device includes: The segmented compression module is used to obtain the voxel objects modified by the editing operation during the execution of the voxel model, and to perform segmented compression on the obtained voxel objects. The data storage module is used to store the segmented and compressed voxel objects in memory; The merging module is used to merge multiple voxel objects that meet preset conditions, wherein the preset conditions include: the voxel material properties and the voxel oriented distance fields of each voxel object are consistent and they are in adjacent positions. The segmented compression module is further configured to import the obtained voxel objects into a processing queue; when the amount of data of the voxel objects imported into the processing queue reaches a preset compression threshold, the voxel objects in the processing queue are compressed; the preset compression threshold includes different first compression thresholds and second compression thresholds, and the processing queue includes a first processing queue and a second processing queue. The segmented compression module is further configured to mark the merged voxel objects as a first type and import them into the first processing queue, and when the data volume of the voxel objects in the first processing queue reaches the first compression threshold, compress the voxel objects in the first processing queue and add the first type of mark after compression; mark the unmerged voxel objects as a second type and import them into the second processing queue, and when the data volume of the voxel objects in the second processing queue reaches the second compression threshold, compress the voxel objects in the second processing queue and add the second type of mark after compression.
5. A terminal device, characterized in that, The terminal device includes a memory, a processor, and a stored program stored in the memory and executable on the processor, wherein the stored program, when executed by the processor, implements the steps of the storage method as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a stored program, which, when executed by a processor, implements the steps of the storage method as described in any one of claims 1 to 3.
7. A computer program product, comprising a computer program, characterized in that, When the computer program is processed and executed, it implements the steps of the storage method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Compression method, device and equipment
CN105204781A
Method and apparatus for rendering, storing and editing voxel objects
US20050151734A1