Model rendering method and device, electronic equipment and storage medium

By obtaining and processing the position information of multiple model planes and performing pose conversion in camera and world space, the problem of restricted pose transformation during multi-model rendering is solved, and a better rendering effect is achieved.

CN119516072APending Publication Date: 2025-02-25NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411501443.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

When rendering multiple models, the merged models can only perform overall pose transformation, and cannot maintain the pose transformation of a single model at their respective positions, resulting in poor rendering effects.

Method used

By obtaining attribute information of the first model composed of the model planes of the plurality of second models, including position information of each model plane in the first model. Then, each model plane is converted to camera space and world space, and its pose information is obtained respectively, and each model plane in the first model is rendered based on these pose information and rendering maps.

Benefits of technology

The rendering effect improvement is achieved during multi-model rendering, and the independent pose transformation of each model plane at its specific position can be maintained, thereby improving rendering quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119516072A_ABST
    Figure CN119516072A_ABST
Patent Text Reader

Abstract

The invention discloses a model rendering method and device, electronic equipment and a computer readable storage medium, according to the embodiment of the invention, attribute information of a first model is obtained, the first model is composed of model planes corresponding to a plurality of second models, and the attribute information comprises position information of each model plane in the first model; on the basis of the position information of each model plane, each model plane is converted into a camera space, the front face of each model plane faces a virtual camera in the camera space, and first pose information of each model plane in the camera space is obtained; based on the first pose information of each model plane, converting each model plane into a world space to obtain second pose information of each model plane in the world space; and rendering each model plane in the first model based on the second pose information of each model plane and the rendering map corresponding to the second model. According to the embodiment of the invention, the rendering effect during multi-model rendering can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of rendering technology, and in particular to a model rendering method, device, electronic device and storage medium. Background Art

[0002] Under the wave of the Internet, entertainment projects are becoming more and more important in people's lives. In order to meet the needs of effect presentation in some entertainment projects (such as animated movies and games), a large amount of model rendering is required.

[0003] Generally, when a large number of models need to be rendered in a scene, each model needs to use the corresponding material when rendering, which leads to the CPU performance bottleneck caused by a large number of materials that need to be rendered. At present, multiple models that need to be rendered can be merged into one during real-time rendering to reduce the loss. However, after merging multiple models into one, the merged model can only be transformed as a whole, and the single model cannot be kept in its respective position for posture transformation, resulting in poor rendering effect when rendering multiple models. Summary of the invention

[0004] The embodiments of the present application provide a model rendering method, device, electronic device and storage medium, which can improve the rendering effect when rendering multiple models.

[0005] In a first aspect, an embodiment of the present application provides a model rendering method, the method comprising:

[0006] Acquire attribute information of the first model, wherein the first model is composed of a plurality of model planes corresponding to the second model, and the attribute information includes position information of each of the model planes in the first model;

[0007] Based on the position information of each of the above model planes, each of the above model planes is converted into the camera space respectively, and each of the model planes is made to face the virtual camera in the above camera space, so as to obtain the first pose information of each of the above model planes in the above camera space;

[0008] Based on the first pose information of each of the model planes, each of the model planes is converted into the world space to obtain second pose information of each of the model planes in the world space;

[0009] Based on the second pose information of each of the model planes and the rendering map corresponding to the second model, each of the model planes in the first model is rendered.

[0010] In a second aspect, an embodiment of the present application provides a model rendering device, the device comprising:

[0011] An information acquisition module, used to acquire attribute information of the first model, wherein the first model is composed of a plurality of model planes corresponding to the second model, and the attribute information includes position information of each of the model planes in the first model;

[0012] A first space conversion module is used to convert each of the above model planes into a camera space based on the position information of each of the above model planes, and make each of the model planes face the virtual camera in the above camera space, so as to obtain the first pose information of each of the above model planes in the above camera space;

[0013] A second space conversion module is used to convert each of the above-mentioned model planes into the world space based on the above-mentioned first pose information of each of the above-mentioned model planes, so as to obtain the second pose information of each of the above-mentioned model planes in the above-mentioned world space;

[0014] A model rendering module is used to render each of the above-mentioned model planes in the above-mentioned first model based on the above-mentioned second posture information of each of the above-mentioned model planes and the rendering map corresponding to the above-mentioned second model.

