Method and device for constructing plug-in piece combination model and electronic equipment
By adjusting the position and size parameters of the insert model and combining them with rendering parameters to construct a combined insert model, the problem of complex and inefficient construction of insert or bulletin board models in existing technologies is solved, achieving efficient and automated model conversion and dynamic lighting adaptation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2022-10-25
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, the construction process of interstitial or bulletin board models is complex and inefficient, making it difficult to efficiently generate and adapt to dynamic lighting changes in game engines, resulting in high iteration costs and inconsistent asset quality.
By acquiring the target model and the initial inlay model, the position and size parameters of the inlay model are adjusted based on the shape and structure of the target model, and the rendering parameters are determined. An inlay combination model is constructed, and an automated process is used to generate inlay or bulletin board assets, decoupling the model from lighting dependency information.
It simplifies the construction process of interposer combination models, improves construction efficiency, reduces system resource waste, adapts to dynamic lighting environments, and realizes one-click model conversion and standardized asset generation.
Smart Images

Figure CN115738246B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional modeling technology, and more specifically, to a method, apparatus, and electronic device for constructing a modular model. Background Technology
[0002] In games, to improve display efficiency on terminal devices, virtual objects corresponding to the models, such as grass and mountains, are typically displayed using model inserts and bulletin boards based on the content displayed in the game scene. This process usually requires technicians to photograph the models within the game engine, adjust the results in drawing software, and finally create the corresponding inserts or bulletin board models in 3D modeling software based on the photographic results. This method is complex and inefficient. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a method, apparatus and electronic device for constructing a plug-in assembly model, so as to simplify the construction process of the plug-in assembly model and improve the construction efficiency.
[0004] In a first aspect, embodiments of the present invention provide a method for constructing a patch combination model, comprising: acquiring a target model and a preset number of initial patch models; generating a patch model corresponding to the target model based on the target model and the initial patch models; wherein the position parameters and / or size parameters of the patch models match the target model; determining the rendering parameters of the patch models based on the rendering parameters of the target model; the rendering parameters are used to: indicate the rendering effect of multiple model positions of the corresponding model; the rendering parameters include rendering color parameters, normal direction parameters and / or position parameters of the model positions; and constructing a patch combination model corresponding to the target model based on the patch models and the rendering parameters of the patch models.
[0005] Secondly, embodiments of the present invention provide a device for constructing a patch combination model, comprising: a target model acquisition module for acquiring a target model and a preset number of initial patch models; a patch model generation module for generating a patch model corresponding to the target model based on the target model and the initial patch models; wherein the position parameters and / or size parameters of the patch models match the target model; a rendering parameter determination module for determining the rendering parameters of the patch models based on the rendering parameters of the target model; the rendering parameters are used to: indicate the rendering effect of multiple model positions of the corresponding model; the rendering parameters include rendering color parameters, normal direction parameters and / or position parameters of the model positions; and a patch combination model construction module for constructing a patch combination model corresponding to the target model based on the patch models and the rendering parameters of the patch models.
[0006] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described method for constructing the chip assembly model.
[0007] Fourthly, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the above-described method for constructing the chip assembly model.
[0008] The embodiments of the present invention bring the following beneficial effects:
[0009] The aforementioned method, apparatus, and electronic device for constructing a patch panel combination model involve: acquiring a target model and a preset number of initial patch panel models; generating patch panel models corresponding to the target model based on the target model and the initial patch panel models; wherein the position parameters and / or size parameters of the patch panel models match those of the target model; determining the rendering parameters of the patch panel models based on the rendering parameters of the target model; and constructing a patch panel combination model corresponding to the target model based on the patch panel models and their rendering parameters. This method simplifies the construction process of the patch panel combination model and improves construction efficiency.
[0010] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0013] Figure 1 A flowchart illustrating a method for constructing a plug-in combination model according to an embodiment of the present invention;
[0014] Figure 2 A schematic diagram showing the decomposition of wind speed parameters provided in an embodiment of the present invention;
[0015] Figure 3A schematic diagram showing the decomposition of wind speed parameters provided in an embodiment of the present invention;
[0016] Figure 4 A schematic diagram of a device for constructing a plug-in combination model provided in an embodiment of the present invention;
[0017] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Open-world exploration games typically feature numerous outdoor exploration scenes. These scenes contain vegetation models such as grasslands and forests. Consequently, the large amount of vegetation has become a key focus of game algorithm iterations. Due to the hardware limitations of terminal devices, directly using a large number of model assets can easily lead to rendering pressure due to polygon count and batch processing issues. Therefore, when models are far from the camera, smaller insets or bulletin boards are usually used instead of the original models.
[0020] For the reasons mentioned above, in actual game development, interstitial and bulletin board-type models are usually used as the main vegetation assets, while model assets are used as secondary assets for close proximity. Taking grass vegetation as an example: there are generally model-type, interstitial, bulletin board-type, and single-piece model (impostor) vegetation assets.
[0021] In related technologies, the following methods are typically used when creating inserts or bulletin boards:
[0022] (1) Prepare the models that need to be converted into inserts or bulletin boards, and import them into the game engine;
[0023] (2) Take photos of the model from multiple or single angles as needed, and export the results;
[0024] (3) Manually correct the shooting results in external software (such as Photoshop), and create corresponding inserts or bulletin board models in 3D modeling software (such as 3Ds Max) based on the shooting results, and unfold the corresponding UVs.
[0025] The above-mentioned method of manually inserting elements and creating bulletin boards is inefficient and cumbersome, and also has many problems in subsequent rendering, which can be summarized as follows:
[0026] (1) It relies heavily on manual processing of different models, requiring manual handling of textures, models and UVs, resulting in low production efficiency;
[0027] (2) The process involves many import and export operations, which are cumbersome.
[0028] (3) The effect is not decoupled from the dynamic scene of the game and lacks sufficient information support. When the game scene has dynamic lighting changes, it will be significantly different from the original model.
[0029] (4) High iteration cost. When the original model is modified, new inserts or bulletin board assets need to be created, which requires additional production iteration time and can easily become a bottleneck in production efficiency.
[0030] (5) It is difficult to standardize, and different people handle it manually in different ways, which can easily lead to uneven assets.
[0031] Based on this, the present invention provides a method, apparatus and electronic device for constructing a patch combination model, which can be applied to the rendering process of distant grasslands in various three-dimensional scenes.
[0032] See Figure 1 First, a method for constructing an insert combination model provided by an embodiment of the present invention will be introduced, which includes the following steps:
[0033] Step S102: Obtain the target model and a preset number of initial insert models.
[0034] The target models mentioned above can be of various types, typically models of natural scenery, artificial scenery, or buildings, such as grassland models, tree models, pavilion models, library models, etc. When these models are far from the virtual camera capturing the scene, in order to save rendering resources on the terminal device, a composite model or bulletin board model corresponding to the target model can be rendered so that the virtual camera can capture it, resulting in a scene displaying the objects corresponding to the target model.
[0035] The aforementioned bulletin board model can be considered a type of interlocking model, consisting of only one interlocking model. Typically, a bulletin board model can be used to display relatively simple target models, such as grassland or mountain models. More complex tree models, however, require an interlocking model that includes multiple interlocking models.
[0036] Intercalation models are typically planar models with multiple vertices. Multiple intercalation models are combined to mimic the shape and structure of the target model, forming an intercalation composite model. Then, the display color of the surface portion of the target model corresponding to that intercalation model is rendered on each intercalation model of the composite model. This allows the intercalation model to simulate the corresponding target model even when it is far from the virtual camera. Since different types of target models typically correspond to different shape structures, the preset number of initial intercalation models corresponding to that type of target model can be determined based on the type of target model.
[0037] The initial insert model typically corresponds to a preset size, and the rotation parameters of the initial insert model can be preset to be evenly divided into 360° based on the number of initial insert models corresponding to the target model. That is, if the number of initial insert models is 4, the corresponding rotation parameters are 0°, 90°, 180°, and 270° respectively.
[0038] Step S104: Based on the target model and the initial insert model, generate the insert model corresponding to the target model; wherein the position parameters and / or size parameters of the insert model match the target model.
[0039] Since the target model has a certain shape and structure, and one or more insert models corresponding to the target model need to simulate the shape and structure of the target model as closely as possible, it is necessary to adjust the position of the initial insert models based on the initial position parameters of the initial insert models and the shape and structure of the target model. This adjustment process can involve relevant personnel observing the target model and then rotating and moving each initial insert model displayed on the graphical user interface using a human-computer interaction device (HCI device) to ensure that a predetermined number of initial insert models simulate the shape and structure of the target model as closely as possible. The process of relevant personnel rotating and moving the initial insert models using the HCI device can be seen as inputting the position adjustment parameters of the initial insert models. The adjusted position of the initial insert models can be determined based on the position adjustment parameters and the initial position parameters, and the adjusted initial insert models can then serve as the insert models corresponding to the target model.
[0040] In practical implementation, to ensure that a predetermined number of initial insert models can effectively simulate the shape and structure of the target model, the projection area of the target model onto the predetermined number of initial insert models needs to cover as much of the target model's surface area as possible. The projection area is typically generated by projecting the target model's surface onto the normal direction of the initial insert models. Therefore, based on the above principle, a corresponding algorithm can be designed to adjust the initial insert models, and the designed algorithm can output the position adjustment parameters of the initial insert models. Various methods can be used, and no restrictions are placed here.
[0041] The initial intercalation model typically corresponds to preset size parameters, while the size of the target model is uncertain. If the initial intercalation model is too large, in addition to the target model's projection area within the initial intercalation model, a large number of other areas need to be rendered ineffectively, wasting system resources. If the initial intercalation model is too small, it is impossible to obtain the complete projection area of the target model in the normal direction of the initial intercalation model. For these reasons, it is usually necessary to further optimize the size of the initial intercalation model after position adjustment to obtain an intercalation model that corresponds to the target model.
[0042] Step S106: Based on the rendering parameters of the target model, determine the rendering parameters of the interpolated model; the rendering parameters are used to indicate the rendering effect of multiple model positions of the corresponding model; the rendering parameters include the rendering color parameters, normal direction parameters and / or position parameters of the model position.
[0043] In practical implementation, the surface of the target model is projected onto the intercalation model to obtain the projection area. Therefore, the focus of rendering the intercalation model is on rendering the projection area on the intercalation model. When determining the projection area on the intercalation model, calculations can be performed based on the model position on the target model's surface and the normal direction of the intercalation model to determine the model position on the model surface that can be projected onto the intercalation model and the corresponding projection point in the intercalation model.
[0044] After determining the projection region, the rendering parameters of the model position can be further determined as the rendering parameters of the corresponding projection point based on the correspondence between the projection points in the projection region and the model positions on the model surface. The rendering parameters of the target model's surface are usually stored in the vertex information of the vertices. These rendering parameters indicate the rendering effect of the model position within the model and typically include rendering color parameters, normal direction parameters, and position parameters. The rendering information of the model position located on a primitive composed of connected vertices needs to be calculated using the vertex information of the vertices that make up the primitive. Therefore, after determining the model position corresponding to the projection point, the rendering information of that model position can be calculated using the vertex information of the vertices that make up the primitive containing that model position, and used as the rendering information of the projection point.
[0045] In practical implementation, the rendering parameters of the target model can also be recorded using texture maps. Pixels in the texture map correspond to the model positions of the target model, and the parameter values of these pixels are typically the rendering parameters for those model positions. After determining the model position corresponding to the projection point of the projection area of the interpolated model, the texture map coordinates of that model position can be calculated. Then, the pixel corresponding to those coordinates can be found in the texture map, thus obtaining the rendering parameters for that model position and consequently determining the rendering parameters for the corresponding projection point.
[0046] Step S108: Based on the interstitial model and its rendering parameters, construct an interstitial combination model corresponding to the target model.
[0047] After obtaining the rendering parameters of each intercalation model, the texture map coordinates of each intercalation model can be rearranged so that the rendering parameters of the intercalation model can be recorded on a single texture map, thereby reducing the use of texture resources and reducing the waste of system resources.
[0048] When using a combined intercalation model generated based on the position parameters of each intercalation model, rendering parameters can be read from the corresponding texture map to render the combined intercalation model, generating a combined intercalation model corresponding to the target model and providing the visual effect of the target model.
[0049] The above-described method for constructing a patch combination model involves: obtaining a target model and a preset number of initial patch models; generating patch models corresponding to the target model based on the target model and the initial patch models; wherein the position parameters and / or size parameters of the patch models match those of the target model; determining the rendering parameters of the patch models based on the rendering parameters of the target model; and constructing a patch combination model corresponding to the target model based on the patch models and their rendering parameters. This method simplifies the construction process of the patch combination model and improves construction efficiency.
[0050] The following embodiments provide an implementation method for generating a corresponding insert model based on a target model and an initial insert model.
[0051] To ensure the insert model simulates the shape and structure of the target model, the position of the initial insert model needs to be adjusted. Specifically, position adjustment parameters for the initial insert model need to be obtained; these parameters can be manually input or calculated using a preset algorithm. In practice, the position adjustment parameters may include translation and / or rotation. Based on the position adjustment parameters and preset initial position parameters, the position of the initial insert model is adjusted to obtain the position-adjusted initial insert model. This position-adjusted initial insert model is then designated as the insert model corresponding to the target model. After combining multiple position-adjusted initial insert models, the surface of the target model should correspond as closely as possible to the complete model surface in the projection areas of the multiple insert models, so that the combined insert model better simulates the shape and structure of the target model.
[0052] Since the intercalation model primarily simulates the surface of the target model by projecting the target model onto its projection area, rendering other areas of the intercalation model outside the projection area is meaningless. Therefore, the size of the intercalation model needs to be adjusted based on the projection area to obtain a sized intercalation model; the size of the sized intercalation model matches the minimum bounding rectangle of the projection area. This method reduces unnecessary rendering work and improves efficiency.
[0053] The following embodiments provide an implementation method for determining the rendering parameters of the interpolated model based on the rendering parameters of the target model.
[0054] In practical implementation, since the interpolation model mainly simulates the surface of the target model by projecting the target model onto the interpolation model's projection area, it is necessary to determine the projection area of the target model onto the interpolation model based on the position parameters of the interpolation model and the position parameters of the target model, and then determine the rendering parameters of the projection area based on the rendering parameters of the target model.
[0055] Specifically, the aforementioned intercalation model includes a model plane composed of multiple model vertices. When determining the projection area of the target model within the intercalation model, it is necessary to first calculate the normal direction of the model plane based on the position parameters of the intercalation model; this normal direction can be considered the orientation of the model plane. Then, for each model vertex of the intercalation model, using the model vertex as the ray origin and the normal direction of the model plane as the ray direction, the surface position of the target model intersecting the ray is determined as the projection point corresponding to the model vertex. This method is also called "ray checking." In practical implementation, instead of using the model vertex as the ray origin, the focal point of a pre-divided mesh on the model plane can be used as the ray origin. This method takes into account the resolution of the texture map corresponding to the subsequently generated intercalation model, ensuring that the mesh density on the model plane matches the resolution. Finally, the region within the model plane composed of model vertices with projection points can be determined as the projection area of the target model within the initial intercalation model.
[0056] The aforementioned projection area includes multiple projection positions; these positions can be determined based on preset resolution parameters, such as by dividing the model into grids as described above. The rendering parameters of the target model are recorded by the texture map corresponding to the target model; the texture map includes multiple pixels, each corresponding to a model position on the surface of the target model. When determining the rendering parameters of the projection area, for each projection position, based on the position parameters of the model position on the surface of the target model corresponding to that projection position, the target pixel of the model position in the texture map is determined, and the rendering parameters corresponding to the target pixel of the model position in the texture map are used as the rendering parameters for that projection position.
[0057] Since the rendering parameters of the target model may correspond to certain lighting parameters, and different lighting parameters may result in different display effects of the target model, it is necessary to perform lighting decoupling processing on the rendering parameters of the target model. Specifically, based on the texture map of the target model, the normal information of the vertices of the target model in tangent space can be generated; then, hemispherical integrals are calculated for multiple model positions in the target model, and the visibility of multiple model positions is determined based on the integral results; visibility includes visible or invisible; that is, visibility indicates whether the model position is visible or invisible. Based on the visibility of multiple model positions, the current occlusion information corresponding to the target model can be determined, and this occlusion information can represent the lighting parameters corresponding to the target model; further, lighting decoupling processing is performed on the texture map of the target model based on the current occlusion information to obtain the decoupled rendering parameters of the target model. Finally, the rendering parameters of the projection region of the interpolated model can be determined using the decoupled rendering parameters of the target model.
[0058] This invention also provides another method for constructing a plug-in combination model, which in... Figure 1 This method is implemented based on the method shown. It can automatically convert models into interstitial or bulletin board assets, satisfying both aesthetic and efficiency requirements. The main purpose of this method is:
[0059] (1) Design a convenient automated process that can automatically generate inserts and bulletin boards according to different needs, and streamline the production process with one click.
[0060] (2) Provide a mechanism to decouple model data from dynamic game scenes, making each part of the data independent, and ensuring that the generated assets can meet the effect requirements under dynamic lighting environment.
[0061] (3) Design a general solution that can uniformly process different types of model assets.
[0062] To implement this method, researchers developed a tool for rapidly generating model inserts and bulletin boards using 3D computer graphics software (such as Houdini). This tool reads the target model (also called the "original model") and its textures, automatically generates the corresponding insert or bulletin board model based on set parameters, and then transfers the dependency information of the target model to the base insert model based on the shooting angle. It generates the insert model and texture map (UV) information based on the base model, samples the information of each point on the base model, outputs the information to different textures, and finally bakes and renders the results using a script, exporting the generated assets to a specified disk path. The specific process is as follows: Figure 2 As shown.
[0063] This method mainly employs the following steps:
[0064] (1) Import the target model: After importing the target model file, the material references in the model file are read and displayed to facilitate the corresponding processing of different types of assets. Usually, different numbers of inset models are used for different types of assets. For example, a grass model uses one inset model (also known as a bulletin board model), while a tree model uses multiple inset models. At the same time, the model can also be rotated in this step to a suitable angle for shooting.
[0065] (2) Generate a basic inlay model corresponding to the target model based on the initial position parameters and adjustment parameters of the inlay model: First, generate a mesh of corresponding density in the inlay model according to the required texture size and resolution. Then, determine the number of times to generate inlays based on the number of inlays to be generated. Calculate the rotation angle based on the initial position parameters of the inlay model and the user's adjustment parameters. The initial position parameters are usually preset according to the number of inlay models. For example, when there are 3 inlay models, the difference in rotation parameters between two adjacent inlay models is 120°. Obtain the orientation of the inlay by cross-product of the rotation vector corresponding to the rotation angle and the upward vector in the world coordinate system. Scale the target model based on the size of the inlay model to be generated, and further calculate the bounding box size of the target model based on the scaling amount and the shooting orientation. Finally, based on the bounding box data, the basic asset that meets the adaptation factors can be easily obtained.
[0066] (3) Preprocessing the rendering information of the target model: This step mainly processes the model's dependency information and decouples the lighting dependency information of the independent model. First, based on the model's texture map, the tangent information can be obtained in the MikkT space, thereby obtaining the vertex normal information of the target model in the tangent space. At the same time, the occlusion information can be obtained by calculating the visibility hemisphere integral of the model, as shown in formula (1).
[0067]
[0068] Furthermore, the dominant directions of non-occlusion can be calculated by determining the visibility of the upper hemisphere at each vertex, thus obtaining the dominant directions of occlusion. The principle is as follows: Figure 3 As shown.
[0069] (4) Data transfer from the target model to the insert: This step mainly involves performing ray checking on each point on the insert model to obtain the spatial position information of the collision with the original model. The ray checking process is as follows: a ray is emitted from a point in space in a preset direction, and the point hit by the ray is returned, which is the spatial position information of the original model mentioned above. Then, based on the spatial position information, the vertex information (such as UVs, normals, positions, etc.) that needs to be obtained on the insert model is obtained by interpolation, and the texture map corresponding to the target model is sampled to obtain pixel information. The obtained information is temporarily stored on the vertices of the insert for subsequent export.
[0070] (5) Optimize the intercalation model: This step mainly involves converting the base model into an intercalation model with texture mapping information. First, the actual projection area is obtained based on the ray detection results, and excess areas are clipped to reduce overdraw. Then, the UVs of multiple base models are rearranged, and the normal information on the model is converted to tangent space based on the texture mapping coordinates. Next, the four corners of each intercalation piece are marked, and the actual intercalation model is generated based on the marked points. That is, the minimum bounding rectangle of the projection area in the basic intercalation model is obtained as the optimized intercalation model.
[0071] (6) Exporting Textures: Vertex information from the base model is transferred to texture maps based on texture map coordinates, and texture channels are recombined using rendering information. When there are multiple materials, corresponding textures can be output separately using markers. Pixel overflow is performed before output to reduce the loss caused by texture compression. Finally, the rendered result is baked using a script, and the asset is exported to the specified disk path.
[0072] This method can serve as a general and rapid solution for generating model inserts and bulletin board creation, suitable for generating inserts for models such as plants. The above method has the following advantages:
[0073] (1) Automatically generate different inserts and textures according to the model type and parameter settings, which can ensure the universality of the generation and production scheme, be compatible with different asset sources, and facilitate the expansion of the insert and bulletin board resource library.
[0074] (2) The color, normal, occlusion and other information of the independent model are decoupled from the lighting results in the environment to ensure that the generated assets can meet the effect requirements of dynamic lighting environment.
[0075] (3) The process is automated, requiring only a few operations to complete the conversion from model to insert, greatly improving the efficiency of generating model inserts and bulletin boards.
[0076] For the above method embodiments, see Figure 4 The embodiment of the present invention shown provides a device for constructing a plug-in combination model, the device comprising:
[0077] The target model acquisition module 402 is used to acquire the target model and a preset number of initial insert models;
[0078] The insert model generation module 404 is used to generate an insert model corresponding to the target model based on the target model and the initial insert model; wherein the position parameters and / or size parameters of the insert model are matched with the target model.
[0079] The rendering parameter determination module 406 is used to determine the rendering parameters of the interpolated model based on the rendering parameters of the target model. The rendering parameters are used to indicate the rendering effect of multiple model positions of the corresponding model. The rendering parameters include the rendering color parameters, normal direction parameters and / or position parameters of the model positions.
[0080] The interstitial model construction module 408 is used to construct an interstitial model corresponding to the target model based on the interstitial model and its rendering parameters.
[0081] The aforementioned apparatus for constructing a patch combination model involves: acquiring a target model and a preset number of initial patch models; generating patch models corresponding to the target model based on the target model and the initial patch models; wherein the position parameters and / or size parameters of the patch models match those of the target model; determining the rendering parameters of the patch models based on the rendering parameters of the target model; and constructing a patch combination model corresponding to the target model based on the patch models and their rendering parameters. This method simplifies the construction process of the patch combination model and improves construction efficiency.
[0082] The aforementioned insert model generation module is also used to: obtain position adjustment parameters for the initial insert model; adjust the position of the initial insert model based on the position adjustment parameters and the preset initial position parameters to obtain the position-adjusted initial insert model; and determine the position-adjusted initial insert model as the insert model corresponding to the target model.
[0083] The aforementioned rendering parameter determination module is also used to: determine the projection area of the target model on the interpolated model based on the position parameters of the interpolated model and the position parameters of the target model; and determine the rendering parameters of the projection area based on the rendering parameters of the target model.
[0084] The aforementioned insert model includes a model plane composed of multiple model vertices; the aforementioned rendering parameter determination module is also used to: calculate the normal direction of the model plane of the insert model based on the position parameters of the insert model; for each model vertex of the insert model, taking the model vertex as the ray origin and the normal direction of the model plane as the ray direction, determine the surface position of the target model that intersects the ray as the projection point corresponding to the model vertex; and determine the region in the model plane composed of model vertices with projection points as the projection region of the target model in the initial insert model.
[0085] The aforementioned projection area includes multiple projection positions; the projection positions are determined based on preset resolution parameters; the projection positions correspond to the model positions on the surface of the target model; the rendering parameters of the target model are recorded by the texture map corresponding to the target model; the texture map includes multiple pixels, and the pixels correspond to the model positions on the surface of the target model; the aforementioned rendering parameter determination module is further used to: for each projection position in the projection area, based on the position parameters of the model positions on the surface of the target model corresponding to the projection position, determine the target pixels of the model positions in the texture map; and determine the rendering parameters corresponding to the target pixels of the model positions in the texture map as the rendering parameters of the projection positions.
[0086] The aforementioned insert model includes the projection area of the target model within the insert model; the aforementioned device further includes: a size adjustment module, used to adjust the size of the insert model based on the projection area to obtain a size-adjusted insert model; the size of the size-adjusted insert model matches the minimum bounding rectangle of the projection area.
[0087] The rendering parameters of the target model are recorded by the texture map corresponding to the target model; the target model consists of multiple vertices; the device further includes: a normal information generation module, used to generate normal information of the vertices of the target model in tangent space based on the texture map of the target model; a visibility determination module, used to perform hemispherical integral calculation on multiple model positions in the target model, and determine the visibility of multiple model positions based on the integral result; visibility includes visible or invisible; an occlusion information determination module, used to determine the current occlusion information corresponding to the target model based on the visibility of multiple model positions; and a lighting decoupling module, used to perform lighting decoupling processing on the texture map of the target model based on the current occlusion information, to obtain the rendering parameters of the decoupled target model.
[0088] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the above-described method for constructing the chip assembly model, for example:
[0089] Obtain the target model and a preset number of initial insert models; based on the target model and the initial insert models, generate insert models corresponding to the target model; wherein the position parameters and / or size parameters of the insert models match the target model; based on the rendering parameters of the target model, determine the rendering parameters of the insert models; the rendering parameters are used to: indicate the rendering effect of multiple model positions of the corresponding model; the rendering parameters include the rendering color parameters, normal direction parameters, and / or position parameters of the model positions; based on the insert models and the rendering parameters of the insert models, construct a combined insert model corresponding to the target model.
[0090] The above method simplifies the construction process of the insert combination model and improves the construction efficiency.
[0091] Optionally, the above steps of generating the insert model corresponding to the target model based on the target model and the initial insert model include: obtaining position adjustment parameters for the initial insert model; adjusting the position of the initial insert model based on the position adjustment parameters and preset initial position parameters to obtain the position-adjusted initial insert model; and determining the position-adjusted initial insert model as the insert model corresponding to the target model.
[0092] Optionally, the steps of determining the rendering parameters of the interstitial model based on the rendering parameters of the target model include: determining the projection area of the target model on the interstitial model based on the position parameters of the interstitial model and the position parameters of the target model; and determining the rendering parameters of the projection area based on the rendering parameters of the target model.
[0093] Optionally, the aforementioned insert model includes a model plane composed of multiple model vertices; the step of determining the projection region of the target model in the insert model based on the position parameters of the insert model and the position parameters of the target model includes: calculating the normal direction of the model plane of the insert model based on the position parameters of the insert model; for each model vertex of the insert model, taking the model vertex as the ray origin and the normal direction of the model plane as the ray direction, determining the surface position of the target model intersecting the ray as the projection point corresponding to the model vertex; and determining the region in the model plane composed of model vertices with the projection point as the projection region of the target model in the initial insert model.
[0094] Optionally, the projection area includes multiple projection positions; the projection positions are determined based on preset resolution parameters; the projection positions correspond to the model positions on the surface of the target model; the rendering parameters of the target model are recorded by the texture map corresponding to the target model; the texture map includes multiple pixels, and the pixels correspond to the model positions on the surface of the target model; the step of determining the rendering parameters of the projection area based on the rendering parameters of the target model includes: for each projection position of the projection area, determining the target pixel of the model position in the texture map based on the position parameters of the model position on the surface of the target model corresponding to the projection position; and determining the rendering parameters corresponding to the target pixel of the model position in the texture map as the rendering parameters of the projection position.
[0095] Optionally, the above-mentioned insert model includes the projection area of the target model in the insert model; the above method further includes: adjusting the size of the insert model based on the projection area to obtain the size-adjusted insert model; the size of the size-adjusted insert model matches the minimum bounding rectangle of the projection area.
[0096] Optionally, the rendering parameters of the target model are recorded by the texture map corresponding to the target model; the target model consists of multiple vertices; before determining the rendering parameters of the interpolated model based on the rendering parameters of the target model, the method further includes: generating the normal information of the vertices of the target model in the tangent space based on the texture map of the target model; performing hemispherical integral calculation on multiple model positions in the target model, and determining the visibility of multiple model positions based on the integral results; visibility includes visible or invisible; determining the current occlusion information corresponding to the target model based on the visibility of multiple model positions; and performing lighting decoupling processing on the texture map of the target model based on the current occlusion information to obtain the decoupled rendering parameters of the target model.
[0097] See Figure 5 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-described method for constructing the chip assembly model.
[0098] Furthermore, Figure 5 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.
[0099] The memory 101 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0100] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. Processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0101] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions cause the processor to implement the above-described method for constructing the chip combination model.
[0102] The present invention provides a method, apparatus, and electronic device for constructing a chip assembly model, including a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments, for example:
[0103] Obtain the target model and a preset number of initial insert models; based on the target model and the initial insert models, generate insert models corresponding to the target model; wherein the position parameters and / or size parameters of the insert models match the target model; based on the rendering parameters of the target model, determine the rendering parameters of the insert models; the rendering parameters are used to: indicate the rendering effect of multiple model positions of the corresponding model; the rendering parameters include the rendering color parameters, normal direction parameters, and / or position parameters of the model positions; based on the insert models and the rendering parameters of the insert models, construct a combined insert model corresponding to the target model.
[0104] The above method simplifies the construction process of the insert combination model and improves the construction efficiency.
[0105] Optionally, the above steps of generating the insert model corresponding to the target model based on the target model and the initial insert model include: obtaining position adjustment parameters for the initial insert model; adjusting the position of the initial insert model based on the position adjustment parameters and preset initial position parameters to obtain the position-adjusted initial insert model; and determining the position-adjusted initial insert model as the insert model corresponding to the target model.
[0106] Optionally, the steps of determining the rendering parameters of the interstitial model based on the rendering parameters of the target model include: determining the projection area of the target model on the interstitial model based on the position parameters of the interstitial model and the position parameters of the target model; and determining the rendering parameters of the projection area based on the rendering parameters of the target model.
[0107] Optionally, the aforementioned insert model includes a model plane composed of multiple model vertices; the step of determining the projection region of the target model in the insert model based on the position parameters of the insert model and the position parameters of the target model includes: calculating the normal direction of the model plane of the insert model based on the position parameters of the insert model; for each model vertex of the insert model, taking the model vertex as the ray origin and the normal direction of the model plane as the ray direction, determining the surface position of the target model intersecting the ray as the projection point corresponding to the model vertex; and determining the region in the model plane composed of model vertices with the projection point as the projection region of the target model in the initial insert model.
[0108] Optionally, the projection area includes multiple projection positions; the projection positions are determined based on preset resolution parameters; the projection positions correspond to the model positions on the surface of the target model; the rendering parameters of the target model are recorded by the texture map corresponding to the target model; the texture map includes multiple pixels, and the pixels correspond to the model positions on the surface of the target model; the step of determining the rendering parameters of the projection area based on the rendering parameters of the target model includes: for each projection position of the projection area, determining the target pixel of the model position in the texture map based on the position parameters of the model position on the surface of the target model corresponding to the projection position; and determining the rendering parameters corresponding to the target pixel of the model position in the texture map as the rendering parameters of the projection position.
[0109] Optionally, the above-mentioned insert model includes the projection area of the target model in the insert model; the above method further includes: adjusting the size of the insert model based on the projection area to obtain the size-adjusted insert model; the size of the size-adjusted insert model matches the minimum bounding rectangle of the projection area.
[0110] Optionally, the rendering parameters of the target model are recorded by the texture map corresponding to the target model; the target model consists of multiple vertices; before determining the rendering parameters of the interpolated model based on the rendering parameters of the target model, the method further includes: generating the normal information of the vertices of the target model in the tangent space based on the texture map of the target model; performing hemispherical integral calculation on multiple model positions in the target model, and determining the visibility of multiple model positions based on the integral results; visibility includes visible or invisible; determining the current occlusion information corresponding to the target model based on the visibility of multiple model positions; and performing lighting decoupling processing on the texture map of the target model based on the current occlusion information to obtain the decoupled rendering parameters of the target model.
[0111] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0112] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0113] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0114] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0115] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for constructing a plug-in combination model, characterized in that, include: Obtain the target model and a preset number of initial insert models; Based on the target model and the initial insert model, an insert model corresponding to the target model is generated; wherein the position parameters and / or size parameters of the insert model are matched with the target model; Based on the rendering parameters of the target model, the rendering parameters of the interpolated model are determined; the rendering parameters are used to indicate the rendering effect of multiple model positions of the corresponding model; the rendering parameters include the rendering color parameters, normal direction parameters and / or position parameters of the model positions; Based on the interpolation model and its rendering parameters, an interpolation combination model corresponding to the target model is constructed. The insert model includes a model plane composed of multiple model vertices; The step of determining the rendering parameters of the interpolated model based on the rendering parameters of the target model includes: Based on the position parameters of the insert model, calculate the normal direction of the model plane of the insert model; For each vertex of the insert model, with the vertex as the ray origin and the normal direction of the model plane as the ray direction, the surface position of the target model that intersects the ray is determined as the projection point corresponding to the vertex. The region in the model plane composed of model vertices with projection points is defined as the projection region of the target model in the initial insert model; Based on the rendering parameters of the target model, the rendering parameters of the projection area are determined.
2. The method according to claim 1, characterized in that, The step of generating an insert model corresponding to the target model based on the target model and the initial insert model includes: Obtain the position adjustment parameters for the initial insert model; Based on the position adjustment parameters and the preset initial position parameters, the position of the initial insert model is adjusted to obtain the position-adjusted initial insert model. The initial insert model after the position adjustment is determined as the insert model corresponding to the target model.
3. The method according to claim 1, characterized in that, The projection area includes multiple projection positions; the projection positions are determined based on preset resolution parameters; the projection positions correspond to the model positions on the surface of the target model; the rendering parameters of the target model are recorded by the texture map corresponding to the target model; the texture map includes multiple pixels, and the pixels correspond to the model positions on the surface of the target model. The step of determining the rendering parameters of the projection region based on the rendering parameters of the target model includes: For each projection position in the projection area, the target pixel of the model position in the texture map is determined based on the position parameters of the model position on the model surface of the target model corresponding to the projection position; The rendering parameters corresponding to the target pixel of the model position in the texture map are determined as the rendering parameters of the projection position.
4. The method according to claim 1, characterized in that, The insert model includes the projection area of the target model in the insert model; the method further includes: The size of the insert model is adjusted based on the projection area to obtain a size-adjusted insert model; the size of the size-adjusted insert model matches the minimum bounding rectangle of the projection area.
5. The method according to claim 1, characterized in that, The rendering parameters of the target model are recorded by the texture map corresponding to the target model; The target model consists of multiple vertices; Before determining the rendering parameters of the interpolated model based on the rendering parameters of the target model, the method further includes: Based on the texture map of the target model, the normal information of the vertices of the target model in tangent space is generated; Hemispherical integrals are calculated for multiple model positions in the target model, and the visibility of the multiple model positions is determined based on the integral results; the visibility includes visible or invisible. Based on the visibility of the multiple model locations, determine the current occlusion information corresponding to the target model; Based on the current occlusion information, the texture map of the target model is subjected to lighting decoupling processing to obtain the rendering parameters of the decoupled target model.
6. A device for constructing a modular assembly model, characterized in that, include: The target model acquisition module is used to acquire the target model and a preset number of initial insert models. The insert model generation module is used to generate an insert model corresponding to the target model based on the target model and the initial insert model; wherein the position parameters and / or size parameters of the insert model match the target model; The rendering parameter determination module is used to determine the rendering parameters of the interpolated model based on the rendering parameters of the target model; the rendering parameters are used to indicate the rendering effect of multiple model positions of the corresponding model; the rendering parameters include the rendering color parameters, normal direction parameters and / or position parameters of the model positions; The interstitial model construction module is used to construct an interstitial model corresponding to the target model based on the interstitial model and the rendering parameters of the interstitial model. The insert model includes a model plane composed of multiple model vertices; The rendering parameter determination module is also used for: Based on the position parameters of the insert model, calculate the normal direction of the model plane of the insert model; For each vertex of the insert model, with the vertex as the ray origin and the normal direction of the model plane as the ray direction, the surface position of the target model that intersects the ray is determined as the projection point corresponding to the vertex. The region in the model plane composed of model vertices with projection points is defined as the projection region of the target model in the initial insert model; Based on the rendering parameters of the target model, the rendering parameters of the projection area are determined.
7. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the method for constructing the interposer combination model according to any one of claims 1-5.
8. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method for constructing the interposer combination model according to any one of claims 1-5.
Citation Information
Patent Citations
Tree model generation method and device, electronic equipment and storage medium
CN114266853A