CN112489203A - Model processing method, model processing apparatus, electronic device, and storage medium - Google Patents

Model processing method, model processing apparatus, electronic device, and storage medium Download PDF

Info

Publication number
CN112489203A
CN112489203A CN202011442857.0A CN202011442857A CN112489203A CN 112489203 A CN112489203 A CN 112489203A CN 202011442857 A CN202011442857 A CN 202011442857A CN 112489203 A CN112489203 A CN 112489203A
Authority
CN
China
Prior art keywords
patch
model
determined
processed
patches
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011442857.0A
Other languages
Chinese (zh)
Inventor
刘宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202011442857.0A priority Critical patent/CN112489203A/en
Publication of CN112489203A publication Critical patent/CN112489203A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/02Non-photorealistic rendering
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images

Abstract

The disclosure provides a model processing method, a model processing device, an electronic device and a computer readable storage medium, and belongs to the technical field of computers. The method comprises the following steps: performing pre-rendering on a model to be processed in a current sampling direction, wherein the model to be processed comprises a surface patch to be determined and a determined visible surface patch; in the pre-rendering process, performing grouping test on patches to be determined in the model to be processed to test the visibility of the patches to be determined, wherein the patches to be determined are patches in the model to be processed except for the determined visible patches; and determining the to-be-determined patch with the test result as a visible patch. The method and the device can accurately and effectively determine the visible surface patches in the model to be processed, and provide convenience for compressing the model to be processed or removing the surface patches in the model to be processed.

Description

