Regular grid-based degradation rendering method and system and storage medium
By judging the existence of child node mesh in the regular mesh segmentation stage and generating degenerated parent node mesh, the problem of model shape inconsistency and pattern anomalies caused by factoring in the prior art is solved, and the consistency and edge smoothness of model patterns are achieved.
Patent Information
- Application Number
- CN202411991256.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-11
AI Technical Summary
In the prior art, when the child node grids under the parent node do not exist, they will be automatically filled, resulting in inconsistent model shapes of different levels as the distance of sight changes, and the merger of multi-level grids leads to abnormal model patterns.
In the regular mesh segmentation stage, the existing mesh is marked and stored in the database. When rendering the mesh model, the mesh outside the range is eliminated based on the marking attribute value to generate a degenerated parent node mesh.
It ensures consistency of model patterns, solves the problem of model shape inconsistency caused by visual line changes, and avoids model pattern anomalies caused by multi-level grid merging, and improves the edge smoothness of the mesh model.
Smart Images

Figure CN119810288A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of regular grid model segmentation and model rendering display, and in particular to a method, system and storage medium based on regular grid degenerate rendering. Background Art
[0002] The multi-level grid model adopts the octree structure for page rendering. The child node grid is loaded when the viewing distance is close, and the parent node grid is replaced when the viewing distance is far. The grids of all levels are cubes. This faces a problem. If the child node grids under the parent node do not all exist, they will be automatically filled at the parent node level. As a result, the shapes of models at different levels are inconsistent when switching pages as the viewing distance changes. Summary of the invention
[0003] In view of the technical defects and technical drawbacks in the prior art, the embodiments of the present invention provide a method, system and storage medium based on regular grid degenerate rendering to overcome the above problems or at least partially solve the above problems. The specific scheme is as follows:
[0004] As a first aspect of the present invention, a method for regular grid-based degenerate rendering is provided, the method comprising:
[0005] Step 1: In the regular grid generation stage, the existence of child node grids is judged to determine whether all child node grids under parent node grids of all levels exist, and special attributes are marked on the existing grids and stored in the database;
[0006] Step 2, when rendering the mesh model, obtain the mesh with special attribute values. When merging multiple levels of meshes, remove the mesh outside the special attribute value range according to the special attribute value recorded in the field to generate a degenerate parent node mesh.
[0007] Furthermore, the determining whether all child node grids under each level of parent node grid exist includes:
[0008] Step 101, read the reference grid and set the reference grid level to the Nth level;
[0009] Step 102, traverse the reference grid, obtain the N-1th level parent node grid of the reference grid, query all the child node grids of the next level of the parent node grid, traverse the child node grids to determine their existence, and record the existence of the corresponding child node grid by marking special attributes, so as to obtain the existence of all the child node grids under the N-1th level parent node grid;
[0010] Step 103, traverse the N-1th level node, obtain the N-2th level parent node grid of the reference grid, query all the child node grids of the next level of the parent node grid, traverse the child node grids to determine their existence, and record the existence of the corresponding child node grid by marking special attributes, so as to obtain the existence of all the child node grids under the N-2th level parent node grid;
[0011] According to the method of steps 102 and 103, it is determined whether all the child node grids under the parent node grids of each level exist.
[0012] Furthermore, the method further comprises: generating a grid model based on the existence of the reference grid, parent node grids of each level and their child nodes.
[0013] Furthermore, the generation of the grid model based on the existence of the reference grid, parent node grids of each level and their child nodes includes:
[0014] Step 201, read the reference grid and generate the Nth level grid model;
[0015] Step 203, read the N-1th level parent node grid of the reference grid, query the existence of the child node grid under the N-1th level parent node grid, if there is a non-existent grid, generate the corresponding degenerate grid, if there is no non-existent grid, generate the parent node grid normally, so as to obtain the N-1th level grid model;
[0016] Step 203, read the N-2 level parent node grid, obtain all the N-1 level grid models under the N-2 level parent node grid, remove the overlapping faces of the models, and merge them to obtain the N-2 level grid model;
[0017] According to the methods of steps 202 and 203, grid models at various levels are obtained.
[0018] As a second aspect of the present invention, a system based on regular grid degenerate rendering is provided, the system comprising:
[0019] The existence judgment module is used to add the judgment of the existence of child node grids in the regular grid generation stage, judge whether all child node grids under the parent node grids at all levels exist, mark the existing grids with special attributes and store them in the database;
[0020] The rendering module is used to obtain meshes with special attribute values when rendering a mesh model. When multiple levels of meshes are merged, meshes outside the range of special attribute values recorded in the field are removed to generate degenerate parent node meshes.
[0021] Furthermore, the existence judgment module judges whether all child node grids under each level of parent node grid exist, including:
[0022] Step 101, read the reference grid and set the reference grid level to the Nth level;
[0023] Step 102, traverse the reference grid, obtain the N-1th level parent node grid of the reference grid, query all the child node grids of the next level of the parent node grid, traverse the child node grids to determine their existence, and record the existence of the corresponding child node grid by marking special attributes, so as to obtain the existence of all the child node grids under the N-1th level parent node grid;
[0024] Step 103, traverse the N-1th level node, obtain the N-2th level parent node grid of the reference grid, query all the child node grids of the next level of the parent node grid, traverse the child node grids to determine their existence, and record the existence of the corresponding child node grid by marking special attributes, so as to obtain the existence of all the child node grids under the N-2th level parent node grid;
[0025] According to the method of steps 102 and 103, it is determined whether all the child node grids under the parent node grids of each level exist.
[0026] Furthermore, the system also includes a generation module, which is used to generate a grid model based on the existence of the reference grid, parent node grids of various levels and their child nodes.
[0027] Furthermore, the generation module is used to generate a grid model based on the existence of the reference grid, parent node grids of each level and their child nodes, including:
[0028] Step 201, read the reference grid and generate the Nth level grid model;
[0029] Step 203, read the N-1th level parent node grid of the reference grid, query the existence of the child node grid under the N-1th level parent node grid, if there is a non-existent grid, generate the corresponding degenerate grid, if there is no non-existent grid, generate the parent node grid normally, so as to obtain the N-1th level grid model;
[0030] Step 203, read the N-2 level parent node grid, obtain all the N-1 level grid models under the N-2 level parent node grid, remove the overlapping surfaces of the models, and merge them to obtain the N-2 level grid model; according to the methods of steps 202 and 203, grid models of each level are obtained.
[0031] As a third aspect of the present invention, a computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the computer executes any one of the above-mentioned methods for regular grid-based degenerate rendering.
[0032] The present invention has the following beneficial effects:
[0033] The present invention adds a step of judging the existence of child node grids in the regular grid division stage under the original method of generating grids by querying grid coordinates and calculating the size of corresponding levels according to grid codes. By judging whether all child grids under multi-level parent grids exist, the existing grids are marked with attributes and stored in a database. When the grid model is subsequently rendered, the existing attribute values are read. When multi-level grids are merged, grids outside the range are removed according to the attribute values recorded in the field to generate a degenerate parent grid, thereby ensuring the model shape. The problems of inconsistent model shapes of different levels when switching pages due to changes in viewing distance and abnormal model shapes caused by merging multi-level grids are solved, and the problem of jagged edges of grid models is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic flow chart of a method for regular grid-based degenerate rendering provided by an embodiment of the present invention;
[0035] Figure 2 An illustration of determining the existence of a sub-grid in an 8×8 grid provided in an embodiment of the present invention;
[0036] Figure 3 A schematic diagram of a 4×4 degenerate grid generation method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] Figure 1 A flowchart of a method for regular grid degenerate rendering provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, an embodiment of the present invention provides a method for regular grid-based degenerate rendering, comprising:
[0039] Step 1: In the regular grid generation stage, the existence of child node grids is judged to determine whether all child node grids under parent node grids of all levels exist, and special attributes are marked on the existing grids and stored in the database;
[0040] Step 2, when rendering the mesh model, obtain the mesh with special attribute values. When merging multiple levels of meshes, remove the mesh outside the special attribute value range according to the special attribute value recorded in the field to generate a degenerate parent node mesh.
[0041] The present invention adds a step of judging the existence of child node grids in the regular grid division stage under the original method of generating grids by querying grid coordinates and calculating the size of corresponding levels according to grid codes. By judging whether all child grids under multi-level parent grids exist, the existing grids are marked with attributes and stored in a database. When the grid model is subsequently rendered, the existing attribute values are read. When multi-level grids are merged, grids outside the range are removed according to the attribute values recorded in the field to generate a degenerate parent grid, thereby ensuring the model shape. The problems of inconsistent model shapes of different levels when switching pages due to changes in viewing distance and abnormal model shapes caused by merging multi-level grids are solved, and the problem of jagged edges of grid models is solved.
[0042] In some embodiments, the present invention adds a determination of the existence of child node grids for grids with different levels of grids whose model morphology changes due to paging and merging, including determining whether all child node grids under parent node grids at all levels exist. The specific steps are as follows:
[0043] Step 101, read the reference grid and set the reference grid level to the Nth level;
[0044] Step 102, traverse the reference grid, obtain the N-1th level parent node grid of the reference grid, query all the child node grids of the next level of the parent node grid, traverse the child node grids to determine their existence, and record the existence of the corresponding child node grid by marking special attributes, so as to obtain the existence of all the child node grids under the N-1th level parent node grid;
[0045] Step 103, traverse the N-1th level node, obtain the N-2th level parent node grid of the reference grid, query all the child node grids of the next level of the parent node grid, traverse the child node grids to determine their existence, and record the existence of the corresponding child node grid by marking special attributes, so as to obtain the existence of all the child node grids under the N-2th level parent node grid;
[0046] Steps 102 and 103 disclose a method for obtaining the existence of all child node grids under the N-1 and N-2 level parent node grids. Similarly, according to the methods of steps 102 and 103, the parent node grid and its child node grids are traversed to obtain whether all child node grids under each level of parent node grid exist.
[0047] According to the above method, the existence of the reference grid, parent node grids at all levels and their child nodes can be obtained.
[0048] Figure 2 A schematic diagram of determining the existence of a sub-grid in an 8×8 grid provided in an embodiment of the present invention, see Figure 2 As shown, in this embodiment, the existing grid is marked with "yes" as the special attribute.
[0049] In some embodiments, the method further includes: generating a grid model based on the existence of the reference grid, parent node grids of each level and their child nodes, the specific steps are as follows:
[0050] Step 201, read the reference grid and generate the Nth level grid model;
[0051] Step 203, read the N-1th level parent node grid of the reference grid, query the existence of the child node grid under the N-1th level parent node grid, if there is a non-existent grid, generate the corresponding degenerate grid, if there is no non-existent grid, generate the parent node grid normally, so as to obtain the N-1th level grid model;
[0052] Step 203, read the N-2 level parent node grid, obtain all the N-1 level grid models under the N-2 level parent node grid, remove the overlapping faces of the models, and merge them to obtain the N-2 level grid model;
[0053] Steps 202 and 203 disclose methods for obtaining N-1 and N-2 level grid models. Similarly, according to the methods of steps 202 and 203, grid models at all levels are obtained.
[0054] Figure 3 A schematic diagram of a 4×4 degenerate grid generation method provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, in this embodiment, for the parent node grid, if there is a non-existent grid, a corresponding degenerate grid is generated; if there is no non-existent grid, the parent node grid is generated normally.
[0055] An embodiment of the present invention further provides a system based on regular grid degenerate rendering, the system comprising:
[0056] The existence judgment module is used to add the judgment of the existence of child node grids in the regular grid generation stage, judge whether all child node grids under the parent node grids at all levels exist, mark the existing grids with special attributes and store them in the database;
[0057] The rendering module is used to obtain meshes with special attribute values when rendering a mesh model. When multiple levels of meshes are merged, meshes outside the range of special attribute values recorded in the field are removed to generate degenerate parent node meshes.
[0058] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a computer, the computer executes any one of the methods for regular grid-based degenerate rendering described above. The method for regular grid-based degenerate rendering is as described above and will not be repeated here.
[0059] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0060] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0061] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0062] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for regular grid degenerate rendering, characterized in that: The method comprises: Step 1: In the regular grid generation stage, the existence of child node grids is judged to determine whether all child node grids under parent node grids of all levels exist, and special attributes are marked on the existing grids and stored in the database; Step 2, when rendering the mesh model, obtain the mesh with special attribute values. When merging multiple levels of meshes, remove the mesh outside the special attribute value range according to the special attribute value recorded in the field to generate a degenerate parent node mesh.
2. The method for regular grid-based degenerate rendering according to claim 1, characterized in that: The determination of whether all child node grids under parent node grids at all levels exist includes: Step 101, read the reference grid and set the reference grid level to the Nth level; Step 102, traverse the reference grid, obtain the N-1th level parent node grid of the reference grid, query all the child node grids of the next level of the parent node grid, traverse the child node grids to determine their existence, and record the existence of the corresponding child node grid by marking special attributes, so as to obtain the existence of all the child node grids under the N-1th level parent node grid; Step 103, traverse the N-1th level node, obtain the N-2th level parent node grid of the reference grid, query all the child node grids of the next level of the parent node grid, traverse the child node grids to determine their existence, and record the existence of the corresponding child node grid by marking special attributes, so as to obtain the existence of all the child node grids under the N-2th level parent node grid; According to the method of steps 102 and 103, it is determined whether all the child node grids under the parent node grids of each level exist.
3. The method for regular grid-based degenerate rendering according to claim 1, characterized in that: The method further comprises: generating a grid model based on the existence of the reference grid, parent node grids of various levels and their child nodes.
4. The method for regular grid-based degenerate rendering according to claim 3, characterized in that: The generation of a grid model based on the existence of a reference grid, parent node grids of various levels and their child nodes includes: Step 201, read the reference grid and generate the Nth level grid model; Step 202, read the N-1th level parent node grid of the reference grid, query the existence of the child node grid under the N-1th level parent node grid, if there is a non-existent grid, generate the corresponding degenerate grid, if there is no non-existent grid, generate the parent node grid normally, so as to obtain the N-1th level grid model; Step 203, read the N-2 level parent node grid, obtain all the N-1 level grid models under the N-2 level parent node grid, remove the overlapping faces of the models, and merge them to obtain the N-2 level grid model; According to the methods of steps 202 and 203, grid models at various levels are obtained.
5. A system based on regular grid degenerate rendering, characterized in that: The system comprises: The existence judgment module is used to add the judgment of the existence of child node grids in the regular grid generation stage, judge whether all child node grids under the parent node grids at all levels exist, mark the existing grids with special attributes and store them in the database; The rendering module is used to obtain meshes with special attribute values when rendering a mesh model. When multiple levels of meshes are merged, meshes outside the range of special attribute values recorded in the field are removed to generate degenerate parent node meshes.
6. The system based on regular grid degenerate rendering according to claim 5, characterized in that: The existence judgment module judges whether all child node grids under each level of parent node grid exist, including: Step 101, read the reference grid and set the reference grid level to the Nth level; Step 102, traverse the reference grid, obtain the N-1th level parent node grid of the reference grid, query all the child node grids of the next level of the parent node grid, traverse the child node grids to determine their existence, and record the existence of the corresponding child node grid by marking special attributes, so as to obtain the existence of all the child node grids under the N-1th level parent node grid; Step 103, traverse the N-1th level node, obtain the N-2th level parent node grid of the reference grid, query all the child node grids of the next level of the parent node grid, traverse the child node grids to determine their existence, and record the existence of the corresponding child node grid by marking special attributes, so as to obtain the existence of all the child node grids under the N-2th level parent node grid; According to the method of steps 102 and 103, it is determined whether all the child node grids under the parent node grids of each level exist.
7. The system based on regular grid degenerate rendering according to claim 5, characterized in that: The system further comprises a generation module, which is used to generate a grid model based on the existence of a reference grid, parent node grids of various levels and their child nodes.
8. The system based on regular grid degenerate rendering according to claim 5, characterized in that: The generation module is used to generate a grid model based on the existence of the reference grid, parent node grids of various levels and their child nodes, including: Step 201, read the reference grid and generate the Nth level grid model; Step 202, read the N-1th level parent node grid of the reference grid, query the existence of the child node grid under the N-1th level parent node grid, if there is a non-existent grid, generate the corresponding degenerate grid, if there is no non-existent grid, generate the parent node grid normally, so as to obtain the N-1th level grid model; Step 203, read the N-2 level parent node grid, obtain all the N-1 level grid models under the N-2 level parent node grid, remove the overlapping faces of the models, and merge them to obtain the N-2 level grid model; According to the methods of steps 202 and 203, grid models at various levels are obtained.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the computer executes the method for regular grid-based degenerate rendering according to any one of claims 1 to 4.