[0015] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory storing a plurality of instructions; a processor loads instructions from the memory to execute the steps of any one of the model rendering methods provided in the embodiments of the present application.

[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute the steps of any one of the model rendering methods provided in the embodiments of the present application.

[0017] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps in any one of the model rendering methods provided in the embodiments of the present application.

[0018] By adopting the scheme of the embodiment of the present application, the attribute information of the first model composed of the model planes of multiple second models can be obtained, and the attribute information includes the position information of each of the above-mentioned model planes in the above-mentioned first model. Then, based on the position information of each of the above-mentioned model planes, each of the above-mentioned model planes is converted to the camera space respectively, and each of the model planes is made to face the virtual camera in the above-mentioned camera space, so as to obtain the first position information of each of the above-mentioned model planes in the above-mentioned camera space. Finally, based on the above-mentioned first position information of each of the above-mentioned model planes, each of the above-mentioned model planes is converted to the world space respectively, and the second position information of each of the above-mentioned model planes in the above-mentioned world space is obtained, so as to render each of the above-mentioned model planes in the above-mentioned first model based on the above-mentioned second position information of each of the above-mentioned model planes and the rendering map corresponding to the above-mentioned second model, so as to record the position information of each model plane in the first model, so as to determine the position transformation information of each model plane respectively, so as to render each model plane accordingly respectively, so as to improve the rendering effect when rendering multiple models. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 This is a flow chart of an embodiment of the model rendering method provided in the embodiments of the present application;

[0021] Figure 2 is a schematic diagram of a second model provided in an embodiment of the present application;

[0022] Figure 3 is a schematic diagram of a model plane of a second model provided in an embodiment of the present application;

[0023] Figure 4 is a schematic diagram of a color map provided in an embodiment of the present application;

[0024] Figure 5 is a schematic diagram of the rendering effect provided in an embodiment of the present application;

[0025] Figure 6 is a structural diagram of a model rendering device provided in an embodiment of the present application;

[0026] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0028] Embodiments of the present application provide a model rendering method, device, electronic device, and computer-readable storage medium.

[0029] Specifically, this embodiment will be described from the perspective of a model rendering device, which can be integrated into an electronic device, that is, the model rendering method of the embodiment of the present application can be executed by an electronic device, and optionally, the electronic device can include: a terminal device. The terminal device can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a game console, or a personal computer (PC) and other devices.

[0030] The model rendering method provided in the embodiment of the present application can be applied to a model rendering system. The model rendering system may include a player terminal device and a server, and the terminal may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. The player terminal device and the server may perform two-way communication via a network.

[0031] Optionally, the server may be an independent server, or a server network or server cluster composed of servers, including but not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of multiple servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.

[0032] The following is a detailed description in conjunction with the accompanying drawings. In this embodiment, the execution subject is a terminal device as an example. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.

[0033] The model rendering method of this embodiment obtains attribute information of a first model, wherein the first model is composed of model planes corresponding to multiple second models, and the attribute information includes position information of each of the model planes in the first model; based on the position information of each of the model planes, each of the model planes is converted into a camera space, and each of the model planes is made to face the virtual camera in the camera space, so as to obtain first pose information of each of the model planes in the camera space; based on the first pose information of each of the model planes, each of the model planes is converted into a world space, so as to obtain second pose information of each of the model planes in the world space; based on the second pose information of each of the model planes and the rendering map corresponding to the second model, each of the model planes in the first model is rendered, so as to improve the rendering effect when rendering multiple models.

[0034] Please refer to Figure 1 Taking a terminal as an example, this embodiment provides a model rendering method. The specific process of the model rendering method can be as follows: Steps 101 to 104, wherein:

[0035] Step 101: Acquire attribute information of a first model, wherein the first model is composed of a plurality of model planes corresponding to the second models, and the attribute information includes position information of each of the model planes in the first model.

[0036] Among them, the above-mentioned second model is the model to be rendered. In some scenes, multiple second models need to be rendered at the same time. For example, in scenes such as pearl bracelets and clothing inlaid with pearls, a large number of pearl effects need to be produced, so more second models are needed to express a large number of spherical elements in the scene.

[0037] It is understandable that since the model requires a high number of model vertices when representing spherical elements, in order to improve efficiency, the terminal can use a model plane to replace the second model for rendering to avoid rendering based on model vertices. The model plane can be a face of a specific shape or a billboard plane, etc., which can be set according to needs and is not limited here.