Model processing method, model processing apparatus, electronic device, and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a model processing method, a model processing apparatus, an electronic device, and a computer-readable storage medium.
Background
In the production of games and animation scenes, a large number of art models are usually produced to enhance the aesthetic effect of a picture and enrich the display contents of a virtual scene. In the production of these art models, the model may include invisible patches in the final model due to the structural characteristics of the model itself or other reasons. Although the patches have no influence on the final rendering result, the patches occupy game bag body resources, and the overhead in terms of memory and rendering is additionally increased during running.
In the prior art, in order to improve rendering efficiency, a model is generally used as a granularity to perform occlusion rejection processing, for example, a model with an invisible view point position is rejected according to a mutual occlusion relationship among a plurality of models, so as to save resource occupancy. However, this approach still has difficulty avoiding the problem of large rendering pressure and memory pressure due to the inclusion of invisible patches inside each model.
Therefore, how to process the model itself and accurately and effectively determine the visible patch to improve the rendering efficiency of the model is a problem to be solved in the prior art.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure provides a model processing method, a model processing apparatus, an electronic device, and a computer-readable storage medium, which at least to some extent overcome the problem in the prior art that it is difficult to improve the model rendering efficiency because the visible surface patches of the model themselves cannot be determined effectively.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a model processing method, including: performing pre-rendering on a model to be processed in a current sampling direction, wherein the model to be processed comprises a surface patch to be determined and a determined visible surface patch; in the pre-rendering process, performing grouping test on patches to be determined in the model to be processed to test the visibility of the patches to be determined, wherein the patches to be determined are patches in the model to be processed except for the determined visible patches; and determining the to-be-determined patch with the test result as a visible patch.
In an exemplary embodiment of the disclosure, before performing pre-rendering on a model to be processed in the current sampling direction, the method further includes: the current sampling direction is determined among a plurality of preset sampling directions.
In an exemplary embodiment of the present disclosure, after the determining the to-be-determined patch for which the test result is visible as a visible patch, the method further includes: and determining the visible surface patches in the model to be processed after traversing the plurality of preset sampling directions.
In an exemplary embodiment of the present disclosure, the visible patch is a target patch for rendering the model to be processed at the time of game runtime.
In an exemplary embodiment of the present disclosure, the pre-rendering the model to be processed includes: performing pre-rendering on the determined visible surface patches in the model to be processed; and performing grouping pre-rendering on the to-be-determined patches in the to-be-processed model.
In an exemplary embodiment of the present disclosure, the performing, in the pre-rendering process, a grouping test on a patch to be determined in the model to be processed includes: and in the grouping pre-rendering process, carrying out grouping test on the surface patch to be determined in the model to be processed.
In an exemplary embodiment of the present disclosure, the performing a grouped prerendering on a patch to be determined in the model to be processed includes: dividing the dough sheet to be determined in the model to be processed into a plurality of dough sheet groups, and pre-rendering all dough sheet groups except the current testing dough sheet group before testing the dough sheet groups.
In an exemplary embodiment of the present disclosure, the performing a grouping test on a patch to be determined in the model to be processed to test the visibility of the patch to be determined includes: judging whether the current test patch group is wholly shielded; if the current testing panel group is wholly shielded, determining that all the panels to be determined in the current testing panel group are invisible; and if the current testing patch group is not wholly shielded, testing the visibility of the patch to be determined in the current testing patch group.
In an exemplary embodiment of the present disclosure, the testing the visibility of the to-be-determined patch within the current test patch group includes: taking the patch to be determined in the current testing patch group as a current testing patch; pre-rendering all the patches to be determined in the current test patch group except the current test patch, and judging whether the current test patch is shielded or not so as to determine the visibility of the current test patch.
In an exemplary embodiment of the present disclosure, the pre-rendering the model to be processed includes: adding depth deviation to the model to be processed, and performing pre-rendering on all patches in the model to be processed.
In an exemplary embodiment of the present disclosure, the performing a grouping test on a patch to be determined in the model to be processed to test the visibility of the patch to be determined includes: dividing the dough sheet to be determined in the model to be processed into a plurality of dough sheet groups, sequentially taking each dough sheet group as a current test dough sheet group, and judging whether the current test dough sheet group is wholly shielded; if the current testing panel group is wholly shielded, determining that all the panels to be determined in the current testing panel group are invisible; and if the current test patch group is not wholly shielded, judging whether each patch to be determined in the current test patch group is shielded or not so as to determine the visibility of the patch.
In an exemplary embodiment of the present disclosure, after determining the to-be-determined patch for which the test result is visible as a visible patch, the method further includes: and rearranging the index information of the to-be-processed model, and arranging the index of the visible patch before the index of the to-be-determined patch.
In an exemplary embodiment of the disclosure, after determining a visible patch in the model to be processed, the method further includes: and removing invisible patches from the model to be processed.
According to a second aspect of the present disclosure, there is provided a model processing method, comprising: acquiring a plurality of sampling direction sets which are arranged in sequence, wherein the number of elements of a previous sampling direction set in the plurality of sampling direction sets is less than that of elements of a next sampling direction set; and executing the model processing method by taking the sampling direction in the sampling direction set as a preset sampling direction so as to determine the visible surface patch in the model to be processed.
According to a third aspect of the present disclosure, there is provided a model processing apparatus comprising: the model pre-rendering module is used for pre-rendering a model to be processed in the current sampling direction, wherein the model to be processed comprises a patch to be determined and a determined visible patch; a patch grouping test module, configured to perform a grouping test on a patch to be determined in the model to be processed in the pre-rendering process to test visibility of the patch to be determined, where the patch to be determined is a patch of the model to be processed other than the determined visible patch; and the visible patch determining module is used for determining the to-be-determined patch with the test result being visible as a visible patch.
In an exemplary embodiment of the present disclosure, the model processing apparatus further includes: and the sampling direction determining module is used for determining the current sampling direction in a plurality of preset sampling directions before performing pre-rendering on the model to be processed in the current sampling direction.
In an exemplary embodiment of the present disclosure, the model processing apparatus further includes: and the sampling direction traversing module is used for determining the visible surface patch in the model to be processed after traversing the plurality of preset sampling directions after determining the surface patch to be determined, of which the test result is visible, as a visible surface patch.
In an exemplary embodiment of the present disclosure, the visible patch is a target patch for rendering the model to be processed at the time of game runtime.
In an exemplary embodiment of the present disclosure, a model prerender module includes: a visible surface patch pre-rendering unit, configured to pre-render the determined visible surface patch in the to-be-processed model; and the grouping pre-rendering unit is used for carrying out grouping pre-rendering on the to-be-determined patch in the to-be-processed model.
In an exemplary embodiment of the present disclosure, a patch grouping test module includes: and the grouping test unit is used for carrying out grouping test on the to-be-determined patch in the to-be-processed model in the grouping pre-rendering process.
In an exemplary embodiment of the present disclosure, a group prerender unit includes: and the surface patch group dividing subunit is used for dividing the surface patches to be determined in the model to be processed into a plurality of surface patch groups, and pre-rendering all the surface patch groups except the current testing surface patch group before testing the surface patch groups.
In an exemplary embodiment of the present disclosure, a patch grouping test module includes: the shielding judgment unit is used for judging whether the current test patch group is integrally shielded; an invisible patch determining unit, configured to determine that all patches to be determined in the current test patch group are invisible if the current test patch group is wholly shielded; and the intra-group testing unit is used for testing the visibility of the to-be-determined patch in the current testing patch group if the current testing patch group is not wholly shielded.
In an exemplary embodiment of the present disclosure, an intra-group test unit includes: the testing subunit is used for taking the patch to be determined in the current testing patch group as a current testing patch; and the patch rendering subunit is used for prerendering all patches to be determined in the current test patch group except the current test patch, and judging whether the current test patch is shielded or not so as to determine the visibility of the current test patch.
In an exemplary embodiment of the present disclosure, a model prerender module includes: and the offset adding unit is used for adding depth offset to the model to be processed and pre-rendering all the patches in the model to be processed.
In an exemplary embodiment of the present disclosure, a patch grouping test module includes: a patch group dividing unit, configured to divide a patch to be determined in the model to be processed into multiple patch groups, sequentially use each patch group as a current test patch group, and determine whether the current test patch group is wholly shielded; an invisible patch determining unit, configured to determine that all patches to be determined in the current test patch group are invisible if the current test patch group is wholly shielded; and the intra-group testing unit is used for judging whether each patch to be determined in the current testing patch group is shielded or not to determine the visibility of the patch if the current testing patch group is not shielded integrally.
In an exemplary embodiment of the present disclosure, the model processing apparatus further includes: and the index rearranging module is used for rearranging the index information of the to-be-processed model after the to-be-determined patch with the test result being visible is determined as a visible patch, and arranging the index of the visible patch before the index of the to-be-determined patch.
In an exemplary embodiment of the present disclosure, the model processing apparatus further includes: and the invisible patch removing module is used for removing the invisible patch from the model to be processed after the visible patch in the model to be processed is determined.
According to a fourth aspect of the present disclosure, there is provided a model processing apparatus comprising: the direction set acquisition module is used for acquiring a plurality of sampling direction sets which are arranged in sequence, wherein the number of elements of a previous sampling direction set in the plurality of sampling direction sets is less than that of elements of a next sampling direction set; and the visible patch determining module is used for executing the model processing method by taking the sampling direction in the sampling direction set as a preset sampling direction so as to determine the visible patch in the model to be processed.
According to a fifth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of any one of the above via execution of the executable instructions.
According to a sixth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any one of the above.
Exemplary embodiments of the present disclosure have the following advantageous effects:
performing pre-rendering on a model to be processed in the current sampling direction, wherein the model to be processed comprises a surface patch to be determined and a determined visible surface patch; in the pre-rendering process, performing grouping test on a to-be-determined surface patch in the to-be-processed model to test the visibility of the to-be-determined surface patch, wherein the to-be-determined surface patch is a surface patch in the to-be-processed model except for the determined visible surface patch; and determining the to-be-determined patch with the test result as visible as a visible patch. On one hand, the exemplary embodiment provides a new model processing method, and a thought strategy of performing grouping test on dough sheets to be determined is provided, and when the model is prerendered, the test is performed by taking a group as a whole, compared with the prior art that when each dough sheet to be determined is subjected to visibility test one by one, all other dough sheets need to be drawn each time, so that the redrawing times of the dough sheets are greatly reduced, and the drawing pressure of the system is reduced; on the other hand, the visibility test is performed at a group level, so that the number of patches to be processed is reduced, the model processing flow is simplified, and the model rendering efficiency is improved; on the other hand, the model processing flow of the exemplary embodiment is simple, the visible surface patches in the model processing flow can be accurately and effectively determined, and convenience can be provided for removing invisible surface patches of the model or application scenes processed by other models.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
FIG. 1 schematically illustrates a flow chart of a model processing method in the present exemplary embodiment;
fig. 2 schematically illustrates a schematic diagram of rearranging patch index information in the present exemplary embodiment;
FIG. 3 schematically illustrates a sub-flow diagram of a model processing method in the present exemplary embodiment;
FIG. 4 schematically illustrates a sub-flow diagram of another model processing method in the present exemplary embodiment;
FIG. 5 is a diagram schematically illustrating patch grouping testing in accordance with the exemplary embodiment;
FIG. 6 schematically illustrates a sub-flow diagram of yet another model processing method in the present exemplary embodiment;
FIG. 7 is a flow chart schematically illustrating another model processing method in the present exemplary embodiment;
FIG. 8 schematically illustrates an aircraft model processed schematic in the exemplary embodiment;
FIG. 9 is a schematic view schematically showing a bookstore model after processing in the present exemplary embodiment;
FIG. 10 is a block diagram schematically showing the configuration of a model processing apparatus in the present exemplary embodiment;
FIG. 11 is a block diagram schematically showing the construction of another model processing apparatus in the present exemplary embodiment;
fig. 12 schematically illustrates an electronic device for implementing the above-described method in the present exemplary embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different 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 example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
An exemplary embodiment of the present disclosure first provides a model processing method, and an application scenario of the method of the present embodiment may be: when animation models or game models are manufactured, each model is processed through the method of the exemplary embodiment, visible patches included by the models can be obtained, other invisible patches are removed according to the visible patches, the problem of large memory occupancy rate caused by invalid patches and the like can be avoided, and the rendering efficiency of the models during the running of subsequent animations or games is improved.
The exemplary embodiment is further described with reference to fig. 1, and as shown in fig. 1, the model processing method may include the following steps S110 to S130:
step S110, pre-rendering a to-be-processed model in the current sampling direction, where the to-be-processed model includes a to-be-determined patch and a determined visible patch.
Typically, a programmer may create model mesh data through specific software or applications to create virtual models for animation or gaming applications. The model mesh data may include patch data for constructing a model, such as triangular faces or four-corner faces, etc., for reflecting the characteristics of the structure, shape, etc., of the model. When the model is observed from different angles, different patches can be seen, that is, the model mesh data may include patches visible from various angles or patches invisible from various angles, where the visible patches are visible patches and the invisible patches are hidden patches. In the present exemplary embodiment, to determine visible faces in the model, the model may be processed in different sampling directions to determine whether each patch has visibility. If a patch is visible in any one direction, the patch is a visible patch; if a patch is not visible in all directions, the patch is either an invisible patch or a hidden patch.
The model to be processed refers to a model in which visible surface information is required to be determined when the model is drawn, and may be various types of models, such as a virtual model of an animation scene or a game scene, and the model to be processed may be a 3D (3-Dimensional) model or a 2.5D (2.5-Dimensional) model. The model to be processed may include patches to be determined, i.e., patches that are not determined to be visible or not, and determined patches that are visible. In this exemplary embodiment, the system may pre-render the model to be processed in a plurality of preset sampling directions, according to a preset sequence, with each sampling direction as a current sampling direction. The pre-rendering process refers to a rendering process during model drawing, and is different from a rendering process of a model during game running, the pre-rendering process can be considered as an offline processing process performed on the model in advance before the model is rendered during game running, and the model is rendered by acquiring rendering data according to a principle similar to that of the rendering process during game running.
In the current sampling direction, the process of performing pre-rendering on the model to be processed, that is, the process of coloring the model to be processed, may be implemented by calling a function of a related function, for example, by calling a Render, to execute a pre-rendering process on the model to be processed in the current sampling direction.
In an exemplary embodiment, before the step S110, the model processing method may further include:
a current sampling direction is determined among a plurality of preset sampling directions.
The present exemplary embodiment may sequentially determine the current sampling direction from a plurality of preset sampling directions on the spherical surface in a spherical surface sampling manner, so as to process the model in different sampling directions to determine whether each patch has visibility. In the present exemplary embodiment, there may be a plurality of preset sampling directions according to different setting parameters, and sampling may be performed in different sampling directions, for example, when a parameter of 6 × 6 rays is set, sampling may be performed in 36 sampling directions, where the current sampling direction is one of the sampling directions.
Step S120, in the pre-rendering process, performing grouping test on the to-be-determined patches in the to-be-processed model to test the visibility of the to-be-determined patches, wherein the to-be-determined patches are patches in the to-be-processed model except the determined visible patches.
Step S130, determining the to-be-determined patch with the test result being visible as a visible patch.
In the exemplary embodiment, the model to be processed may be first processed by blocking the query function with a specific tool, for example, a GPU (Graphics Processing Unit), to determine the visible patch therein. And further, determining other patches which cannot be determined whether to have visibility as patches to be determined based on the preliminarily determined visible patches. And in the pre-rendering process, grouping the patches to be determined, and respectively carrying out visibility test by taking each group as a whole. And if the whole group is invisible, directly skipping the group, determining all patches in the group as invisible patches, specifically testing the visibility of each patch in the group if the group is visible, and when testing the visibility of each patch in the group, only once drawing the patches of other groups except the currently tested group without once drawing each patch in the group. In the present exemplary embodiment, the patches in the model to be processed may be triangle patches. That is, the model to be processed may refer to a model composed of triangular patches.
In an exemplary embodiment, the visible patch is a target patch for rendering the model to be processed when the game is running.
In the exemplary embodiment, the process of pre-rendering the model and determining the visible patch is to determine the valid patch, so that the model rendering can be performed more efficiently when the game is running, and the problem of extra memory overhead caused by rendering the invalid patch is avoided. Therefore, the visible patch determined in step S130 is also the target patch that is actually rendered when the game or other program is finally executed.
It should be noted that, when the patches to be determined in the model to be processed are grouped, the number of groups or the number of patches included in each group may be customized according to needs, for example, when 60 patches to be determined need to be tested, the 60 patches may be equally divided into 6 groups, and 6 groups are determined, where each group includes 10 patches; it may also be divided into different numbers, for example, 60 pieces are divided into 4 groups, 5 groups or 6 groups, and the number in each group may be the same or different, and this disclosure does not specifically limit this.
When the visibility of a patch in a model is tested, patches except for the tested patch are generally drawn once, and the complexity is about O (I)2) Where I represents the number of all patches. When the number of patches included in the model is large, a large overhead is incurred. In the exemplary embodiment, by performing the grouping test on the patches to be determined, the redrawing times of some patches can be reduced when each patch is tested, so that the test efficiency is improved, and the working pressure of the system is reduced.
In an exemplary embodiment, after the step S130, the model processing method may further include:
and determining a visible patch in the model to be processed after traversing a plurality of preset sampling directions.
The exemplary embodiment may traverse a plurality of preset sampling directions, that is, determine the visible patch of the model to be processed in each preset sampling direction, so as to finally obtain the visible patch of the model to be processed. For example, when the model to be processed includes 100 patches, the 100 patches are determined from 36 sampling directions, and the process of traversing the 36 sampling directions is a process of gradually shrinking and refining the visible patches of the model to be processed. Based on the determined visible patches, the invisible patches can be removed from the model to be processed.
Further, in an exemplary embodiment, in step S130, after determining a visible patch in the to-be-processed model, the model processing method may further include:
and removing invisible patches from the model to be processed.
The invisible patch, i.e., the hidden patch, is a patch that is invisible regardless of the sampling direction. Considering that the patches do not affect the rendering result of the final model, in order to improve the rendering efficiency of the model and save the occupancy rate of system memory resources, after determining the visible patches of the model to be processed, the exemplary embodiment may remove the invisible patches from all patches of the model to be processed, that is, remove the hidden patches. Specifically, each patch in the model to be processed may be stored by specific identification information, such as vertex information or index information of a vertex. Therefore, the present exemplary embodiment may remove other invisible patches according to the determined vertex information of the visible patch or the index information of the vertex. During removal, custom removal can be performed according to actual needs, for example, in an off-line state, time is sufficient, only visible patches can be reserved, and all invisible patches can be removed; or in other cases where the requirement on the memory is not high, a preset number of invisible patches and the like are removed, which is not specifically limited by the present disclosure.
Based on the above description, in the present exemplary embodiment, a model to be processed is pre-rendered in a current sampling direction, where the model to be processed includes a patch to be determined and a determined visible patch; in the pre-rendering process, performing grouping test on a to-be-determined surface patch in the to-be-processed model to test the visibility of the to-be-determined surface patch, wherein the to-be-determined surface patch is a surface patch in the to-be-processed model except for the determined visible surface patch; and determining the to-be-determined patch with the test result as visible as a visible patch. On one hand, the exemplary embodiment provides a new model processing method, and a thought strategy of performing grouping test on dough sheets to be determined is provided, and when the model is prerendered, the test is performed by taking a group as a whole, compared with the prior art that when each dough sheet to be determined is subjected to visibility test one by one, all other dough sheets need to be drawn each time, so that the redrawing times of the dough sheets are greatly reduced, and the drawing pressure of the system is reduced; on the other hand, the visibility test is performed at a group level, so that the number of patches to be processed is reduced, the model processing flow is simplified, and the model rendering efficiency is improved; on the other hand, the model processing flow of the exemplary embodiment is simple, the visible surface patches in the model processing flow can be accurately and effectively determined, and convenience can be provided for removing invisible surface patches of the model or application scenes processed by other models.
In an exemplary embodiment, after the step S130, the model processing method may further include:
and rearranging the index information of the patch of the model to be processed, and arranging the index of the visible patch before the index of the patch to be determined.
In practical application, each patch in the model may be represented by corresponding vertex data, for example, a triangle patch may be represented by data of three vertices of a triangle, the vertex data may be stored in a vertex buffer, and an index buffer may store index information of the patch in the model, where the index information may point to the corresponding vertex data, and therefore, the index information may also represent each patch in the model. In this exemplary embodiment, when a to-be-determined patch is subjected to a visibility test, patch index information of a to-be-processed model may be rearranged first, indexes of all visible patches are arranged before indexes of the to-be-determined patches, as shown in fig. 2, when the model includes 6 patches, where the patches 3 and 5 are visible patches, the index information of the patches is rearranged, the indexes of the patches 3 and 5 are arranged before the patches 1, 2, 4, and 6, and for convenience of calculation and testing, a set of two divided patches may be identified, a set of visible patches is represented by V, and a set of to-be-determined patches is represented by I. By classifying the visible surface patches and the surface patches to be determined and performing grouping test on the surface patches to be determined, the success rate of testing the surface patches to be determined in the group level can be increased.
In the present exemplary embodiment, different types of models or models with different environmental requirements may have different model pre-rendering methods, for example, in an offline state, when the requirement on the computation speed is low, a pre-rendering method of a non-Depth Bias model may be started, and at this time, the accuracy of model pre-rendering is high; in a non-offline state, when the requirement on the calculation speed is high, the pre-rendering method of the Depth Bias model can be started, and at the moment, the model rendering accuracy is low. The Depth bias model is a model when Depth offset is added to polygons of the model, and at this time, coplanar polygons in a three-dimensional space can be made to look as if they are not coplanar, so that they can be correctly pre-rendered.
Next, in the present exemplary embodiment, a description will be made of the prerendering process of the non-Depth Bias model and the Depth Bias model, respectively.
First, for the non-Depth Bias model:
in an exemplary embodiment, as shown in fig. 3, the pre-rendering the model to be processed in step S110 may include the following steps:
step S310, performing pre-rendering on the determined visible surface patches in the model to be processed;
and step S320, performing grouping pre-rendering on the to-be-determined patches in the to-be-processed model.
For the non-DepthBias model, when performing model pre-rendering, all the patch index information in the model to be processed may be rearranged first, after the rearrangement, the patch index is divided into two parts, the former part is a visible patch, and the latter part is a patch to be determined. Because the visible patches do not need to be tested for visibility, each sampling direction is drawn only once and used as a background to shield other patches to be determined, and the other patches to be determined need to be subjected to grouping pre-rendering.
Further, in an exemplary embodiment, the step S120 may include:
and in the grouping pre-rendering process, carrying out grouping test on the to-be-determined patches in the to-be-processed model.
That is, the exemplary embodiment may divide the patch to be determined into a plurality of groups of patches, and perform a pre-rendering process on the patches of each group to determine the visibility of the patch to be determined, so as to implement a grouping test on the patch to be determined.
In an exemplary embodiment, the step S320 may include:
dividing the dough sheet to be determined in the model to be processed into a plurality of dough sheet groups, and pre-rendering all dough sheet groups except the current testing dough sheet group before testing each dough sheet group.
In the exemplary embodiment, when each group of patches is drawn, the visible patches are drawn once at the beginning of the pre-rendering, and the drawing is not repeated subsequently, and then the flow of grouping pre-rendering is executed. For example, the model to be processed includes 100 patches, wherein there are 30 visible patches and 70 patches to be determined, where the 70 patches to be determined are divided into 7 patch groups, and the 7 patch groups are subjected to visibility tests respectively. When testing the first group of patches, firstly, 30 visible patches can be pre-rendered, and when testing any patch in the group later, the 30 patches do not need to be re-pre-rendered. Then the other 6 patch groups except the current test patch group are pre-rendered, namely 60 patches to be determined.
In testing each group of patches, the visibility may be tested in group as a whole, and specifically, in an exemplary embodiment, as shown in fig. 4, the step S120 may include:
step S410, judging whether the current test patch group is wholly shielded;
step S420, if the current testing panel group is wholly shielded, determining that all the panels to be determined in the current testing panel group are invisible;
step S430, if the current testing panel group is not wholly shielded, the visibility of a panel to be determined in the current testing panel group is tested.
In the present exemplary embodiment, the visibility of each divided test panel group may be judged as a whole. If the current testing panel group is wholly shielded by other pre-rendered panels, all the panels to be determined included in the current testing panel group can be determined to be invisible panels. If the current testing patch group is not wholly shielded, the visible patches are possibly included, and the visibility of each patch to be determined in the patch group needs to be further tested.
Further, the testing the visibility of each patch to be determined in each testing patch group, in an exemplary embodiment, the testing the visibility of each patch to be determined in the current testing patch group in the step S430 may include the following steps:
taking each patch to be determined in the current test patch group as a current test patch;
pre-rendering all the patches to be determined in the current test patch group except the current test patch, and judging whether the current test patch is shielded or not so as to determine the visibility of the current test patch.
In the exemplary embodiment, each patch to be determined in each patch group to be tested is used as a current test patch, a pre-rendering process is executed, and whether the patch to be determined to be tested is blocked or not is judged by firstly rendering patches to be determined in other patch groups, then rendering other patches except the current test patch in the current group, and finally rendering the current test patch per se, so as to determine visibility. Specifically describing a specific drawing process, fig. 5 shows a plurality of patch groups currently needing patch testing, where a visible patch set in the model to be processed is denoted as V, a patch set to be determined is denoted as I, the number of the divided patch groups of the plurality of patches to be determined is M, the number of the patches to be determined in each patch group is equal to N, the number of the patch groups is G _1, …, G _ X, …, and G _ M, respectively, the number of the patch group currently being tested is G _ X, and the included patch numbers to be determined include T _1, …, T _ Y, …, and T _ N. When testing the currently tested patch group G _ X, it is necessary to draw other patch groups except the patch group G _ X. The computational complexity of pre-rendering after grouping is about O (M × I + M × N)2). For example, assuming that the current set of to-be-determined patches of the to-be-processed model is 70, the number of divided patch groups is 7, each group includes 10 to-be-determined patches, since each patch group needs to draw the patches of other groups once at the time of testing, 60 times, and total 7 groups, which is 60 times, 7 times in total, each patch group needs to draw the patches of other groups except the to-be-determined patch tested once at the time of testing each to-be-determined patch in the group, 9 times, one group includes 10 patches, which is 7 groups in total, and total 7 times 9 times in total, that is, grouping is performed byThe number of times the way was tested for the visibility of the tiles was 60 × 7+7 × 9 × 10, which can be approximately regarded as 70 × 7+7 × 102I.e. complexity M I + M N2. It can be clearly seen that the way of grouping patches to be determined by the present exemplary embodiment is significantly optimized compared to the computational complexity of the prior art.
It should be noted that the above-mentioned packet size N needs to be set appropriately as needed, if the packet setting is large, it may be difficult to embody the advantage of the packet test, and the difference from the case of no packet is not large, and if the packet setting is small, the overall complexity may not be optimized well, and this exemplary embodiment may set N to 128.
Second, for the Depth bias model:
in an exemplary embodiment, in the step S110, the pre-rendering the model to be processed may include the following steps:
and adding depth offset to the model to be processed, and performing pre-rendering on all patches in the model to be processed.
Adding a depth offset to the model to be processed can ensure that each object with a depth offset can be rendered correctly. When the Depth Bias model is processed, the difference of the pre-rendering process of the non-Depth Bias model is that the Depth offset exists in the Depth Bias model, and a tested patch cannot be shielded, so that the drawing times can be further reduced, and the whole model to be processed (including the tested patch) is pre-rendered once.
Further, for the pre-rendering process of the Depth Bias model, similar to the pre-rendering process of the non-Depth Bias model, as shown in fig. 6, the grouping test of the to-be-determined patch in the to-be-processed model in step S120 to test the visibility of the to-be-determined patch may include the following steps:
step S610, dividing the dough sheet to be determined in the model to be processed into a plurality of dough sheet groups, sequentially taking each dough sheet group as the current test dough sheet group, and judging whether the current test dough sheet group is wholly shielded;
step S620, if the current testing panel group is wholly shielded, all the panels to be determined in the current testing panel group are determined to be invisible;
step S630, if the current testing patch group is not entirely shielded, it is determined whether each patch to be determined in the current testing patch group is shielded, so as to determine the visibility of the patch.
The visibility of each patch group can be integrally judged, and if the current testing patch group is integrally shielded by other pre-rendered patches, all patches to be determined in the current testing patch group can be determined to be invisible patches. If the current testing patch group is not wholly shielded, the visible patches are possibly included, and the visibility of each patch to be determined in the patch group needs to be further tested. The test logic in each test panel group is similar to the non-Depth Bias model, and is not described herein again.
It should be noted that, no matter the Depth Bias model or the non-Depth Bias model, after the pre-rendering process is performed for each preset sampling direction, the index information may be rearranged, so as to ensure that the to-be-determined patch is further screened after each preset sampling direction is traversed.
An exemplary embodiment of the present disclosure further provides another model processing method, which is further described below with reference to fig. 7, and as shown in fig. 7, the model processing method may include the following steps S710 to S720:
step S710, a plurality of sampling direction sets which are arranged in sequence are obtained, and the number of elements of a previous sampling direction set in the plurality of sampling direction sets is less than that of elements of a next sampling direction set;
step S720, taking the sampling direction in the sampling direction set as a preset sampling direction, executing steps S110 to S130 of the model processing method and other related steps to determine a visible patch in the model to be processed.
The plurality of sampling direction sets may include a plurality of sampling directions determined by performing parameter setting for a plurality of times. In the present exemplary embodiment, different parameter settings may be adopted to perform a multi-stage sampling process on the model to be processed, for example, a first-stage sampling process adopts a lower parameter setting, for example, a resolution is 512 × 512, and a ray number is 6 × 6, and at this time, 36 sampling processes need to be performed from 36 sampling directions of the model to be processed, so as to determine a visible patch of the model to be processed; the second set of sampling processes uses higher parameter settings, for example, the resolution is 800 × 600, the number of rays is 16 × 16, and at this time, 256 sampling processes are required from 256 sampling directions of the model to be processed, and then the multiple sampling direction sets may include two sampling direction sets, the first sampling direction set includes 36 sampling directions, the second sampling direction set includes 256 sampling directions, and the like, and the sampling directions in the sets are elements in the sets.
Further, in each sampling direction set, the sampling direction in each sampling direction set is sequentially used as a preset sampling direction, and the steps S110 to S130 of the model processing method and other related steps are executed, so that a visible patch in the model to be processed can be determined. Since the number of elements in the subsequent sampling direction set is greater than the number of elements in the previous sampling direction set, for example, the first sampling direction set includes 36 sampling directions, and the second sampling direction set includes 256 sampling directions, that is, the precision of the subsequent sampling set is higher, so that the process of determining the visible patch of the model to be processed through the multiple sampling direction sets can be regarded as a process of gradually reducing the calculation precision and performing multi-stage screening on the visible patch. In particular, in the exemplary embodiment, two sampling direction sets may be adopted, a first sampling direction set may be regarded as a preview stage to quickly calculate a rough visible patch, and a second sampling direction set may be regarded as a full-scale calculation stage to further determine a fine visible patch. The process of determining the visible patch is the same as the model processing method in steps S110 to S130, and is not described in detail here.
By the model processing mode, the visible patches of the model to be processed are determined, the invisible patches of the model to be processed can be effectively and quickly removed, so that the rendering efficiency of the model in game operation is improved, and the difference between the removed model and the model which is not removed is small in rendering effect.
Table 1 below is a table of comparison data for invisible patch rejection by an airplane model using the prior art and the present exemplary embodiment:
TABLE 1
Figure BDA0002823024640000161
Correspondingly, fig. 8 shows a schematic diagram of the airplane model after removing invisible patches from 6972 patches to 5123 patches.
Table 2 below is a table of data comparison of invisible patch rejection by a bookstore model using the prior art and invisible patch rejection using the present exemplary embodiment:
TABLE 2
Figure BDA0002823024640000162
Figure BDA0002823024640000171
Correspondingly, fig. 9 shows a schematic diagram of the bookshelf model after removing invisible patches from 1668 patches to 1055 patches.
It can be seen that, by processing the model to be processed according to the exemplary embodiment, the efficiency of removing the invisible slices can be greatly reduced, and the acceleration ratio is higher.
Based on the above description, in the present exemplary embodiment, a plurality of sampling direction sets arranged in order are acquired, and the number of elements of a previous sampling direction set in the plurality of sampling direction sets is smaller than the number of elements of a subsequent sampling direction set; and taking the sampling direction in the sampling direction set as a preset sampling direction, and executing the model processing methods of the steps S110 to S130 and the related steps to determine the visible surface patch in the model to be processed. On one hand, the model to be processed is sampled through a plurality of sampling direction sets, and because the number of the sampling directions included in each sampling direction set is different, the process can carry out a multi-stage sampling process on the model to be processed through different sampling direction sets, quickly determine the visible surface patch of the model to be processed, gradually determine more accurate visible surface patches and improve the determination efficiency and effectiveness of the visible surface patches; on the other hand, the model processing flow is simple, and the application range is wide.
Exemplary embodiments of the present disclosure also provide a model processing apparatus. Referring to fig. 10, the apparatus 1000 may include a model pre-rendering module 1010, configured to pre-render a model to be processed in a current sampling direction, where the model to be processed includes a patch to be determined and a determined visible patch; a patch grouping test module 1020, configured to perform a grouping test on a patch to be determined in the model to be processed in the pre-rendering process to test the visibility of the patch to be determined, where the patch to be determined is a patch in the model to be processed other than the determined visible patch; and a visible patch determining module 1030, configured to determine the to-be-determined patch, which is visible as the test result, as a visible patch.
In an exemplary embodiment, the model processing apparatus further includes: and the sampling direction determining module is used for determining the current sampling direction in a plurality of preset sampling directions before the model to be processed is subjected to prerendering in the current sampling direction.
In an exemplary embodiment, the model processing apparatus further includes: and the sampling direction traversing module is used for determining the visible surface patch in the model to be processed after traversing a plurality of preset sampling directions after determining the surface patch to be determined, which is visible in the test result, as the visible surface patch.
In an exemplary embodiment, the visible patch is a target patch for rendering the model to be processed at the time of game runtime.
In an exemplary embodiment, the model prerender module includes: the visible surface patch pre-rendering unit is used for pre-rendering the determined visible surface patches in the model to be processed; and the grouping pre-rendering unit is used for performing grouping pre-rendering on the to-be-determined patch in the to-be-processed model.
In an exemplary embodiment, the patch grouping test module includes: and the grouping test unit is used for performing grouping test on the to-be-determined surface patch in the to-be-processed model in the grouping pre-rendering process.
In an exemplary embodiment, a packet pre-rendering unit includes: and the surface patch group dividing and dividing unit is used for dividing the surface patch to be determined in the model to be processed into a plurality of surface patch groups, and pre-rendering all the surface patch groups except the current testing surface patch group before testing the surface patch groups.
In an exemplary embodiment, a patch grouping test module includes: the shielding judgment unit is used for judging whether the current test patch group is integrally shielded; the invisible patch determining unit is used for determining that all patches to be determined in the current testing patch group are invisible if the current testing patch group is wholly shielded; and the intra-group testing unit is used for testing the visibility of a to-be-determined patch in the current testing patch group if the current testing patch group is not wholly shielded.
In an exemplary embodiment, an intra-group test cell, includes: the testing subunit is used for taking a patch to be determined in the current testing patch group as a current testing patch; and the surface patch rendering subunit is used for pre-rendering all the surface patches to be determined in the current testing surface patch group except the current testing surface patch, and judging whether the current testing surface patch is shielded or not so as to determine the visibility of the current testing surface patch.
In an exemplary embodiment, the model prerender module includes: and the offset adding unit is used for adding depth offset to the model to be processed and performing pre-rendering on all patches in the model to be processed.
In an exemplary embodiment, a patch grouping test module includes: the system comprises a dough sheet group dividing unit, a judging unit and a judging unit, wherein the dough sheet group dividing unit is used for dividing a dough sheet to be determined in a model to be processed into a plurality of dough sheet groups, and judging whether the current testing dough sheet group is wholly shielded or not by taking each dough sheet group as a current testing dough sheet group in sequence; the invisible patch determining unit is used for determining that all patches to be determined in the current testing patch group are invisible if the current testing patch group is wholly shielded; and the intra-group testing unit is used for judging whether each patch to be determined in the current testing patch group is shielded or not to determine the visibility of the patch if the current testing patch group is not shielded integrally.
In an exemplary embodiment, the model processing apparatus further includes: and the index rearranging module is used for rearranging the index information of the to-be-processed model after the to-be-determined patch with the test result being visible is determined as a visible patch, and arranging the index of the visible patch before the index of the to-be-determined patch.
In an exemplary embodiment, the model processing apparatus further includes: and the invisible patch removing module is used for removing the invisible patch from the model to be processed after the visible patch in the model to be processed is determined.
Exemplary embodiments of the present disclosure also provide a model processing apparatus. Referring to fig. 11, the apparatus 1100 may include a direction set obtaining module 1110 configured to obtain a plurality of sampling direction sets arranged in sequence, where a number of elements of a previous sampling direction set in the plurality of sampling direction sets is smaller than a number of elements of a next sampling direction set; the visible patch determining module 1120 is configured to execute the model processing method with a sampling direction in the sampling direction set as a preset sampling direction, so as to determine a visible patch in the to-be-processed model.
The specific details of each module/unit in the above-mentioned apparatus have been described in detail in the embodiment of the method section, and the details that are not disclosed may refer to the contents of the embodiment of the method section, and therefore are not described herein again.
Exemplary embodiments of the present disclosure also provide an electronic device capable of implementing the above method.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 1200 according to such an exemplary embodiment of the present disclosure is described below with reference to fig. 12. The electronic device 1200 shown in fig. 12 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 12, the electronic device 1200 is embodied in the form of a general purpose computing device. The components of the electronic device 1200 may include, but are not limited to: the at least one processing unit 1210, the at least one memory unit 1220, the bus 1230 connecting the various system components (including the memory unit 1220 and the processing unit 1210), and the display unit 1240.
Where the memory unit stores program code, the program code may be executed by the processing unit 1210 such that the processing unit 1210 performs the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "exemplary methods" section of this specification. For example, the processing unit 1210 may perform the steps shown in fig. 1, 3, 4, 6, or 7.
The storage unit 1220 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)1221 and/or a cache memory unit 1222, and may further include a read only memory unit (ROM) 1223.
Storage unit 1220 may also include a program/utility 1224 having a set (at least one) of program modules 1225, such program modules 1225 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 1230 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 1200 may also communicate with one or more external devices 1300 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1200, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1200 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 1250. Also, the electronic device 1200 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 1260. As shown, the network adapter 1260 communicates with the other modules of the electronic device 1200 via the bus 1230. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the exemplary embodiments of the present disclosure.
Exemplary embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure described in the above-mentioned "exemplary methods" section of this specification, when the program product is run on the terminal device.
Exemplary embodiments of the present disclosure also provide a program product for implementing the above method, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a 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 foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind 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., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes included in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit according to an exemplary embodiment of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the following claims.

