Virtual scene model processing method and device, computer device, and storage medium
By reducing the polygonal mesh of the virtual scene model and generating physical resources, the problem of low efficiency in setting physical resources for virtual scene models is solved, and automated batch generation of physical resources is achieved, saving labor costs.
Patent Information
- Application Number
- CN202311587872.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-11-24
AI Technical Summary
In existing technologies, the physical resource setup for virtual scene models is inefficient. Artists need to manually create the physical resources for each model, resulting in high labor costs and the inability to reuse them.
By reducing the polygonal mesh of the target virtual scene model, physical resources with the target physical functions are generated, and these resources are then mounted onto the virtual scene model, thus achieving automated batch generation of physical resources.
It improves the efficiency of physical resource generation for virtual scene models, saves labor costs, and enables automated batch physical resource setting for multiple virtual scene models.
Smart Images

Figure CN120037660B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, in particular to the technical field of games, and specifically to a virtual scene model processing method and device, a computer device and a storage medium. BACKGROUND
[0002] With the continuous development of computer communication technology, the massive popularization and application of terminals such as smart phones, tablet computers and notebook computers, terminals are developing in the direction of diversification and individualization, and are increasingly becoming indispensable terminals in people's life and work. In order to meet people's pursuit of spiritual life, entertainment games that can be operated on terminals have emerged as the times require, such as multi-player online tactical competitive games and large-scale multi-player online games developed based on client or server architecture. Due to the characteristics of high smoothness, good operation feeling and instant combat, these games are deeply loved by users. With the vigorous development of online games, people's demand for the reality of game scenes is becoming higher and higher. In order to enable players to have a better game experience, many terminal games are often constructed based on real scenes and items in real scenes, so that the implementation of virtual scenes and virtual elements and other game resources in the game will be closer to the real environment when designing the game.
[0003] In actual game design engineering, in order to make the game world more realistic, game producers often make game scenes through game engines. 3ds Max is a professional 3D modeling software that can be used to make animation and rendering applications, and can be used to make 3D animation, models, interactive games and visual effects for the entertainment industry. In the prior art, when setting the game physics of a virtual scene model or a virtual object model, an art producer usually manually establishes a model in the 3ds Max software to simulate the physical shape of a scene static model, and then imports it into the game engine for physical simulation. The model is generated by manual modeling in a 3DMax modeling DCC, which requires high labor costs, and the physical resources produced cannot be reused. Art producers need to create physical resources for each virtual scene model, resulting in low efficiency of physical resource setting for virtual scene models or virtual object models. SUMMARY
[0004] The embodiment of the application provides a virtual scene model processing method, device, computer equipment and a storage medium, by reducing the polygonal grid of a target virtual scene model, one or more virtual scene models after reduction are obtained, which can be used for physical resource production, then, a physical resource with a target physical function is generated according to the virtual scene model after reduction, and is output to a game engine where the target virtual scene model is located to reference the physical resource, so that the physical resource is automatically generated for multiple virtual scene models in batches, the manpower cost is saved, and the physical resource setting efficiency of the virtual scene model is improved.
[0005] The embodiment of the application provides a virtual scene model processing method, which comprises the following steps:
[0006] At least one target virtual scene model is acquired from a preset virtual scene space, wherein the target virtual scene model is composed of a plurality of polygonal grids;
[0007] The polygonal grid of the target virtual scene model is subjected to reduction processing based on preset reduction parameters, to obtain a processed virtual scene model;
[0008] A target bounding box with a target physical function is generated based on preset bounding box parameters and the model shape of the processed virtual scene model;
[0009] The target bounding box is mounted on the target virtual scene model, to obtain a target virtual scene model with the target physical function.
[0010] Correspondingly, the embodiment of the application also provides a virtual scene model processing device, which comprises the following:
[0011] An acquisition unit is configured to acquire at least one target virtual scene model from a preset virtual scene space, wherein the target virtual scene model is composed of a plurality of polygonal grids;
[0012] A first processing unit is configured to subject the polygonal grid of the target virtual scene model to reduction processing based on preset reduction parameters, to obtain a processed virtual scene model;
[0013] A generation unit is configured to generate a target physical resource with a target physical function based on preset physical attribute parameters and the processed virtual scene model;
[0014] A second processing unit is configured to mount the target physical resource on the target virtual scene model, to obtain a target virtual scene model with the target physical function.
[0015] Correspondingly, the embodiment of the present application further provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program is executed by the processor to implement the processing method of the virtual scene model according to any one of the above.
[0016] Correspondingly, the embodiment of the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the processing method of the virtual scene model according to any one of the above.
[0017] The embodiment of the present application provides a processing method, device, computer device and storage medium of a virtual scene model. At least one target virtual scene model is obtained from a preset virtual scene space, wherein the target virtual scene model is composed of a plurality of polygon meshes. Then, the polygon meshes of the target virtual scene model are processed by reducing the area based on a preset area reduction parameter, to obtain a processed virtual scene model. Next, a target physical resource with a target physical function is generated based on a preset physical property parameter and the processed virtual scene model. Finally, the target physical resource is mounted to the target virtual scene model to obtain a target virtual scene model with the target physical function. The embodiment of the present application can process the polygon meshes of the target virtual scene model by reducing the area, to obtain one or more virtual scene models after reducing the area, which can be used for physical resource production. Then, the physical resource with the target physical function is generated according to the virtual scene model after reducing the area, and is output to the game engine where the target virtual scene model is located for reference of the physical resource, so as to realize automatic batch generation of corresponding physical resources for a plurality of virtual scene models, save the labor cost, improve the physical interaction performance, and improve the physical resource generation efficiency of the virtual scene model. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0019] Figure 1 is a system schematic diagram of the virtual scene model processing device provided by the embodiment of the present application.
[0020] Figure 2 is a flowchart of the virtual scene model processing method provided by the embodiment of the present application.
[0021] Figure 3is a scene schematic diagram of a processing method of a virtual scene model provided by an embodiment of the present application.
[0022] Figure 4 is another scene schematic diagram of a processing method of a virtual scene model provided by an embodiment of the present application.
[0023] Figure 5 is a structure schematic diagram of a processing device of a virtual scene model provided by an embodiment of the present application.
[0024] Figure 6 is a structure schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person skilled in the art without creative work fall within the scope of protection of the present application.
[0026] The embodiments of the present application provide a processing method and device of a virtual scene model, a computer device and a storage medium. Specifically, the processing method of the virtual scene model of the embodiments of the present application can be executed by a computer device, and the computer device can be a terminal. The terminal can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (PDA), and the like. The terminal can also include a client, which can be a video application client, a music application client, a game application client, a browser client carrying a game program, an instant messaging client, or the like.
[0027] Please refer to Figure 1 , Figure 1The scene schematic diagram of the virtual scene model processing system provided by the embodiment of the present application includes a computer device, and the system can include at least one terminal, at least one server, and a network. The terminal held by a user can be connected to different game servers through the network. The terminal is any device with computing hardware capable of supporting and executing a software product corresponding to a game. In addition, the terminal has one or more multi-touch screens for sensing and obtaining the input of a user through touch or sliding operations performed at multiple points on one or more touch display screens. In addition, when the system includes multiple terminals, multiple servers, and multiple networks, different terminals can be connected to each other through different networks and through different servers. The network can be a wireless network or a wired network, such as a wireless network that is a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, and the like. In addition, different terminals can also use their own Bluetooth networks or hotspot networks to connect to other terminals or servers, and the like.
[0028] In the embodiment of the present application, the computer device can obtain at least one target virtual scene model from a preset virtual scene space, wherein the target virtual scene model is composed of a plurality of polygon meshes; then, based on a preset decimation parameter, the polygon meshes of the target virtual scene model are subjected to decimation processing to obtain a processed virtual scene model; then, based on a preset physical property parameter and the processed virtual scene model, a target physical resource with a target physical function is generated; and finally, the target physical resource is mounted to the target virtual scene model to obtain a target virtual scene model with the target physical function. The embodiment of the present application can obtain one or more virtual scene models subjected to decimation by decimating the polygon meshes of the target virtual scene model, and then generate a physical resource with a target physical function according to the virtual scene model subjected to decimation, and output to a game engine where the target virtual scene model is located for reference of the physical resource, thereby realizing automatic batch generation of corresponding physical resources for multiple virtual scene models, saving labor costs, and improving the physical resource generation efficiency of the virtual scene model.
[0029] It should be noted that, Figure 1 The scene schematic diagram of the virtual scene model processing system shown is only an example, and the virtual scene model processing system and the scene described in the embodiment of the present application are used to more clearly illustrate the technical solutions of the embodiment of the present application, and do not constitute a limitation on the technical solutions provided by the embodiment of the present application. It is known to those skilled in the art that, as the virtual scene model processing system evolves and new business scenarios appear, the technical solutions provided by the embodiment of the present application are also applicable to similar technical problems.
[0030] The virtual scene model processing method provided in the embodiments of the present application can use model making application software, for example, 3D MAX (3D Studio MAX) can be used. 3D MAX is a PC system based three-dimensional animation rendering and making software, which can be used in animation making of computer games and special effect making of films and television programs, etc. A game maker can pre-set the size and shape of a model, and make a virtual scene model in 3D MAX based on the pre-set model size and shape. Further, the virtual scene model processing method provided in the embodiments of the present application can also be used in DCC software. DCC software refers to "Digital Content Creation" software. Such software is a tool for creating, editing and processing digital content. DCC software is usually used in the fields of films, animations, game development, virtual reality, building visualization, etc. and can provide various functions including modeling, animation, rendering, special effects, material editing, particle simulation, character animation, scene arrangement, etc. to help artists and designers create high-quality digital content. Common DCC software includes Autodesk Maya, Autodesk 3ds Max, Cinema 4D, Blender, Houdini, etc.
[0031] The virtual scene model processing method, device, computer device and storage medium provided in the embodiments of the present application can be used in cooperation with a terminal such as a smart phone, a tablet computer, a notebook computer or a personal computer, etc. The virtual scene model processing method, device, computer device and storage medium are described in detail below. It should be noted that the description order of the following embodiments is not limited to the preferred order of the embodiments.
[0032] Please refer to Figure 2 , Figure 2 A flowchart of the virtual scene model processing method provided in the embodiments of the present application is shown in FIG. 1. The specific process can include the following steps 101 to 104.
[0033] 101. At least one target virtual scene model is obtained from a pre-set virtual scene space, wherein the target virtual scene model is composed of a plurality of polygon meshes.
[0034] In the embodiments of the present application, after the step of "obtaining at least one target virtual scene model from a pre-set virtual scene space", the following steps are further included:
[0035] The target virtual scene model is exported from the virtual scene space through a file export interface corresponding to a first file format, to obtain a model file in the first file format corresponding to the target virtual scene model.
[0036] Specifically, all virtual scene models in the preset virtual scene space can be exported through a file export interface (FBX API) corresponding to the first file format, that is, all virtual scene models are exported from the virtual scene space to obtain a plurality of model files in the first file format (that is, FBX files) corresponding to the virtual scene models.
[0037] The file export interface corresponding to the first file format can be an FBX API. The FBX API is an interface provided by Autodesk for modifying FBX properties. Specifically, the FBX API is a set of application programming interfaces (APIs) for processing FBX (Filmbox) file formats. Further, FBX is a file format for exchanging and storing 3D models, animations, and related data, developed and maintained by Autodesk. The FBX API allows developers to access and manipulate the contents of FBX files in application programs. By using the FBX API, developers can read, write, and modify various elements of virtual scene models in FBX files, such as objects, materials, textures, animations, and skeletons. In addition, custom tools and scripts can be created to automate the processing of FBX files, such as importing and exporting models, converting animations, and editing materials. The FBX API also provides access and parsing functions for the structure of FBX files, so that developers can understand and manipulate the hierarchical structure and data relationships of the files.
[0038] 102, based on a preset decimation parameter, the polygon mesh of the target virtual scene model is decimated to obtain a processed virtual scene model.
[0039] In the embodiments of the present application, the step of "based on a preset decimation parameter, the polygon mesh of the target virtual scene model is decimated to obtain a processed virtual scene model", the method can include:
[0040] The decimation function interface is called to decimate the polygon mesh of the target virtual scene model corresponding to the model file to obtain a processed virtual scene model and a model file in the second file format corresponding to the processed virtual scene model.
[0041] Specifically, the decimation function interface (python api provided by Simplygon) can be called to decimate the polygon mesh of the virtual scene model corresponding to the model file in the first file format (that is, the FBX file) corresponding to the plurality of virtual scene models to obtain a processed virtual scene model and a model file in the second file format corresponding to the processed virtual scene model. By using the python api provided by Simplygon, a local fbx file can be converted into two decimated physical resources as input resources.
[0042] In order to maintain the original shape of the virtual scene model to the maximum extent while keeping the original scene model unchanged, in the embodiments of the present application, the local fbx decimation rate can be adjusted to 80% and 50% by using Simplygon API. Simplygon API is the application programming interface (API) of Simplygon. Simplygon is a software tool for 3D content optimization, and Simplygon API allows developers to integrate and use the functions of Simplygon in their applications. Specifically, through Simplygon API, developers can automate polygon reduction, LOD (Level of Detail) generation, texture compression and optimization of 3D models. Code can also be written to call Simplygon API to process and optimize complex 3D models, thereby improving real-time rendering performance, reducing bandwidth requirements and increasing loading speed. Simplygon API provides various functions and options, allowing developers to customize according to their needs and application scenarios. Simplygon API can be integrated with various development environments and programming languages such as C++, C#, Python, etc., allowing developers to use Simplygon functions in different platforms and environments. By using Simplygon API, developers can easily integrate 3D content optimization functions into their applications to improve performance and optimize user experience.
[0043] In an embodiment, the step of "decimating the polygon mesh of the target virtual scene model based on the preset decimation parameters to obtain a processed virtual scene model" can include:
[0044] Obtaining shape constraint parameters and decimation ratio parameters;
[0045] Decimating the polygon mesh of the target virtual scene model based on the shape constraint parameters and the decimation ratio parameters to obtain a processed virtual scene model.
[0046] Further, the step of "decimating the polygon mesh of the target virtual scene model based on the shape constraint parameters and the decimation ratio parameters to obtain a processed virtual scene model" can include:
[0047] Constraining the model shape of the target virtual scene model based on the shape constraint parameters, and processing the number of meshes of the polygon mesh of the target virtual scene model based on the decimation ratio parameters to obtain a processed virtual scene model.
[0048] The surface reduction ratio parameter can be 80% or 50%. When the surface reduction ratio parameter is 80%, the generated surface reduction scene model can be used to make a physical resource for detecting the walking of a virtual character. When the surface reduction ratio parameter is 50%, the generated surface reduction scene model can be used to make a physical resource for detecting scene interaction. Specifically, when the surface reduction ratio parameter is 80%, the number of polygon meshes to be retained is 80% of the total number of original polygon meshes. When the surface reduction ratio parameter is 50%, the number of polygon meshes to be retained is 50% of the total number of original polygon meshes. It should be noted that the surface reduction ratio parameter can also be other numerical values, such as 20%, 30%, or 70%, and the like. The above is only an example and is not limited.
[0049] Specifically, the shape constraint parameter can include a deviation ratio, a first module parameter corresponding to a first function module (Geometry Approximation Settings), and a second module parameter corresponding to a second function module (Opmization Settings). The deviation ratio is used to switch the global clipping distance ratio on which the effect preview depends. Since a physical resource needs to be made, the deviation ratio should be as small as possible. Geometry Approximation Settings is used to select the shape of the object. Different geometric approximation levels can be set to achieve this. Generally, a higher approximation level can better preserve the shape of a virtual object, but it will also increase the number of polygons in the model. The Opmization Settings function can be in the optimization settings of Simplygon. Any shape optimization option can be selected, which will ensure that the shape and topology of the virtual object will not be modified, thereby preserving its original shape.
[0050] Optionally, the shape constraint parameter and the surface reduction ratio parameter are obtained by:
[0051] The first surface reduction ratio parameter corresponding to the first physical function, the second surface reduction ratio parameter corresponding to the second physical function, and the shape constraint parameter are obtained.
[0052] The polygon meshes of the target virtual scene model are subjected to surface reduction processing based on the shape constraint parameter and the first surface reduction ratio parameter, to obtain a first processed virtual scene model. The first processed virtual scene model is used to generate a target virtual scene model with a first target physical function.
[0053] Based on the shape constraint parameter and the second decimation ratio parameter, the polygon mesh of the target virtual scene model is subjected to decimation processing to obtain a second processed virtual scene model, wherein the second processed virtual scene model is used to generate a target virtual scene model with a second target physical function.
[0054] Optionally, two or more decimation ratio parameters can be obtained to generate multiple virtual scene models with different physical functions.
[0055] In the embodiments of the present application, the selected target virtual scene model in the preset virtual scene space can be exported through a file export interface (FBX API) corresponding to a first file format to obtain a model file (i.e., an FBX file) of the target virtual scene model in the first file format. Then, a first decimation ratio parameter 80% corresponding to a first physical function, a second decimation ratio parameter 50% corresponding to a second physical function, and a shape constraint parameter are obtained. The decimation scene model generated when the decimation ratio parameter is 80% can be used to make physical resources for detecting the walking of a virtual character, and the decimation scene model generated when the decimation ratio parameter is 50% can be used to make physical resources for detecting scene interaction. Next, based on the shape constraint parameter and the first decimation ratio parameter 80%, the polygon mesh of the target virtual scene model is subjected to decimation processing to obtain a first processed virtual scene model, which is used to make physical resources for detecting the walking of a virtual character; based on the shape constraint parameter and the second decimation ratio parameter 50%, the polygon mesh of the target virtual scene model is subjected to decimation processing to obtain a second processed virtual scene model, which is used to make physical resources for detecting scene interaction.
[0056] 103. Based on the preset physical attribute parameter and the processed virtual scene model, a target physical resource with a target physical function is generated.
[0057] In the embodiments of the present application, a corresponding physical resource can be generated according to a virtual scene model. The physical resource processing includes a target bounding box and also has physical attributes, physical materials, and physical interaction information. For example, some physical resources can interact with other virtual objects (such as bullets) in a virtual scene, and some physical resources can be used for a virtual character to walk in a virtual scene.
[0058] Specifically, in addition to the bounding box, the physical resource in the embodiment of the present application can also include collision properties, rigid body type, collision determination, and physical material settings, etc., wherein, the physical center point of the model and the coordinates of the bounding box relative to the model can be found to generate a target bounding box; the model can be set with collision properties for collision testing; the type of rigid body can also be set; angle offset, maximum angular velocity determination can also be performed, and a callback method after physical collision can also be set to determine whether the gravity effect is received.
[0059] In a specific embodiment, a target bounding box with a target physical function can be generated based on preset bounding box parameters and the model shape of the processed virtual scene model; then, the target bounding box is mounted to the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0060] Specifically, the method further includes:
[0061] The model file in the second file format corresponding to the processed virtual scene model is imported into the game engine where the target virtual scene model is located, and the game engine is called to perform physical resource generation processing on the model file in the second file format to obtain a target bounding box with a target physical function corresponding to the processed virtual scene model, and a physical resource file corresponding to the target bounding box.
[0062] In the embodiment of the present application, the step of "generating a target bounding box with a target physical function based on preset bounding box parameters and the model shape of the processed virtual scene model" can include:
[0063] Obtaining preset bounding box parameters, wherein the preset bounding box parameters include bounding box size parameters and bounding box shape parameters;
[0064] Determining the center point position of the model shape based on the model shape of the processed virtual scene model;
[0065] Generating a target bounding box with a target physical function based on the center point position, the bounding box size parameters and the bounding box shape parameters.
[0066] For example, please refer to Figure 3acquire preset bounding box parameters, wherein the preset bounding box parameters comprise a bounding box size parameter and a bounding box shape parameter, the bounding box size parameter can be determined based on the model size of the processed virtual scene model to ensure that the target bounding box can completely wrap the processed virtual scene model into the target bounding box, and the bounding box shape parameter can be a spherical parameter, and meanwhile, the model shape based on the processed virtual scene model is acquired, the center point position of the model center point of the model shape based on the processed virtual scene model is determined, and then the target bounding box with the target physical function is generated based on the center point position, the bounding box size parameter and the bounding box shape parameter.
[0067] In order to generate a physical resource that fits the target virtual scene model, before the step of "acquiring preset bounding box parameters", the method can comprise:
[0068] acquiring the model shape and the model size of the processed virtual scene model;
[0069] determining the bounding box shape parameter based on the model shape;
[0070] determining the bounding box size parameter based on the model size.
[0071] For example, please refer to Figure 4 acquiring the model shape and the model size of the processed virtual scene model, determining the bounding box shape parameter based on the model shape, determining the bounding box size parameter based on the model size, determining the center point position of the model center point of the model shape based on the model shape of the processed virtual scene model, and then generating the target bounding box with the target physical function based on the center point position, the bounding box size parameter and the bounding box shape parameter.
[0072] It should be noted that the model center point of the model shape can be a position determined by the computer device itself, and the model center point of the model shape can also be a position set by the developer in the model shape. The shape of the bounding box can be a regular shape, such as a rectangle, a sphere, or other polygons, or can be the same shape as the model shape of the virtual scene model, or can be a shape defined by the developer. Further, the shape of the bounding box can also be determined according to the physical function that the virtual scene model needs to have, for example, when the virtual scene model is a virtual house model, the bounding box of the virtual house model can be consistent with the model shape of the virtual house model; when the virtual scene model is a virtual bonfire, in order to simulate the distance between a person and the bonfire in a real situation, a circular spherical bounding box can be generated based on the center point of the virtual bonfire, so that there is a certain distance between the virtual character and the virtual bonfire, thereby enabling the virtual character and the virtual bonfire in the game scene to simulate the distance between a person and the bonfire in a real situation; when the virtual scene model is a virtual vehicle, such as a virtual car, an elliptical spherical bounding box that just wraps the virtual car can be drawn, thereby enabling the virtual character and the virtual car to simulate the distance between a person and the car in a real situation.
[0073] In order to enable the developer to personalize the bounding box, before the step of "obtaining preset bounding box parameters", the method can comprise:
[0074] displaying a graphical user interface, the graphical user interface displaying a parameter setting page, wherein the parameter setting page includes at least one parameter input interface;
[0075] in response to a submission operation of parameter information input to the parameter input interface, obtaining the input parameter information as preset bounding box parameters.
[0076] For example, the computer device can display a graphical user interface, the graphical user interface displaying a parameter setting page, wherein the parameter setting page includes at least one parameter input interface, the at least one parameter input interface including a shape parameter input interface, a size parameter input interface, and a bounding box attribute parameter input interface, the developer can input the bounding box shape parameter through the shape parameter input interface, can input the bounding box size parameter through the size parameter input interface, and can input the bounding box attribute parameter configured for the bounding box through the bounding box attribute parameter input interface. The computer device can obtain the input bounding box shape parameter, bounding box size parameter, and bounding box attribute parameter as preset bounding box parameters in response to a submission operation of parameter information input to the shape parameter input interface, the size parameter input interface, and the bounding box attribute parameter input interface.
[0077] 104, mounting the target physical resource to the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0078] In the embodiments of the present application, the link of the target physical resource can be mounted to the target virtual scene model, so that the target virtual scene model has the physical characteristics corresponding to the target physical resource. Specifically, the link of the target physical resource can be connected under the physical attribute information corresponding to the attribute information of the target virtual scene model, so that the target virtual scene model has the physical characteristics corresponding to the target physical resource.
[0079] In the embodiments of the present application, the method further comprises:
[0080] obtaining a target file path of the physical resource file;
[0081] associating the target file path with a model description file of the target virtual scene model to mount the target bounding box to the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0082] Specifically, the present application can select a virtual scene model in a virtual scene (Messiah scene) in a game engine, and obtain a file in fbx format of a mesh model corresponding to the virtual scene (under mesh.fbx). Then, a Simplygon API is called to perform mesh reduction processing on the virtual scene model to obtain a model file of the reduced virtual scene model (reduced.fbx). Next, the model file (reduced.fbx) is imported into max, and then the model file (reduced.fbx) is imported into the game engine through max, so as to obtain the data of the reduced scene model in max. Further, the model file (reduced.fbx) is batch written, specifically, the model file (reduced.fbx) is batch converted into a binary engine physical resource (converted by the function of the game engine itself), and finally a physical description file is generated according to the above physical resource to obtain a virtual scene model with physical function.
[0083] In order to further illustrate the processing method of the virtual scene model provided in the embodiments of the present application, the application of the processing method of the virtual scene model in a specific implementation scene will be described as an example, and the specific scene is as follows:
[0084] (1) Batch export of all virtual scene models in the virtual space using FBX is possible. Specifically, developers can use the FBX API to export the resources of a whole set of static virtual scene models in the virtual space as FBX files back to the local space, and then use the FBX API to batch convert and name the imported FBX files to conform to the Simplygon file format. For example, all virtual scene models in a preset virtual scene space can be exported through the file export interface (FBX API) corresponding to the first file format, that is, all virtual scene models can be exported from the virtual scene space to obtain multiple model files (i.e., FBX files) in the first file format corresponding to the virtual scene models.
[0085] Developers can utilize the FBX interface provided by Autodesk to import FBX files of static virtual scene models from the virtual space to their local machine. Then, they can use the FBX API to batch modify the node names of the FBX files and encapsulate this into a user interface for easy batch operations by artists. This requires first establishing a connection between the game engine and the FBX API, and then exporting the resources of the static virtual scene models referenced by the scene in batches as a queue. The specific implementation code is shown below:
[0086] do query
[0087] fbx_files=os.listdir_("D:\TEST"+" / / "+"high_export"+" / / "+"fbx")
[0088] for fbx in fbx_files:
[0089] gWatting = True
[0090] fbx_api.query_fbx_(fbx_file+" / / "+fbx,repo path,package_path)
[0091] fbx_ref.path=fbx_file+" / / "+fbx
[0092] while gWatting:
[0093] time.sleep_(0.01)
[0094] / / Load FBX file
[0095] FbxImporter*pImporter=FbxImporter::Create(pManager,"");
[0096] if (!pImporter->Initialize("test.fbx", -1, pManager->GetIOSettings()))
[0097] {
[0098] cerr << "Failed to load FBX file." << endl;
[0099] exit(0);
[0100] }
[0101] pImporter->Import(pScene);
[0102] pImporter->Destroy();
[0103] / / Modify Mesh node name
[0104] FbxNode *pRootNode = pScene->GetRootNode();
[0105] ChangeNodeName(pRootNode, "newMeshName");
[0106] / / Save FBX file
[0107] FbxExporter *pExporter = FbxExporter::Create(pManager, "");
[0108] if (!pExporter->Initialize("new_fbx_file.fbx", -1, pManager->GetIOSettings()))
[0109] {
[0110] cerr << "Failed to create FBX exporter." << endl;
[0111] exit(0);
[0112] }
[0113] pExporter->Export(pScene);
[0114] pExporter->Destroy();
[0115] (2) In this embodiment, the Simplygon module can be used to physically reduce the polygon count of the virtual scene model. This means that the model files in the first file format corresponding to the multiple virtual scene models from the previous step are subjected to polygon reduction processing to obtain the processed virtual scene models. Specifically, the Python API provided by the Simplygon module can be used to convert the local FBX file as input into two sets of physical resources with reduced polygon counts. Specifically, Simplygon needs to be initialized and a Simplygon object obtained. Then, a processing object can be created and the parameters for generating the reduced polygon counts can be set. After processing, the result can be exported as an FBX file, and then `gc` can be called to manually destroy it. The specific implementation code is shown below:
[0116] Def clear_sg(self,sg):
[0117] :param sg:
[0118] :return: Cleanup operation,
[0119] sg = None
[0120] gc.collect()
[0121] processor=sg.CreateReductionProcessor()
[0122] processor.SetScene(scene)
[0123] setting=processor.GetReductionSettings()
[0124] setting.SetReductionTargets(Simplygon.EStopCondition_All,True,False,False,False)
[0125] setting.SetReductionTargetTriangleRatio(0.01)
[0126] processor.RunProcessing()
[0127] (3) In the embodiment of the present application, the scene physical resource of the processed virtual scene model corresponding to the plurality of virtual scene models can be guided back and physically generated. Specifically, the storage form of the file of each virtual scene model in the virtual space is mainly an xml file, and the way of hanging the physical resource on the static virtual scene model is equivalent to generating a Rigidbody resource under the physical tag of the scene static model. Then, the physical writing of the static virtual scene model is realized by using the ElmentTree method for the resource content of the Rigidbody resource.
[0128] To sum up, the embodiment of the present application provides a virtual scene model processing method, which comprises the following steps: acquiring at least one target virtual scene model from a preset virtual scene space, wherein the target virtual scene model is composed of a plurality of polygon meshes; performing decimation processing on the polygon meshes of the target virtual scene model based on a preset decimation parameter to obtain a processed virtual scene model; generating a target physical resource with a target physical function based on a preset physical property parameter and the processed virtual scene model; and mounting the target physical resource to the target virtual scene model to obtain a target virtual scene model with the target physical function. The embodiment of the present application can perform decimation processing on the polygon meshes of the target virtual scene model to obtain one or more virtual scene models after decimation which can be used for physical resource production. Then, the physical resource with the target physical function is generated according to the virtual scene model after decimation, and is output to the game engine where the target virtual scene model is located for physical resource reference, so as to realize automatic batch generation of corresponding physical resources for a plurality of virtual scene models, save the labor cost, and improve the physical resource generation efficiency of the virtual scene model.
[0129] In order to better implement the above method, the embodiment of the present application can also provide a virtual scene model processing device. The virtual scene model processing device can be integrated in a computer device, for example, a terminal or the like.
[0130] Please refer to Figure 5 , Figure 5 The virtual scene model processing device provided by the embodiment of the present application has the following structure.
[0131] The acquisition unit 201 is configured to acquire at least one target virtual scene model from a preset virtual scene space, wherein the target virtual scene model is composed of a plurality of polygon meshes.
[0132] The first processing unit 202 is configured to perform decimation processing on the polygon meshes of the target virtual scene model based on a preset decimation parameter to obtain a processed virtual scene model.
[0133] The generating unit 203 is configured to generate a target physical resource with a target physical function based on the preset physical attribute parameter and the processed virtual scene model.
[0134] The second processing unit 204 is configured to mount the target physical resource to the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0135] In some embodiments, the processing apparatus of the virtual scene model comprises:
[0136] The first obtaining subunit is configured to obtain a shape constraint parameter and a surface reduction ratio parameter.
[0137] The first processing subunit is configured to perform surface reduction processing on a polygon mesh of the target virtual scene model based on the shape constraint parameter and the surface reduction ratio parameter to obtain a processed virtual scene model.
[0138] In some embodiments, the processing apparatus of the virtual scene model comprises:
[0139] The second processing subunit is configured to perform constraint processing on a model shape of the target virtual scene model based on the shape constraint parameter, and perform processing on a mesh quantity of the polygon mesh of the target virtual scene model based on the surface reduction ratio parameter to obtain a processed virtual scene model.
[0140] In some embodiments, the processing apparatus of the virtual scene model comprises:
[0141] The second obtaining subunit is configured to obtain a first surface reduction ratio parameter corresponding to a first physical function, a second surface reduction ratio parameter corresponding to a second physical function, and a shape constraint parameter.
[0142] The third processing subunit is configured to perform surface reduction processing on a polygon mesh of the target virtual scene model based on the shape constraint parameter and the first surface reduction ratio parameter to obtain a first processed virtual scene model, wherein the first processed virtual scene model is used to generate a target virtual scene model with a first target physical function.
[0143] The third processing subunit is further configured to perform surface reduction processing on the polygon mesh of the target virtual scene model based on the shape constraint parameter and the second surface reduction ratio parameter to obtain a second processed virtual scene model, wherein the second processed virtual scene model is used to generate a target virtual scene model with a second target physical function.
[0144] In some embodiments, the processing apparatus of the virtual scene model comprises:
[0145] The first generating sub-unit is configured to generate a target bounding box with a target physical function based on preset bounding box parameters and a model shape of the processed virtual scene model.
[0146] In some embodiments, the processing apparatus of the virtual scene model comprises:
[0147] The fourth processing sub-unit is configured to mount the target bounding box to the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0148] In some embodiments, the processing apparatus of the virtual scene model comprises:
[0149] The third obtaining sub-unit is configured to obtain preset bounding box parameters, wherein the preset bounding box parameters comprise a bounding box size parameter and a bounding box shape parameter.
[0150] The first determining sub-unit is configured to determine a center point position of the model shape based on a model shape of the processed virtual scene model.
[0151] The second generating sub-unit is configured to generate a target bounding box with a target physical function based on the center point position, the bounding box size parameter and the bounding box shape parameter.
[0152] In some embodiments, the processing apparatus of the virtual scene model comprises:
[0153] The fourth obtaining sub-unit is configured to obtain a model shape and a model size of the processed virtual scene model.
[0154] The second determining sub-unit is configured to determine a bounding box shape parameter based on the model shape.
[0155] The second determining sub-unit is further configured to determine a bounding box size parameter based on the model size.
[0156] In some embodiments, the processing apparatus of the virtual scene model comprises:
[0157] The display sub-unit is configured to display a graphical user interface, and the graphical user interface displays a parameter setting page, wherein the parameter setting page comprises at least one parameter input interface.
[0158] The fifth obtaining sub-unit is configured to obtain input parameter information as preset bounding box parameters in response to a submission operation of the parameter information input to the parameter input interface.
[0159] In some embodiments, the processing apparatus of the virtual scene model comprises:
[0160] The derivation subunit is configured to derive the target virtual scene model from the virtual scene space through a file export interface corresponding to a first file format, to obtain a model file in the first file format corresponding to the target virtual scene model.
[0161] In some embodiments, the virtual scene model processing apparatus comprises:
[0162] The first calling subunit is configured to call a decimation function interface to perform decimation processing on a polygon mesh of the target virtual scene model corresponding to the model file, to obtain a processed virtual scene model and a model file in a second file format corresponding to the processed virtual scene model.
[0163] In some embodiments, the virtual scene model processing apparatus comprises:
[0164] The second calling subunit is configured to import the model file in the second file format corresponding to the processed virtual scene model into a game engine in which the target virtual scene model is located, to call the game engine to perform physical resource generation processing on the model file in the second file format, to obtain a target bounding box with a target physical function corresponding to the processed virtual scene model and a physical resource file corresponding to the target bounding box.
[0165] In some embodiments, the virtual scene model processing apparatus comprises:
[0166] The sixth obtaining subunit is configured to obtain a target file path of the physical resource file.
[0167] The fifth processing subunit is configured to associate the target file path with a model description file of the target virtual scene model, to mount the target bounding box to the target virtual scene model, to obtain a target virtual scene model with the target physical function.
[0168] The embodiment of the present application discloses a virtual scene model processing device, at least one target virtual scene model can be acquired from a preset virtual scene space by an acquisition unit 201, wherein the target virtual scene model is composed of a plurality of polygon meshes; a first processing unit 202 performs face reduction processing on the polygon meshes of the target virtual scene model based on a preset face reduction parameter, to obtain a processed virtual scene model; a generation unit 203 generates a target physical resource with a target physical function based on a preset physical attribute parameter and the processed virtual scene model; and a second processing unit 204 mounts the target physical resource to the target virtual scene model, to obtain a target virtual scene model with the target physical function. The embodiment of the present application can perform face reduction processing on the polygon meshes of the target virtual scene model, to obtain one or more virtual scene models after face reduction which can be used for physical resource manufacturing, then generate a physical resource with a target physical function according to the virtual scene model after face reduction, and output to a game engine where the target virtual scene model is located for reference of the physical resource, so as to realize automatic batch generation of physical resources for a plurality of virtual scene models, save the labor cost, and improve the physical resource generation efficiency of the virtual scene model.
[0169] Correspondingly, the embodiment of the present application also provides a computer device, which can be a terminal or a server. The terminal can be a smart phone, a tablet computer, a notebook computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA) and the like. Figure 6 As shown in the figure, Figure 6 The computer device provided by the embodiment of the present application is shown in the structure diagram. The computer device 300 includes a processor 301 with one or more processing cores, a memory 302 with one or more computer readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 is electrically connected to the memory 302. Those skilled in the art can understand that the computer device structure shown in the figure does not constitute a limitation on the computer device, and can include more or fewer components than the figure, or combine certain components, or different component arrangements.
[0170] The processor 301 is the control center of the computer device 300, which connects all parts of the computer device 300 through various interfaces and lines, executes various functions of the computer device 300 and processes data by running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, so as to overall monitor the computer device 300.
[0171] In the embodiments of the present application, the processor 301 in the computer device 300 loads the instructions corresponding to the processes of one or more application programs into the memory 302 and runs the application programs stored in the memory 302 by the processor 301 to implement various functions according to the following steps:
[0172] obtain at least one target virtual scene model from a preset virtual scene space, wherein the target virtual scene model is composed of a plurality of polygon meshes;
[0173] perform polygon reduction processing on the polygon meshes of the target virtual scene model based on a preset polygon reduction parameter to obtain a processed virtual scene model;
[0174] generate a target physical resource having a target physical function based on a preset physical attribute parameter and the processed virtual scene model;
[0175] mount the target physical resource to the target virtual scene model to obtain a target virtual scene model having the target physical function.
[0176] In an embodiment, the polygon reduction processing on the polygon meshes of the target virtual scene model based on the preset polygon reduction parameter to obtain the processed virtual scene model comprises:
[0177] obtain a shape constraint parameter and a polygon reduction ratio parameter;
[0178] perform polygon reduction processing on the polygon meshes of the target virtual scene model based on the shape constraint parameter and the polygon reduction ratio parameter to obtain the processed virtual scene model.
[0179] In an embodiment, the polygon reduction processing on the polygon meshes of the target virtual scene model based on the shape constraint parameter and the polygon reduction ratio parameter to obtain the processed virtual scene model comprises:
[0180] perform constraint processing on a model shape of the target virtual scene model based on the shape constraint parameter, and perform processing on a number of meshes of the polygon meshes of the target virtual scene model based on the polygon reduction ratio parameter to obtain the processed virtual scene model.
[0181] In an embodiment, the obtaining of the shape constraint parameter and the polygon reduction ratio parameter comprises:
[0182] obtain a first polygon reduction ratio parameter corresponding to a first physical function, a second polygon reduction ratio parameter corresponding to a second physical function, and a shape constraint parameter;
[0183] perform face reduction on the polygonal mesh of the target virtual scene model based on the shape constraint parameter and the first face reduction ratio parameter, to obtain a first processed virtual scene model, wherein the first processed virtual scene model is used to generate the target virtual scene model with the first target physical function;
[0184] perform face reduction on the polygonal mesh of the target virtual scene model based on the shape constraint parameter and the second face reduction ratio parameter, to obtain a second processed virtual scene model, wherein the second processed virtual scene model is used to generate the target virtual scene model with the second target physical function.
[0185] In an embodiment, the generating, based on the preset physical attribute parameter and the processed virtual scene model, the target physical resource with the target physical function comprises:
[0186] generating, based on a preset bounding box parameter and a model shape of the processed virtual scene model, a target bounding box with the target physical function;
[0187] The mounting, to the target virtual scene model, of the target physical resource to obtain the target virtual scene model with the target physical function comprises:
[0188] The mounting, to the target virtual scene model, of the target bounding box to obtain the target virtual scene model with the target physical function.
[0189] In an embodiment, the generating, based on the preset bounding box parameter and the model shape of the processed virtual scene model, the target bounding box with the target physical function comprises:
[0190] obtaining a preset bounding box parameter, wherein the preset bounding box parameter comprises a bounding box size parameter and a bounding box shape parameter;
[0191] determining a center point position of the model shape based on the model shape of the processed virtual scene model;
[0192] generating, based on the center point position, the bounding box size parameter and the bounding box shape parameter, the target bounding box with the target physical function.
[0193] In an embodiment, before the obtaining of the preset bounding box parameter, the method further comprises:
[0194] obtaining a model shape and a model size of the processed virtual scene model;
[0195] determining a bounding box shape parameter based on the model shape;
[0196] Determine a bounding box size parameter based on the model size.
[0197] In an embodiment, before obtaining the preset bounding box parameter, the method further comprises:
[0198] Display a graphical user interface, the graphical user interface displays a parameter setting page, wherein the parameter setting page includes at least one parameter input interface;
[0199] In response to a submission operation of parameter information input to the parameter input interface, obtain the input parameter information as the preset bounding box parameter.
[0200] In an embodiment, after obtaining at least one target virtual scene model from the preset virtual scene space, the method further comprises:
[0201] Export the target virtual scene model from the virtual scene space through a file export interface corresponding to the first file format, to obtain a model file of the first file format corresponding to the target virtual scene model.
[0202] In an embodiment, the method further comprises:
[0203] Call a decimation function interface to perform decimation processing on the polygonal mesh of the target virtual scene model corresponding to the model file, to obtain a processed virtual scene model and a model file of the second file format corresponding to the processed virtual scene model.
[0204] In an embodiment, the method further comprises:
[0205] Import the model file of the second file format corresponding to the processed virtual scene model into a game engine in which the target virtual scene model is located, call the game engine to perform physical resource generation processing on the model file of the second file format, to obtain a target bounding box corresponding to the processed virtual scene model and having a target physical function, and a physical resource file corresponding to the target bounding box.
[0206] In an embodiment, the method further comprises:
[0207] Obtain a target file path of the physical resource file.
[0208] Associate the target file path with a model description file of the target virtual scene model, to mount the target bounding box to the target virtual scene model, to obtain a target virtual scene model having the target physical function.
[0209] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0210] Optional, such as Figure 6 As shown, the computer device 300 also includes: a touch screen display 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the touch screen display 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307. Those skilled in the art will understand that... Figure 6 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0211] The touch display screen 303 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 303 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 301. It can also receive and execute commands from the processor 301. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 301 to determine the type of touch event. Subsequently, the processor 301 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 303 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 303 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 303 can also be used as part of the input unit 306 to achieve input functions.
[0212] In the embodiments of the present application, the processor 301 executes an application program to generate a graphical interface on the touch display screen 303. The touch display screen 303 is configured to present the graphical interface and receive operation instructions generated by a user acting on the graphical interface.
[0213] The radio frequency circuit 304 can be configured to transceive radio frequency signals to establish wireless communication with a network device or other computer device, and transceive signals between the network device or other computer device.
[0214] The audio circuit 305 can be configured to provide an audio interface between a user and the computer device through a speaker and a microphone. The audio circuit 305 can convert received audio data into an electrical signal and transmit the electrical signal to the speaker, which converts the electrical signal into an audible signal and outputs the audible signal. On the other hand, the microphone collects a sound signal and converts the sound signal into an electrical signal, which is received by the audio circuit 305 and converted into audio data. The audio data is output to the processor 301 for processing, and then transmitted to another computer device through the radio frequency circuit 304, or output to the memory 302 for further processing. The audio circuit 305 can also include a jack for a headset to provide communication between the headset and the computer device.
[0215] The input unit 306 can be configured to receive inputted digital, character information or user feature information (e.g. fingerprint, iris, face information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0216] The power supply 307 is configured to supply power to various components of the computer device 300. Optionally, the power supply 307 can be logically connected to the processor 301 through a power management system, so that the power management system can be used to manage charging, discharging and power consumption management, etc. The power supply 307 can also include one or more direct current or alternating current power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, etc.
[0217] Although Figure 6 Although not shown in the embodiments, the computer device 300 can also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described herein.
[0218] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0219] As can be seen from the above, the computer device provided in this embodiment obtains at least one target virtual scene model from a preset virtual scene space, wherein the target virtual scene model is composed of multiple polygonal meshes; then, based on preset polygon reduction parameters, the polygonal meshes of the target virtual scene model are subjected to polygon reduction processing to obtain a processed virtual scene model; next, based on preset physical attribute parameters and the processed virtual scene model, a target physical resource with target physical functions is generated; finally, the target physical resource is mounted onto the target virtual scene model to obtain a target virtual scene model with the target physical functions. This embodiment of the application can obtain one or more polygon-reduced virtual scene models that can be used for physical resource creation by performing polygon reduction processing on the polygonal meshes of the target virtual scene model. Then, physical resources with target physical functions are generated based on the polygon-reduced virtual scene models and output to the game engine where the target virtual scene model resides for reference, thereby realizing the automated batch generation of corresponding physical resources for multiple virtual scene models, saving labor costs and improving the efficiency of physical resource generation for virtual scene models.
[0220] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0221] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute steps in any of the virtual scene model processing methods provided in embodiments of this application. For example, the computer program can execute the following steps:
[0222] Obtain at least one target virtual scene model from a preset virtual scene space, wherein the target virtual scene model is composed of multiple polygonal meshes;
[0223] The polygon mesh of the target virtual scene model is reduced based on preset reduction parameters to obtain the processed virtual scene model.
[0224] Based on preset physical attribute parameters and the processed virtual scene model, a target physical resource with target physical functions is generated.
[0225] The target physical resources are mounted onto the target virtual scene model to obtain a target virtual scene model with the target physical functions.
[0226] In an embodiment, the polygonal mesh of the target virtual scene model is decimated based on the preset decimation parameter, to obtain a processed virtual scene model, including:
[0227] The shape constraint parameter and the decimation ratio parameter are obtained.
[0228] The polygonal mesh of the target virtual scene model is decimated based on the shape constraint parameter and the decimation ratio parameter, to obtain a processed virtual scene model.
[0229] In an embodiment, the polygonal mesh of the target virtual scene model is decimated based on the shape constraint parameter and the decimation ratio parameter, to obtain a processed virtual scene model, including:
[0230] The model shape of the target virtual scene model is constrained based on the shape constraint parameter, and the number of meshes of the polygonal mesh of the target virtual scene model is processed based on the decimation ratio parameter, to obtain a processed virtual scene model.
[0231] In an embodiment, the shape constraint parameter and the decimation ratio parameter are obtained, including:
[0232] The first decimation ratio parameter corresponding to the first physical function, the second decimation ratio parameter corresponding to the second physical function, and the shape constraint parameter are obtained.
[0233] The polygonal mesh of the target virtual scene model is decimated based on the shape constraint parameter and the first decimation ratio parameter, to obtain a first processed virtual scene model, wherein the first processed virtual scene model is used to generate a target virtual scene model with a first target physical function.
[0234] The polygonal mesh of the target virtual scene model is decimated based on the shape constraint parameter and the second decimation ratio parameter, to obtain a second processed virtual scene model, wherein the second processed virtual scene model is used to generate a target virtual scene model with a second target physical function.
[0235] In an embodiment, the target physical resource with the target physical function is generated based on the preset physical attribute parameter and the processed virtual scene model, including:
[0236] A target bounding box with the target physical function is generated based on a preset bounding box parameter and the model shape of the processed virtual scene model.
[0237] The target physical resource is mounted on the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0238] The target bounding box is mounted on the target virtual scene model to obtain a target virtual scene model with the target physical function.
[0239] In an embodiment, the target bounding box with the target physical function is generated based on the preset bounding box parameters and the model shape of the processed virtual scene model, including:
[0240] The preset bounding box parameters are obtained, wherein the preset bounding box parameters include bounding box size parameters and bounding box shape parameters.
[0241] Based on the model shape of the processed virtual scene model, the center point position of the model shape is determined.
[0242] Based on the center point position, the bounding box size parameters and the bounding box shape parameters, the target bounding box with the target physical function is generated.
[0243] In an embodiment, before obtaining the preset bounding box parameters, further comprising:
[0244] The model shape and the model size of the processed virtual scene model are obtained.
[0245] The bounding box shape parameters are determined based on the model shape.
[0246] The bounding box size parameters are determined based on the model size.
[0247] In an embodiment, before obtaining the preset bounding box parameters, further comprising:
[0248] A graphical user interface is displayed, and the graphical user interface displays a parameter setting page, wherein the parameter setting page includes at least one parameter input interface.
[0249] In response to a submission operation of parameter information input to the parameter input interface, the input parameter information is obtained as the preset bounding box parameters.
[0250] In an embodiment, after obtaining at least one target virtual scene model from the preset virtual scene space, further comprising:
[0251] The target virtual scene model is exported from the virtual scene space through a file export interface corresponding to a first file format to obtain a model file in a first file format corresponding to the target virtual scene model.
[0252] In an embodiment, the polygon mesh of the target virtual scene model is decimated based on the preset decimation parameter to obtain a processed virtual scene model, including:
[0253] The decimation function interface is called to decimate the polygon mesh of the target virtual scene model corresponding to the model file to obtain a processed virtual scene model and a model file in a second file format corresponding to the processed virtual scene model.
[0254] In an embodiment, the method further includes:
[0255] The model file in the second file format corresponding to the processed virtual scene model is imported into a game engine in which the target virtual scene model is located, and the game engine is called to perform physical resource generation processing on the model file in the second file format to obtain a target bounding box corresponding to the processed virtual scene model and having a target physical function, and a physical resource file corresponding to the target bounding box.
[0256] In an embodiment, the method further includes:
[0257] A target file path of the physical resource file is obtained.
[0258] The target file path is associated with a model description file of the target virtual scene model to mount the target bounding box to the target virtual scene model to obtain a target virtual scene model having the target physical function.
[0259] The specific implementation of each operation can be referred to the foregoing embodiments, which will not be described here.
[0260] The storage medium can include a read-only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, or the like.
[0261] According to the computer program stored in the storage medium, the steps in any of the processing methods of the virtual scene model provided in the embodiments of the present application can be performed, at least one target virtual scene model is obtained from a preset virtual scene space, wherein the target virtual scene model is composed of a plurality of polygon meshes; then, the polygon meshes of the target virtual scene model are processed by surface reduction based on a preset surface reduction parameter, to obtain a processed virtual scene model; then, a target physical resource with a target physical function is generated based on a preset physical property parameter and the processed virtual scene model; finally, the target physical resource is mounted to the target virtual scene model, to obtain a target virtual scene model with the target physical function. The embodiments of the present application can process the polygon meshes of the target virtual scene model by surface reduction, to obtain one or more virtual scene models after surface reduction which can be used for physical resource manufacturing; then, a physical resource with a target physical function is generated according to the virtual scene model after surface reduction, and is output to a game engine where the target virtual scene model is located, to reference the physical resource, so that the corresponding physical resource is automatically generated in batches for a plurality of virtual scene models, the labor cost is saved, and the physical resource generation efficiency of the virtual scene model is improved.
[0262] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0263] The virtual scene model processing method, device, computer device and storage medium provided in the embodiments of the present application are described in detail above, and the principle and implementation manner of the present application are described by applying specific examples; the above embodiment description is only used to help understand the technical solutions and core ideas of the present application; those skilled in the art should understand that the technical solutions recorded in the above embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for processing virtual scene models, characterized in that, include: Obtain at least one target virtual scene model from a preset virtual scene space, wherein the target virtual scene model is composed of multiple polygonal meshes; The polygon mesh of the target virtual scene model is reduced based on preset reduction parameters to obtain the processed virtual scene model. Based on preset physical attribute parameters and the processed virtual scene model, a target physical resource with target physical functions is generated. The target physical resources are mounted onto the target virtual scene model to obtain a target virtual scene model with the target physical functions; After obtaining at least one target virtual scene model from the preset virtual scene space, the method further includes: The target virtual scene model is exported from the virtual scene space through the file export interface corresponding to the first file format, thereby obtaining a model file in the first file format corresponding to the target virtual scene model. The polygon reduction function interface is called to perform polygon reduction processing on the polygon mesh of the target virtual scene model corresponding to the model file, so as to obtain the processed virtual scene model and the model file in the second file format corresponding to the processed virtual scene model.
2. The method for processing virtual scene models according to claim 1, characterized in that, The process of reducing the polygonal mesh of the target virtual scene model based on preset polygon reduction parameters to obtain the processed virtual scene model includes: Obtain the shape constraint parameters and the reduction ratio parameters; Based on the shape constraint parameters and the reduction ratio parameters, the polygon mesh of the target virtual scene model is subjected to reduction processing to obtain the processed virtual scene model.
3. The method for processing virtual scene models according to claim 2, characterized in that, The process of reducing the polygonal mesh of the target virtual scene model based on the shape constraint parameters and the reduction ratio parameters to obtain the processed virtual scene model includes: The shape of the target virtual scene model is constrained based on the shape constraint parameters, and the number of polygon meshes of the target virtual scene model is processed based on the reduction ratio parameters to obtain the processed virtual scene model.
4. The method for processing virtual scene models according to claim 2, characterized in that, The acquisition of shape constraint parameters and reduction ratio parameters includes: Obtain the first reduction ratio parameter corresponding to the first physical function, the second reduction ratio parameter corresponding to the second physical function, and the shape constraint parameter; Based on the shape constraint parameters and the first reduction ratio parameters, the polygon mesh of the target virtual scene model is subjected to reduction processing to obtain a first processed virtual scene model, wherein the first processed virtual scene model is used to generate a target virtual scene model with a first target physical function. Based on the shape constraint parameters and the second reduction ratio parameters, the polygon mesh of the target virtual scene model is subjected to reduction processing to obtain a second processed virtual scene model, wherein the second processed virtual scene model is used to generate a target virtual scene model with a second target physical function.
5. The method for processing virtual scene models according to claim 1, characterized in that, The generation of target physical resources with target physical functions based on preset physical attribute parameters and the processed virtual scene model includes: Based on the preset bounding box parameters and the model shape of the processed virtual scene model, a target bounding box with target physical functions is generated. The step of mounting the target physical resource onto the target virtual scene model to obtain a target virtual scene model with the target physical function includes: The target bounding box is attached to the target virtual scene model to obtain a target virtual scene model with the target physical functions.
6. The method for processing virtual scene models according to claim 5, characterized in that, The process of generating a target bounding box with target physical functions based on preset bounding box parameters and the model shape of the processed virtual scene model includes: Obtain preset bounding box parameters, wherein the preset bounding box parameters include bounding box size parameters and bounding box shape parameters; Based on the shape of the processed virtual scene model, determine the position of the center point of the model shape; Based on the center point location, the bounding box size parameters, and the bounding box shape parameters, a target bounding box with target physical functions is generated.
7. The method for processing virtual scene models according to claim 6, characterized in that, Before obtaining the preset bounding box parameters, the following is also included: Obtain the shape and size of the processed virtual scene model; Determine the bounding box shape parameters based on the model shape; The bounding box size parameters are determined based on the model dimensions.
8. The method for processing virtual scene models according to claim 6, characterized in that, Before obtaining the preset bounding box parameters, the following is also included: A graphical user interface is displayed, which includes a parameter setting page, wherein the parameter setting page includes at least one parameter input interface; In response to the submission operation of parameter information input to the parameter input interface, the input parameter information is obtained as a preset bounding box parameter.
9. The method for processing virtual scene models according to claim 1, characterized in that, The method further includes: The second file format model file corresponding to the processed virtual scene model is imported into the game engine where the target virtual scene model is located. The game engine is then called to perform physical resource generation processing on the second file format model file to obtain the target bounding box with target physical function corresponding to the processed virtual scene model, and the physical resource file corresponding to the target bounding box.
10. The method for processing virtual scene models according to claim 9, characterized in that, The method further includes: Obtain the target file path of the physical resource file; The target file path is associated with the model description file of the target virtual scene model to mount the target bounding box onto the target virtual scene model, thereby obtaining a target virtual scene model with the target physical functions.
11. A processing device for a virtual scene model, characterized in that, include: An acquisition unit is used to acquire at least one target virtual scene model from a preset virtual scene space, wherein the target virtual scene model is composed of multiple polygonal meshes; The first processing unit is used to perform polygon reduction processing on the polygon mesh of the target virtual scene model based on preset polygon reduction parameters to obtain the processed virtual scene model. The generation unit is used to generate target physical resources with target physical functions based on preset physical attribute parameters and the processed virtual scene model. The second processing unit is used to mount the target physical resources onto the target virtual scene model to obtain a target virtual scene model with the target physical functions; The export subunit is used to export the target virtual scene model from the virtual scene space through the file export interface corresponding to the first file format, so as to obtain a model file in the first file format corresponding to the target virtual scene model; The first calling subunit is used to call the polygon reduction function interface to perform polygon reduction processing on the polygon mesh of the target virtual scene model corresponding to the model file, so as to obtain the processed virtual scene model and the model file in the second file format corresponding to the processed virtual scene model.
12. A computer device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the processing method for the virtual scene model as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the processing method for the virtual scene model as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Scene rendering method and device, computer readable storage medium and computer equipment
CN111105491A