[0038] Among them, the terminal can use the billboard technology to simulate the visual effect of a three-dimensional object using a two-dimensional texture. The BillBoard technology uses a quadrilateral with a texture, and its texture image is the image of the model targeted by the BillBoard technology, that is, a rectangle with the image of the object is used to replace the graphic image of the object. The terminal places the billboard plane corresponding to the BillBoard technology at the center of the position of the second model replaced, and changes with the movement of the camera, always facing the camera.

[0039] It is understandable that, since multiple models to be rendered are merged into one during real-time rendering, only the merged model can be transformed as a whole, and the single model cannot be kept in its respective position for posture transformation. Therefore, in this embodiment, the terminal can record the position information of the model planes corresponding to each second model in the first model, so as to control each model plane to perform independent transformation through the position information of each model plane in the first model, thereby associating all the information required for rendering the second model through a single first model, and also ensuring that each second model can perform corresponding transformation separately. Among them, the position information can be the relative position information of the model plane in the first model, or it can be the position coordinates of the model plane in the first model (such as dividing the coordinate axis with the center of the first model as the origin, and the position coordinates are the position of the center point of the model plane on the coordinate axis), which can be set according to the needs and is not limited here.

[0040] It should be noted that the above-mentioned first model is equivalent to a large model plane, and this large model plane contains multiple model planes of the second model.

[0041] In some embodiments, the above-mentioned position information includes relative position information. Before obtaining the attribute information of the first model, it is necessary to obtain multiple second models to be rendered, so as to construct the first model based on the second models, and determine the attribute information of the first model, that is, determine the relative position information of each model plane in the first model, so that by recording the relative position information, various model sizes can be matched to ensure sufficient relative accuracy.

[0042] First, the terminal may obtain multiple second models to be rendered, and respectively create model planes corresponding to the second models.

[0043] Among them, the above-mentioned multiple second models to be rendered can be a combination of multiple objects of the same type or style in the virtual scene, or a combination of objects that are related and need to appear at the same time in the virtual scene, etc., which can be set specifically according to needs and are not limited here.

[0044] Specifically, the above-mentioned creation of model planes corresponding to each of the above-mentioned second models may include: the terminal may obtain the model size and model position of each of the above-mentioned second models, and then, at the model position of each of the above-mentioned second models, create model planes matching the model size of each of the above-mentioned second models.

[0045] The normal lines of the above-mentioned model planes are in the same direction, for example, the normal lines are facing upwards.

[0046] It can be understood that since both the second model and the model plane occupy a certain space, in order to match the two, they can be established based on the center points of the second model and the model plane, that is, the model position of the second model is the position of the center point of the second model, and a bounding box can be constructed around the second model, and the center point of the bounding box is set as the center point of the second model.

[0047] Furthermore, since the model plane is a two-dimensional plane, the length and width of the model plane can be aligned with the X-axis and Y-axis in the space where the second model is located, and the length and width of the model plane can be set based on the size of the second model or the bounding box built around the second model. For example, when the second model is a pearl model, the length and width of the model plane of the second model are set according to the radius size of the enclosing sphere of the pearl model. For example, the length and width of the model plane are both the product of 2 and the radius size, that is, the diameter of the enclosing sphere.

[0048] For example, Figure 2 and Figure 3 As shown, in Figure 2 The figure shows a series of independent spherical models, which are the second models. Then, the terminal creates a model plane for each second model to obtain Figure 3 The model planes corresponding to the second models shown are Figure 3 It contains multiple independent four-sided planes.

[0049] Secondly, the terminal can construct the first model based on the model plane corresponding to each of the above second models, that is, Figure 3 The model planes corresponding to the second models in are merged into a single model, namely the first model.

[0050] Specifically, the terminal may use 3dmax software and the attach command to merge the model planes corresponding to the second models into the first model.

[0051] Finally, the terminal may obtain the center position of the first model, that is, the position of the center point of the first model, and respectively determine the relative position information between each of the model planes and the center position of the first model.

[0052] The center position of the first model may be the center position of the first model itself or the center position of the bounding box of the first model. The center position may be set according to the requirements and is not limited here.

[0053] It can be understood that after the terminal obtains the center position of the first model, it is necessary to calculate the relative position information between each model plane and the center position of the first model based on the center position of the first model. The relative position information can be the relative distance between each model plane and the center position of the first model on different coordinate axes, relative distance ratio, etc., or it can be the relative direction between each model plane and the center position of the first model and the relative distance between the two, etc. The specific setting can be based on demand and is not limited here.

[0054] The position of the model plane compared with the center position of the first model may be the center point position of the model plane or the position of any point on the model plane, etc., which may be set according to requirements and is not limited here.

[0055] Specifically, the above-mentioned determination of the relative position information between each of the above-mentioned model planes and the center position of the above-mentioned first model may include: the terminal may respectively determine the position difference information between the center position of each of the above-mentioned model planes and the center position of the above-mentioned first model; then, the terminal may obtain the model size of the above-mentioned first model, and use the ratio of the above-mentioned position difference information to the model size of the above-mentioned first model as the above-mentioned relative position information.

[0056] The model size of the first model may be the model size of the first model itself or the size of the bounding box of the first model, which may be set according to requirements and is not limited here.

[0057] Exemplarily, if the minimum coordinate value of the bounding box of the first model is set to (0, 0, 0) and the maximum coordinate value is set to (1, 1, 1), then the terminal can calculate the position difference between the center position of the model plane and the center position of the above-mentioned first model, and then use the ratio of the position difference to the size of the bounding box of the first model as the above-mentioned relative position information.

[0058] In some embodiments, it also includes: the terminal can convert the relative position information of each of the above-mentioned model planes into color indication information. Then, among the model vertices of the above-mentioned first model, the target model vertices corresponding to each of the above-mentioned model planes are respectively determined, and the color indication information of each of the above-mentioned model planes is respectively written into the vertex attributes of the target model vertices corresponding to each of the above-mentioned model planes, such as writing into the model vertex color. Accordingly, the above-mentioned acquisition of the attribute information of the first model may include: acquiring the color indication information of each of the above-mentioned model planes from the vertex attributes of the model vertices of the above-mentioned first model, so as to determine the relative position information of the corresponding model plane based on the above-mentioned color indication information.

[0059] The color indication information is used to indicate the relative position information of the model plane.

[0060] Among them, the target model vertex corresponding to the model plane can be the model vertex closest to the center position of the model plane, or the model vertex consistent with the center position of the model plane, etc., which can be set according to needs and is not limited here.

[0061] The relative position information of each of the above-mentioned model planes is converted into color indication information, which may be the conversion of three coordinates in the relative position information into RGB color values, for example, multiplying the relative position coordinates by 255 to convert them into RGB color values.

[0062] Further, based on the above example, if the minimum coordinate value of the bounding box of the first model is set to (0, 0, 0) and the maximum coordinate value is set to (1, 1, 1), then the relative position information calculated by the terminal is in the range of -0.5 to 0.5. For the convenience of calculation, before the relative position information of each of the above model planes is converted into color indication information, the relative position information needs to be normalized so that it is mapped in the range of 0 to 1. The relative position information can be normalized to the range of 0 to 1 by calculating the sum between the relative position information and (0.5, 0.5, 0.5).

[0063] It should be noted that after the vertex colors are baked in, that is, the color indication information of each of the above-mentioned model planes is written into the vertex attributes of the target model vertices corresponding to each of the above-mentioned model planes, the RGB color values ​​correspond to the XYZ coordinate values ​​in the relative position information. However, due to the differences in coordinate systems of different software, the channels storing vertex colors need to be adjusted accordingly. Taking 3dmax imported into the neox engine as an example, in order to match the coordinate axes, the values ​​of its g and b channels need to be exchanged, that is, the Y axis and Z axis are opposite in different coordinate systems, so the G color value and the B color value need to be exchanged.

[0064] Step 102: Based on the position information of each of the above model planes, each of the above model planes is converted into the camera space respectively, and each model plane is made to face the virtual camera in the above camera space to obtain the first position information of each of the above model planes in the above camera space.

[0065] In this embodiment, the terminal can convert each model plane into the camera space so that the X-axis and Y-axis of each model plane can face the virtual camera in the camera space, that is, the front of the model plane faces the virtual camera, so that the changes of each model plane can be adjusted in real time in the camera space according to the changes of the virtual camera.

[0066] It should be noted that the center point of each model plane in the camera space is located at the world origin, and the pose of each model plane in the world space needs to be adjusted based on the first pose information obtained.

[0067] The terminal may convert each model plane into the camera space based on its local coordinates, so that different model planes are located at different positions in the camera space.

[0068] Specifically, the terminal can further collect the local coordinates of the center position of the first model and the model size of the first model (the model size can be the size of the first model bounding box) that are preset or automatically injected by the engine, so as to restore the local coordinates of each model plane based on the collected information about the first model and the position information of each model plane, such as the relative position of each model plane in the first model, which can be the local coordinates of the center point of each model plane.

[0069] In some embodiments, the first pose information of each of the above-mentioned model planes in the above-mentioned camera space is obtained, including: obtaining the pose adjustment parameters of each of the above-mentioned model planes in the above-mentioned camera space, the pose adjustment parameters can be generated by the user in real time, or can be pre-set by the user, and the pose adjustment parameters of different model planes can be the same or different. The pose adjustment parameters can include position offset parameters and pose adjustment parameters. For example, the pose adjustment parameters can include scaling parameters, rotation parameters, etc., which are set specifically according to needs and are not limited here.

[0070] Then, the terminal can adjust the posture of each of the above-mentioned model planes in the above-mentioned camera space based on the above-mentioned posture adjustment parameters of each of the above-mentioned model planes, and obtain the first position information of each of the above-mentioned model planes in the above-mentioned camera space, and the first position information is the posture information of the model plane after adjustment in the camera space.

[0071] In some embodiments, since different model planes have different positions in the first model, and the virtual camera has different viewing angles, the model planes at different positions away from the virtual camera need to undergo different degrees of posture changes. Therefore, the above-mentioned acquisition of the posture adjustment parameters of each of the above-mentioned model planes in the above-mentioned camera space may include: the terminal may determine the target viewing angle of the above-mentioned virtual camera during the current shooting, and then, the terminal may determine the posture adjustment parameters of each of the above-mentioned model planes in the above-mentioned camera space under the above-mentioned target viewing angle based on the position information of each of the above-mentioned model planes.

[0072] Step 103: Based on the first pose information of each of the model planes, each of the model planes is converted into the world space to obtain the second pose information of each of the model planes in the world space.

[0073] In this embodiment, the terminal needs to convert each model plane into the world space based on the first pose information of the model plane obtained in the camera space to obtain the second pose information of each model plane in the world space.

[0074] It can be understood that since the center point of each model plane in the camera space is at the origin in the world space, when the terminal converts the model plane from the camera space to the world space, it is necessary to adjust the posture of the model plane based on the first posture information at the origin of the world space to obtain the second posture information of the model plane in the world space.

[0075] Step 104: Render each of the model planes in the first model based on the second pose information of each of the model planes and the rendering map corresponding to the second model.

[0076] In this embodiment, the terminal can obtain the rendering map of the above-mentioned second model. Since each plane model has corresponding second pose information, each model plane in the first model can be rendered based on the second pose information of each plane model and a corresponding rendering map is assigned to each plane model, so as to achieve the rendering effect of each second model in the virtual scene, so that the rendering effect of the model can be achieved by rendering only the model plane, which improves the rendering effect when rendering multiple models and reduces the loss required for rendering.

[0077] The above-mentioned rendering maps include but are not limited to color maps, transparency maps, etc., which can be set according to specific needs and are not limited here.

[0078] For example, Figure 4 As shown, from Figure 4 As can be seen in , if the second model is set as a series of spherical models, the color map used by the model planes of each spherical model in the scene is the same color map, and each model plane corresponds to a color map, and each model plane corresponds to its own UV texture coordinates. The color on the map can be sampled by the UV texture coordinates and pasted to the model plane, and finally rendered as follows Figure 5 Schematic diagram of the rendering effect shown.

[0079] From the above content, it can be seen that by obtaining the attribute information of the first model composed of multiple model planes of the second model, the attribute information includes the position information of each of the above model planes in the above first model. Then, based on the position information of each of the above model planes, each of the above model planes is converted to the camera space respectively, and each model plane is made to face the virtual camera in the above camera space, so as to obtain the first pose information of each of the above model planes in the above camera space. Finally, based on the above first pose information of each of the above model planes, each of the above model planes is converted to the world space respectively, and the second pose information of each of the above model planes in the above world space is obtained, so as to render each of the above model planes in the above first model based on the above second pose information of each of the above model planes and the rendering map corresponding to the above second model, so as to record the position information of each model plane in the first model, so as to determine the pose transformation information of each model plane respectively, so as to render each model plane accordingly, so as to improve the rendering effect when rendering multiple models.

[0080] This embodiment also provides a model rendering device, which can be integrated into a terminal device. Figure 6 As shown, the model rendering device may include:

[0081] The information acquisition module 601 is used to acquire the attribute information of the first model, wherein the first model is composed of a plurality of model planes corresponding to the second model, and the attribute information includes the position information of each of the model planes in the first model;

[0082] A first space conversion module 602 is used to convert each of the above model planes into the camera space based on the position information of each of the above model planes, and make each of the above model planes face the virtual camera in the above camera space, so as to obtain the first pose information of each of the above model planes in the above camera space;

[0083] A second space conversion module 603 is used to convert each of the above-mentioned model planes into the world space based on the above-mentioned first pose information of each of the above-mentioned model planes, so as to obtain the second pose information of each of the above-mentioned model planes in the above-mentioned world space;

[0084] The model rendering module 604 is used to render each of the above-mentioned model planes in the above-mentioned first model based on the above-mentioned second posture information of each of the above-mentioned model planes and the rendering map corresponding to the above-mentioned second model.

[0085] In some embodiments, the position information includes relative position information, and the model rendering device further includes an information determination module, and the information determination module is specifically used to:

[0086] Acquire multiple second models, and create model planes corresponding to each of the second models;

[0087] Constructing a first model based on the model planes corresponding to the second models;

[0088] The center position of the first model is obtained, and relative position information between each of the model planes and the center position of the first model is determined respectively.

[0089] In some embodiments, the information determination module is specifically used to:

[0090] Obtaining the model size and model position of each of the second models;

[0091] At the model position of each of the second models, a model plane matching the model size of each of the second models is created respectively, wherein the normal lines of each of the model planes are in the same direction.

[0092] In some embodiments, the information determination module is specifically used to:

[0093] Respectively determining position difference information between the center position of each of the above-mentioned model planes and the center position of the above-mentioned first model;

[0094] The model size of the first model is obtained, and the ratio of the position difference information to the model size of the first model is used as the relative position information.

[0095] In some embodiments, the model rendering device further includes an information writing module, and the information writing module is specifically used to:

[0096] Converting the relative position information of each of the above model planes into color indication information;

[0097] Among the model vertices of the first model, respectively determine the target model vertices corresponding to the model planes;

[0098] Writing the color indication information of each of the above-mentioned model planes into the vertex attributes of the target model vertices corresponding to each of the above-mentioned model planes;

[0099] The information acquisition module 601 is specifically used for:

[0100] The color indication information of each of the above-mentioned model planes is obtained from the vertex attributes of the model vertices of the above-mentioned first model, so as to determine the relative position information of the corresponding model plane based on the above-mentioned color indication information.

[0101] In some embodiments, the first space conversion module 602 is specifically used for:

[0102] Obtaining the posture adjustment parameters of each of the above model planes in the above camera space;

[0103] Based on the above-mentioned posture adjustment parameters of each of the above-mentioned model planes, the posture of each of the above-mentioned model planes in the above-mentioned camera space is adjusted respectively to obtain the first posture information of each of the above-mentioned model planes in the above-mentioned camera space.

[0104] In some embodiments, the first space conversion module 602 is specifically used for:

[0105] Determine the target viewing angle of the virtual camera when currently shooting;

[0106] Based on the position information of each of the above-mentioned model planes, the posture adjustment parameters of each of the above-mentioned model planes in the above-mentioned camera space under the above-mentioned target viewing angle are determined.

[0107] From the above content, it can be seen that by obtaining the attribute information of the first model composed of multiple model planes of the second model, the attribute information includes the position information of each of the above model planes in the above first model. Then, based on the position information of each of the above model planes, each of the above model planes is converted to the camera space respectively, and each model plane is made to face the virtual camera in the above camera space, so as to obtain the first pose information of each of the above model planes in the above camera space. Finally, based on the above first pose information of each of the above model planes, each of the above model planes is converted to the world space respectively, and the second pose information of each of the above model planes in the above world space is obtained, so as to render each of the above model planes in the above first model based on the above second pose information of each of the above model planes and the rendering map corresponding to the above second model, so as to record the position information of each model plane in the first model, so as to determine the pose transformation information of each model plane respectively, so as to render each model plane accordingly, so as to improve the rendering effect when rendering multiple models.

[0108] Accordingly, an embodiment of the present application further provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and other terminal devices. Alternatively, the electronic device may be a server.

[0109] like Figure 7 As shown, Figure 7A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 700 includes a processor 701 having one or more processing cores, a memory 702 having one or more computer-readable storage media, and a computer program stored in the memory 702 and executable on the processor. The processor 701 is electrically connected to the memory 702. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.

[0110] The processor 701 is the control center of the electronic device 700, and uses various interfaces and lines to connect various parts of the entire electronic device 700. By running or loading software programs and / or units stored in the memory 702, and calling data stored in the memory 702, the processor 701 executes various functions of the electronic device 700 and processes data, thereby monitoring the electronic device 700 as a whole. The processor 701 can be a central processing unit CPU, a graphics processing unit GPU, a network processor (Network Processor, NP), etc., and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0111] In the embodiment of the present application, the processor 701 in the electronic device 700 will load instructions corresponding to the processes of one or more application programs into the memory 702 according to the following steps, and the processor 701 will run the application programs stored in the memory 702 to implement various functions, such as:

[0112] Acquire attribute information of the first model, wherein the first model is composed of a plurality of model planes corresponding to the second model, and the attribute information includes position information of each of the model planes in the first model;

[0113] Based on the position information of each of the above model planes, each of the above model planes is converted into the camera space respectively, and each of the model planes is made to face the virtual camera in the above camera space, so as to obtain the first pose information of each of the above model planes in the above camera space;

[0114] Based on the first pose information of each of the model planes, each of the model planes is converted into the world space to obtain second pose information of each of the model planes in the world space;

[0115] Based on the second pose information of each of the model planes and the rendering map corresponding to the second model, each of the model planes in the first model is rendered.

[0116] Therefore, the electronic device 700 provided in this embodiment can bring the following technical effects: improving the rendering effect when rendering multiple models.

[0117] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0118] Optional, such as Figure 7 As shown, the electronic device 700 further includes: a touch screen 703, a radio frequency circuit 704, an audio circuit 705, an input unit 706, and a power supply 707. The processor 701 is electrically connected to the touch screen 703, the radio frequency circuit 704, the audio circuit 705, the input unit 706, and the power supply 707, respectively. Those skilled in the art can understand that Figure 7 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0119] The touch display screen 703 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 703 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 701, and can receive the command sent by the processor 701 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 701 to determine the type of touch event, and then the processor 701 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 703 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 703 can also be used as a part of the input unit 706 to realize the input function.

[0120] The radio frequency circuit 704 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals between the network device or other electronic devices.

[0121] The audio circuit 705 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 705 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 705 and converted into audio data, and then the audio data is output to the processor 701 for processing, and then sent to another electronic device through the radio frequency circuit 704, or the audio data is output to the memory 702 for further processing. The audio circuit 705 may also include an earplug jack to provide communication between an external headset and an electronic device.

[0122] The input unit 706 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0123] The power supply 707 is used to supply power to various components of the electronic device 700. Optionally, the power supply 707 can be logically connected to the processor 701 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 707 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0124] although Figure 7 Not shown, the electronic device 700 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0125] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0126] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0127] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer program can be loaded by a processor to execute any one of the model rendering methods provided in the embodiments of the present application. The computer program can execute the following steps of the model rendering method:

[0128] Acquire attribute information of the first model, wherein the first model is composed of a plurality of model planes corresponding to the second model, and the attribute information includes position information of each of the model planes in the first model;

[0129] Based on the position information of each of the above model planes, each of the above model planes is converted into the camera space respectively, and each of the model planes is made to face the virtual camera in the above camera space, so as to obtain the first pose information of each of the above model planes in the above camera space;

[0130] Based on the first pose information of each of the model planes, each of the model planes is converted into the world space to obtain second pose information of each of the model planes in the world space;

[0131] Based on the second pose information of each of the model planes and the rendering map corresponding to the second model, each of the model planes in the first model is rendered.

[0132] It can be seen that the computer program can be loaded by the processor to execute any model rendering method provided in the embodiments of the present application, thereby bringing the following technical effects: improving the rendering effect when rendering multiple models.

[0133] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0134] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0135] Since the computer program stored in the computer-readable storage medium can execute any one of the model rendering methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the model rendering methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0136] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the methods provided in various optional implementations of the above embodiments.

[0137] In the above-mentioned model rendering device, computer-readable storage medium, electronic device, and computer program product embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the above-described model rendering device, computer-readable storage medium, computer program product, electronic device, and its corresponding units can refer to the description of the model rendering method in the above embodiment, and will not be repeated here.

[0138] The above is a detailed introduction to a model rendering method, device, electronic device, computer-readable storage medium and computer program product provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A model rendering method, characterized in that: The method comprises: Acquire attribute information of a first model, wherein the first model is composed of a plurality of model planes corresponding to the second model, and the attribute information includes position information of each of the model planes in the first model; Based on the position information of each model plane, each model plane is converted into the camera space respectively, and each model plane is made to face the virtual camera in the camera space, so as to obtain the first pose information of each model plane in the camera space; Based on the first pose information of each of the model planes, each of the model planes is converted into a world space to obtain second pose information of each of the model planes in the world space; Based on the second pose information of each model plane and the rendering map corresponding to the second model, each model plane in the first model is rendered.

2. The model rendering method according to claim 1, characterized in that: The position information includes relative position information, and before acquiring the attribute information of the first model, further includes: Acquire multiple second models, and create model planes corresponding to each of the second models; constructing a first model based on the model planes corresponding to each of the second models; The center position of the first model is acquired, and relative position information between each of the model planes and the center position of the first model is determined respectively.

3. The model rendering method according to claim 2, characterized in that: The step of respectively creating model planes corresponding to the second models comprises: Obtaining a model size and a model position of each of the second models; At the model positions of the second models, model planes matching the model sizes of the second models are created respectively, wherein the normals of the model planes are in the same direction.

4. The model rendering method according to claim 2, characterized in that: The respectively determining the relative position information between each of the model planes and the center position of the first model comprises: Respectively determining position difference information between the center position of each of the model planes and the center position of the first model; The model size of the first model is acquired, and the ratio of the position difference information to the model size of the first model is used as the relative position information.

5. The model rendering method according to claim 2, characterized in that: Also includes: Converting the relative position information of each of the model planes into color indication information; Among the model vertices of the first model, respectively determining the target model vertices corresponding to the model planes; Writing the color indication information of each of the model planes into the vertex attributes of the target model vertices corresponding to each of the model planes; The obtaining of the attribute information of the first model includes: Color indication information of each of the model planes is acquired from vertex attributes of the model vertices of the first model, so as to determine relative position information of the corresponding model plane based on the color indication information.

6. The model rendering method according to any one of claims 1 to 5, characterized in that: The obtaining of the first pose information of each of the model planes in the camera space includes: Obtaining posture adjustment parameters of each of the model planes in the camera space; Based on the posture adjustment parameters of each of the model planes, the posture of each of the model planes in the camera space is adjusted respectively to obtain the first posture information of each of the model planes in the camera space.

7. The model rendering method according to claim 6, characterized in that: The obtaining of the posture adjustment parameters of each of the model planes in the camera space includes: Determine the target viewing angle of the virtual camera when currently shooting; Based on the position information of each of the model planes, a posture adjustment parameter of each of the model planes in the camera space under the target viewing angle is determined.

8. A model rendering device, characterized in that: The device comprises: An information acquisition module, used to acquire attribute information of a first model, wherein the first model is composed of a plurality of model planes corresponding to the second model, and the attribute information includes position information of each of the model planes in the first model; A first space conversion module is used to convert each of the model planes into a camera space based on the position information of each of the model planes, and make each of the model planes face the virtual camera in the camera space to obtain the first pose information of each of the model planes in the camera space; A second space conversion module, used for converting each of the model planes into a world space based on the first pose information of each of the model planes, to obtain second pose information of each of the model planes in the world space; A model rendering module is used to render each of the model planes in the first model based on the second posture information of each of the model planes and the rendering map corresponding to the second model.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the model rendering method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the model rendering method according to any one of claims 1 to 7.