Claims (18)

1. A method of model processing, comprising:
performing pre-rendering on a model to be processed in a current sampling direction, wherein the model to be processed comprises a surface patch to be determined and a determined visible surface patch;
in the pre-rendering process, performing grouping test on patches to be determined in the model to be processed to test the visibility of the patches to be determined, wherein the patches to be determined are patches in the model to be processed except for the determined visible patches;
and determining the to-be-determined patch with the test result as a visible patch.
2. The method of claim 1, wherein prior to pre-rendering the model for processing in the current sampling direction, the method further comprises:
the current sampling direction is determined among a plurality of preset sampling directions.
3. The method of claim 2, wherein after the determining the to-be-determined patch with the test result visible as a visible patch, the method further comprises:
and determining the visible surface patches in the model to be processed after traversing the plurality of preset sampling directions.
4. The method of claim 1, wherein the visible patch is a target patch for rendering the model to be processed at game runtime.
5. The method of claim 1, wherein pre-rendering the model to be processed comprises:
performing pre-rendering on the determined visible surface patches in the model to be processed;
and performing grouping pre-rendering on the to-be-determined patches in the to-be-processed model.
6. The method of claim 5, wherein the performing grouping test on the patch to be determined in the model to be processed in the pre-rendering process comprises:
and in the grouping pre-rendering process, carrying out grouping test on the surface patch to be determined in the model to be processed.
7. The method of claim 5, wherein the performing the grouped prerendering on the to-be-determined patch in the to-be-processed model comprises:
dividing the dough sheet to be determined in the model to be processed into a plurality of dough sheet groups, and pre-rendering all dough sheet groups except the current testing dough sheet group before testing the dough sheet groups.
8. The method of claim 7, wherein the performing a grouping test on the to-be-determined patch in the to-be-processed model to test the visibility of the to-be-determined patch comprises:
judging whether the current test patch group is wholly shielded;
if the current testing panel group is wholly shielded, determining that all the panels to be determined in the current testing panel group are invisible;
and if the current testing patch group is not wholly shielded, testing the visibility of the patch to be determined in the current testing patch group.
9. The method of claim 8, wherein said testing the visibility of the to-be-determined patch within the current test patch group comprises:
taking the patch to be determined in the current testing patch group as a current testing patch;
pre-rendering all the patches to be determined in the current test patch group except the current test patch, and judging whether the current test patch is shielded or not so as to determine the visibility of the current test patch.
10. The method of claim 1, wherein pre-rendering the model to be processed comprises:
adding depth deviation to the model to be processed, and performing pre-rendering on all patches in the model to be processed.
11. The method of claim 10, wherein the performing a grouping test on the to-be-determined patch in the to-be-processed model to test the visibility of the to-be-determined patch comprises:
dividing the dough sheet to be determined in the model to be processed into a plurality of dough sheet groups, sequentially taking each dough sheet group as a current test dough sheet group, and judging whether the current test dough sheet group is wholly shielded;
if the current testing panel group is wholly shielded, determining that all the panels to be determined in the current testing panel group are invisible;
and if the current test patch group is not wholly shielded, judging whether each patch to be determined in the current test patch group is shielded or not so as to determine the visibility of the patch.
12. The method of claim 1, wherein after determining the to-be-determined patch that is visible as a test result as a visible patch, the method further comprises:
and rearranging the index information of the to-be-processed model, and arranging the index of the visible patch before the index of the to-be-determined patch.
13. The method of claim 1, wherein after determining visible patches in the model to be processed, the method further comprises:
and removing invisible patches from the model to be processed.
14. A method of model processing, comprising:
acquiring a plurality of sampling direction sets which are arranged in sequence, wherein the number of elements of a previous sampling direction set in the plurality of sampling direction sets is less than that of elements of a next sampling direction set;
performing the model processing method according to any one of claims 1 to 13 with a sampling direction in the set of sampling directions as a preset sampling direction to determine a visible patch in the model to be processed.
15. A model processing apparatus, comprising:
the model pre-rendering module is used for pre-rendering a model to be processed in the current sampling direction, wherein the model to be processed comprises a patch to be determined and a determined visible patch;
a patch grouping test module, configured to perform a grouping test on a patch to be determined in the model to be processed in the pre-rendering process to test visibility of the patch to be determined, where the patch to be determined is a patch of the model to be processed other than the determined visible patch;
and the visible patch determining module is used for determining the to-be-determined patch with the test result being visible as a visible patch.
16. A model processing apparatus, comprising:
the direction set acquisition module is used for acquiring a plurality of sampling direction sets which are arranged in sequence, wherein the number of elements of a previous sampling direction set in the plurality of sampling direction sets is less than that of elements of a next sampling direction set;
a visible patch determining module, configured to execute the model processing method according to any one of claims 1 to 13 with a sampling direction in the sampling direction set as a preset sampling direction, so as to determine a visible patch in the model to be processed.
17. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the method of any of claims 1-13 via execution of the executable instructions.
18. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of any one of claims 1-13.
CN202011442857.0A 2020-12-08 2020-12-08 Model processing method, model processing apparatus, electronic device, and storage medium Pending CN112489203A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011442857.0A CN112489203A (en) 2020-12-08 2020-12-08 Model processing method, model processing apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011442857.0A CN112489203A (en) 2020-12-08 2020-12-08 Model processing method, model processing apparatus, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
CN112489203A true CN112489203A (en) 2021-03-12

