Model rendering method and related equipment

By voxelizing the leaf model and updating the normal vector, the problem of poor rendering effect under hardware limitations is solved, and a more realistic and controllable rendering effect is achieved.

CN114926575BActive Publication Date: 2025-08-26BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210488469.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-06
Publication Date
2025-08-26
Estimated Expiration
2042-05-06

AI Technical Summary

Technical Problem

Due to hardware computing resources limitations, existing leaf models cannot use enough inserts for image rendering, resulting in poor rendering and users cannot adjust the rendering effect.

Method used

By voxelizing the initial leaf model based on the voxelization parameters determined by the user, a magnification model is generated, and the normal vector of the intersection point of the extension line of the vertex normal and the magnification model is calculated, and the normal vector of the initial leaf model is updated for rendering.

Benefits of technology

It improves the rendering effect of the leaf model, enhances the authenticity of the leaf display, and realizes user control and adjustment of the rendering effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114926575B_ABST
    Figure CN114926575B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image rendering method and related equipment. The method includes: obtaining an initial leaf model, wherein the surface of the initial leaf model includes multiple vertices; performing voxelization processing on the initial leaf model based on voxelization parameters to obtain a voxelized model; generating an enlarged model that accommodates the voxelized model; calculating the intersection of the extension line of the first normal vector of the vertex in the initial leaf model and the enlarged model, as well as the second normal vector of the intersection; updating the normal vector of the vertex in the initial leaf model based on the second normal vector to obtain a new leaf model; and rendering the new leaf model. According to the present disclosure, the rendering effect of the leaf model is improved, and the rendering process can be adjusted to improve the controllability of the rendering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a model rendering method and related equipment. Background Art

[0002] Due to hardware computing resource limitations, existing leaf models cannot use many inserts for image rendering, resulting in poor rendering quality and a lack of realism. Furthermore, the leaf normals that determine leaf orientation in commonly used leaf model rendering methods are automatically calculated and cannot be adjusted by the user, making it impossible to adjust or optimize the rendering effect. Summary of the Invention

[0003] The present disclosure proposes a model rendering method and related equipment to solve, to a certain extent, the technical problems of poor rendering effect of the model and the inability of users to adjust and control the rendering effect.

[0004] In a first aspect, the present disclosure provides a model rendering method, comprising:

[0005] Acquire an initial leaf model, wherein a surface of the initial leaf model includes a plurality of vertices;

[0006] voxelize the initial leaf model based on the voxelization parameters to obtain a voxelized model;

[0007] generating an enlarged model accommodating the voxelized model;

[0008] Calculating an intersection point of an extension line of a first normal vector of the vertex in the initial leaf model and the enlarged model, and a second normal vector of the intersection point;

[0009] updating the normal vectors of the vertices in the initial leaf model based on the second normal vector to obtain a new leaf model;

[0010] Rendering the new leaf model.

[0011] In a second aspect of the present disclosure, a model rendering device is provided, comprising:

[0012] An acquisition module, configured to acquire an initial leaf model, wherein a surface of the initial leaf model includes a plurality of vertices;

[0013] a pre-processing module, configured to voxelize the initial leaf model based on voxelization parameters to obtain a voxelized model; and generate an enlarged model accommodating the voxelized model;

[0014] a calculation module, configured to calculate an intersection point between an extension line of a first normal vector of the vertex in the initial leaf model and the enlarged model, and a second normal vector of the intersection point;

[0015] An updating module, configured to update the normal vectors of the vertices in the initial leaf model based on the second normal vector to obtain a new leaf model;

[0016] A rendering module is used to render the new leaf model.

[0017] In a third aspect of the present disclosure, an electronic device is provided, characterized in that it includes one or more processors, a memory; and one or more programs, wherein the one or more programs are stored in the memory and executed by the one or more processors, and the programs include instructions for executing the method described in the first aspect.

