Virtual object generation method, virtual vegetation generation method, and computing device
By receiving object configuration information and terrain configuration information, the target point cloud data is generated based on the reference object resources. This solves the problem of overly uniform virtual vegetation objects and achieves adaptation between virtual objects and terrain, as well as improved realism.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHUHAI SEASUN MOBILE GAME TECH CO LTD
- Filing Date
- 2026-03-19
- Publication Date
- 2026-06-19
AI Technical Summary
The virtual vegetation objects generated in existing technologies are too uniform or mechanically repetitive in virtual scenes, making it difficult to reflect the irregularity and randomness of the real natural environment, thus affecting the user's immersive experience.
By receiving the object configuration information and terrain configuration information of the target virtual object, the reference object resources are determined according to the preset configuration relationship, and target point cloud data is generated to adapt to the terrain and improve the realism of the virtual object.
The generated virtual objects can adapt to different terrains, improving the realism of the virtual scene and the user's immersive experience.
Smart Images

Figure CN122244391A_ABST
Abstract
Description
Technical Field
[0001] This manual relates to the fields of digital cultural and creative activities and computer technology, and in particular to methods for generating virtual objects, methods for generating virtual vegetation, and computing devices. Background Technology
[0002] In practical applications, in order to enhance the user's immersive experience in virtual scenes, a large number of virtual objects can usually be generated in the virtual scene to improve the realism of the virtual scene. For example, in a game virtual scene, a large number of virtual vegetation objects can be generated to improve the realism of the game virtual scene.
[0003] Currently, when generating virtual vegetation objects, these objects are typically not manually placed one by one in a virtual scene. Instead, a large number of vegetation instances are generated through procedural rules. These rules can include factors such as slope, altitude, and soil type within the virtual scene. However, the large number of vegetation instances generated through procedural rules often results in overly uniform or mechanically repetitive vegetation instances, failing to reflect the irregularity and randomness of vegetation growth in real natural environments. This affects the realism of the virtual scene and further impacts the user's immersive experience. Therefore, an effective technical solution is urgently needed to address these issues. Summary of the Invention
[0004] In view of this, embodiments of this specification provide a method for generating virtual objects. This specification also relates to a virtual object generation apparatus, a virtual vegetation generation method, a virtual vegetation generation apparatus, a computing device, a computer-readable storage medium, and a computer program product, to solve the aforementioned problems existing in the prior art.
[0005] According to a first aspect of the embodiments of this specification, a method for generating virtual objects is provided, comprising: Receive object configuration information and terrain configuration information corresponding to the target virtual object, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual object; Based on the preset configuration relationship between candidate terrain and candidate object resources, the reference object resources corresponding to the terrain configuration information are determined; Based on the terrain configuration information, the object configuration information, and the reference object resources, target point cloud data corresponding to the target virtual object is generated, wherein the target point cloud data is used to generate the target virtual object.
[0006] According to a second aspect of the embodiments of this specification, a virtual object generation apparatus is provided, comprising: The first receiving module is configured to receive object configuration information and terrain configuration information corresponding to the target virtual object, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual object; The first determining module is configured to determine the reference object resource corresponding to the terrain configuration information based on the preset configuration relationship between the candidate terrain and the candidate object resource. The first generation module is configured to generate target point cloud data corresponding to the target virtual object based on the terrain configuration information, the object configuration information, and the reference object resource, wherein the target point cloud data is used to generate the target virtual object.
[0007] According to a third aspect of the embodiments of this specification, a method for generating virtual vegetation is provided, comprising: Receive vegetation configuration information and terrain configuration information corresponding to the target virtual vegetation, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual vegetation; Based on the preset configuration relationship between candidate terrain and candidate vegetation resources, the reference vegetation resources corresponding to the terrain configuration information are determined; Based on the terrain configuration information, the vegetation configuration information, and the reference vegetation resources, target point cloud data corresponding to the target virtual vegetation is generated, wherein the target point cloud data is used to generate the target virtual vegetation.
[0008] According to a fourth aspect of the embodiments of this specification, a virtual vegetation generation device is provided, comprising: The second receiving module is configured to receive vegetation configuration information and terrain configuration information corresponding to the target virtual vegetation, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual vegetation. The second determining module is configured to determine the reference vegetation resources corresponding to the terrain configuration information based on the preset configuration relationship between the candidate terrain and the candidate vegetation resources. The second generation module is configured to generate target point cloud data corresponding to the target virtual vegetation based on the terrain configuration information, the vegetation configuration information, and the reference vegetation resources, wherein the target point cloud data is used to generate the target virtual vegetation.
[0009] According to a fifth aspect of the embodiments of this specification, another method for generating virtual objects is provided, including: The virtual scene construction end, in response to the object generation request for the target virtual object, obtains the object configuration information and terrain configuration information corresponding to the target virtual object and sends them to the object generation end; The object generation end receives the object configuration information and terrain configuration information, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual object; determines the reference object resource corresponding to the terrain configuration information according to the preset configuration relationship between candidate terrain and candidate object resources; generates target point cloud data corresponding to the target virtual object according to the terrain configuration information, the object configuration information and the reference object resource, and sends the target point cloud data to the virtual scene construction end, wherein the target point cloud data is used to generate the target virtual object; The virtual scene construction terminal generates the target virtual object based on the target point cloud data.
[0010] According to a sixth aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the above method.
[0011] According to a seventh aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0012] According to an eighth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0013] This specification provides a method for generating virtual objects, comprising: receiving object configuration information and terrain configuration information corresponding to a target virtual object, wherein the terrain configuration information is configuration information of a target virtual scene corresponding to the target virtual object; determining a reference object resource corresponding to the terrain configuration information based on a preset configuration relationship between candidate terrain and candidate object resources; and generating target point cloud data corresponding to the target virtual object based on the terrain configuration information, the object configuration information, and the reference object resource, wherein the target point cloud data is used to generate the target virtual object.
[0014] In the above method, in order to generate the target virtual object, object configuration information and terrain configuration information corresponding to the target virtual object can be received. Based on the preset configuration relationship between candidate terrain and candidate object resources, the reference object resource corresponding to the terrain configuration information is determined. Target point cloud data corresponding to the target virtual object is generated based on the terrain configuration information, object configuration information, and reference object resource, so that the target virtual object can be generated subsequently based on the target point cloud data. The influence of terrain configuration information is taken into account during the generation of the target virtual object, so that the generated target virtual object can adapt to the terrain, thereby reflecting the different forms of the target virtual object in different terrains, ensuring the authenticity of the generated target virtual object and the target virtual scene in which the target virtual object is located, and further enhancing the user's immersive experience of the target virtual scene containing the target virtual object. Attached Figure Description
[0015] Figure 1 This is a flowchart of a virtual object generation method provided in one embodiment of this specification; Figure 2 This is a schematic diagram illustrating the effect of generating a target virtual scene containing virtual vegetation based on terrain configuration information and object configuration information in a virtual object generation method provided in one embodiment of this specification. Figure 3 This is a schematic diagram of a custom mask in a virtual object generation method provided in one embodiment of this specification; Figure 4 This is a schematic diagram of clustered deletion based on target noise in a virtual object generation method provided in one embodiment of this specification; Figure 5 This is a schematic diagram of clustered deletion in a virtual object generation method provided in one embodiment of this specification; Figure 6 This is a schematic diagram illustrating the effect of clustered deletion in a virtual object generation method provided in one embodiment of this specification; Figure 7 This is a flowchart illustrating a virtual object generation method for vegetation generation provided in one embodiment of this specification. Figure 8 This is a flowchart illustrating the calculation of target point cloud data in a virtual object generation method provided in one embodiment of this specification. Figure 9 This is a flowchart illustrating the calculation of vegetation in special terrain in a virtual object generation method provided in one embodiment of this specification; Figure 10 This is a schematic diagram of the structure of a virtual object generation device provided in one embodiment of this specification; Figure 11 This is a flowchart illustrating a virtual vegetation generation method provided in one embodiment of this specification; Figure 12 This is a schematic diagram of the structure of a virtual vegetation generation device provided in one embodiment of this specification; Figure 13 This is a flowchart of another virtual object generation method provided in one embodiment of this specification; Figure 14 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0016] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0017] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0018] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0019] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0020] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0021] HDA: Houdini Digital Asset, is a programmatic reusable asset format in Houdini.
[0022] Houdini: Advanced procedural 3D animation and special effects software, widely used in film and television special effects (such as explosions, fluids, and fragmentation), game asset generation, and procedural environment construction.
[0023] Unity: A cross-platform real-time 3D engine primarily used for developing interactive applications such as games, virtual reality (VR), augmented reality (AR), architectural visualization, and industrial simulation.
[0024] UV: In 3D graphics, UV is a coordinate system used to map 2D textures onto the surface of a 3D model.
[0025] AR: Augmented Reality, refers to the technology of overlaying virtual information (images, text, 3D models) onto a real-world view using devices (such as mobile phones, AR glasses).
[0026] VR: Virtual Reality, refers to the technology that allows users to be fully immersed in a computer-generated 3D virtual environment through head-mounted displays (such as Meta Quest and HTC Vive).
[0027] RAW: Raw data / source file, refers to raw binary data that has not undergone any processing, compression, or formatting.
[0028] PNG: Portable Network Graphics, a bitmap image format.
[0029] JSON: JavaScript Object Notation, a lightweight data-interchange format that is text-based, easy for humans to read and write, and easy for machines to parse and generate.
[0030] OBJ: A 3D geometric model file format.
[0031] Prefab: In the Unity engine, a resource file stored on disk contains a complete copy of a GameObject and all its components, sub-objects, properties, and settings.
[0032] Fbx: A 3D exchange format.
[0033] GameObject: The base class for everything in a scene within the Unity engine.
[0034] Box: Basic geometry, the most basic cube model.
[0035] This specification provides a method for generating virtual objects, and also relates to a virtual object generation apparatus, a virtual vegetation generation method, a virtual vegetation generation apparatus, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.
[0036] The virtual object generation method provided in this specification can be used to create digital cultural products. In order to generate a target virtual object, object configuration information and terrain configuration information corresponding to the target virtual object can be received. Based on the preset configuration relationship between candidate terrain and candidate object resources, the reference object resource corresponding to the terrain configuration information can be determined. Target point cloud data corresponding to the target virtual object can be generated based on the terrain configuration information, object configuration information, and reference object resource, so that the target virtual object can be generated subsequently based on the target point cloud data, thereby realizing the generation of digital cultural products and further providing users with realistic and immersive digital cultural content services.
[0037] Figure 1 A flowchart of a virtual object generation method according to an embodiment of this specification is shown, which specifically includes the following steps: Step 102: Receive object configuration information and terrain configuration information corresponding to the target virtual object, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual object.
[0038] Specifically, the virtual object generation method provided in the embodiments of this specification can be applied to the field of virtual scenes, and can be used to generate virtual objects in virtual scenes. Virtual scenes can be, for example, game scenes, AR virtual scenes, VR virtual scenes, etc., and the embodiments of this specification do not limit this. This virtual object generation method can be applied to the object generation end.
[0039] In practical applications, the object generator can be Houdini.
[0040] In this context, the target virtual object can be understood as the virtual object to be generated in the target virtual scene. For example, the target virtual scene could be a grassland virtual scene in a game, and the target virtual object could be the virtual vegetation within that grassland virtual scene. Object configuration information can be understood as the configuration information of the target virtual object, and terrain configuration information can be understood as the configuration information of the target virtual scene. Object configuration information can be used to define the target virtual object's own attribute information, visual representation information, and physical behavior information. Object configuration information can include the target virtual object's geometric information, morphological parameters, and ecological rules. Geometric information can include the target virtual object's material, shader, bounding box, radius, and pivot point offset information. Morphological parameters can include the target virtual object's size variation range, rotational changes, morphological variants, and wind parameters. Ecological rules can include the target virtual object's suitable slope, suitable altitude, community density, and repulsion radius. Terrain configuration information can include geometric information of the target virtual object, mask and control layers, environmental field data, etc. Geometric information can include height data (used to determine the height of virtual vegetation), normal data (used to determine the initial orientation of virtual vegetation), UV coordinates, etc. Mask and control layers can be understood as grayscale images with the same resolution as the terrain, used to control vegetation distribution, and can include slope masks, elevation masks, noise / disturbance masks, and custom masks, etc. Environmental field data can include humidity / soil type maps, light / orientation maps, and wind fields, etc., which can be used for the procedural growth logic of virtual vegetation.
[0041] For ease of understanding, this specification uses virtual vegetation as an example to illustrate the embodiments, and this does not affect the application of the virtual object generation method provided in this specification to the generation of other virtual objects. When the target virtual object is virtual vegetation, the object configuration information can be used to define the attribute information, visual representation information, and physical behavior information of the target virtual vegetation, and the terrain configuration information can be used to describe the terrain environment information in which the target virtual vegetation grows. The terrain configuration information may include terrain texture information and landform type information, etc., and the object configuration information may include the vegetation type information and vegetation distribution information of the virtual vegetation, etc. The vegetation distribution information can be used to indicate which terrains have vegetation and which terrains do not have vegetation, etc.
[0042] Based on this, in order to generate the target virtual object, the object generation end can receive the object configuration information and terrain configuration information corresponding to the target virtual object.
[0043] Further, receiving the object configuration information and terrain configuration information corresponding to the target virtual object includes: The virtual scene construction terminal receives object configuration information and terrain configuration information corresponding to the target virtual object sent by the virtual scene construction terminal, wherein the virtual scene construction terminal obtains the object configuration information and terrain configuration information corresponding to the target virtual object in response to an object generation request for the target virtual object.
[0044] In practical applications, the virtual scene building platform can be understood as Unity. An object generation request can be understood as a request sent by the user through Unity to generate the target virtual object.
[0045] Specifically, users can click the object generation control in Unity and select or enter the corresponding configuration information. Unity responds to the user's click command, generates an object generation request for the target virtual object, and sends it to Houdini. This object generation request can carry the object configuration information and terrain configuration information selected by the user. After importing this object configuration information and terrain configuration information into Houdini, Houdini can generate the target virtual object based on this object configuration information and terrain configuration information.
[0046] In practical applications, this virtual object generation method can be used to generate virtual vegetation based on terrain texture layers. Users can select the corresponding texture layer and terrain type as terrain configuration information in Unity's tool panel to generate the corresponding virtual vegetation. For example, if the user selects green and black textures, the vegetation generation rules included in the object configuration information are: Rule 0: Generate vegetation of the "Green Squirrel" terrain on the terrain area corresponding to the green texture layer, excluding the areas above and below the selected 160 objects, and simultaneously generate vegetation of the "Green Pine Tree" terrain on the selected 28 cliff objects; Rule 1: Generate vegetation of "Dead Trees and Burnt Trees" on the terrain areas above and below the selected 16 objects and corresponding to the black texture layer. See also Figure 2 , Figure 2 The illustration shows the effect of generating a target virtual scene containing virtual vegetation based on terrain configuration information and object configuration information in a virtual object generation method provided according to an embodiment of this specification.
[0047] Furthermore, when Unity sends object configuration information and terrain configuration information to Houdini, since only some terrain layers need to participate in the calculation, specific formats can be used to transmit heightmaps and terrain texture blending maps when transmitting terrain data corresponding to the terrain configuration information. For example, heightmaps can be transmitted in RAW format, and terrain texture blending maps in PNG format. Each channel in the terrain texture blending map contains the weight information of a texture layer, and the terrain position, size, and channel correspondence between texture layers and terrain texture blending maps are stored in a custom JSON file. For model data, OBJ meshes + JSON can be exported as needed, removing redundant attribute information such as UVs / vertex colors, and it is applicable to any model with mesh components in the scene. Due to the complexity of objects in the scene, although Houdini's built-in export method can export all models uniformly, this method requires a lot of time to communicate with Houdini and does not perform special processing for identical models. By exporting model information using OBJ meshes + custom JSON format, it is applicable to any model with mesh components in the scene (including Prefabs, FBX GameObjects, Boxes, and other engine-built-in geometry, as well as HDA results), and saves time communicating with Houdini. Since the generated OBJ file only contains necessary information such as vertex positions and normals, the time for reading the model on the Houdini side has also been optimized.
[0048] In summary, by determining the terrain configuration information and object configuration information at the virtual scene construction end and importing them into the object generation end, the object generation end can generate target virtual objects based on the terrain configuration information and object configuration information, thereby improving generation efficiency.
[0049] Step 104: Determine the reference object resource corresponding to the terrain configuration information based on the preset configuration relationship between the candidate terrain and the candidate object resource.
[0050] Among them, candidate terrain can be understood as the terrain where the target virtual object to be generated is located, candidate object resources can be understood as object resources pre-made in the object generation end, and object resources can be HDA. The preset configuration relationship between candidate terrain and candidate object resources can be understood as the preset configuration table between the terrain and HDA. Reference object resources can be understood as the object resources corresponding to the target terrain corresponding to the terrain configuration information.
[0051] Specifically, the terrain configuration information can be used to determine the terrain features, and the reference object resources corresponding to the terrain features can be determined from the preset configuration relationship between the candidate terrain and the candidate object resources in the object generation end.
[0052] In practical applications, the vegetation generator in Houdini can be used to generate target virtual objects. After importing terrain configuration information and object configuration information into the vegetation generator in Houdini, the configuration table can be read, and vegetation points can be sprinkled on the terrain corresponding to the terrain configuration information. Prefabricated vegetation HDAs (i.e., reference object resources) can be dynamically generated in the vegetation generation sub-node of Houdini based on the configuration table, facilitating the subsequent generation of target point cloud data corresponding to the target virtual object based on this prefabricated vegetation HDA. In Houdini, the editable node function allows the prefabricated vegetation HDA to function normally even when it is locked.
[0053] Step 106: Generate target point cloud data corresponding to the target virtual object based on the terrain configuration information, the object configuration information, and the reference object resource, wherein the target point cloud data is used to generate the target virtual object.
[0054] In this context, target point cloud data can be understood as a collection of a large number of discrete points. Each point can carry spatial location information and additional attribute information. When the target virtual object is virtual vegetation, target point cloud data can be used to represent the distribution location of each plant in the virtual vegetation.
[0055] Specifically, target point cloud data corresponding to the target virtual object can be generated based on terrain configuration information, object configuration information, and reference object resources, so that the target virtual object can be generated subsequently based on the target point cloud data.
[0056] In specific implementation, generating target point cloud data corresponding to the target virtual object based on the terrain configuration information, the object configuration information, and the reference object resources includes: Based on the terrain configuration information and the object configuration information, a target object mask map corresponding to the target virtual object is generated; Based on the reference object resource, the target object masking image, and the object configuration information, generate the target object resource corresponding to the target virtual object; Based on the target object resources, generate target point cloud data corresponding to the target virtual object.
[0057] The target object mask map can be used to connect the terrain data and virtual object distribution rules of the target virtual scene. When the target virtual object is virtual vegetation, the target object mask map can be used to connect the terrain data and vegetation distribution rules. It can be used to indicate which locations in the target virtual scene can generate vegetation and how to generate vegetation. The mask map can use the brightness value of pixels to control the distribution probability or density of vegetation. For example, the white area in the mask map can be the allowed growth area. In this area, virtual vegetation can be generated normally or densely according to the set base density. The black area can be the prohibited growth area. In this area, no virtual vegetation will be generated at all. The gray area can be the transition area. In this area, the probability of virtual vegetation generation will be reduced, or the number of generation will be reduced, thereby creating a natural edge transition for virtual vegetation.
[0058] In practical applications, the target object resource corresponding to the target virtual object can be the HDA of the target virtual object.
[0059] Specifically, a target object mask map corresponding to the target virtual object can be generated based on terrain configuration information and object configuration information. Based on the target object mask map, reference object resources, and object configuration information, an HDA of the target virtual object can be generated. Based on the HDA, the calculation process of the HDA is run to generate a large number of vegetation instance points that conform to the rules, forming target point cloud data for generating the target virtual object. One vegetation instance point can represent the instantiation information of a plant or a cluster of vegetation.
[0060] In summary, by generating a target object mask map, a connection is established between the terrain of the target virtual scene and the distribution rules of the target virtual objects. This facilitates the subsequent generation of HDA of the target virtual objects and further calculation of the target point cloud data of the target virtual objects. This allows the target point cloud data to contain the spatial location and attribute information of vegetation instances, enabling the target virtual objects generated based on the target point cloud data to adapt to the terrain and further improve realism.
[0061] Further, generating the target object mask map corresponding to the target virtual object based on the terrain configuration information and the object configuration information includes: Based on the terrain configuration information and the object configuration information, an initial object mask map corresponding to the target virtual object is generated; The initial object masking image is masked to obtain the target object masking image corresponding to the target virtual object.
[0062] Specifically, based on terrain configuration information and object configuration information, an initial object masking map corresponding to the target virtual object can be generated. Custom masking processing and / or mask exclusion processing can be performed on the initial object masking map to obtain the target object masking map corresponding to the target virtual object.
[0063] In summary, by performing further masking processing on the initial object mask map after its generation—specifically by adding custom masks and exclusion masks—the distribution range of the target virtual objects can be further subdivided, ensuring the rationality of the hierarchical relationships and spatial distribution of the target virtual objects.
[0064] Further, generating the initial object mask map corresponding to the target virtual object based on the terrain configuration information and the object configuration information includes: Read the terrain data map from the terrain configuration information, and read the object generation rules from the object configuration information; The terrain data map and the object generation rules are matched to obtain a matching result, and an initial object mask map corresponding to the target virtual object is generated based on the matching result.
[0065] Among them, the object generation rule can be understood as the vegetation generation rule, which can be used to specify the distribution rules and distribution locations of the generated virtual vegetation.
[0066] Specifically, after reading the terrain data map from the terrain configuration information and the object generation rules from the object configuration information, the terrain data map and the object generation rules are matched to generate an initial object mask map. For example, the initial object mask map can indicate: blocking tree generation in steep areas, increasing grass density in low-lying areas, and reducing vegetation cover in rocky areas. The initial object mask map can distribute each vegetation type in the object configuration information onto the terrain data map according to the object generation rules.
[0067] In summary, by obtaining terrain data maps and object generation rules from terrain configuration information and object configuration information, the initial object mask map is generated, providing a foundation for the subsequent generation of target virtual objects and establishing a connection between terrain and virtual objects.
[0068] Further, the step of performing masking processing on the initial object masking image to obtain the target object masking image corresponding to the target virtual object includes: Add a custom mask to the initial object mask image, and / or add an exclusion mask to the initial object mask image; Obtain the target object mask image corresponding to the target virtual object.
[0069] Custom masks and exclusion masks can be used to finely control the generation area of the target virtual object. Custom masks and exclusion masks can be textures, and grayscale values are used to represent the degree to which generation is allowed or prohibited.
[0070] A custom mask can be understood as a manually defined mask image. Users can manually draw or import custom masks to cover or enhance the distribution rules of automatically generated target virtual objects. A grayscale value of 1 indicates that the generation of target virtual objects is allowed, while a grayscale value of 0 indicates that the generation of target virtual objects is prohibited. For example, if a user wants to plant a circle of reeds by a lake in a target virtual scene, but the terrain configuration information indicates that the lakeside is too wet to be suitable for planting, then the user can draw a custom mask to enable the generation of virtual vegetation of the reed type only in the lakeside area.
[0071] Exclusion masking can be understood as explicitly prohibiting the generation of target virtual objects. For example, if there is a house in the target virtual scene, to avoid generating virtual vegetation on the walls or roof, an exclusion mask can be generated for the area where the house is located. Then, when the target virtual object is generated subsequently, the area corresponding to the exclusion mask can be automatically skipped.
[0072] Specifically, you can add custom masks and / or exclude masks to the initial object mask map to obtain the target object mask map.
[0073] In practical applications, custom masks can include the top and bottom sides of the terrain, the portion above the terrain, the portion below the terrain, and the terrain boundary. Houdini's built-in mask generation node provides three mask generation options, which can be used to generate custom masks for the top and bottom sides of the terrain, the portion above the terrain, and the portion below the terrain. Custom masks at terrain boundaries are custom logic that can generate masks at the boundary between the target virtual object's model and the terrain. See [link to documentation]. Figure 3 , Figure 3 This diagram illustrates a custom mask in a virtual object generation method according to an embodiment of this specification, as shown below. Figure 3 As shown, if the radius of the custom mask at the terrain boundary is set to 0, the custom mask of the part of the terrain inside the model will be output.
[0074] Furthermore, when adding a custom mask, a mask can be generated at the intersection of the custom mask geometry and the terrain. For each pixel of the terrain, n rays are randomly emitted from its position. If a ray hits the geometry, it is determined whether the normal at the hit position is close to the ray direction; if so, the ray is considered a valid ray. If more than half of the n rays are valid rays, the pixel is considered to be inside the geometry. After obtaining the mask inside the geometry, it is aligned and expanded, then subtracted from the unexpanded mask to obtain the mask at the intersection of the geometry and the terrain, which is then used as the custom mask.
[0075] In summary, by customizing and excluding the initial object masking map, the automated generation of target virtual objects can maintain large-scale automation efficiency while allowing for adjustments to the generation details of target virtual objects according to user needs, thus facilitating the subsequent construction of high-quality virtual scenes.
[0076] Furthermore, the step of generating target point cloud data corresponding to the target virtual object based on the terrain configuration information, the object configuration information, and the reference object resource further includes: If, based on the terrain configuration information, it is determined that the target virtual scene includes the target terrain, and candidate object resources corresponding to the target terrain can be obtained, then the target point cloud data of the target virtual object on the target terrain is calculated based on the candidate object resources; or If, based on the terrain configuration information, it is determined that the target virtual scene includes the target terrain, but the candidate object resource corresponding to the target terrain cannot be obtained, the target terrain is mapped to obtain the terrain object resource corresponding to the target terrain, and the target point cloud data of the target virtual object on the target terrain is calculated based on the terrain object resource.
[0077] The target terrain can be understood as special terrain, or terrain that is difficult for the target virtual object to generate, such as cliff terrain.
[0078] Specifically, if the target virtual scene is determined to include the target terrain based on the terrain configuration information, and if the candidate object resources corresponding to the target terrain can be obtained, the target point cloud data of the target virtual object on the target terrain can be calculated based on the candidate object resources. If the candidate object resources corresponding to the target terrain cannot be obtained, the target terrain can be mapped to obtain the terrain object resources corresponding to the target terrain, and the target point cloud data of the target virtual object on the target terrain can be calculated based on the terrain object resources.
[0079] In practical applications, in Houdini, vegetation child nodes can be generated on the grid, and prefabricated vegetation HDAs can be dynamically generated based on terrain configuration information (i.e., configuration table). If a corresponding cliff vegetation HDA (i.e., candidate object resource) is found to exist, the cliff vegetation HDA can be directly called to calculate the vegetation and obtain the cliff vegetation result (i.e., target point cloud data). If a corresponding cliff vegetation HDA is found not to exist, the cliff can be mapped to the terrain, and the corresponding terrain vegetation HDA (i.e., terrain object resource) can be used to calculate the vegetation and obtain the cliff vegetation result.
[0080] Furthermore, when calculating the target point cloud data of the target virtual object on the target terrain, initial data (i.e., target point cloud data) can be initially calculated in Houdini. Then, the initial data is read in Unity, and raycasting is used to exclude target virtual objects with unreasonable positions. The target virtual object is generated from the excluded target point cloud data, avoiding the transmission of a large amount of scene model information to Houdini. By calculating the target point cloud data in Houdini and performing raycasting in Unity to calculate the cliff vegetation information, the amount of data that needs to be transmitted is reduced.
[0081] In summary, by processing the special terrain in the target virtual scene, and using the candidate object resources corresponding to the special terrain or the terrain object resources obtained after mapping the special terrain to realize the calculation of the target point cloud data, the generated target virtual object and the terrain are more adapted, further ensuring the realism of the target virtual object.
[0082] Furthermore, after generating the target point cloud data corresponding to the target virtual object based on the terrain configuration information, the object configuration information, and the reference object resource, the method further includes: The target point cloud data is reduced according to the preset reduction rules to obtain the reduced target point cloud data.
[0083] Among them, the preset deletion rules can be understood as the rules for cluster-based deletion of the target point cloud data.
[0084] Specifically, the target point cloud data can be reduced according to preset reduction rules to obtain the reduced target point cloud data, and then the target virtual object can be generated based on the reduced target point cloud data.
[0085] In specific implementation, the step of reducing the target point cloud data according to a preset reduction rule to obtain the reduced target point cloud data includes: According to the first preset reduction rule, the first reduction ratio corresponding to the target point cloud data is calculated; The target point cloud data is reduced according to the first reduction ratio to obtain the first target point cloud data; According to the second preset deletion rule, calculate the second deletion ratio corresponding to the first target point cloud data; According to the second reduction ratio, the first target point cloud data is reduced to obtain the second target point cloud data as the reduced target point cloud data. The resolution of the first target virtual object is higher than that of the second target virtual object. The first target virtual object is generated based on the first target point cloud data, and the second target virtual object is generated based on the second target point cloud data.
[0086] The first preset pruning rule can be understood as a rule that uses cluster pruning parameters and applies noise effects for pruning, while the second preset pruning rule can be understood as a custom merging and cluster pruning rule. The difference between the first target virtual object generated from the first target point cloud data pruned based on the first preset pruning rule and the second target virtual object generated from the second target point cloud data pruned based on the second preset pruning rule is that the resolution of the first target virtual object is higher than that of the second target virtual object.
[0087] Specifically, based on a first preset reduction rule, a first reduction ratio of the target point cloud data can be calculated, and the target point cloud data can be reduced according to the first reduction ratio to obtain the first target point cloud data. Based on a second preset reduction rule, a second reduction ratio of the first target point cloud data can be calculated, and the first target point cloud data can be reduced according to the second reduction ratio to obtain the second target point cloud data as the reduced target point cloud data.
[0088] Optionally, when reducing the target point cloud data, the reduction can be performed solely according to the first preset reduction rule to obtain the reduced target point cloud data. Alternatively, the reduction can be performed solely according to the second preset reduction rule to obtain the reduced target point cloud data. This specification does not limit the scope of this embodiment.
[0089] In summary, by reducing the target point cloud data according to the first and second preset reduction rules, target virtual objects of different image quality can be generated, thereby optimizing the quantity and types of objects and reducing runtime performance pressure.
[0090] Further, the step of calculating the first reduction ratio corresponding to the target point cloud data according to the first preset reduction rule includes: The target point cloud data is clustered to obtain multiple first point cloud data clusters; Calculate the first initial weight corresponding to each first point cloud data cluster, and process the first initial weight based on the target noise to obtain the first target weight corresponding to each first point cloud data cluster; Based on the first target weight corresponding to each first point cloud data cluster, the first reduction ratio corresponding to the target point cloud data is determined.
[0091] The target noise can be understood as noise used to interfere with the weight information. For example, the target noise can be Gaussian noise. The first reduction ratio can be understood as the ratio of points to be reduced in each first point cloud data cluster.
[0092] Specifically, the target point cloud data can be clustered to obtain multiple first point cloud data clusters. A first initial weight is calculated for each first point cloud data cluster, and noise is added to these initial weights based on target noise to obtain a first target weight for each first point cloud data cluster. Based on the first target weight for each first point cloud data cluster, a first reduction ratio for the target point cloud data is calculated. For example, the higher the first target weight, the smaller the reduction ratio for the first point cloud data cluster. Taking two first point cloud data clusters as an example, if the first target weight for first point cloud data cluster 1 is 40% and the first target weight for first point cloud data cluster 2 is 60%, then the calculated first reduction ratio could be 3:2.
[0093] In practical applications, the first target weight of each first point cloud data cluster can be normalized based on the sort node in Houdini, ensuring that the calculated first pruning ratio strictly conforms to the set cluster pruning parameters (i.e., global point scattering parameters). When calculating the first target weight, the first initial weight (i.e., coarse weight) can be calculated based on the cluster area and distance from the cluster center of the first point cloud data cluster. The first point cloud data clusters are then sorted according to the coarse weight, and target noise is added to obtain the first target weight for each first point cloud data cluster. See also... Figure 4 , Figure 5 and Figure 6 , Figure 4 The diagram illustrates cluster pruning based on target noise in a virtual object generation method according to an embodiment of this specification. Figure 5 The diagram illustrates cluster pruning in a virtual object generation method according to an embodiment of this specification. Figure 6 This diagram illustrates the effect of clustered deletion in a virtual object generation method according to an embodiment of this specification.
[0094] In summary, by performing clustered pruning on the target point cloud data based on target noise, the virtual target objects generated from the pruned target point cloud data appear more natural.
[0095] Further, the step of calculating the second reduction ratio corresponding to the first target point cloud data according to the second preset reduction rule includes: The first target point cloud data is clustered to obtain multiple second point cloud data clusters; Calculate the weight of the second objective corresponding to each second point cloud data cluster; Based on the second target weight corresponding to each second point cloud data cluster, the second reduction ratio corresponding to the first target point cloud data is determined.
[0096] Specifically, the first target point cloud data can be clustered to obtain multiple second point cloud data clusters. Based on the edge distance and cluster area of each second point cloud data cluster, the second target weight corresponding to each second point cloud data cluster is calculated. Based on the second target weight corresponding to each second point cloud data cluster, the second reduction ratio is calculated.
[0097] In practical applications, the pruning probability can be calculated using the distance between virtual vegetation and the cluster edge, as well as the cluster area, to achieve pruning while preserving vegetation distribution characteristics. When pruning the quantity of virtual vegetation, the target point cloud data corresponding to the virtual vegetation can be clustered to obtain multiple point cloud data clusters. For each point cloud data cluster, the edge distance d between the virtual vegetation and the edge of the point cloud data cluster and the cluster area a can be calculated. Based on d and a, the second target weight of the point cloud data cluster can be calculated.
[0098] Furthermore, for low-quality virtual vegetation, the types of virtual vegetation can be optimized, in addition to merging by size and variants based on naming conventions. For specific merging needs, there is a corresponding configuration table that enables custom merging methods. Based on the merging rules in the custom configuration table, virtual vegetation can be replaced at low quality. By merging different types of vegetation, the number of vegetation types can be reduced, thus reducing runtime data loading.
[0099] Furthermore, after generating the target point cloud data corresponding to the target virtual object based on the terrain configuration information, the object configuration information, and the reference object resource, the method further includes: The target point cloud data is sent to the virtual scene construction terminal so that the virtual scene construction terminal generates the target virtual object based on the target point cloud data.
[0100] Specifically, after generating the target point cloud data corresponding to the target virtual object at the object generation end, the target point cloud data can be sent to the virtual scene construction end, which can then generate the target virtual object based on the target point cloud data.
[0101] Furthermore, the virtual object generation method provided in the embodiments of this specification can function simultaneously as an independent tool and a PDG node. When used as an independent tool, it generates configuration data and a master configuration table, and generates virtual vegetation based on the PDG process results. When used as a PDG node, it updates the configuration data according to the master configuration table, and generates virtual vegetation based on the configuration data and the calculation results of upstream nodes.
[0102] In summary, the above method, in order to generate the target virtual object, can receive the object configuration information and terrain configuration information corresponding to the target virtual object, and determine the reference object resource corresponding to the terrain configuration information according to the preset configuration relationship between the candidate terrain and the candidate object resources. Then, it generates the target point cloud data corresponding to the target virtual object based on the terrain configuration information, object configuration information, and reference object resources, so that the target virtual object can be generated subsequently based on the target point cloud data. The influence of terrain configuration information is taken into account during the generation of the target virtual object, so that the generated target virtual object can adapt to the terrain, thereby reflecting the different forms of the target virtual object in different terrains, ensuring the authenticity of the generated target virtual object and the target virtual scene in which the target virtual object is located, and further enhancing the user's immersive experience of the target virtual scene containing the target virtual object.
[0103] The following is in conjunction with the appendix Figure 7 Taking the application of the virtual object generation method provided in this specification in vegetation generation as an example, the virtual object generation method will be further explained. Figure 7 The present specification illustrates a processing flowchart of a virtual object generation method for vegetation generation according to an embodiment of this specification, which specifically includes the following steps.
[0104] Start: Process initiated.
[0105] In Unity, users can trigger the vegetation generation process by clicking on a target in the Unity editor, and the system will begin preparing the relevant data.
[0106] Exporting Scene Information and Generating Configuration Tables: Unity exports key information about the current scene, such as terrain, topography, and lighting, and generates a vegetation generation configuration table (i.e., object configuration information) and a scene information table (i.e., terrain configuration information) for subsequent processing. This data includes environmental parameters required for vegetation distribution, such as height, slope, and occlusion.
[0107] Vegetation generation configuration table and scene information: This step is the data transfer stage, where the exported information is used as input and passed to Houdini for further processing.
[0108] Specifically, when Unity sends object configuration information and terrain configuration information to Houdini, since only some terrain layers need to participate in the calculation, specific formats can be used to transmit heightmaps and terrain texture blending maps when transmitting terrain data corresponding to the terrain configuration information. For example, heightmaps can be transmitted in RAW format, and terrain texture blending maps in PNG format. Each channel in the terrain texture blending map contains the weight information of a texture layer, and the terrain position, size, and channel correspondence between texture layers and terrain texture blending maps are stored in a custom JSON file. For model data, OBJ meshes + JSON can be exported as needed, removing redundant attribute information such as UVs / vertex colors, and it is applicable to any model with mesh components in the scene. Due to the complexity of objects in the scene, although Houdini's built-in export method can export all models uniformly, this method requires a lot of time to communicate with Houdini and does not provide special processing for identical models. By exporting model information using OBJ meshes + custom JSON format, it is applicable to any model with mesh components in the scene (including Prefabs, FBX GameObjects, Boxes, and other engine-built-in geometry, as well as HDA results), and saves time communicating with Houdini. Since the generated OBJ file only contains necessary information such as vertex positions and normals, the time for reading the model on the Houdini side has also been optimized.
[0109] Houdini Backend Calculations: Houdini receives configuration and scene information from Unity and performs complex calculations and simulations in the background. This stage includes terrain analysis, vegetation density calculation, and spatial distribution optimization.
[0110] Dynamically generated prefabricated HDAs: Based on the calculation results, Houdini dynamically generates vegetation prefabricated forms (HDAs) suitable for specific scenarios. These prefabricated forms encapsulate the vegetation generation logic and parameters, and can be flexibly adjusted and reused.
[0111] Creating pre-made HDA templates in Houdini: Design or adjust vegetation HDA templates in Houdini to support generation rules for different types of vegetation (such as trees, shrubs, and grasses).
[0112] Landform-HDA Configuration Table: Matches the HDAs defined in Houdini with specific landform features to form a landform-HDA configuration table (i.e., a preset configuration relationship), which is used to guide different regions on which vegetation types and generation strategies to use.
[0113] Calculating Vegetation Point Clouds: Combining the previous configuration and scene information, Houdini calculates vegetation point cloud data (i.e., target point cloud data) that matches the actual environment. These point clouds represent the position, orientation, size, and other attributes of each plant, forming the basis for subsequent rendering. Furthermore, after calculating the target point cloud data, cluster pruning can be performed to obtain the pruned target point cloud data.
[0114] Restoring to the Vegetation System: The calculated vegetation point cloud data is exported and imported into Unity's Vegetation System. This system is responsible for efficiently instantiating and rendering a large number of vegetation objects in Unity to achieve a realistic natural landscape. The vegetation generation process is complete, and vegetation that matches the environmental characteristics has been successfully arranged in the scene.
[0115] See Figure 8 , Figure 8 The diagram illustrates a flowchart of the calculation process for target point cloud data in a virtual object generation method according to an embodiment of this specification, specifically including the following steps.
[0116] Start: The process begins, entering the vegetation generation stage.
[0117] Terrain Input: First, load or acquire terrain data (such as height maps, normal maps, slope maps, etc.) for the target area. This is the basis for all subsequent vegetation distribution decisions. This terrain data can be obtained from the terrain configuration information.
[0118] Vegetation generation configuration table: Provides a predefined vegetation generation configuration table (i.e., object configuration information), which includes: generation rules for different vegetation types (such as grass, shrubs, and trees); applicability of various vegetation types under different terrain conditions (e.g., grass is suitable for flat land, and trees are suitable for gentle slopes); parameters such as density, distribution probability, and minimum spacing.
[0119] Based on the configuration table information, a terrain texture mask is created by matching the rules in the vegetation configuration table with the terrain data to generate a vegetation mask map (i.e., an initial object mask map). For example, tree generation is masked in steep areas; grass density is increased in low-lying areas; and vegetation cover is reduced in rocky areas.
[0120] Apply custom masking: Allows users to manually add additional masking layers, such as for areas where vegetation should not be present, like roads, buildings, and water bodies; or for special landscape design requirements (such as allowing only a certain type of plant in a specific area). These custom masks are overlaid on the previous terrain masking, further refining the vegetation distribution range.
[0121] Exclude the upper layer of vegetation (i.e., exclude shading): If the current vegetation layer is multi-layered (e.g., bottom layer grass + mid-layer shrubs + top layer trees), the area occupied by the already generated upper layer of vegetation needs to be excluded to avoid overlap or conflict. For example, tall shrubs will not be generated in the location where trees have already been generated. This ensures the rationality of vegetation layers and spatial distribution.
[0122] Merging the final vegetation mask: Logically merge all the above masks (terrain masks, custom masks, exclusion masks) to obtain a final map of vegetation-growing areas, i.e., the target object mask map. This mask determines which locations can generate vegetation, and what type of vegetation can be generated.
[0123] Dynamically generated vegetation HDA: Using a preset vegetation HDA, combined with the final mask (i.e., the target object mask map) and terrain data, a procedural generation logic is executed. This HDA can include the following functions: randomly distributing vegetation based on a noise algorithm; adjusting vegetation types according to terrain height; controlling attributes such as vegetation density, orientation, and size; and outputting point data with position, rotation, scaling, and vegetation type ID.
[0124] Computational vegetation: The HDA computation process is run to generate a large number of vegetation instance points that conform to the rules, forming vegetation point cloud data (i.e., target point cloud data). Each point represents the instantiation information of a plant or a cluster of vegetation.
[0125] Terrain and Vegetation Point Cloud: Outputs the final vegetation point cloud, which contains the spatial location and attribute information of all vegetation instances and can be used for subsequent rendering or imported into the vegetation system.
[0126] End: The vegetation point cloud computing is complete, and the process is finished.
[0127] See Figure 9 , Figure 9 A flowchart illustrating the calculation of special terrain vegetation in a virtual object generation method according to an embodiment of this specification is shown, specifically including the following steps.
[0128] Start: The process begins, entering the vegetation generation and judgment phase.
[0129] Determine if cliff vegetation HDA exists. If it exists, proceed to the dedicated cliff vegetation generation path; otherwise, proceed to the general terrain vegetation generation path.
[0130] In the dedicated cliff vegetation generation path, cliff vegetation HDA can be called or instantiated to perform programmatic calculations on the target terrain, generate vegetation point cloud data suitable for cliff terrain, and output the cliff vegetation data as part of the target point cloud data.
[0131] In the general terrain vegetation generation path, the cliff terrain can be mapped to ordinary terrain processing, and the boundary information of the cliff terrain can be preserved. The general terrain vegetation HDA is used to generate vegetation for the entire terrain, and the cliff vegetation data is used as part of the target point cloud data.
[0132] The above methods reduce the amount of data transfer required for computation, significantly reduce memory usage and computation time, achieve seamless switching between PDG and standalone modes, ensure version consistency while improving the efficiency of vegetation iteration, and reduce performance pressure while maintaining ecological distribution characteristics in low-quality mode.
[0133] Corresponding to the above method embodiments, this specification also provides embodiments of a virtual object generation apparatus. Figure 10 A schematic diagram of a virtual object generation apparatus according to an embodiment of this specification is shown. Figure 10 As shown, the device includes: The first receiving module 1002 is configured to receive object configuration information and terrain configuration information corresponding to the target virtual object, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual object; The first determining module 1004 is configured to determine the reference object resource corresponding to the terrain configuration information based on the preset configuration relationship between the candidate terrain and the candidate object resource. The first generation module 1006 is configured to generate target point cloud data corresponding to the target virtual object based on the terrain configuration information, the object configuration information, and the reference object resource, wherein the target point cloud data is used to generate the target virtual object.
[0134] In an optional embodiment, the first generation module 1006 is further configured to: Based on the terrain configuration information and the object configuration information, a target object mask map corresponding to the target virtual object is generated; Based on the reference object resource, the target object masking image, and the object configuration information, generate the target object resource corresponding to the target virtual object; Based on the target object resources, generate target point cloud data corresponding to the target virtual object.
[0135] In an optional embodiment, the first generation module 1006 is further configured to: Based on the terrain configuration information and the object configuration information, an initial object mask map corresponding to the target virtual object is generated; The initial object masking image is masked to obtain the target object masking image corresponding to the target virtual object.
[0136] In an optional embodiment, the first generation module 1006 is further configured to: Read the terrain data map from the terrain configuration information, and read the object generation rules from the object configuration information; The terrain data map and the object generation rules are matched to obtain a matching result, and an initial object mask map corresponding to the target virtual object is generated based on the matching result.
[0137] In an optional embodiment, the first generation module 1006 is further configured to: Add a custom mask to the initial object mask image, and / or add an exclusion mask to the initial object mask image; Obtain the target object mask image corresponding to the target virtual object.
[0138] In an optional embodiment, the first generation module 1006 is further configured to: If, based on the terrain configuration information, it is determined that the target virtual scene includes the target terrain, and candidate object resources corresponding to the target terrain can be obtained, then the target point cloud data of the target virtual object on the target terrain is calculated based on the candidate object resources; or If, based on the terrain configuration information, it is determined that the target virtual scene includes the target terrain, but the candidate object resource corresponding to the target terrain cannot be obtained, the target terrain is mapped to obtain the terrain object resource corresponding to the target terrain, and the target point cloud data of the target virtual object on the target terrain is calculated based on the terrain object resource.
[0139] In an optional embodiment, the first generation module 1006 is further configured to: The target point cloud data is reduced according to the preset reduction rules to obtain the reduced target point cloud data.
[0140] In an optional embodiment, the first generation module 1006 is further configured to: According to the first preset reduction rule, the first reduction ratio corresponding to the target point cloud data is calculated; The target point cloud data is reduced according to the first reduction ratio to obtain the first target point cloud data; According to the second preset deletion rule, calculate the second deletion ratio corresponding to the first target point cloud data; According to the second reduction ratio, the first target point cloud data is reduced to obtain the second target point cloud data as the reduced target point cloud data. The resolution of the first target virtual object is higher than that of the second target virtual object. The first target virtual object is generated based on the first target point cloud data, and the second target virtual object is generated based on the second target point cloud data.
[0141] In an optional embodiment, the first generation module 1006 is further configured to: The target point cloud data is clustered to obtain multiple first point cloud data clusters; Calculate the first initial weight corresponding to each first point cloud data cluster, and process the first initial weight based on the target noise to obtain the first target weight corresponding to each first point cloud data cluster; Based on the first target weight corresponding to each first point cloud data cluster, the first reduction ratio corresponding to the target point cloud data is determined.
[0142] In an optional embodiment, the first generation module 1006 is further configured to: The first target point cloud data is clustered to obtain multiple second point cloud data clusters; Calculate the weight of the second objective corresponding to each second point cloud data cluster; Based on the second target weight corresponding to each second point cloud data cluster, the second reduction ratio corresponding to the first target point cloud data is determined.
[0143] In an optional embodiment, the first receiving module 1002 is further configured to: The virtual scene construction terminal receives object configuration information and terrain configuration information corresponding to the target virtual object sent by the virtual scene construction terminal, wherein the virtual scene construction terminal obtains the object configuration information and terrain configuration information corresponding to the target virtual object in response to an object generation request for the target virtual object; The target point cloud data is sent to the virtual scene construction terminal so that the virtual scene construction terminal generates the target virtual object based on the target point cloud data.
[0144] In the aforementioned device, in order to generate a target virtual object, object configuration information and terrain configuration information corresponding to the target virtual object can be received. Based on the preset configuration relationship between candidate terrain and candidate object resources, the reference object resource corresponding to the terrain configuration information is determined. Target point cloud data corresponding to the target virtual object is generated based on the terrain configuration information, object configuration information, and reference object resource. This allows for the subsequent generation of the target virtual object based on the target point cloud data. The influence of terrain configuration information is considered during the generation of the target virtual object, enabling the generated target virtual object to adapt to the terrain. This reflects the different forms of the target virtual object in different terrains, ensuring the authenticity of the generated target virtual object and the target virtual scene in which the target virtual object is located, and further enhancing the user's immersive experience of the target virtual scene containing the target virtual object.
[0145] The above is an illustrative scheme of a virtual object generation device according to this embodiment. It should be noted that the technical solution of this virtual object generation device and the technical solution of the virtual object generation method described above belong to the same concept. For details not described in detail in the technical solution of the virtual object generation device, please refer to the description of the technical solution of the virtual object generation method described above.
[0146] Corresponding to the above method embodiments, this specification also provides a virtual vegetation generation method, see [link to relevant documentation]. Figure 11 , Figure 11 A flowchart of a virtual vegetation generation method according to an embodiment of this specification is shown, which specifically includes the following steps.
[0147] Step 1102: Receive vegetation configuration information and terrain configuration information corresponding to the target virtual vegetation, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual vegetation; Step 1104: Determine the reference vegetation resources corresponding to the terrain configuration information based on the preset configuration relationship between candidate terrain and candidate vegetation resources; Step 1106: Generate target point cloud data corresponding to the target virtual vegetation based on the terrain configuration information, the vegetation configuration information, and the reference vegetation resources, wherein the target point cloud data is used to generate the target virtual vegetation.
[0148] The above is an illustrative scheme of a virtual vegetation generation method according to this embodiment. It should be noted that the technical solution of this virtual vegetation generation method belongs to the same concept as the technical solution of the virtual object generation method described above. For details not described in detail in the technical solution of the virtual vegetation generation method, please refer to the description of the technical solution of the virtual object generation method described above.
[0149] Corresponding to the above method embodiments, this specification also provides embodiments of a virtual vegetation generation device. Figure 12 A schematic diagram of a virtual vegetation generation device according to an embodiment of this specification is shown. Figure 12 As shown, the device includes: The second receiving module 1202 is configured to receive vegetation configuration information and terrain configuration information corresponding to the target virtual vegetation, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual vegetation; The second determining module 1204 is configured to determine the reference vegetation resources corresponding to the terrain configuration information based on the preset configuration relationship between the candidate terrain and the candidate vegetation resources. The second generation module 1206 is configured to generate target point cloud data corresponding to the target virtual vegetation based on the terrain configuration information, the vegetation configuration information and the reference vegetation resources, wherein the target point cloud data is used to generate the target virtual vegetation.
[0150] The above is a schematic scheme of a virtual vegetation generation device according to this embodiment. It should be noted that the technical solution of this virtual vegetation generation device and the technical solution of the virtual object generation method described above belong to the same concept. For details not described in detail in the technical solution of the virtual vegetation generation device, please refer to the description of the technical solution of the virtual object generation method described above.
[0151] Corresponding to the above method embodiments, this specification also provides another method for generating virtual objects, see [link to documentation]. Figure 13 , Figure 13 A flowchart of another virtual object generation method according to an embodiment of this specification is shown, which specifically includes the following steps.
[0152] Step 1302: The virtual scene construction end, in response to the object generation request for the target virtual object, obtains the object configuration information and terrain configuration information corresponding to the target virtual object and sends them to the object generation end; Step 1304: The object generation end receives the object configuration information and terrain configuration information, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual object; determines the reference object resource corresponding to the terrain configuration information according to the preset configuration relationship between candidate terrain and candidate object resources; generates target point cloud data corresponding to the target virtual object according to the terrain configuration information, the object configuration information and the reference object resource, and sends the target point cloud data to the virtual scene construction end, wherein the target point cloud data is used to generate the target virtual object; Step 1306: The virtual scene construction terminal generates the target virtual object based on the target point cloud data.
[0153] The above is an illustrative scheme of a virtual object generation method according to this embodiment. It should be noted that the technical solution of this virtual object generation method belongs to the same concept as the above-described virtual object generation method. For details not described in detail in the technical solution of the virtual object generation method, please refer to the description of the technical solution of the above-described virtual object generation method.
[0154] Figure 14 A structural block diagram of a computing device 1400 according to an embodiment of this specification is shown. The components of the computing device 1400 include, but are not limited to, a memory 1410 and a processor 1420. The processor 1420 is connected to the memory 1410 via a bus 1430, and a database 1450 is used to store data.
[0155] The computing device 1400 also includes an access device 1440, which enables the computing device 1400 to communicate via one or more networks 1460. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 1440 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0156] In one embodiment of this specification, the above-described components of the computing device 1400 and Figure 14 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 14The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0157] The computing device 1400 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 1400 can also be a mobile or stationary server.
[0158] The processor 1420 is configured to execute a computer program / instruction that, when executed by the processor, implements the steps of the above method.
[0159] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above method belong to the same concept, and all details not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the above method.
[0160] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0161] The above is an illustrative embodiment of a computer-readable storage medium. It should be noted that the technical solution of this storage medium and the technical solution of the method described above belong to the same concept; details not described in detail in the technical solution of the storage medium can be found in the description of the technical solution of the method described above.
[0162] An embodiment of this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0163] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the above method belong to the same concept, and all details not described in detail in the technical solution of the computer program product can be referred to in the description of the technical solution of the above method.
[0164] The foregoing has described specific embodiments of this specification. 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 a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0165] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0166] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this specification is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this specification. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this specification.
[0167] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0168] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. These embodiments have been selected and specifically described in this specification to better explain the principles and practical applications of this specification, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A method for generating virtual objects, characterized in that, include: Receive object configuration information and terrain configuration information corresponding to the target virtual object, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual object; Based on the preset configuration relationship between candidate terrain and candidate object resources, the reference object resources corresponding to the terrain configuration information are determined; Based on the terrain configuration information, the object configuration information, and the reference object resources, target point cloud data corresponding to the target virtual object is generated, wherein the target point cloud data is used to generate the target virtual object.
2. The method according to claim 1, characterized in that, The step of generating target point cloud data corresponding to the target virtual object based on the terrain configuration information, the object configuration information, and the reference object resources includes: Based on the terrain configuration information and the object configuration information, a target object mask map corresponding to the target virtual object is generated; Based on the reference object resource, the target object masking image, and the object configuration information, generate the target object resource corresponding to the target virtual object; Based on the target object resources, generate target point cloud data corresponding to the target virtual object.
3. The method according to claim 2, characterized in that, The step of generating a target object mask map corresponding to the target virtual object based on the terrain configuration information and the object configuration information includes: Based on the terrain configuration information and the object configuration information, an initial object mask map corresponding to the target virtual object is generated; The initial object masking image is masked to obtain the target object masking image corresponding to the target virtual object.
4. The method according to claim 3, characterized in that, The step of generating an initial object mask map corresponding to the target virtual object based on the terrain configuration information and the object configuration information includes: Read the terrain data map from the terrain configuration information, and read the object generation rules from the object configuration information; The terrain data map and the object generation rules are matched to obtain a matching result, and an initial object mask map corresponding to the target virtual object is generated based on the matching result. The step of performing masking processing on the initial object masking image to obtain the target object masking image corresponding to the target virtual object includes: Add a custom mask to the initial object mask image, and / or add an exclusion mask to the initial object mask image; Obtain the target object mask image corresponding to the target virtual object.
5. The method according to any one of claims 1-4, characterized in that, The step of generating target point cloud data corresponding to the target virtual object based on the terrain configuration information, the object configuration information, and the reference object resource further includes: If, based on the terrain configuration information, it is determined that the target virtual scene includes the target terrain, and candidate object resources corresponding to the target terrain can be obtained, then the target point cloud data of the target virtual object on the target terrain is calculated based on the candidate object resources; or If, based on the terrain configuration information, it is determined that the target virtual scene includes the target terrain, but the candidate object resource corresponding to the target terrain cannot be obtained, the target terrain is mapped to obtain the terrain object resource corresponding to the target terrain, and the target point cloud data of the target virtual object on the target terrain is calculated based on the terrain object resource.
6. The method according to any one of claims 1-4, characterized in that, After generating the target point cloud data corresponding to the target virtual object based on the terrain configuration information, the object configuration information, and the reference object resources, the method further includes: The target point cloud data is reduced according to the preset reduction rules to obtain the reduced target point cloud data; The step of reducing the target point cloud data according to a preset reduction rule to obtain the reduced target point cloud data includes: According to the first preset reduction rule, the first reduction ratio corresponding to the target point cloud data is calculated; The target point cloud data is reduced according to the first reduction ratio to obtain the first target point cloud data; According to the second preset deletion rule, calculate the second deletion ratio corresponding to the first target point cloud data; According to the second reduction ratio, the first target point cloud data is reduced to obtain the second target point cloud data as the reduced target point cloud data. The resolution of the first target virtual object is higher than that of the second target virtual object. The first target virtual object is generated based on the first target point cloud data, and the second target virtual object is generated based on the second target point cloud data.
7. The method according to claim 6, characterized in that, The step of calculating the first reduction ratio corresponding to the target point cloud data according to the first preset reduction rule includes: The target point cloud data is clustered to obtain multiple first point cloud data clusters; Calculate the first initial weight corresponding to each first point cloud data cluster, and process the first initial weight based on the target noise to obtain the first target weight corresponding to each first point cloud data cluster; Based on the first target weight corresponding to each first point cloud data cluster, determine the first reduction ratio corresponding to the target point cloud data; The step of calculating the second reduction ratio corresponding to the first target point cloud data according to the second preset reduction rule includes: The first target point cloud data is clustered to obtain multiple second point cloud data clusters; Calculate the weight of the second objective corresponding to each second point cloud data cluster; Based on the second target weight corresponding to each second point cloud data cluster, the second reduction ratio corresponding to the first target point cloud data is determined.
8. The method according to any one of claims 1-4, characterized in that, The receiving of object configuration information and terrain configuration information corresponding to the target virtual object includes: The virtual scene construction terminal receives object configuration information and terrain configuration information corresponding to the target virtual object sent by the virtual scene construction terminal, wherein the virtual scene construction terminal obtains the object configuration information and terrain configuration information corresponding to the target virtual object in response to an object generation request for the target virtual object; After generating the target point cloud data corresponding to the target virtual object based on the terrain configuration information, the object configuration information, and the reference object resources, the method further includes: The target point cloud data is sent to the virtual scene construction terminal so that the virtual scene construction terminal generates the target virtual object based on the target point cloud data.
9. A method for generating virtual vegetation, characterized in that, include: Receive vegetation configuration information and terrain configuration information corresponding to the target virtual vegetation, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual vegetation; Based on the preset configuration relationship between candidate terrain and candidate vegetation resources, the reference vegetation resources corresponding to the terrain configuration information are determined; Based on the terrain configuration information, the vegetation configuration information, and the reference vegetation resources, target point cloud data corresponding to the target virtual vegetation is generated, wherein the target point cloud data is used to generate the target virtual vegetation.
10. A method for generating virtual objects, characterized in that, include: The virtual scene construction end, in response to the object generation request for the target virtual object, obtains the object configuration information and terrain configuration information corresponding to the target virtual object and sends them to the object generation end; The object generation end receives the object configuration information and terrain configuration information, wherein the terrain configuration information is the configuration information of the target virtual scene corresponding to the target virtual object; determines the reference object resource corresponding to the terrain configuration information according to the preset configuration relationship between candidate terrain and candidate object resources; generates target point cloud data corresponding to the target virtual object according to the terrain configuration information, the object configuration information and the reference object resource, and sends the target point cloud data to the virtual scene construction end, wherein the target point cloud data is used to generate the target virtual object; The virtual scene construction terminal generates the target virtual object based on the target point cloud data.
11. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 10.
12. A computer-readable storage medium storing a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 10.
13. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 10.