Family

ID=74941160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011442857.0A Pending CN112489203A (en) 2020-12-08 2020-12-08 Model processing method, model processing apparatus, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN112489203A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115423980A (en) * 2022-09-08 2022-12-02 如你所视(北京)科技有限公司 Model display processing method and device and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015070618A1 (en) * 2013-11-18 2015-05-21 华为技术有限公司 Method and device for global illumination rendering under multiple light sources
CN107358643A (en) * 2017-07-04 2017-11-17 网易(杭州)网络有限公司 Image processing method, device, electronic equipment and storage medium
CN109754454A (en) * 2019-01-30 2019-05-14 腾讯科技(深圳)有限公司 Rendering method, device, storage medium and the equipment of object model
CN109903385A (en) * 2019-04-29 2019-06-18 网易(杭州)网络有限公司 Rendering method, device, processor and the terminal of threedimensional model
US20190213783A1 (en) * 2018-01-11 2019-07-11 Sony Interactive Entertainment Inc. Back-facing patch culling with displacement
US20190325639A1 (en) * 2018-04-19 2019-10-24 Microsoft Technology Licensing, Llc Compact visibility state for gpus compatible with hardware instancing
CN111275803A (en) * 2020-02-25 2020-06-12 北京百度网讯科技有限公司 3D model rendering method, device, equipment and storage medium
CN111369659A (en) * 2018-12-26 2020-07-03 杭州海康威视数字技术股份有限公司 Texture mapping method, device and equipment based on three-dimensional model
CN111798556A (en) * 2020-06-18 2020-10-20 完美世界(北京)软件科技发展有限公司 Image rendering method, device, equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015070618A1 (en) * 2013-11-18 2015-05-21 华为技术有限公司 Method and device for global illumination rendering under multiple light sources
CN107358643A (en) * 2017-07-04 2017-11-17 网易(杭州)网络有限公司 Image processing method, device, electronic equipment and storage medium
US20190213783A1 (en) * 2018-01-11 2019-07-11 Sony Interactive Entertainment Inc. Back-facing patch culling with displacement
US20190325639A1 (en) * 2018-04-19 2019-10-24 Microsoft Technology Licensing, Llc Compact visibility state for gpus compatible with hardware instancing
CN111369659A (en) * 2018-12-26 2020-07-03 杭州海康威视数字技术股份有限公司 Texture mapping method, device and equipment based on three-dimensional model
CN109754454A (en) * 2019-01-30 2019-05-14 腾讯科技(深圳)有限公司 Rendering method, device, storage medium and the equipment of object model
CN109903385A (en) * 2019-04-29 2019-06-18 网易(杭州)网络有限公司 Rendering method, device, processor and the terminal of threedimensional model
CN111275803A (en) * 2020-02-25 2020-06-12 北京百度网讯科技有限公司 3D model rendering method, device, equipment and storage medium
CN111798556A (en) * 2020-06-18 2020-10-20 完美世界(北京)软件科技发展有限公司 Image rendering method, device, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
李基初;唐俊;: "一种改进的基于切片的可视面片选择方法", 电脑知识与技术, no. 17, pages 1505 - 1506 *
王竹;束搏;邱显杰;王兆其;: "基于场景结合的大规模动态群体可见性计算方法", 计算机辅助设计与图形学学报, no. 03, pages 331 - 338 *
聂俊岚;郑鹏;: "一种基于GPU的遮挡剔除算法改进研究", 微计算机信息, no. 27, pages 29 - 31 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115423980A (en) * 2022-09-08 2022-12-02 如你所视(北京)科技有限公司 Model display processing method and device and storage medium
CN115423980B (en) * 2022-09-08 2023-12-29 如你所视(北京)科技有限公司 Model display processing method, device and storage medium