[0018] According to a fourth aspect of the present disclosure, a non-volatile computer-readable storage medium containing a computer program is provided. When the computer program is executed by one or more processors, the processors are caused to execute the method described in the first aspect.

[0019] In a fifth aspect of the present disclosure, a computer program product is provided, comprising computer program instructions, which, when executed on a computer, cause the computer to execute the method described in the first aspect.

[0020] As can be seen from the foregoing, the model rendering method and related devices provided herein voxelize an initial leaf model based on user-specified voxelization parameters, then amplify it to obtain a magnified model. The method then transfers the normals of the intersection points of the extended vertex normals in the initial leaf model and the magnified model to the vertices, generating a new leaf model for rendering. This method not only improves rendering effects and enhances the realism of leaf display, but also enables user control over the rendering effect, increasing user controllability of the rendering process. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0022] Figure 1 A schematic diagram of a rendering architecture of a leaf model according to an embodiment of the present disclosure.

[0023] Figure 2 Schematic diagram of the hardware structure of an exemplary terminal according to an embodiment of the present disclosure.

[0024] Figure 3 A schematic diagram of a method for rendering a leaf model according to an embodiment of the present disclosure.

[0025] Figure 4 This is a schematic rendering diagram of the initial leaf model according to an embodiment of the present disclosure.

[0026] Figure 5A and Figure 5B Schematic diagram of voxelized models at different granularities according to an embodiment of the present disclosure Figure 6A and Figure 6B Schematic diagram of an enlarged model of an embodiment of the present disclosure.

[0027] Figures 7A-7C Schematic diagram of intersection point detection according to an embodiment of the present disclosure.

[0028] Figure 8 A rendering diagram of a new leaf model according to an embodiment of the present disclosure.

[0029] Figure 9 Schematic diagram of a rendering device for a leaf model according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

[0031] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should have the usual meanings understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative position relationships. When the absolute position of the described object changes, the relative position relationship may also change accordingly.

[0032] When rendering leaf models to display leaves, the limited processing power of the device hardware means that the number of inserts used for rendering is relatively small, resulting in a strong sense of inserts in the rendering effect and an inability to achieve a quantified rendering effect. Currently, commonly used methods to improve rendering effects include the environment normal (BentNormal) and the spherical normal. Both of these normals are automatically calculated, making it difficult for users to control and adjust the rendering effect from an artistic perspective. Therefore, how to improve the rendering effect of leaf models and facilitate user adjustment and control of the rendering process and rendering effects has become a technical problem that needs to be solved urgently.

[0033] In light of this, embodiments of the present disclosure provide a model rendering method and related devices. This method voxelizes an initial leaf model based on user-specified voxelization parameters, then enlarges it to obtain an enlarged model. The normals of the intersection points of the extended vertex normals in the initial leaf model and the enlarged model are transferred to the vertices to obtain a new leaf model for rendering. This method not only improves rendering effects and enhances the realism of leaf display, but also enables user control over the rendering effect, increasing user controllability of the rendering process.

[0034] Figure 1 FIG. 1 is a schematic diagram showing a rendering architecture of a leaf model according to an embodiment of the present disclosure. Figure 1 The rendering architecture 100 of the leaf model may include a server 110, a terminal 120, and a network 130 that provides a communication link. The server 110 and the terminal 120 may be connected via a wired or wireless network 130. The server 110 may be an independent physical server, or a server cluster or distributed system consisting of multiple physical servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0035] Terminal 120 can be implemented in hardware or software. For example, when implemented in hardware, terminal 120 can be any electronic device with a display screen that supports page display, including but not limited to smartphones, tablet computers, e-book readers, laptop computers, and desktop computers. When terminal 120 is implemented in software, it can be installed in the electronic devices listed above; it can be implemented as multiple software or software modules (such as software or software modules used to provide distributed services), or it can be implemented as a single software or software module, and no specific limitations are given here.

[0036] It should be noted that the leaf model rendering method provided in the embodiment of the present application can be executed by the terminal 120 or by the server 110. Figure 1The number of terminals, networks, and servers in the embodiment is for illustration only and is not intended to limit the number of terminals, networks, and servers.

[0037] Figure 2 FIG. 2 shows a schematic diagram of the hardware structure of an exemplary terminal 200 provided in an embodiment of the present disclosure. Figure 2 As shown, terminal 200 may include: processor 202, memory 204, network module 206, peripheral interface 208 and bus 210. Processor 202, memory 204, network module 206 and peripheral interface 208 are connected to each other through bus 210 within terminal device 200.

[0038] The processor 202 may be a central processing unit (CPU), an image processor, a neural network processor (NPU), a microcontroller (MCU), a programmable logic device, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), or one or more integrated circuits. The processor 202 may be used to perform functions related to the technology described in this disclosure. In some embodiments, the processor 202 may also include multiple processors integrated into a single logical component. For example, Figure 2 As shown, the processor 202 may include a plurality of processors 202a, 202b, and 202c.

[0039] The memory 204 may be configured to store data (eg, instructions, computer code, etc.). Figure 2 As shown, the data stored in the memory 204 may include program instructions (for example, program instructions for implementing the rendering method of the leaf model of the embodiment of the present disclosure) and data to be processed (for example, the memory may store configuration files of other modules, etc.). The processor 202 may also access the program instructions and data stored in the memory 204, and execute the program instructions to operate on the data to be processed. The memory 204 may include a volatile storage device or a non-volatile storage device. In some embodiments, the memory 204 may include a random access memory (RAM), a read-only memory (ROM), an optical disc, a magnetic disk, a hard disk, a solid-state drive (SSD), a flash memory, a memory stick, etc.

[0040] The network module 206 can be configured to provide communication with other external devices to the terminal 200 via a network. The network can be any wired or wireless network capable of transmitting and receiving data. For example, the network can be a wired network, a local wireless network (e.g., Bluetooth, WiFi, near field communication (NFC)), a cellular network, the Internet, or a combination thereof. It will be appreciated that the type of network is not limited to the specific examples above. In some embodiments, the network module 106 can include any number of network interface controllers (NICs), radio frequency modules, transceivers, modems, routers, gateways, adapters, cellular network chips, and the like.

[0041] The peripheral interface 208 can be configured to connect the terminal device 200 to one or more peripheral devices to implement information input and output. For example, the peripheral devices can include input devices such as a keyboard, a mouse, a touchpad, a touch screen, a microphone, and various sensors, as well as output devices such as a display, a speaker, a vibrator, and an indicator light.

[0042] The bus 210 can be configured to transmit information between the various components of the terminal 200 (e.g., the processor 202, the memory 204, the network module 206, and the peripheral interface 208), such as an internal bus (e.g., a processor-memory bus), an external bus (USB port, PCI-E bus), etc.

[0043] It should be noted that although the architecture of the terminal 200 shown above only shows the processor 202, the memory 204, the network module 206, the peripheral interface 208, and the bus 210, in a specific implementation, the architecture of the terminal device 200 may also include other components necessary for normal operation. In addition, those skilled in the art will understand that the architecture of the terminal 200 may also include only the components necessary to implement the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.

[0044] See also Figure 3 , Figure 3 A schematic flow chart of a model rendering method according to an embodiment of the present disclosure is shown. The method 300 may be performed by Figure 2 The terminal 200 shown is implemented. Figure 3 As shown, the method 300 may include the following steps.

[0045] In step S310, an initial leaf model is obtained, where the surface of the initial leaf model includes a plurality of vertices.

[0046] The initial leaf model may be a newly created 3D image model of leaves, such as a leaf model created based on a video image or a point cloud. Each vertex in the initial leaf model may represent a vertex of a leaf. Figure 4 As shown, Figure 4 A rendering schematic diagram of an initial leaf model according to an embodiment of the present disclosure is shown. Figure 4 In the example, plant (e.g., tree) model 400 includes a leaf model 410 and a trunk image model 420. Existing rendering methods can render leaf model 410 unrealistically, with a strong sense of insert. Therefore, leaf model 410 can be rendered using the method of the present embodiment to improve the rendering effect. It should be understood that the leaves in the present embodiment are not limited to those of trees, but may also include plants with a large number of leaves clustered together, such as bushes.

[0047] In actual applications, the initial leaf model file can be imported to display the initial leaf model. The attributes (e.g., color, transparency, etc.) in the initial leaf model can be deleted to obtain an attributeless leaf model. The leaf model can be moved to a specified location (e.g., the center point of the display interface) for re-rendering.

[0048] In step S320, voxelization is performed on the initial leaf model based on the voxelization parameters.

[0049] Among them, voxelization processing can refer to converting the geometric representation of an object into a voxel representation that is similar to the object, and generating a corresponding volume data set. The volume data set can not only contain the surface information of the model, such as the coordinates of each vertex of the voxelized model obtained after voxelization, but also describe the internal properties of the model. Corresponding parameter input controls (for example, input boxes) or parameter adjustment controls can be provided to the user to input or adjust the voxelization parameters. In this way, the user can adjust the voxelization process during the voxelization process, providing the user with greater creative freedom, so that the user can enhance the control of the subsequent rendering effect.

[0050] In some embodiments, method 300 may further include:

[0051] The voxelization parameter determined by a user is received, or an adjustment to the voxelized model made by a user is received, so as to adjust at least one of a shape, a scale, a size, a subdivision granularity, or a smoothness of the voxelized model.

[0052] The voxelization parameters can be determined by the user, for example, by inputting the voxelization parameters (via an input device such as a keyboard, mouse, or touch screen). Alternatively, the user can directly adjust the voxelized model, for example, by manually adjusting the voxelized model using a model adjustment tool. This allows the user to adjust the voxelized model according to their needs, thereby enhancing the user's control over the voxelization process.

[0053] In some embodiments, the surface of the enlarged model may include multiple polygons, such as triangles, quadrilaterals, and the like.

[0054] In some embodiments, the voxelization parameter includes a subdivision granularity; wherein, the smaller the subdivision granularity, the greater the number of the polygons.

[0055] Specifically, if Figure 5A and Figure 5B As shown, Figure 5A and Figure 5B Schematic diagram of voxelized models at different subdivision granularities according to an embodiment of the present disclosure is shown. Figure 5A The subdivision granularity is DivisionA, for example 0.333; Figure 5B The subdivision granularity is DivisionB, for example 0.6. It can be seen that when DivisionA is smaller than DivisionB, Figure 5A The voxelized model has more polygons on its surface and its outline is closer to the outline of the initial leaf model. Accordingly, this may lead to a greater amount of computation in the rendering process; Figure 5B The voxelized model surface has fewer polygons and is closer to the initial leaf model contour than Figure 5A Moderately poor, but may reduce the amount of calculation to some extent.

[0056] In some embodiments, voxelizing the initial leaf model based on the voxelization parameters includes:

[0057] Scaling down the initial leaf model by a second preset multiple to obtain a scaled-down model;

[0058] The reduced model is voxelized based on the voxelization parameters to obtain a voxelized model.

[0059] The initial leaf model can be scaled down by a certain ratio (i.e., a second predetermined multiple), for example, to 1 / 100 of the initial leaf model, to reduce subsequent processing time. Because the larger the model, the greater the computational effort required, scaling the model down by a certain ratio before voxelization can reduce the computational effort, thereby reducing the time required for subsequent processing, including voxelization.

[0060] In some embodiments, the voxelizing the initial leaf model based on the voxelization parameters further includes:

[0061] Generate an intermediate model surrounding the initial leaf model based on a plurality of preset models, wherein the preset model includes at least one three-dimensional shape;

[0062] Merging the preset models in the intermediate model to connect the interior of the intermediate model to obtain a merged model;

[0063] The merged model is voxelized based on the voxelization parameters.

[0064] Among them, in order to provide users with greater creative freedom, the user can follow the initial leaf model and splice based on different preset models to fit the shape of the initial leaf model. For example, the preset model can be a three-dimensional figure of different shapes such as a cuboid, a cube, etc. The user can choose these preset models to fit the shape of the initial leaf model. For example, a cube with a side length of 10 cm can be selected to be superimposed into the shape of the initial leaf model, and a cube with a side length of 5 cm can be selected to be superimposed into the shape of the initial leaf model. Then, compared with the merged model B obtained by the cube with a side length of 5 cm, the subdivision granularity of the merged model A obtained by the cube with a side length of 10 cm will be greater than the subdivision granularity of the merged model B. After voxelization, the surface of the merged model B has more polygons than the merged model A. In this way, the user can also intervene in the rendering process before voxelization, further improving the controllability of the rendering process.

[0065] In some embodiments, the voxelizing the initial leaf model based on the voxelization parameters further includes:

[0066] Performing voxelization processing on the initial leaf model based on the voxelization parameters to obtain a voxelized model;

[0067] receiving a smoothing parameter determined by a user, and performing smoothing processing on the voxelized model based on the smoothing parameter to obtain a smoothed model;

[0068] The smoothed model is amplified to obtain the amplified model.

[0069] In some embodiments, the smoothing parameter may include a degree of smoothness.

[0070] Specifically, each polygon on the surface of the voxelized model should be planar. However, there may be individual points in the polygon that are neither vertices nor on the same plane as other points. In this case, there may be errors in the coordinates of these individual points. In order to reduce or eliminate this error, the voxelized model can be smoothed to ensure the accuracy of subsequent calculations such as normal vectors.

[0071] In some embodiments, method 300 further includes: receiving user adjustments to the voxelized model and / or the smoothed model to adjust at least one of the shape, scale, size, granularity, or smoothness of the voxelized model and / or the smoothed model, which may be performed before the upscaling process.

[0072] After voxelization and / or smoothing, the user may want to make minor adjustments to the voxelized and / or smoothed models to achieve the desired rendering effect. In this case, the user can use the model adjustment tool to adjust relevant parameters of the voxelized and / or smoothed models. The relevant parameters may include at least one of shape, scale, size, granularity, or smoothness.

[0073] Specifically, when performing the magnification process in step S320, the current voxelized model and / or smoothed model may be magnified by N times, where N is a positive integer. For example, the current voxelized model and / or smoothed model may be magnified by 2 times to obtain a magnified model that can completely surround the initial leaf model. Figure 6A and 6B , Figure 6A and Figure 6B A schematic diagram of an enlarged model according to an embodiment of the present disclosure is shown. Figure 6A In the figure, the enlarged model has not yet completely surrounded the initial leaf model, and some leaves are exposed outside the enlarged model; Figure 6B The medium-scale model completely surrounds the initial foliage model, with no foliage exposed outside the scaled-up model.

[0074] In step S330 , an enlarged model accommodating the voxelized model is generated.

[0075] The enlarged model is larger than the voxelized model to accommodate it. The enlarged model can be generated by enlarging the voxelized model or by generating it based on a preset shape. Compared to generating an enlarged model based on a preset shape, enlarging the voxelized model by a certain factor creates an enlarged image that is more similar in shape to the original leaf model, ensuring better and more realistic leaf rendering.

[0076] In some embodiments, generating an enlarged model that accommodates the voxelized model includes: enlarging the voxelized model according to a first preset multiple to obtain the enlarged model.

[0077] In step S340, the intersection point of the extension line of the first normal vector of the vertex in the initial leaf model and the enlarged model and the second normal vector of the intersection point are calculated.

[0078] In some embodiments, step S340 may further include: calculating a first normal vector of the vertex in the initial leaf model.

[0079] In some embodiments, calculating the first normal vector of the vertex in the initial leaf model includes:

[0080] Calculating the average coordinates of all vertices based on the coordinates of all vertices in the initial leaf model to obtain the coordinates of the geometric center point of the initial leaf model;

[0081] Calculate the vector from the coordinates of the geometric center point to the coordinates of the vertex to obtain the first normal vector.

[0082] Specifically, the leaf vertices can be spread outward along their corresponding first normal vectors for a certain distance until they touch the magnified model, and the intersection point can be detected. Figures 7A-7C , Figures 7A-7C A schematic diagram of intersection point detection according to an embodiment of the present disclosure is shown. Figure 7A , the enlarged model 710 completely surrounds the initial leaf model 720; Figure 7B In the figure, the initial leaf model 720 is enlarged, but does not collide with the enlarged model 710; Figure 7C In the example, the initial leaf model 720 continues to enlarge and collides with the enlarged model 710, obtaining the intersection points corresponding to the vertices of each leaf. Given the first normal vector and the coordinates of each vertex of the enlarged model, the coordinates of the intersection point between the extended line of the first normal vector and the enlarged model can be calculated based on the intersection point calculation method of a spatial line and a surface.

[0083] In some embodiments, calculating the intersection point of the extension line of the first normal vector and the enlarged model and the second normal vector of the intersection point includes:

[0084] Calculating the coordinates of the intersection point and the target polygon where the intersection point is located based on the first normal vector and the coordinates of each vertex of the enlarged model;

[0085] Calculate, based on the coordinates of the intersection point and the coordinates of the first vertex, the second vertex, and the third vertex of the target polygon, a first distance, a second distance, and a third distance from the intersection point to the first vertex, the second vertex, and the third vertex, respectively;

[0086] Calculating the sum of the first distance, the second distance, and the third distance, and the proportions of the first distance, the second distance, and the third distance in the sum, respectively, to obtain a first proportion, a second proportion, and a third proportion;

[0087] respectively calculating a first product of a first vertex normal vector of the first vertex and the first ratio, a second product of a second vertex normal vector of the second vertex and the second ratio, and a third product of a third vertex normal vector of the third vertex and the third ratio;

[0088] The sum of the first product, the second product, and the third product is calculated to obtain the second normal vector.

[0089] Specifically, the coordinates of the intersection point hitpoint are (xh, yh, zh), and the polygon where the intersection point is located includes vertices A(xa, ya, za), B(xb, yb, zb), and C(xc, yc, zc). Calculate the distance from hitpoint to vertex A. The distance from hitpoint to vertex B The distance from the hitpoint to the vertex C Then calculate the sum of distance DisHA, distance DisHB, and distance DisHC: Distotal = DisHA + DisHB + DisHC. Calculate the second normal vector of the intersection point hitpoint based on the normal vector NormalA of vertex A, the normal vector NormalB of vertex B, and the normal vector NormalC of vertex C.

[0090] In step S350, the normal vectors of the vertices in the initial leaf model are updated based on the second normal vector to obtain a new leaf model.

[0091] Specifically, the second normal vector is used as the normal vector of the corresponding vertex in the initial leaf model to update the initial leaf model to obtain a new leaf model. For example, the first normal vector of vertex L in the initial leaf model is The intersection point of the extended line of the first normal vector and the magnified model is I, then the intersection point I corresponds to the vertex L, and the second normal vector of the intersection point I is Then the second normal vector Corresponding to vertex L. The second normal vector can be As the normal vector of the corresponding vertex L. When the normal vectors of all vertices in the initial leaf model are updated, a new leaf model is obtained. According to the embodiment of the present disclosure, the normal vector of the intersection point corresponding to the vertex is transferred to the vertex, which can improve the rendering effect of the leaf model, reduce the sense of insertion, and improve the realism of the leaf display.

[0092] In step S360, the new leaf model is rendered.

[0093] like Figure 8 As shown, Figure 8 FIG. 1 shows a rendering diagram of a new leaf model according to an embodiment of the present disclosure. Figure 4 Compared with the rendering schematic diagram of the initial leaf model in , the method according to the embodiment of the present disclosure can improve the rendering effect of the leaf model.

[0094] It should be noted that the method of the embodiments of the present disclosure can be performed by a single device, such as a computer or server. The method of the embodiments of the present disclosure can also be applied in a distributed scenario, where multiple devices cooperate to perform the method. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the multiple devices will interact with each other to complete the method.

[0095] It should be noted that the above description is limited to some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0096] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a model rendering device.

[0097] refer to Figure 9 , the model rendering device includes:

[0098] An acquisition module 910 is configured to acquire an initial leaf model, wherein a surface of the initial leaf model includes a plurality of vertices;

[0099] A pre-processing module 920 is configured to voxelize the initial leaf model based on voxelization parameters to obtain a voxelized model; and generate an enlarged model that accommodates the voxelized model.

[0100] A calculation module 930 is configured to calculate an intersection point between an extension line of a first normal vector of the vertex in the initial leaf model and the enlarged model, and a second normal vector of the intersection point;

[0101] An updating module 940 is configured to update the normal vectors of the vertices in the initial leaf model based on the second normal vector to obtain a new leaf model;

[0102] The rendering module 950 is used to render the new leaf model.

[0103] For the convenience of description, the above devices are described as being functionally divided into various modules. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0104] The device of the above embodiment is used to implement the corresponding model rendering method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0105] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the model rendering method described in any of the above embodiments.

[0106] The computer-readable media of this embodiment include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0107] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the model rendering method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0108] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Within the scope of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.

[0109] In addition, to simplify the description and discussion, and so as not to obscure the embodiments of the present disclosure, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, devices may be shown in the form of block diagrams to avoid obscuring the embodiments of the present disclosure, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure are to be implemented (i.e., these details should be fully within the purview of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that the embodiments of the present disclosure may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0110] Although the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those skilled in the art based on the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0111] The embodiments of the present disclosure are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.

Claims

1. A model rendering method, characterized in that: include: Acquire an initial leaf model, wherein a surface of the initial leaf model includes a plurality of vertices; Performing voxelization processing on the initial leaf model based on voxelization parameters set by a user to obtain a voxelized model; generating an enlarged model accommodating the voxelized model; wherein the surface of the enlarged model includes a plurality of polygons; Calculating an intersection point of an extension line of a first normal vector of the vertex in the initial leaf model and the enlarged model and a second normal vector of the intersection point, comprising: Calculating the coordinates of the intersection point and the target polygon where the intersection point is located based on the first normal vector and the coordinates of each vertex of the enlarged model; Determine, based on a ratio of the distances from the first vertex, the second vertex, and the third vertex of the target polygon to the intersection point to the sum of the distances, a first ratio, a second ratio, and a third ratio corresponding to the vertex normal vectors of the first vertex, the second vertex, and the third vertex, respectively; respectively calculating a first product of a first vertex normal vector of the first vertex and the first ratio, a second product of a second vertex normal vector of the second vertex and the second ratio, and a third product of a third vertex normal vector of the third vertex and the third ratio; Calculating the sum of the first product, the second product, and the third product to obtain the second normal vector; updating the normal vectors of the vertices in the initial leaf model based on the second normal vector to obtain a new leaf model; Rendering the new leaf model.

2. The method according to claim 1, characterized in that Determining, based on a ratio of the distances from the first vertex, the second vertex, and the third vertex of the target polygon to the intersection point to the sum of the distances, a first ratio, a second ratio, and a third ratio corresponding to the vertex normal vectors of the first vertex, the second vertex, and the third vertex, respectively, includes: Calculate, based on the coordinates of the intersection point and the coordinates of the first vertex, the second vertex, and the third vertex of the target polygon, a first distance, a second distance, and a third distance from the intersection point to the first vertex, the second vertex, and the third vertex, respectively; The sum of the first distance, the second distance, and the third distance, and the proportions of the first distance, the second distance, and the third distance in the sum are calculated to obtain a first proportion, a second proportion, and a third proportion.

3. The method according to claim 2, characterized in that Calculating a first normal vector of the vertex in the initial leaf model includes: Calculating the average coordinates of all vertices based on the coordinates of all vertices in the initial leaf model to obtain the coordinates of the geometric center point of the initial leaf model; Calculate the vector from the coordinates of the geometric center point to the coordinates of the vertex to obtain the first normal vector.

4. The method according to claim 2, characterized in that The voxelization parameters include subdivision granularity; wherein, the smaller the subdivision granularity, the greater the number of polygons.

5. The method according to claim 1, wherein Also includes: The voxelization parameter determined by a user is received, or an adjustment to the voxelized model made by a user is received, so as to adjust at least one of a shape, a scale, a size, a subdivision granularity, or a smoothness of the voxelized model.

6. The method according to claim 1, characterized in that Generating an enlarged model that accommodates the voxelized model includes: enlarging the voxelized model according to a first preset multiple to obtain the enlarged model.

7. The method according to claim 1, characterized in that The voxelization processing of the initial leaf model based on the voxelization parameters includes: Scaling down the initial leaf model by a second preset multiple to obtain a scaled-down model; The reduced model is voxelized based on the voxelization parameters to obtain a voxelized model.

8. The method according to claim 1, characterized in that The voxelization processing of the initial leaf model based on the voxelization parameters further includes: receiving an intermediate model generated by a user by splicing a plurality of preset models to surround the initial leaf model, wherein the preset model includes at least one three-dimensional shape; Merging the preset models in the intermediate model to connect the interior of the intermediate model to obtain a merged model; The merged model is voxelized based on the voxelization parameters.

9. A model rendering device, characterized in that: include: An acquisition module, configured to acquire an initial leaf model, wherein a surface of the initial leaf model includes a plurality of vertices; a pre-processing module, configured to voxelize the initial leaf model based on voxelization parameters set by a user to obtain a voxelized model; and generate an enlarged model accommodating the voxelized model; wherein the surface of the enlarged model includes a plurality of polygons; A calculation module, configured to calculate an intersection point of an extension line of a first normal vector of the vertex in the initial leaf model and the enlarged model and a second normal vector of the intersection point, comprising: Calculating the coordinates of the intersection point and the target polygon where the intersection point is located based on the first normal vector and the coordinates of each vertex of the enlarged model; Determine, based on a ratio of the distances from the first vertex, the second vertex, and the third vertex of the target polygon to the intersection point to the sum of the distances, a first ratio, a second ratio, and a third ratio corresponding to the vertex normal vectors of the first vertex, the second vertex, and the third vertex, respectively; respectively calculating a first product of a first vertex normal vector of the first vertex and the first ratio, a second product of a second vertex normal vector of the second vertex and the second ratio, and a third product of a third vertex normal vector of the third vertex and the third ratio; Calculating the sum of the first product, the second product, and the third product to obtain the second normal vector; An updating module, configured to update the normal vectors of the vertices in the initial leaf model based on the second normal vector to obtain a new leaf model; A rendering module is used to render the new leaf model.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 8 when executing the program. 11 . A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are configured to cause a computer to execute the method according to claim 1 .

12. A computer program product comprising computer program instructions, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Target virtual model construction method and device, electronic equipment and storage medium

    CN112755523A

  • Virtual plant display method and device, equipment and storage medium

    CN112950753A