Method and device for generating three-dimensional virtual scene data, storage medium, and terminal
By obtaining the geometric data and layout parameters of the basic component model, the texture material is automatically built and rendered, which solves the problem of low efficiency in generating three-dimensional virtual scenes and realizes efficient generation and rendering of material effects.
Patent Information
- Application Number
- CN202111669499.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2041-12-30
AI Technical Summary
The existing three-dimensional virtual scene data generation efficiency is low, manual production is cumbersome and consumes a lot of human resources, and the generated scene cannot directly express the material effect, which affects the generation efficiency.
By obtaining the geometric model data and model layout parameters of the basic component model, the target scene model is automatically built, and three-dimensional virtual scene data is generated using texture material rendering, increasing the flexibility and automatic adjustment capabilities of the scene model.
It improves the convenience and efficiency of generating three-dimensional virtual scene data, realizes the flexible adjustment of scene models and rendering of material effects, and improves generation efficiency.
Smart Images

Figure CN114307158B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method and device for generating three-dimensional virtual scene data, a storage medium, and a terminal. Background Art
[0002] When processing a three-dimensional virtual scene, a 3D virtual scene with a conceptual content is usually pre-produced so that this 3D virtual scene can be applied to scenes such as games and videos for testing or scene layout. Currently, when generating 3D virtual scene data, scene producers usually perform manual production, and different producers use different production methods. However, the manual production of 3D virtual scenes reduces the efficiency of 3D virtual scene generation due to the cumbersome production steps, consumes a large amount of human resources, and greatly wastes the time of generating the 3D virtual scene. Moreover, the generated 3D virtual scene still cannot be directly expressed as the final image with material effects, thereby affecting the efficiency of generating 3D virtual scene data. Summary of the Invention
[0003] In view of this, the present invention provides a method and device for generating three-dimensional virtual scene data, a storage medium, and a terminal, the main purpose of which is to solve the problem of low efficiency in the existing three-dimensional virtual scene data generation.
[0004] According to one aspect of the present invention, a method for generating three-dimensional virtual scene data is provided, comprising:
[0005] Acquire geometric model data and model layout parameters of a basic component model of a virtual scene to be constructed, wherein the basic component model is a non-static model, and the model layout parameters are used to characterize the distribution position and logical relationship of the basic component model;
[0006] Determining the construction parameters of the basic component model according to the geometric model data and the model layout parameters, and generating a target scene model that matches the construction parameters;
[0007] Acquiring model adjustment parameters of the target scene model, and adjusting the construction parameters of the target scene model according to the model adjustment parameters to obtain an adjusted target scene model;
[0008] A texture material matching the target scene model is obtained, and the target scene model is rendered based on the texture material to generate three-dimensional virtual scene data.
[0009] Furthermore, generating a target scene model that matches the construction parameters includes:
[0010] Retrieving a space partition component, and building the basic component model in a three-dimensional virtual scene based on the space partition component, wherein the space partition component is configured with initial building parameters of different basic component models;
[0011] The initial building parameters are configured as the building parameters through the space partitioning component to obtain a target scene model in the three-dimensional virtual scene.
[0012] Furthermore, the acquiring of the model adjustment parameters of the target scene model and adjusting the construction parameters of the target scene model by using the model adjustment parameters to obtain the adjusted target scene model includes:
[0013] Acquiring a scene adjustment operation on the target scene model, wherein the scene adjustment operation includes adjusting geometric model data and model layout parameters of the target scene model;
[0014] Analyze the adjustment content of the target scene model generated by the scene adjustment operation, determine the model adjustment parameters, and based on the space editing sub-component of the space partitioning component, adjust the construction parameters of the target scene model according to the model adjustment parameters to obtain the adjusted target scene model.
[0015] Furthermore, before obtaining the texture material matching the target scene model, the method further includes:
[0016] Load resource maps for rendering different target scene models;
[0017] Creating a material ball based on the resource map, and configuring at least one material parameter for the material ball to obtain a map material;
[0018] A matching parameter node is configured for the material parameter, so as to adjust the material parameter based on the parameter node.
[0019] Furthermore, the acquiring of a texture material matching the target scene model, and rendering the target scene model based on the texture material to generate three-dimensional virtual scene data includes:
[0020] Determining at least one texture material that matches the model surface of the target scene model according to a composition-material correspondence relationship, wherein the composition-material correspondence relationship is used to characterize the correspondence between different model surfaces and different material textures;
[0021] The material ball of the mapping material is retrieved, and the model surface of the target scene model is rendered according to the material parameters corresponding to the material ball to obtain three-dimensional virtual scene data.
[0022] Furthermore, after acquiring a texture material matching the target scene model and rendering the target scene model based on the texture material to generate three-dimensional virtual scene data, the method further includes:
[0023] Acquire at least one scene atmosphere model, where the scene atmosphere model is used to increase the atmosphere characteristics of the three-dimensional virtual scene data;
[0024] The scene atmosphere model is rendered into the three-dimensional virtual scene data according to the scene feature auxiliary relationship to obtain the scene three-dimensional virtual scene data. The scene feature auxiliary relationship is used to characterize the feature relationship between different scene atmosphere models and different target scene models in the three-dimensional virtual scene data.
[0025] Furthermore, the method further comprises:
[0026] When obtaining geometric model data and model layout parameters of a basic component model of a virtual scene to be constructed to generate three-dimensional virtual scene data, a rollback mechanism is initiated, wherein the rollback mechanism is used to track and record process information of generating the three-dimensional virtual scene data;
[0027] The process information matching the target rollback node is acquired from the rollback information obtained by starting the rollback mechanism, so as to adjust the data in the process information.
[0028] According to another aspect of the present invention, there is provided a device for generating three-dimensional virtual scene data, comprising:
[0029] An acquisition module is used to obtain geometric model data and model layout parameters of a basic component model of a virtual scene to be built, wherein the basic component model is a non-static model, and the model layout parameters are used to characterize the distribution position and logical relationship of the basic component model;
[0030] A generation module, configured to determine the construction parameters of the basic component model according to the geometric model data and the model layout parameters, and generate a target scene model matching the construction parameters;
[0031] An adjustment module, configured to obtain model adjustment parameters of the target scene model, and adjust the construction parameters of the target scene model using the model adjustment parameters to obtain an adjusted target scene model;
[0032] The rendering module is used to obtain a texture material that matches the target scene model, and render the target scene model based on the texture material to generate three-dimensional virtual scene data.
[0033] Furthermore, the generation module includes:
[0034] A calling unit, configured to call a space partition component and build the basic component model in a three-dimensional virtual scene based on the space partition component, wherein the space partition component is configured with initial building parameters of different basic component models;
[0035] A configuration unit is configured to configure the initial construction parameters into the construction parameters through the space partitioning component to obtain a target scene model in the three-dimensional virtual scene.
[0036] Furthermore, the acquisition module includes:
[0037] an acquiring unit, configured to acquire a scene adjustment operation on the target scene model, wherein the scene adjustment operation includes adjusting geometric model data and model layout parameters of the target scene model;
[0038] A determination unit is used to parse the adjustment content generated by the scene adjustment operation on the target scene model, determine the model adjustment parameters, and adjust the construction parameters of the target scene model according to the model adjustment parameters based on the spatial editing subcomponent of the spatial partitioning component to obtain the adjusted target scene model.
[0039] Furthermore, the device further comprises: a loading module,
[0040] The loading module is further used to load resource maps for rendering different target scene models;
[0041] The configuration module is used to create a material ball based on the resource map, and configure at least one material parameter for the material ball to obtain a map material;
[0042] The configuration module is further configured to configure matching parameter nodes for the material parameters, so as to adjust the material parameters based on the parameter nodes.
[0043] Furthermore, the rendering module includes:
[0044] a determining unit, configured to determine at least one texture material matching the model surface of the target scene model according to a composition-material correspondence relationship, wherein the composition-material correspondence relationship is used to characterize a correspondence between different model surfaces and different material textures;
[0045] The rendering unit is used to retrieve the material ball of the mapping material and render the model surface of the target scene model according to the material parameters corresponding to the material ball to obtain three-dimensional virtual scene data.
[0046] Furthermore,
[0047] The acquisition module is further configured to acquire at least one scene atmosphere model, wherein the scene atmosphere model is configured to increase the atmosphere characteristics of the three-dimensional virtual scene data;
[0048] The rendering module is also used to render the scene atmosphere model into the three-dimensional virtual scene data according to the scene feature auxiliary relationship to obtain the scene three-dimensional virtual scene data. The scene feature auxiliary relationship is used to characterize the feature relationship between different scene models and different target scene models in the three-dimensional virtual scene data.
[0049] Furthermore, the device further comprises: a starting module,
[0050] The startup module is used to start a rollback mechanism when obtaining geometric model data and model layout parameters of a basic component model of a virtual scene to be built to generate three-dimensional virtual scene data. The rollback mechanism is used to track and record process information of generating the three-dimensional virtual scene data;
[0051] The acquisition module is further configured to acquire process information matching the target rollback node from the rollback information obtained by starting the rollback mechanism, so as to adjust the data in the process information.
[0052] According to another aspect of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, wherein the executable instruction enables a processor to execute operations corresponding to the above-mentioned method for generating three-dimensional virtual scene data.
[0053] According to another aspect of the present invention, there is provided a terminal, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;
[0054] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned method for generating three-dimensional virtual scene data.
[0055] By means of the above technical solution, the technical solution provided by the embodiment of the present invention has at least the following advantages:
[0056] The present invention provides a method and device, a storage medium, and a terminal for generating three-dimensional virtual scene data. Compared with the prior art, an embodiment of the present invention obtains geometric model data and model layout parameters of a basic component model of a virtual scene to be built, wherein the basic component model is a non-static model, and the model layout parameters are used to characterize the distribution position and logical relationship of the basic component model; determines the building parameters of the basic component model according to the geometric model data and the model layout parameters, and generates a target scene model matching the building parameters; obtains model adjustment parameters of the target scene model, and adjusts the building parameters of the target scene model according to the model adjustment parameters to obtain the adjusted target scene model; obtains a texture material matching the target scene model, and renders the target scene model based on the texture material to generate three-dimensional virtual scene data, thereby increasing the operational convenience of generating three-dimensional virtual scene data, achieving the purpose of flexible and automatic adjustment of the scene model in the three-dimensional virtual scene data, and increasing the scene effect of the three-dimensional virtual scene data by rendering the texture material, thereby improving the generation efficiency of the three-dimensional virtual scene data.
[0057] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0059] Figure 1 A flow chart of a method for generating three-dimensional virtual scene data provided by an embodiment of the present invention is shown;
[0060] Figure 2 A schematic diagram of a basic component model provided by an embodiment of the present invention is shown;
[0061] Figure 3 A schematic diagram of a target scene model provided by an embodiment of the present invention is shown;
[0062] Figure 4 A schematic diagram of a three-dimensional street view virtual scene provided by an embodiment of the present invention is shown;
[0063] Figure 5 A flow chart of another method for generating three-dimensional virtual scene data provided by an embodiment of the present invention is shown;
[0064] Figure 6 A flow chart of another method for generating three-dimensional virtual scene data provided by an embodiment of the present invention is shown;
[0065] Figure 7 A flow chart of another method for generating three-dimensional virtual scene data provided by an embodiment of the present invention is shown;
[0066] Figure 8 A schematic diagram of a material ball provided by an embodiment of the present invention is shown;
[0067] Figure 9 A flow chart of a method for generating three-dimensional virtual scene data provided by an embodiment of the present invention is shown;
[0068] Figure 10 A schematic diagram of three-dimensional virtual scene data of a street scene atmosphere provided by an embodiment of the present invention is shown;
[0069] Figure 11 A schematic diagram of an auxiliary image in FBX file format provided by an embodiment of the present invention is shown;
[0070] Figure 12 A block diagram showing the composition of a device for generating three-dimensional virtual scene data provided by an embodiment of the present invention is shown;
[0071] Figure 13 A schematic structural diagram of a terminal provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0072] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0073] When generating three-dimensional virtual scene data, scene producers usually perform manual production, and different producers use different production methods. However, the manual production of three-dimensional virtual scenes will reduce the efficiency of three-dimensional virtual scene generation due to the cumbersome production steps, consume a lot of human resources, and greatly waste the time of generating three-dimensional virtual scenes. Moreover, the generated three-dimensional virtual scenes still cannot be directly expressed as the final images with material effects, thereby affecting the efficiency of generating three-dimensional virtual scene data. An embodiment of the present invention provides a method for generating three-dimensional virtual scene data, such as Figure 1 As shown, the method includes:
[0074] 101. Obtain geometric model data and model layout parameters of a basic component model of a virtual scene to be constructed.
[0075] In an embodiment of the present invention, the virtual scene to be constructed is three-dimensional virtual scene data, and the current execution subject obtains the geometric model data and model distribution parameters of the basic component model. In this case, the geometric model data and model distribution parameters can be pre-entered by the editor or entered in real time by the editor, and the embodiment of the present invention does not specifically limit this. Among them, the basic component model is the basic building block unit for constructing the three-dimensional virtual scene. The basic component model is a non-static model. By adjusting the three-dimensional modeling coordinates of the basic component model, different shape UVs, i.e., three-dimensional modeling texture UV coordinates representing different shapes, can be obtained. At the same time, the basic component model is also configured with a splicing interface to enable splicing between basic component models of different geometric shapes, for example, splicing between a cube component model and a cone component model. The basic component model includes but is not limited to models of basic collective shapes such as boxes, cones, cylinders, pyramids, spheres, curved connectors, linear connectors, and spiral connectors, and the embodiment of the present invention does not specifically limit this. Specifically, since the basic component model is used to represent the most basic model bodies of the expected virtual scene, in this case, the geometric model data and model layout parameters are used as the basic parameters for constructing the basic component model. Among them, the geometric model data is model data used to characterize the geometric shape of the basic component model in three-dimensional space, and the model layout parameters are used to characterize the distribution position and logical relationship of the basic component model. The distribution position is the composition position where the basic component model is expected to be built in the three-dimensional virtual scene, and the logical relationship is the logical relationship for Boolean operations between basic component models, such as logical AND, logical OR, logical NOT, and logical XOR, so that the current execution entity automatically builds the scene model in the three-dimensional virtual scene based on the geometric model data and the model layout parameters.
[0076] It should be noted that the geometric model data and model layout parameters of the basic component model of the virtual scene to be built can be entered in real time by the scene editor or directly stored in the current execution end, so that they can be obtained when the basic component model needs to be built. The embodiment of the present invention does not make specific limitations.
[0077] 102. Determine construction parameters of the basic component model according to the geometric model data and the model layout parameters, and generate a target scene model matching the construction parameters.
[0078] In an embodiment of the present invention, after the geometric model data and the model layout parameters are obtained, the construction parameters of the basic component model are determined by calculation. At this time, the construction parameters are used to characterize the specific spatial position, model parameters, etc. of the basic component model in the three-dimensional virtual model. Among them, since there can be multiple basic component models obtained, and each basic component model can be spliced together through a splicing interface, the geometric shape of the model is determined based on the geometric model data, and the spatial position of the basic component model in the three-dimensional space is determined based on the distribution position in the model layout parameters. At this time, for the splicing between multiple basic component models, the splicing position between each basic component model is calculated through the logical relationship in the model layout parameters of each basic component model, thereby obtaining the spatial position, model parameters, etc. of each basic component model after splicing, which are used as construction parameters, so as to build a target scene model of the basic component model in the three-dimensional virtual scene. For example, Figure 2 As shown, the basic component models include cubes, bridges, cuboids, etc. The spatial positions and model parameters of the cubes, bridges, and cuboids in the virtual street scene are calculated based on the geometric model data and model layout parameters of the cubes, bridges, and cuboids, thereby generating a target street scene model. At this time, the target street scene model includes multiple building models in the virtual scene, and each building model is a model of a simple geometric body, thereby further refining the model.
[0079] 103. Obtain model adjustment parameters of the target scene model, and adjust the construction parameters of the target scene model using the model adjustment parameters to obtain an adjusted target scene model.
[0080] In the embodiment of the present invention, since the basic component models are three-dimensional models of different geometric shapes, in order to achieve convenient adjustment of the composition of the target scene, thereby improving the refinement of the composition, the model adjustment parameters of the target scene model are first obtained. Among them, the target scene model may include a basic component model built in a three-dimensional virtual scene, or may include multiple basic component models built in a three-dimensional virtual scene. At this time, the model adjustment parameters of one or more target scene models may be entered by the user, or may be model adjustment parameters that have a matching relationship pre-established with the target scene model, thereby achieving the purpose of automatic adjustment. At this time, since the target scene model is generated based on the construction parameters, the corresponding model adjustment parameters for adjusting the target scene model are the data content for adjusting the construction parameters. Therefore, the construction parameters are adjusted through the model adjustment parameters to achieve a refined composition of the target scene model, such as Figure 3 shown.
[0081] 104. Acquire a texture material that matches the target scene model, and render the target scene model based on the texture material to generate three-dimensional virtual scene data.
[0082] In an embodiment of the present invention, in order to show the composition effect of the virtual scene and increase the material effect, a texture material that matches the target scene model is obtained, and the texture material is used to render the target scene model, thereby adding material effects to the target scene model in the virtual scene to achieve different scene effects. Among them, the texture material can be pre-baked or loaded from the cloud or local material database, and the embodiment of the present invention does not make specific limitations. In addition, when rendering the target scene model based on the texture material, it is sufficient to directly render based on the texture material that matches the target scene model, and obtain three-dimensional virtual scene data containing all rendered target scene models, such as Figure 4 shown.
[0083] It should be noted that since the three-dimensional virtual scene data is three-dimensional, it can be used as a data basis for scene editors to produce virtual scenes such as three-dimensional animations or games. Therefore, it is rendered and generated based on the game engine, animation production system, etc. in the current execution end, and then directly imported into the game engine or action production system for use. For example, the three-dimensional virtual scene data can be stored as data in the FBX file format for import and use.
[0084] In another embodiment of the present invention, in order to further define and illustrate, as Figure 5 As shown, step 102 of generating a target scene model that matches the building parameters includes:
[0085] 201. Retrieve a space partition component, and build the basic component model in a three-dimensional virtual scene based on the space partition component;
[0086] 202. Configure the initial construction parameters as the construction parameters through the space partitioning component to obtain a target scene model in the three-dimensional virtual scene.
[0087] In an embodiment of the present invention, the space partition component can be a component embedded in a game engine that adds a basic component model to a virtual scene. The current execution subject calls the space partition component through the game engine to construct basic component models of different geometric shapes, which is not specifically limited in the embodiment of the present invention. Among them, the space partition component is configured with a plurality of basic component models of different shapes as basic building blocks, so as to be built in a three-dimensional virtual scene. At the same time, the space partition component is configured with initial building parameters of different basic component models. When building a basic component model based on the space partition component, it is built according to the initial building parameters, and then the building parameters calculated based on the geometric model data and model layout parameters are configured to configure the initial building time, thereby obtaining the target scene model.
[0088] It should be noted that the production of the three-dimensional virtual scene of the game in the embodiment of the present invention is applied to the scene building function of the game engine. The game engine can be UE, Unity, etc., without specific limitation. Furthermore, according to the building parameters calculated according to the geometric model data and model layout parameters, the spatial partition component is called in the game engine to build the basic component model to obtain the target scene model. At this time, in the game engine, the target scene model built according to the building parameters is a three-dimensional model with spatial position, spatial layout, and splicing relationship. The target scene model is directly built and generated according to the building parameters. The embodiment of the present invention does not make specific limitations.
[0089] In another embodiment of the present invention, in order to further define and illustrate, as Figure 6 As shown, step 103 obtains the model adjustment parameters of the target scene model, and adjusts the construction parameters of the target scene model by using the model adjustment parameters, and obtains the adjusted target scene model including:
[0090] 301. Acquire a scene adjustment operation for the target scene model;
[0091] 302. Analyze the adjustment content of the target scene model generated by the scene adjustment operation, determine the model adjustment parameters, and adjust the construction parameters of the target scene model according to the model adjustment parameters based on the space editing subcomponent of the space partitioning component to obtain the adjusted target scene model.
[0092] In order to achieve flexible adjustment of the model composition and meet the composition requirements of different scene editors, the target scene model parameters are adjusted based on the model adjustment parameters, thereby achieving detailed adjustment of the target scene. Specifically, in the process of composing the virtual scene, the scene adjustment operation of the target scene model is obtained. The scene adjustment operation includes the operation content of adjusting the geometric model data and model layout parameters of the target scene model, so as to determine the model adjustment parameters based on the scene adjustment operation, and achieve the purpose of detailed adjustment of the target scene model according to the model adjustment parameters. Among them, the scene adjustment operation includes the adjustment content of the model points, model lines, and model surfaces of the target scene model, so as to determine the operation content of adjusting the geometric model data and model layout parameters based on the operation content, including but not limited to moving the target scene model points, extending the target scene model lines, expanding the target scene model surfaces, splicing multiple target scene models, and moving the spatial position. At this time, if the points, lines, and surfaces corresponding to the adjustment operation are determined, the target scene model can be determined accordingly, and the embodiments of the present invention do not make specific limitations. In addition, since the target scene model surface is composed of the lines connecting the target scene model points, and the lines between the target scene model points include the target scene model lines, any adjustment content of the target scene model points, target scene model lines, and target scene model surfaces can achieve coordinated adjustment of other target scene model points, target scene model lines, and target scene model surfaces.
[0093] It should be noted that, since the scene adjustment operation includes the operation content of adjusting the geometric model data and model layout parameters of the target scene model, including the adjustment operation of the position, length, size and other contents of the target scene model points of the target scene model, at this time, the adjustment operation determines the change content of the geometric model data and the model layout parameters, which is determined as the model adjustment parameters. Based on the spatial editing subcomponent of the spatial partitioning component, the construction parameters of the target scene model are adjusted according to the model adjustment parameters to obtain the adjusted target scene model. The embodiment of the present invention does not make specific limitations. Among them, since the spatial partitioning component is embedded in the game engine, after the target scene model is built, the editing subcomponent in the spatial partitioning space is called, so as to refine the construction parameters of the target scene model according to the model adjustment parameters based on the spatial editing subcomponent to obtain the target scene model after adjusting the model parameters. At this time, the target scene model is a three-dimensional model after enriching the scene details.
[0094] In another embodiment of the present invention, in order to further define and illustrate, as Figure 7 As shown, before step 104 of obtaining the texture material matching the target scene model, the method further includes:
[0095] 401. Load resource maps for rendering different target scene models;
[0096] 402. Create a material ball based on the resource map, and configure at least one material parameter for the material ball to obtain a map material;
[0097] 403. Configure matching parameter nodes for the material parameters.
[0098] In order to construct the three-dimensional virtual scene data for rendering map materials and improve the composition effect of the virtual scene, map materials are baked in advance. Among them, the resource map is pre-stored in the material library, so when constructing the map material, the resource map is loaded from the material library. At this time, the material library can be Quixel or an accelerator material library. The resource map is the material texture map used to render different composition models, so that the map material is generated based on this resource map. Specifically, after loading the resource map, create a material ball that matches the resource map, such as Figure 8 As shown, material parameters are configured for each material ball so that the material can be adjusted based on the material parameters. The material parameters include but are not limited to color, transparency, etc. so as to adjust the scene of the rendered model.
[0099] It should be noted that in order to adjust the texture material based on material parameters to meet the composition effects of different virtual scenes, after the texture material is generated, parameter nodes are configured for each material parameter of the texture material to adjust the material parameters based on the parameter nodes. Among them, the parameter node is the node in the texture material that binds different material parameters, so that the material is adjusted through the parameters of this node. Therefore, after the texture material is generated, the material parameters of the texture material are adjusted based on the parameter node, for example, adjusting the color or transparency of the wall material. This is not specifically limited in the embodiments of the present invention.
[0100] In another embodiment of the present invention, for further limitation and explanation, step 104 obtains a texture material that matches the target scene model, and renders the target scene model based on the texture material to generate three-dimensional virtual scene data, including: determining at least one texture material that matches the model surface of the target scene model according to the composition-material correspondence; calling the material ball of the texture material, and rendering the model surface of the target scene model according to the material parameters corresponding to the material ball to obtain three-dimensional virtual scene data.
[0101] In order to simplify the texture material selection process when rendering three-dimensional virtual scene data and realize the purpose of automatically generating three-dimensional virtual scene data, specifically, the texture material matching each model surface of the target scene model is determined according to the composition material correspondence. The composition material correspondence is used to characterize the correspondence between different target scene model surfaces and different material textures. By pre-configuring with the current execution end, when rendering is required, this composition material correspondence is called to determine the texture material matching the model surface of the target scene model. Among them, the composition material correspondence can be pre-written by the user, or downloaded at the same time when the resource texture is loaded. The embodiment of the present invention does not make specific limitations. After determining the texture material, the material ball of the configured texture material is called to render the model surface of the target scene model according to the material parameters corresponding to the material ball to obtain the three-dimensional virtual scene data. At this time, it can be directly implemented through the rendering module in the game engine, such as Figure 4 The embodiment of the present invention is not specifically limited.
[0102] In another embodiment of the present invention, in order to further define and illustrate, as Figure 9 As shown, after step 104 of acquiring a texture material matching the target scene model and rendering the target scene model based on the texture material to generate three-dimensional virtual scene data, the method further includes:
[0103] 501. Obtain at least one scene atmosphere model;
[0104] 502. Render the scene atmosphere model into the three-dimensional virtual scene data according to the scene feature auxiliary relationship to obtain the three-dimensional virtual scene data.
[0105] Since the three-dimensional virtual scene data is a three-dimensional virtual scene, in order to add more scene effects, after rendering the three-dimensional virtual scene data, a scene atmosphere model is obtained, and the scene atmosphere model is rendered into the three-dimensional virtual scene data according to the auxiliary relationship of the scene features, thereby obtaining three-dimensional virtual scene data with a scene atmosphere. Among them, the scene atmosphere model is a model used to increase the atmosphere features of the three-dimensional virtual scene data. The atmosphere features include but are not limited to special effects, plants, celestial bodies and other contents that represent the scene atmosphere in the three-dimensional virtual scene data. For example, Figure 10As shown, the detailed atmosphere effect of the three-dimensional virtual scene data is reflected. In addition, in order to automatically realize the rendering of the sense of atmosphere, the scene atmosphere model is rendered into the three-dimensional virtual scene data according to the scene feature auxiliary relationship. The scene feature auxiliary relationship is used to characterize the feature relationship between different scene atmosphere models and different target scene models in the three-dimensional virtual scene data. For example, the leaf model as the scene atmosphere model has an attachment relationship with the wall target scene model. Therefore, when rendering, the leaf model is rendered in attachment to the wall model. Specifically, the feature relationship may include but is not limited to attachment relationship, position relationship, embedding relationship, etc., so that when rendering, the sense of atmosphere is increased by adding the scene atmosphere model to obtain three-dimensional virtual scene data with a sense of atmosphere, thereby achieving the purpose of accurate and refined virtual scene data generation.
[0106] In another embodiment of the present invention, for further definition and illustration, the method further includes:
[0107] 601. Initiate a rollback mechanism when obtaining geometric model data and model layout parameters of a basic component model of a virtual scene to be constructed to generate three-dimensional virtual scene data;
[0108] 602. Obtain process information matching the target rollback node from the rollback information obtained by starting the rollback mechanism, so as to adjust data in the process information.
[0109] In an embodiment of the present invention, since it is necessary to perform Boolean logic calculations based on the generation of the target scene model when building a three-dimensional virtual scene in order to splice different basic component models or adjust and refine the target scene model, a rollback mechanism is configured to improve the efficiency and flexibility of building the three-dimensional virtual scene. At this time, the rollback mechanism is started by obtaining the geometric model data and model layout parameters of the basic component model of the virtual scene to be built to generate the three-dimensional virtual scene data, so as to backtrack any rollback node in the generation of the three-dimensional virtual scene data. The rollback mechanism is used to track and record the process information of generating the three-dimensional virtual scene data. The process information is the information from obtaining the geometric model data and model layout parameters of the basic component model to generating the three-dimensional scene data. At this time, the process information includes but is not limited to blank virtual scene data, the operation content of adjusting the geometric model data and model layout parameters, the target scene model for the operation adjustment, and each operation time point, so as to achieve the rollback purpose by recording and tracking the process information. After the rollback mechanism is started, when the generation of the three-dimensional virtual scene data in the embodiment of the present invention is currently executed, each operation time sequence and the corresponding operation content are recorded and tracked, and the rollback node corresponding to each operation and the corresponding recorded process information are determined, so that when the rollback operation is performed, the target rollback node is determined from the rollback information containing all the process information to obtain the corresponding process information for output. The rollback operation is to select the target rollback node from the process information corresponding to the recorded operation time sequence after completing the recording and tracking of the process information, such as selecting according to the time point, and quickly returning to the previous operation record point by using the mouse wheel, so as to retrieve the record information at the previous record point for display, which is not specifically limited in the embodiment of the present invention. Among them, the rollback information contains a piece of process information corresponding to each recorded time point, and each recorded time node corresponds to a rollback node, so that the target rollback node can be selected therefrom.
[0110] It should be noted that, since the rollback mechanism is used to record and track the process information of any time point in the entire process of obtaining the geometric model data and model layout parameters of the basic component model of the virtual scene to be built to generate three-dimensional virtual scene data, the output of the recorded information can be the blank virtual scene data at each recorded time point, or the operation content of adjusting the geometric model data and model layout parameters or the target scene model for the operation adjustment to perform virtual scene rendering, that is, re-rendering the virtual scene at the target rollback node, thereby overcoming the destructive disadvantage of Boolean operation. Of course, if the process information corresponding to the rollback operation only contains the adjustment of the model point coordinates, the corresponding adjustment content can be directly output. If the process information contains the content of the Boolean operation in the logical relationship, the virtual scene needs to be re-rendered. The embodiment of the present invention does not make specific limitations.
[0111] In an embodiment of the present invention, in order to generate three-dimensional virtual scene data based on image data with composition content, reference composition image data can be loaded to obtain the geometric model data and model layout parameters of the basic component model of the virtual scene to be built from the reference composition image data, thereby building the basic image data. Among them, the reference composition image data is a two-dimensional image content that provides composition content for the basic component model. The composition content includes the position of each scene object in the scene under different scenes and other contents, thereby showing a two-dimensional image with a scene production effect. The reference composition image data can be loaded in the cloud or in the composition subsystem, which is not specifically limited in the embodiment of the present invention. At the same time, in order to generate the basic component model using the space partition component, the space partition component is called, and after the space partition component parses the geometric shape in the reference composition image data, the geometric model data and model layout parameters of the basic component model of the virtual scene to be built are obtained, thereby calculating the construction parameters and completing the construction of the basic component model. The space partition component is a component in the game engine, which is not specifically limited in the embodiment of the present invention.
[0112] In order to meet the needs of quickly and conveniently building a basic component model and achieve flexible scene editing, basic composition requirement data can also be obtained. The basic composition requirement data is used to characterize the content of the composition model features required for the expected generation of the basic component model. The composition model features include but are not limited to the shape of the composition model. Therefore, through the spatial partitioning component, a basic component model that matches the reference composition image data is generated according to the basic composition requirement data.
[0113] It should be noted that in the process of building a basic component model based on the spatial partition component, according to the reference composition image data, the spatial partition component is used to build a basic component model of a simple geometric shape that matches the scene in the reference composition image data. At this time, the scene editor can select a matching geometric shape from the spatial partition component according to the scene in the reference composition image data for construction, or the spatial partition component can be used to scan or image recognize the two-dimensional reference composition image data to determine the spatial position and layout composition of the key geometric bodies in the scene, thereby obtaining the geometric model data and model layout parameters of the basic component model of the virtual scene to be built, so as to calculate the construction parameters and the construction of the basic component model. This embodiment of the present invention does not make specific restrictions. At the same time, in order to refine the basic component model of a simple geometric shape and thus simplify the user's operation process, the input basic composition requirement data can be used to refine and adjust the construction parameters of the basic component model. This embodiment of the present invention does not make specific restrictions.
[0114] In an embodiment of the present invention, in an application scenario for generating three-dimensional virtual scene data for building a scene, the following steps are included: when starting to produce the three-dimensional virtual scene data for the scene, a production project for editing the scene can be created to obtain the geometric model data and model layout parameters of the basic component model of the virtual scene to be built. After the current execution entity calculates the construction parameters based on the geometric model data and model layout parameters, a target scene model is generated through the spatial partition component in the game engine UE4, that is, a target scene model containing one or more geometric shapes is obtained. After determining the composition, the model adjustment parameters of the target scene model are obtained, and the game engine UE4 performs model refinement processing on the construction parameters of the target scene model, that is, the construction parameters are adjusted according to the model adjustment parameters to obtain the adjusted target scene model. Then, texture resources can be loaded from the Perfect Accelerator material library or Quixel material library, which are third-party texture websites, and a material ball can be created in the game engine UE4. The obtained texture material is rendered to the target scene model to obtain three-dimensional virtual scene data. Furthermore, by rendering the scene atmosphere model, more atmospheric three-dimensional virtual scene data can be obtained. At this point, since the generated three-dimensional virtual scenes can be realized through the game engine UE4, they can be converted into static meshes and FBX file format during post-production and imported into 3D software, such as Figure 11 shown.
[0115] An embodiment of the present invention provides a method for generating three-dimensional virtual scene data. Compared with the prior art, the embodiment of the present invention obtains geometric model data and model layout parameters of a basic component model of a virtual scene to be built, wherein the basic component model is a non-static model, and the model layout parameters are used to characterize the distribution position and logical relationship of the basic component model; determines the building parameters of the basic component model according to the geometric model data and the model layout parameters, and generates a target scene model matching the building parameters; obtains model adjustment parameters of the target scene model, and adjusts the building parameters of the target scene model according to the model adjustment parameters to obtain the adjusted target scene model; obtains a texture material matching the target scene model, and renders the target scene model based on the texture material to generate three-dimensional virtual scene data, thereby increasing the operational convenience of generating three-dimensional virtual scene data, achieving the purpose of flexible and automatic adjustment of the scene model in the three-dimensional virtual scene data, and increasing the scene effect of the three-dimensional virtual scene data by rendering the texture material, thereby improving the generation efficiency of the three-dimensional virtual scene data.
[0116] Furthermore, as a response to the above Figure 1 The embodiment of the present invention provides a device for generating three-dimensional virtual scene data, such as Figure 12 As shown, the device includes:
[0117] An acquisition module 61 is configured to acquire geometric model data and model layout parameters of a basic component model of a virtual scene to be constructed, wherein the basic component model is a non-static model, and the model layout parameters are used to characterize the distribution position and logical relationship of the basic component model;
[0118] A generating module 62 is configured to determine the building parameters of the basic component model according to the geometric model data and the model layout parameters, and to generate a target scene model matching the building parameters;
[0119] An adjustment module 63 is configured to obtain model adjustment parameters of the target scene model and adjust the construction parameters of the target scene model using the model adjustment parameters to obtain an adjusted target scene model;
[0120] The rendering module 64 is configured to obtain a texture material that matches the target scene model, and render the target scene model based on the texture material to generate three-dimensional virtual scene data.
[0121] Furthermore, the generation module includes:
[0122] A calling unit, configured to call a space partition component and build the basic component model in a three-dimensional virtual scene based on the space partition component, wherein the space partition component is configured with initial building parameters of different basic component models;
[0123] A configuration unit is configured to configure the initial construction parameters into the construction parameters through the space partitioning component to obtain a target scene model in the three-dimensional virtual scene.
[0124] Furthermore, the acquisition module includes:
[0125] an acquiring unit, configured to acquire a scene adjustment operation on the target scene model, wherein the scene adjustment operation includes adjusting geometric model data and model layout parameters of the target scene model;
[0126] A determination unit is used to parse the adjustment content generated by the scene adjustment operation on the target scene model, determine the model adjustment parameters, and adjust the construction parameters of the target scene model according to the model adjustment parameters based on the spatial editing subcomponent of the spatial partitioning component to obtain the adjusted target scene model.
[0127] Furthermore, the device further comprises: a loading module,
[0128] The loading module is further used to load resource maps for rendering different target scene models;
[0129] The configuration module is used to create a material ball based on the resource map and configure at least one material parameter for the material ball to obtain a map material;
[0130] The configuration module is further configured to configure matching parameter nodes for the material parameters, so as to adjust the material parameters based on the parameter nodes.
[0131] Furthermore, the rendering module includes:
[0132] a determining unit, configured to determine at least one texture material matching the model surface of the target scene model according to a composition-material correspondence relationship, wherein the composition-material correspondence relationship is used to characterize a correspondence between different model surfaces and different material textures;
[0133] The rendering unit is used to retrieve the material ball of the mapping material and render the model surface of the target scene model according to the material parameters corresponding to the material ball to obtain three-dimensional virtual scene data.
[0134] Further,
[0135] The acquisition module is further configured to acquire at least one scene atmosphere model, wherein the scene atmosphere model is configured to increase the atmosphere characteristics of the three-dimensional virtual scene data;
[0136] The rendering module is also used to render the scene atmosphere model into the three-dimensional virtual scene data according to the scene feature auxiliary relationship to obtain the scene three-dimensional virtual scene data. The scene feature auxiliary relationship is used to characterize the feature relationship between different scene models and different target scene models in the three-dimensional virtual scene data.
[0137] Furthermore, the device further comprises: a starting module,
[0138] The startup module is used to start a rollback mechanism when obtaining geometric model data and model layout parameters of a basic component model of a virtual scene to be built to generate three-dimensional virtual scene data. The rollback mechanism is used to track and record process information of generating the three-dimensional virtual scene data;
[0139] The acquisition module is further configured to acquire process information matching the target rollback node from the rollback information obtained by starting the rollback mechanism, so as to adjust the data in the process information.
[0140] An embodiment of the present invention provides a device for generating three-dimensional virtual scene data. Compared with the prior art, the embodiment of the present invention obtains geometric model data and model layout parameters of a basic component model of a virtual scene to be built, wherein the basic component model is a non-static model, and the model layout parameters are used to characterize the distribution position and logical relationship of the basic component model; determines the building parameters of the basic component model according to the geometric model data and the model layout parameters, and generates a target scene model matching the building parameters; obtains model adjustment parameters of the target scene model, and adjusts the building parameters of the target scene model according to the model adjustment parameters to obtain the adjusted target scene model; obtains a texture material matching the target scene model, and renders the target scene model based on the texture material to generate three-dimensional virtual scene data, thereby increasing the operational convenience of generating three-dimensional virtual scene data, achieving the purpose of flexible and automatic adjustment of the scene model in the three-dimensional virtual scene data, and increasing the scene effect of the three-dimensional virtual scene data by rendering the texture material, thereby improving the generation efficiency of the three-dimensional virtual scene data.
[0141] According to one embodiment of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction. The computer executable instruction can execute the method for generating three-dimensional virtual scene data in any of the above method embodiments.
[0142] Figure 13 A schematic structural diagram of a terminal provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the terminal.
[0143] like Figure 13 As shown, the terminal may include: a processor (processor) 702 , a communication interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .
[0144] The processor 702 , the communication interface 704 , and the memory 706 communicate with each other via a communication bus 708 .
[0145] The communication interface 704 is used to communicate with other devices such as clients or other servers.
[0146] The processor 702 is configured to execute the program 710 , and specifically to execute the relevant steps in the embodiment of the method for generating three-dimensional virtual scene data.
[0147] Specifically, the program 710 may include program codes, which include computer operation instructions.
[0148] Processor 702 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in the terminal may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.
[0149] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0150] The program 710 may be specifically configured to cause the processor 702 to perform the following operations:
[0151] Acquire geometric model data and model layout parameters of a basic component model of a virtual scene to be constructed, wherein the basic component model is a non-static model, and the model layout parameters are used to characterize the distribution position and logical relationship of the basic component model;
[0152] Determining the construction parameters of the basic component model according to the geometric model data and the model layout parameters, and generating a target scene model that matches the construction parameters;
[0153] Acquiring model adjustment parameters of the target scene model, and adjusting the construction parameters of the target scene model according to the model adjustment parameters to obtain an adjusted target scene model;
[0154] A texture material matching the target scene model is obtained, and the target scene model is rendered based on the texture material to generate three-dimensional virtual scene data.
[0155] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, centralized on a single computing device, or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0156] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A method for generating three-dimensional virtual scene data, characterized in that: include: Acquire geometric model data and model layout parameters of a basic component model of a virtual scene to be constructed, wherein the basic component model is a non-static model, and the model layout parameters are used to characterize the distribution position and logical relationship of the basic component model; Determining the construction parameters of the basic component model according to the geometric model data and the model layout parameters, and generating a target scene model that matches the construction parameters; Acquiring model adjustment parameters of the target scene model, and adjusting the construction parameters of the target scene model according to the model adjustment parameters to obtain an adjusted target scene model; Acquire a texture material that matches the target scene model, and render the target scene model based on the texture material to generate three-dimensional virtual scene data; Generating a target scene model that matches the building parameters includes: Retrieving a space partition component, and building the basic component model in a three-dimensional virtual scene based on the space partition component, wherein the space partition component is configured with initial building parameters of different basic component models, and the basic component model is configured with a splicing interface, and the splicing interface is used to splice basic component models of different geometric shapes; The initial building parameters are configured as the building parameters through the space partitioning component to obtain a target scene model in the three-dimensional virtual scene.
2. The method according to claim 1, characterized in that The acquiring of the model adjustment parameters of the target scene model and adjusting the construction parameters of the target scene model by using the model adjustment parameters to obtain the adjusted target scene model comprises: Acquiring a scene adjustment operation on the target scene model, wherein the scene adjustment operation includes adjusting geometric model data and model layout parameters of the target scene model; Analyze the adjustment content of the target scene model generated by the scene adjustment operation, determine the model adjustment parameters, and based on the space editing sub-component of the space partitioning component, adjust the construction parameters of the target scene model according to the model adjustment parameters to obtain the adjusted target scene model.
3. The method according to claim 1, characterized in that Before obtaining the map material matching the target scene model, the method further includes: Load resource maps for rendering different target scene models; Creating a material ball based on the resource map, and configuring at least one material parameter for the material ball to obtain a map material; A matching parameter node is configured for the material parameter, so as to adjust the material parameter based on the parameter node.
4. The method according to claim 3, characterized in that The acquiring of a texture material matching the target scene model, and rendering the target scene model based on the texture material to generate three-dimensional virtual scene data includes: Determining at least one texture material that matches the model surface of the target scene model according to a composition-material correspondence relationship, wherein the composition-material correspondence relationship is used to characterize the correspondence between different model surfaces and different material textures; The material ball of the mapping material is retrieved, and the model surface of the target scene model is rendered according to the material parameters corresponding to the material ball to obtain three-dimensional virtual scene data.
5. The method according to claim 1, wherein After acquiring a texture material matching the target scene model and rendering the target scene model based on the texture material to generate three-dimensional virtual scene data, the method further includes: Acquire at least one scene atmosphere model, where the scene atmosphere model is used to increase the atmosphere characteristics of the three-dimensional virtual scene data; The scene atmosphere model is rendered into the three-dimensional virtual scene data according to the scene feature auxiliary relationship to obtain the scene three-dimensional virtual scene data. The scene feature auxiliary relationship is used to characterize the feature relationship between different scene atmosphere models and different target scene models in the three-dimensional virtual scene data.
6. The method according to claim 1, characterized in that The method further comprises: When obtaining geometric model data and model layout parameters of a basic component model of a virtual scene to be constructed to generate three-dimensional virtual scene data, a rollback mechanism is initiated, wherein the rollback mechanism is used to track and record process information of generating the three-dimensional virtual scene data; The process information matching the target rollback node is acquired from the rollback information obtained by starting the rollback mechanism, so as to adjust the data in the process information.
7. A device for generating three-dimensional virtual scene data, characterized in that: include: An acquisition module is used to obtain geometric model data and model layout parameters of a basic component model of a virtual scene to be built, wherein the basic component model is a non-static model, and the model layout parameters are used to characterize the distribution position and logical relationship of the basic component model; A generation module, configured to determine the construction parameters of the basic component model according to the geometric model data and the model layout parameters, and generate a target scene model matching the construction parameters; An adjustment module, configured to obtain model adjustment parameters of the target scene model, and adjust the construction parameters of the target scene model using the model adjustment parameters to obtain an adjusted target scene model; A rendering module, configured to obtain a texture material matching the target scene model, and render the target scene model based on the texture material to generate three-dimensional virtual scene data; The generation module includes: a calling unit, configured to call a space partition component and build the basic component model in a three-dimensional virtual scene based on the space partition component, wherein the space partition component is configured with initial building parameters of different basic component models, and the basic component model is configured with a splicing interface, wherein the splicing interface is used to splice basic component models of different geometric shapes; A configuration unit is used to configure the initial construction parameters into the construction parameters through the space partition component to obtain a target scene model in the three-dimensional virtual scene.
8. A storage medium storing at least one executable instruction, wherein the executable instruction enables a processor to execute operations corresponding to the method for generating three-dimensional virtual scene data according to any one of claims 1 to 6.
9. A terminal comprising: A processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute an operation corresponding to the method for generating three-dimensional virtual scene data according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method for automatic modeling and dynamic updating of geological three-dimensional model
CN102592313A
Fast rendering method for virtual scene and model
CN107103638A
Method and device applied to virtual reality equipment and virtual reality equipment
CN108073270A
Virtual building model generation method and device, processor and electronic device
CN110826136A
Indoor space layout method and system based on indoor space openness
CN113282991A