Similar Documents

Publication Publication Date Title
CN110443893B (en) Large-scale building scene rendering acceleration method, system, device and storage medium
US9092901B2 (en) Parallel grid population
JP4579262B2 (en) Early Z-test method and system for rendering three-dimensional images
EP3933779A1 (en) Intersection testing in a ray tracing system
US20080225048A1 (en) Culling occlusions when rendering graphics on computers
US20030043147A1 (en) Method of using view frustrum culling for scaleable collision detection
CN110478898B (en) Configuration method and device of virtual scene in game, storage medium and electronic equipment
Livnat et al. Interactive point-based isosurface extraction
US8400447B1 (en) Space partitioning trees using planes selected from a discrete set of orientations
CN108229363A (en) Key frame dispatching method and device, electronic equipment, program and medium
CN111514587B (en) Information processing method, device, equipment and storage medium
CN114529658A (en) Graph rendering method and related equipment thereof
CN110930492B (en) Model rendering method, device, computer readable medium and electronic equipment
US20220036106A1 (en) Method and apparatus for data calculation in neural network model, and image processing method and apparatus
CN112489203A (en) Model processing method, model processing apparatus, electronic device, and storage medium
US9135749B2 (en) Method and apparatus for processing three-dimensional model data
Greß et al. Object-space interference detection on programmable graphics hardware
US20220066819A1 (en) Methods and apparatuses for coalescing function calls for ray-tracing
US20220392146A1 (en) Graphics processing
CN113486415B (en) Model perspective method, intelligent terminal and storage device
CN111932689B (en) Three-dimensional object quick selection method adopting ID pixel graph
WO1998043208A2 (en) Method and apparatus for graphics processing
CN114564268A (en) Equipment management method and device, electronic equipment and storage medium
CN115591243A (en) Rendering channel performance detection method and device, electronic equipment and storage medium
CN114974438A (en) Particle motion simulation method, device, apparatus, storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination