Vegetation image processing method, device and electronic equipment
By obtaining and baking resource data of vegetation models and configuring layered material information in the rendering engine, the problem of large-scale vegetation LOD production in the existing technology cannot interact, and good image effects and animation effects in interactive scenarios are achieved.
Patent Information
- Application Number
- CN202111583888.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2041-12-22
AI Technical Summary
The existing LOD production methods of large-scale vegetation cannot be interacted with, which affects the image effect of vegetation in interactive scenes.
By obtaining resource data of the vegetation model, passing it into three-dimensional computer graphics software tools for baking, obtaining map information, and configuring layered material information in the rendering engine, so that the vegetation model can be imported into the multi-detail level hierarchy.
It realizes good image effects of the vegetation model in interactive scenes, can interact with the wind field, and ensures the animation effect of large vegetation in the wind field.
Smart Images

Figure CN114255312B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image information processing, and in particular to a method, device and electronic device for processing vegetation images. Background Art
[0002] With the development of Internet technology, more and more games have emerged, and the types of games have also become diverse. Users can not only kill time by playing games, but also learn historical knowledge through some games with strong historical backgrounds, making games accepted by more and more users.
[0003] Sometimes it is necessary to draw various large vegetation models during game development. Currently, the 3D modeling optimization technology Billboard and Imposter are used to solve the problem of multi-level of detail (LOD) production of large vegetation such as trees. However, this method cannot be interactive, which will affect the image effect of vegetation in interactive scenes. For example, it cannot interact with wind farms, which will affect the animation effect of vegetation wind farms. Summary of the invention
[0004] In view of this, the present application provides a vegetation image processing method, device and electronic device, the main purpose of which is to improve the current large-scale vegetation LOD production method, which is unable to interact and affects the technical problem of the image effect of vegetation in interactive scenes.
[0005] According to one aspect of the present application, a method for processing a vegetation image is provided, the method comprising:
[0006] Get resource data for vegetation model;
[0007] The resource data is transferred into a three-dimensional computer graphics software tool for baking to obtain the texture information of the vegetation model;
[0008] The mapping information is configured with corresponding layered material information in a rendering engine, so that the vegetation model is imported into a multi-level detail level corresponding to the resource data.
[0009] According to another aspect of the present application, a vegetation image processing device is provided, the device comprising:
[0010] An acquisition unit, used for acquiring resource data of a vegetation model;
[0011] A baking unit, used for transferring the resource data into a three-dimensional computer graphics software tool for baking to obtain texture information of the vegetation model;
[0012] A configuration unit is used to configure the corresponding layered material information of the map information in the rendering engine, so that the vegetation model is imported into the level of multiple levels of detail corresponding to the resource data.
[0013] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned vegetation image processing method is implemented.
[0014] According to another aspect of the present application, an electronic device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned vegetation image processing method when executing the computer program.
[0015] By means of the above technical scheme, the present application provides a vegetation image processing method, device and electronic device. Compared with the currently existing large-scale vegetation LOD production method, the present application is equivalent to providing a new large-scale vegetation LOD production solution. Specifically, the resource data of the vegetation model can be first obtained, and then the resource data of the vegetation model can be transferred into the three-dimensional computer graphics software tool for baking to obtain the texture information of the vegetation model; finally, the texture information is configured with the corresponding layered material information in the rendering engine, so that the vegetation model is imported into the LOD level corresponding to the resource data. By applying the large-scale vegetation LOD production method proposed in this application, interaction can be achieved while producing better results, which can improve the image effect of vegetation in interactive scenes. For example, interaction with the wind farm can be achieved, thereby ensuring the animation effect of large vegetation in the wind farm.
[0016] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 A schematic diagram showing a process flow of a vegetation image processing method provided in an embodiment of the present application is shown;
[0019] Figure 2 A schematic flow chart of another vegetation image processing method provided in an embodiment of the present application is shown;
[0020] Figure 3 A schematic diagram showing an example of setting a directional frequency provided in an embodiment of the present application is shown;
[0021] Figure 4 A schematic diagram showing the final effect obtained by using the solution for large-scale vegetation LOD production provided by an embodiment of the present application;
[0022] Figure 5 A schematic structural diagram of a vegetation image processing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0024] In order to improve the existing large-scale vegetation LOD production method, which cannot be interactive and affects the image effect of vegetation in interactive scenes, this embodiment provides a vegetation image processing method, such as Figure 1 As shown, the method includes:
[0025] Step 101: Obtain resource data of the vegetation model.
[0026] The vegetation model can be a large vegetation model, such as a tree model, and resource data of the tree model is obtained to facilitate subsequent understanding.
[0027] The execution subject of this embodiment can be a vegetation image processing device or equipment, which can be used for the production of multiple levels of detail (LOD) of large vegetation images. Among them, LOD technology refers to determining the resource allocation of object rendering based on the position and importance of the nodes of the object model in the display environment, reducing the number of faces and details of non-important objects, thereby obtaining efficient rendering operations.
[0028] Step 102: The resource data of the vegetation model is transferred into a three-dimensional computer graphics software tool for baking to obtain the texture information of the vegetation model.
[0029] Optionally, the 3D computer graphics software tool may be a data asset module of a movie special effects magician (Houdini) tool or other 3D modeling tools.
[0030] The Houdini Digital Asset (HDA) module of the Houdini tool can package Houdini's nodes into a node plug-in, which can be used by itself and other third-party digital content creation (DCC) software and engines.
[0031] For example, select the corresponding tree resource in the rendering engine, use the tree resource as input, and pass it into the corresponding Houdini tool's data asset module for baking. After baking is completed, the Houdini tool will automatically send the result back to the rendering engine.
[0032] Step 103: In the rendering engine, the texture information of the vegetation model is configured with corresponding layered material information, so that the vegetation model is imported into the multi-level detail level corresponding to the resource data.
[0033] For example, in the rendering engine, you can assign the map to the corresponding material, and the model will be automatically imported into the LOD level corresponding to the original resource.
[0034] By applying the large vegetation LOD production method proposed in this embodiment, interaction can be achieved while producing better effects. For example, in order to achieve interaction with a wind farm, the motion parameters (material parameters) of large vegetation in the wind farm can be configured, and the wind farm model data of the large vegetation after the material parameters are configured can be rendered to obtain dynamic image information of the large vegetation in the wind farm.
[0035] Compared with the currently existing large-scale vegetation LOD production method, this embodiment is equivalent to providing a new large-scale vegetation LOD production solution. Specifically, the resource data of the vegetation model can be first obtained, and then the resource data of the vegetation model can be transferred into the three-dimensional computer graphics software tool for baking to obtain the texture information of the vegetation model; finally, the texture information is configured with the corresponding layered material information in the rendering engine, so that the vegetation model is imported into the LOD level corresponding to the resource data. By applying the large-scale vegetation LOD production method proposed in this embodiment, interaction can be achieved while producing better results, and the image effect of vegetation in interactive scenes can be improved. For example, interaction with the wind farm can be achieved, thereby ensuring the animation effect of large vegetation in the wind farm.
[0036] The main implementation parts of the method of this embodiment are concentrated in the three-dimensional computer graphics software tool part. Further, as a refinement and extension of the specific implementation methods of the above embodiment, in order to illustrate the process of baking the texture information of the vegetation model in the three-dimensional computer graphics software tool, another vegetation image processing method is provided, such as Figure 2 As shown, the method includes:
[0037] Step 201: Obtain resource data of the vegetation model.
[0038] Step 202: The resource data of the vegetation model is transferred to a three-dimensional computer graphics software tool to compare all angles around the vegetation model. If the ratio of the area of the model piece at the target angle to the area of the total model pieces is the largest, the information of all model pieces visible at the target angle is recorded, and the recorded model pieces are removed. The comparison process is repeated until all model pieces have been selected.
[0039] The target angle can be a certain angle among all angles. For example, taking the vegetation model as a tree model, all angles around the tree model are compared. If an angle is found, and the ratio of the model piece at this angle to the area of the total model piece is the largest, then take a photo of the model at this angle, that is, record the information of all triangular patches (model pieces) visible at this angle, and then remove these captured triangular patches. Then compare all angles around the tree model again... and so on, repeat this comparison step until all triangular patches are selected and end.
[0040] Optionally, step 202 may specifically perform the following process:
[0041] (1) First, a directional distribution is selected, and a set of projection planes are generated equidistantly in each direction of the vegetation model, where each projection plane has a preset width range around it, and the leaf triangular facets within the preset width range are projected onto the plane.
[0042] Select the directional distribution, including: Select Geodesic Sphere Distribution, only a hemisphere is needed, so that based on the symmetry of the sphere, the projection results at the same angle are the same. This method can improve the processing efficiency, and thus improve the efficiency of baking the map.
[0043] (2) Then select the target projection plane with the largest ratio of the leaf coverage area to the total area of all unselected leaves, and mark all the leaves on the target projection plane.
[0044] (3) Repeat the above process (1) and (2) until all leaves are marked by the projection plane.
[0045] For example, after selecting the directional distribution, a set of projection planes can be generated equidistantly in each direction. There is a range of Epsilon width around each plane, and the leaf triangles within this range will be projected onto the plane. Do this operation for all planes in each direction, and then select the projection plane with the largest ratio of the leaf coverage area to the total area of all unselected leaves. Mark all these leaves on this projection plane, and then perform the above operation again. Note that the marked leaves do not need to be deleted, otherwise holes will be created on other projection planes, affecting the effect. Loop until all leaves are captured by the plane.
[0046] Step 203: Bake the texture information of the vegetation model according to the recorded information of the model piece.
[0047] Optionally, step 203 may specifically include: UV unfolding all projection planes using a UV split tool, then exporting the base color and normal map of the original leaves, and pasting them on the leaves of the corresponding projection planes, and adding corresponding parameter information to obtain the mapping information of the vegetation model.
[0048] Furthermore, all the projection planes are UV unfolded using a UV splitting tool, and then the base color and normal map of the original leaves are exported and pasted on the leaves of the corresponding projection planes. Specifically, the basic material is configured in a three-dimensional computer graphics software tool as the color of the leaves of the projection plane.
[0049] For example, use the UVlayout node (UV splitting tool) to UV unfold all the projection planes, then export the base color and normal map of the original leaves, and paste them on the leaves of the corresponding projection planes. Write a simple basic material in the Houdini tool as the color of the leaves of these projection planes, so that these maps can be rendered. Bake the generated map, and then paste it back to the corresponding position of the plane.
[0050] To illustrate the specific implementation process, optionally, all projection planes are UV unfolded using a UV split tool, and then the base color and normal map of the original leaf are exported and pasted on the leaf of the corresponding projection plane, specifically including: first, the model is reduced in surface area, and the reduced surface is recorded as the main projection plane; then, based on the main projection plane, the area of the projection plane corresponding to each leaf is determined; based on the projection plane with the largest area corresponding to each leaf, the projection plane is rotated to the midpoint at the position where the tangent and the preset point coincide, and then the UV split tool is used for UV unfolding, and the camera tool is used to bake the map; finally, all UV coordinates are projected onto the projection plane, and then the projection plane is rotated back to the position corresponding to the vegetation.
[0051] In order not to affect the plane of the overall effect and further save resources, optionally, based on the projection plane with the largest projection plane area corresponding to each blade, the projection plane is rotated to the midpoint at the position where the tangent and the preset point coincide, and then the UV split tool is used to perform UV unfolding, and before the camera tool is used to bake the map, it can also include: eliminating the projection plane with an area smaller than a preset threshold (which can be pre-set according to actual needs).
[0052] For example, you can perform the following steps:
[0053] (a) Import the model and reduce the surface, then record the reduced surface as the main projection plane. These projection planes are all local optimal.
[0054] (b) Each leaf then calculates which projection plane has the largest area. The purpose here is to prevent some leaves from being captured by the local maximum slice during the first projection, thereby forming a large hole around the first few leaves. At the same time, because the leaves move to the plane, sampling is actually done in essence, resulting in some leaves that could have been seen from multiple angles, but because they are taken away, from some angles, there will be a hole where there should be leaves, resulting in a visual effect of fewer leaves overall. Therefore, repeated rendering of leaves is adopted here.
[0055] (c) Then remove the projection planes with extremely small areas. This step is to remove the planes that have a very small proportion and do not affect the overall effect in the end, further saving resources.
[0056] (d) Rotate the projection plane to the midpoint at the position where the tangent coincides with the preset point (0, 1, 0), then unfold it using the UVlayout node, and bake the texture using the camera tool cam1 node (the camera when rendering the insert texture).
[0057] (e) Project all UV coordinates onto the projection plane, rotate the projection plane back to the position of the corresponding tree, add PE Houdini parameters (parameter information), and output the mapping information of the vegetation model.
[0058] Add corresponding parameter information (PEHoudini parameters) including at least: directional frequency, plane density, trunk retention percentage, slice mode, maximum number of planes, level of multiple details (LOD level), one or more parameters in the rendering map mode. In addition, other parameter information can be included according to actual needs.
[0059] For example, the parameter information may include the following parameters:
[0060] Input Object: Input Mesh.
[0061] Leaf Material Name: Separate leaves from other parts of the tree by their material name.
[0062] Leaf Material: The material of the leaves.
[0063] Favor Vertical Direction: If checked, only slices perpendicular to the ground are generated. Direction Frequency will become Horizontal Direction.
[0064] Horizontal Direction: It is the number of vertices on a circle, used for vertical distribution, and can generally be set to around 15.
[0065] Direction Frequency: Figure 3 The frequency is defined as (b, c), and the direction density is defined as density = b + c. So basically, setting the direction density to 1 or 2 is enough, and the current maximum value can be defined as 5.
[0066] Fixed Spacing: This is used to control the method of calculating the number of planes. If checked, the distance between planes is a fixed value, and the number of planes is the quotient of the distance between the farthest and closest points of the bounding box intersection in this direction and the plane spacing. If unchecked, the number of planes in the same direction is controlled by the plane density.
[0067] Generally speaking, if the aspect ratio is close to 1:1:1, just uncheck this option. If you have a rectangular tree like a pine tree, you can use Fixed Spacing to manually control the plane distance.
[0068] Plane Density: The number of slices in one direction. The larger the density, the smaller the spacing between planes. Conversely, the larger the density, the larger the spacing.
[0069] Plane Spacing: The distance between the selected areas of the slices. The larger the distance, the more content is contained between each slice, but the more errors are likely to occur. Generally, this value is set to about 5% of the length of the tree bounding box. For example, if the length, width and height of a tree are about 1400, then a Plane Spacing of 35 to 70 is more appropriate. Of course, the value of each tree may require repeated attempts to get the best result.
[0070] Branch Percentage to Keep: The percentage of the branch to keep.
[0071] Max plane output: Slice mode, the remaining leaves will be forced to be output to the first selected N slices.
[0072] Max plane count: Select the maximum number of slices to output.
[0073] LODLevel: Select the LOD level of the original StaticMesh to be imported. In model mode, it will automatically be imported into the corresponding LOD level of the original model. If it is -1 or 0, it will not automatically enter the original model LOD level.
[0074] Render Texture: Check this box to enter the render texture mode.
[0075] Texture Resolution: Texture resolution.
[0076] Original image path (BaseMap Path): BaseMap path, which can support the original image.
[0077] Opacity Map: By default, the Alpha value of BaseMap is used as Opacity. Check Opacity Map to allow the incoming map to be used as Opacity.
[0078] Opacity Map Path: The path of the OpacityMap, which also supports the original image.
[0079] Output Picture Path: Currently supports PNG format and needs to have a PNG suffix.
[0080] Render to Disk: Click to save the texture to the hard disk.
[0081] Step 204: In the rendering engine, the texture information of the vegetation model is configured with corresponding layered material information, so that the vegetation model is imported into the multi-level detail level corresponding to the resource data.
[0082] For example, after importing the above generated model and texture resources into the rendering engine, create the corresponding material in the rendering engine. This varies depending on the original material of the project team. However, you only need to connect the generated normal and base color maps to the corresponding inputs. The final result can be as follows Figure 4 shown.
[0083] Compared with the existing large-scale vegetation LOD production method, this embodiment is equivalent to providing a new large-scale vegetation LOD production solution. Combining the advantages of multiple surface reduction methods, a solution that can both interact and reduce surfaces is generated. By applying the large-scale vegetation LOD production method proposed in this embodiment, interaction can be achieved while producing better effects, and the image effect of vegetation in interactive scenes can be improved. For example, interaction with the wind farm can be achieved, thereby ensuring the animation effect of large vegetation in the wind farm.
[0084] Further, as Figure 1 and Figure 2 The specific implementation of the method shown in the embodiment provides a vegetation image processing device, such as Figure 5 As shown, the device includes: an acquisition unit 31, a baking unit 32, and a configuration unit 33.
[0085] An acquisition unit 31 is used to acquire resource data of a vegetation model;
[0086] A baking unit 32, used for transferring the resource data into a three-dimensional computer graphics software tool for baking to obtain the texture information of the vegetation model;
[0087] The configuration unit 33 is used to configure the corresponding layered material information of the map information in the rendering engine, so that the vegetation model is imported into the LOD level corresponding to the resource data.
[0088] In a specific application scenario, the baking unit 32 is specifically used to compare all angles around the vegetation model. If the ratio of the area of the model piece at the target angle to the area of the total model pieces is the largest, then the information of all model pieces visible at the target angle is recorded, and the recorded model pieces are removed. The comparison process is repeated until all model pieces have been selected; the mapping information is baked based on the recorded information of the model pieces.
[0089] In a specific application scenario, the baking unit 32 is further used to select a directional distribution, generate a set of projection planes equidistantly in each direction of the vegetation model, wherein each projection plane has a preset width range around it, and the leaf triangular facets within the preset width range are projected onto the plane; select a target projection plane with the largest ratio of the leaf coverage area to the total area of all unselected leaves, and mark all the leaves on the target projection plane;
[0090] Repeat the above process until all leaves are marked by the projection plane.
[0091] In a specific application scenario, the baking unit 32 is further configured to select a geodesic sphere distribution so that, based on the symmetry of the sphere, the projection results at the same angle are the same.
[0092] In a specific application scenario, the baking unit 32 is specifically used to UV unfold all projection planes using a UV splitting tool, then export the base color and normal map of the original leaves, and paste them on the leaves of the corresponding projection planes, and add corresponding parameter information to obtain the mapping information.
[0093] In a specific application scenario, the baking unit 32 is specifically used to reduce the surface of the model and record the reduced surface as a main projection plane; based on the main projection plane, the area of the projection plane corresponding to each leaf is determined; based on the projection plane with the largest projection plane area corresponding to each leaf, the projection plane is rotated to the midpoint at the position where the tangent and the preset point coincide, and then the UV split tool is used to perform UV unfolding, and the camera tool is used to bake the map; the UV coordinates are projected onto the projection plane, and then the projection plane is rotated back to the position corresponding to the vegetation.
[0094] In a specific application scenario, the baking unit 32 is further used to rotate the projection plane to the midpoint at the position where the tangent and the preset point coincide based on the projection plane with the largest area corresponding to each blade, and then use the UV splitting tool to perform UV unfolding, and before using the camera tool to bake the map, eliminate the projection plane with an area smaller than a preset threshold.
[0095] In a specific application scenario, the baking unit 32 is further used to configure the basic material in a three-dimensional computer graphics software tool as the color of the leaves on the projection plane.
[0096] In a specific application scenario, optionally, the parameter information includes at least one or more parameters of: directional frequency, plane density, trunk retention percentage, slicing mode, maximum number of planes, LOD level, and rendering mapping mode.
[0097] It should be noted that for other corresponding descriptions of the functional units involved in the vegetation image processing device provided in this embodiment, reference can be made to Figure 1 and Figure 2 The corresponding description in will not be repeated here.
[0098] Based on the above Figure 1 and Figure 2 The method shown in the embodiment also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figure 1 and Figure 2 The processing method of the vegetation image shown.
[0099] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.
[0100] Based on the above Figure 1 and Figure 2 The method shown, and Figure 5 In order to achieve the above-mentioned purpose, the embodiment of the present application also provides an electronic device, which can be a personal computer, a laptop computer, a smart phone, a server or other network device, etc. The device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 and Figure 2 The processing method of the vegetation image is shown.
[0101] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0102] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.
[0103] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.
[0104] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware platforms, or by hardware. By applying the solution of this embodiment, compared with the existing large-scale vegetation LOD production method, this embodiment is equivalent to providing a new solution for large-scale vegetation LOD production. Combining the advantages of multiple surface reduction methods, a solution that can both interact and reduce surfaces is generated. Specifically, the resource data of the vegetation model can be first obtained, and then the resource data of the vegetation model is passed into the three-dimensional computer graphics software tool for baking to obtain the texture information of the vegetation model; finally, the texture information is configured with the corresponding layered material information in the rendering engine, so that the vegetation model is imported into the LOD level corresponding to the resource data. By applying the large-scale vegetation LOD production method proposed in this embodiment, interaction can be achieved while producing better results, and the image effect of vegetation in interactive scenes can be improved. For example, interaction with the wind farm can be achieved, thereby ensuring the animation effect of large vegetation in the wind farm.
[0105] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0106] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.
Claims
1. A vegetation image processing method, characterized in that: include: Get resource data for vegetation model; The resource data is transferred into a three-dimensional computer graphics software tool for baking to obtain the texture information of the vegetation model, including: comparing all angles around the vegetation model, if the ratio of the model piece at the target angle to the area of the total model pieces is the largest, then recording the information of all model pieces visible at the target angle, and removing the recorded model pieces, repeating this comparison process until all model pieces have been selected and ending; baking the texture information according to the recorded model piece information; The mapping information is configured with corresponding layered material information in a rendering engine, so that the vegetation model is imported into a multi-level detail level corresponding to the resource data.
2. The method according to claim 1, characterized in that The comparison is performed at all angles around the vegetation model. If the ratio of the area of the model piece at the target angle to the area of the total model pieces is the largest, the information of all model pieces visible at the target angle is recorded, and the recorded model pieces are removed. The comparison process is repeated until all model pieces have been selected, and the process ends. Specifically, it includes: Selecting a directional distribution, generating a set of projection planes equidistantly in each direction of the vegetation model, wherein each projection plane has a preset width range around it, and leaf triangular facets within the preset width range are projected onto the plane; Selecting a target projection plane with the largest ratio of the leaf coverage area to the total area of all unselected leaves, and marking all leaves on the target projection plane; Repeat the above process until all leaves are marked by the projection plane.
3. The method according to claim 2, characterized in that The selection direction distribution specifically includes: The geodesic spherical distribution is chosen so that projections at the same angle give the same result, based on the symmetry of the sphere.
4. The method according to claim 2, characterized in that: The step of baking the texture information according to the recorded information of the model piece specifically includes: All projection planes are UV unfolded using a UV split tool, and then the base color and normal map of the original leaves are exported and pasted on the leaves of the corresponding projection planes, and corresponding parameter information is added to obtain the mapping information.
5. The method according to claim 4, characterized in that The method of UV unwrapping all the projection planes using the UV splitting tool, then exporting the base color and normal map of the original leaves, and pasting them on the leaves of the corresponding projection planes specifically includes: Reduce the surface of the model and record the reduced surface as the main projection plane; According to the main projection plane, determining the area of the projection plane corresponding to each leaf; Based on the projection plane with the largest projection plane area corresponding to each leaf, rotate the projection plane to the midpoint at the position where the tangent and the preset point coincide, then use the UV split tool to perform UV unfolding, and use the camera tool to bake the map; Project all UV coordinates onto the projection plane, and then rotate the projection plane back to the position corresponding to the vegetation.
6. The method according to claim 5, characterized in that Based on the projection plane with the largest projection plane area corresponding to each blade, the projection plane is rotated to the midpoint at the position where the tangent and the preset point coincide, and then UV unwrapping is performed using a UV splitting tool, and before the map is baked using a camera tool, the method further includes: Eliminate projection planes whose area is smaller than the preset threshold.
7. The method according to claim 4, characterized in that The method of UV unwrapping all the projection planes using the UV splitting tool, then exporting the base color and normal map of the original leaves, and pasting them on the leaves of the corresponding projection planes, specifically includes: The color of the blades is used as the projection plane by configuring the base material in a 3D computer graphics software tool.
8. The method according to claim 4, characterized in that The parameter information includes at least one or more parameters of: directional frequency, plane density, trunk retention percentage, slice mode, maximum number of planes, level of multiple detail levels, and rendering map mode.
9. The method according to any one of claims 1 to 8, characterized in that The three-dimensional computer graphics software tool is a data asset module of the Houdini tool.
10. A vegetation image processing device, characterized in that: include: An acquisition unit, used for acquiring resource data of a vegetation model; A baking unit, used for transferring the resource data into a three-dimensional computer graphics software tool for baking to obtain texture information of the vegetation model; A configuration unit, configured to configure the corresponding layered material information of the texture information in a rendering engine, so that the vegetation model is imported into the level of multiple levels of detail corresponding to the resource data; The baking unit is specifically used to: compare all angles around the vegetation model, if the ratio of the model piece at the target angle to the area of the total model pieces is the largest, then record the information of all model pieces visible at the target angle, remove the recorded model pieces, repeat this comparison process until all model pieces have been selected; and bake the map information according to the recorded model piece information.
11. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
12. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
A shader-based virtual simulation system and method for representing meteorological changes in real time
CN109377541A
Three-dimensional model baking method and system based on urban brain space-time construction component
CN113822988A