Virtual scene generation method and device, electronic equipment and storage medium

By acquiring pre-generated virtual models and performing procedural construction and material processing, the problems of manpower and time consumption in virtual scene production are solved, and efficient scene generation is achieved.

CN116459514BActive Publication Date: 2026-06-02NETEASE (HANGZHOU) NETWORK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2023-03-20
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

The current technology for creating virtual scenes consumes a lot of manpower and time, and is prone to errors, affecting the scene effect and production efficiency.

Method used

By acquiring a pre-generated virtual model, identifying the construction location and building an initial virtual scene, and performing material processing to generate the target virtual scene, a procedural approach is used to reduce manual operations.

Benefits of technology

It reduces the labor and time costs of virtual scene production, improves scene effects and production efficiency, and avoids splicing errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116459514B_ABST
    Figure CN116459514B_ABST
Patent Text Reader

Abstract

The application provides a virtual scene generation method and device, electronic equipment and storage medium, a virtual model is acquired in advance; a building position of the virtual model in a virtual scene is identified, and the virtual model is built according to the building position to generate an initial virtual scene; a specified virtual model in the virtual model is subjected to material processing to obtain a target virtual model; and a target virtual scene is generated based on the initial virtual scene and the target virtual model. In this way, the virtual model is built through programming, and the specified virtual model is subjected to material processing to generate at least one type of virtual scene, so that manual drawing of different types of virtual scenes is not needed, the labor cost for producing the virtual scene is reduced, the production cycle is saved, and the scene effect and production efficiency of the virtual scene are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for generating virtual scenes. Background Technology

[0002] Current game scenes are incredibly diverse. To enhance their visual appeal, game scenes typically include architectural, natural, and various indoor environments. The process usually involves first creating models for the game scene, then using specialized software to render different scenes based on those models. Developers often employ different methods for model processing depending on the scene type, including manually assembling models and manually drawing different models to achieve various display effects. A complete game scene often comprises numerous different types of scenes, each containing a large number of models. Manually processing these scenes is extremely time-consuming and labor-intensive, prone to errors that can negatively impact the scene's visual quality, and reduce production efficiency. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a method, apparatus, electronic device and storage medium for generating virtual scenes, so as to reduce the labor and time costs of creating virtual scenes and improve the scene effect and production efficiency of virtual scenes.

[0004] In a first aspect, embodiments of the present invention provide a method for generating a virtual scene, the method comprising: acquiring a pre-generated virtual model; wherein the virtual model is used to generate at least one type of scene; identifying the construction position of the virtual model in the virtual scene, and constructing the virtual model according to the construction position to generate an initial virtual scene; performing material processing on a specified virtual model in the virtual model to obtain a target virtual model, and generating a target virtual scene based on the initial virtual scene and the target virtual model.

[0005] Secondly, embodiments of the present invention provide a virtual scene generation apparatus, the apparatus comprising: a virtual model acquisition module, configured to acquire a pre-generated virtual model; wherein the virtual model is used to generate at least one type of scene; an initial virtual scene generation module, configured to identify the construction location of the virtual model and construct the virtual model according to the construction location to generate an initial virtual scene; a target virtual model determination module, configured to perform material processing on a specified virtual model in the virtual model to obtain a target virtual model; and a target virtual scene generation module, configured to generate a target virtual scene based on the initial virtual scene and the target virtual model.

[0006] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the virtual scene generation method of any of the first aspects.

[0007] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the virtual scene generation method of any one of the first aspects.

[0008] The embodiments of the present invention bring the following beneficial effects:

[0009] This invention provides a method, apparatus, electronic device, and storage medium for generating virtual scenes. The method involves acquiring a pre-generated virtual model; identifying the construction position of the virtual model within the virtual scene; constructing the virtual model according to the construction position to generate an initial virtual scene; applying material processing to a specified virtual model within the virtual model to obtain a target virtual model; and generating the target virtual scene based on the initial virtual scene and the target virtual model. This approach generates at least one type of virtual scene by programmatically constructing the virtual model and applying material processing to the specified virtual model, eliminating the need for manually drawing different types of virtual scenes. This reduces the labor costs of creating virtual scenes, saves production time, and thus improves the scene effect and production efficiency of virtual scenes.

[0010] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0013] Figure 1 A flowchart illustrating a method for generating a virtual scene according to an embodiment of the present invention;

[0014] Figure 2 A function setting interface provided in an embodiment of the present invention;

[0015] Figure 3 A schematic diagram of a first component model provided in an embodiment of the present invention;

[0016] Figure 4 This is a schematic diagram of marker points in a first component model and a second component model provided in an embodiment of the present invention;

[0017] Figure 5 This is a schematic diagram of the marker points in another first component model and second component model provided in an embodiment of the present invention;

[0018] Figure 6 This is another function setting interface provided in an embodiment of the present invention;

[0019] Figure 7 A schematic diagram of another first component model provided in an embodiment of the present invention;

[0020] Figure 8 This is another function setting interface provided in an embodiment of the present invention;

[0021] Figure 9 A schematic diagram of a virtual scene provided in an embodiment of the present invention;

[0022] Figure 10 A schematic diagram of a specified virtual model provided in an embodiment of the present invention;

[0023] Figure 11 A schematic diagram of a first target material provided in an embodiment of the present invention;

[0024] Figure 12 A schematic diagram of another specified virtual model provided in an embodiment of the present invention;

[0025] Figure 13 A schematic diagram of a target virtual model provided in an embodiment of the present invention;

[0026] Figure 14 A schematic diagram of another specified virtual model provided in an embodiment of the present invention;

[0027] Figure 15 This is another function setting interface provided in an embodiment of the present invention;

[0028] Figure 16 A schematic diagram of another target virtual model provided in an embodiment of the present invention;

[0029] Figure 17 This is a schematic diagram illustrating the texture display effect in a specified virtual model, provided by an embodiment of the present invention.

[0030] Figure 18 A schematic diagram of a virtual cube provided for an embodiment of the present invention;

[0031] Figure 19 This is a schematic diagram illustrating the texture display effect in a target virtual model according to an embodiment of the present invention;

[0032] Figure 20 A schematic diagram of the structure of a virtual scene generation device provided in an embodiment of the present invention;

[0033] Figure 21 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0035] Current game scenes are very diverse. To enhance the scene effects, game scenes typically include architectural scenes, natural scenes, and various indoor scenes. In related technologies, the models needed for the game scene are usually created first, and then different scenes are rendered based on these models using specific software. Developers often need to process the models using different methods for different types of scenes, including manually assembling models, manually drawing different models, and achieving various display effects. A complete game scene usually includes many different types of scenes, and each type of scene contains a large number of models. Manually processing these is very time-consuming and labor-intensive, prone to errors, affecting the scene effects, and reducing production efficiency. Therefore, this invention provides a method, apparatus, electronic device, and storage medium for generating virtual scenes, which can be applied to devices such as laptops and computers.

[0036] To facilitate understanding of this embodiment, a method for generating a virtual scene disclosed in this invention will first be described in detail, such as... Figure 1 As shown, the method includes the following steps:

[0037] Step S102: Obtain a pre-generated virtual model; wherein the virtual model is used to generate at least one type of scene;

[0038] The aforementioned virtual models can be models from different virtual scenes. For example, virtual walls, doors, windows, floors, and fences in architectural scenes; various virtual machines in mechanical scenes; virtual trees, beaches, rocks, and rivers in natural environment scenes; and virtual glass, lighting fixtures, appliances, and furniture in indoor environments. These virtual scenes typically refer to virtual scenes within games. They can be a single type of virtual scene or include multiple types. For instance, it could be a virtual scene containing architectural scenes, natural scenes, or only architectural scenes.

[0039] Specifically, the virtual models mentioned above are usually created using modeling software. In order to save the production cycle of virtual scenes, the size of each virtual model is usually pre-planned so that the size of all virtual models is a regular integer.

[0040] Step S104: Identify the construction location of the virtual model in the virtual scene, and construct the virtual model according to the construction location to generate the initial virtual scene;

[0041] Specifically, the above steps can be performed using pre-created blueprints. These pre-created blueprints typically include multiple blueprints, each used for different functions, such as generating an initial virtual scene, generating architectural virtual scenes, or applying materials to the model. Additionally, each blueprint includes multiple functional nodes, each used for different functions, such as identifying the placement of the virtual model or constructing the virtual model. The placement of the virtual model can be pre-configured during virtual model creation or determined in the game engine using blueprints based on the virtual model's dimensions. The initial virtual model typically refers to a virtual scene without any model rendering.

[0042] Specifically, when opening a virtual model in the game engine and building each virtual model, the required functions are first enabled, and a blueprint is created based on the target function nodes. Then, based on the enabled functions and the created blueprint, the model size and building position of the virtual model can be automatically identified. Finally, the virtual model that conforms to the building size can be automatically built based on the model size and building position. This building process can be automatic or manual.

[0043] Step S106: Perform material processing on the specified virtual model in the virtual model to obtain the target virtual model;

[0044] The aforementioned specified virtual model can be virtual equipment, virtual machines, virtual glass, virtual rivers, virtual rocks, etc., within a virtual scene. The target virtual model possesses a realistic and natural visual effect, typically including wear and tear effects, such as wear on metal, wood, or plastic, which can include paint chipping, polishing, or breakage. It also includes material blending effects, such as the blending of stone and sand materials. The blueprint is created by combining multiple target functional nodes, which at least include: VertexNormalMS node, IF node, LinearInterpolate node, DistanceToNearestSurface node, Absolute Worldposition node, CameraPosition node, PixelDepth node, and various function nodes.

[0045] The VertexNormalMS node outputs the expression for the vertex normals in world scene space; the IF node compares two inputs and then passes the expression for one of the other single input values ​​based on the comparison result; the LinearInterpolate node is an expression that interpolates between two input values ​​using a third input as the masking parameter; the DistanceToNearestSurface node is an expression for the distance from the nearest surface to the material; the Absolute Worldposition node outputs the expression for the current pixel's position in global space; the CameraPosition node outputs a 3D vector value representing the camera's position in world scene space; the PixelDepth node outputs the depth of the currently rendered pixel, i.e., the expression for the distance between the pixel and the camera; various function nodes include at least the BreakOutFloat3Components and MakeFloat2 functions. The BreakOutFloat3Components function takes a 3D vector as input and retrieves and outputs a scalar for a single channel. The MakeFloat2 function creates a 2D vector from a series of scalar inputs.

[0046] Specifically, a target texture can be drawn at a specified location on a specified virtual model, or a target material can be assigned to it to obtain the target virtual model. The target texture and target material are usually pre-generated to give the target virtual character a realistic and natural display effect.

[0047] Step S108: Generate the target virtual scene based on the initial virtual scene and the target virtual model.

[0048] After creating the initial virtual scene and the target virtual model, the virtual model in the initial virtual scene can be rendered to make the initial virtual scene more realistic and natural. The target virtual model can then be placed into the initial virtual scene to generate the target virtual scene. The aforementioned target virtual scenes include at least: architectural scenes, natural environment scenes, indoor scenes, and mechanical scenes.

[0049] It should be noted that the aforementioned "blueprint" can serve as one of the execution entities for the virtual scene generation method described above. Alternatively, it can be understood as executing the steps of the virtual scene generation method using a pre-created blueprint for reuse / invocation. This blueprint refers to a visual script.

[0050] This invention provides a method for generating virtual scenes, which involves: acquiring a pre-generated virtual model; identifying the construction position of the virtual model in the virtual scene and constructing the virtual model according to the construction position to generate an initial virtual scene; applying material processing to a specified virtual model within the virtual model to obtain a target virtual model; and generating the target virtual scene based on the initial virtual scene and the target virtual model. This method generates at least one type of virtual scene by programmatically constructing the virtual model and applying material processing to the specified virtual model, eliminating the need to manually draw different types of virtual scenes, reducing the labor costs of creating virtual scenes, saving production time, and thus improving the scene effect and production efficiency of virtual scenes.

[0051] Currently, when creating realistic architectural scenes, the main approach is to first create component models, and then achieve variations in detail through different combinations of these components. However, the assembly process relies entirely on visual observation and manual splicing. This method, relying solely on visual observation and manual splicing, easily leads to misalignment, overlap, or cracks at the joints. Eliminating these errors requires a considerable amount of time.

[0052] The virtual model mentioned above includes a first component model and a second component model, which are used at least to generate architectural scenes; the first component model and the second component model are each preset with marker points; the marker points are used to indicate the connection positions between the first component model and the second component model;

[0053] This embodiment uses a virtual model as an example of a building scene. The first component model typically refers to a building model, such as various building walls, while the second component model typically refers to accessory models within the building, such as doors and windows. The marker points mentioned above are pre-configured anchor points.

[0054] The first component model and the second component pricing model mentioned above are created in the following manner:

[0055] First, set the grid size in the modeling software. Specifically, you can use the Grid Spacing function to set the side length of each grid cell in the background grid of the virtual model, for example, to 100cm. Figure 2 As shown, set the input box for Grid Spacing to 100cm. Grid Spacing serves as the reference unit for precise model positioning. Since directly building components within an architectural scene can easily lead to light leaks or misalignments, the dimensions of the first and second component models need to be carefully planned. Specifically, the background grid of the virtual model can be used as a reference to ensure that the dimensions of the created models are regular integers. For example... Figure 3 The first component model shown has dimensions that are regular integers.

[0056] Additionally, for the second component model, which consists of door and window fittings with non-integer dimensions, anchor points can be configured at specific locations in the second component model (such as corners or below the center line of doors and windows) and at corresponding locations in the first component model. For example, such as... Figure 4 The marker points (i.e., anchor points) set on the door model (corresponding to the second component model mentioned above) and the door frame model (object of the first component model mentioned above) are shown. For example... Figure 5 The marker points (i.e. anchor points) are set on the window model (corresponding to the second component model above) and the window frame model (object of the first component model above).

[0057] One possible implementation of the above steps—identifying the location of the virtual model, building the virtual model based on the location, and generating the initial virtual scene—is as follows:

[0058] The model size of the first component model is determined by capturing the mesh and the capture angle, and the first component model is built according to the model size. The capturing mesh and capture angle are used to determine the model size of each first component model, and first component models with the same model size are built together. A component snap-fit ​​system is used to detect the distance between preset marker points of the first component model and preset marker points of the second component model. The component snap-fit ​​system is used to identify the preset marker points of the first component model and the second component model in real time, and calculate the distance between the preset marker points of different models. When the distance is less than a preset threshold, the second component model is controlled to be built at the target position of the first component model, generating an initial virtual scene.

[0059] The aforementioned preset thresholds can be set according to actual needs. Specifically, when assembling (building) the first and second component models in the game engine, it is necessary to enable the game engine's mesh snapping and angle snapping functions. A diagram illustrating these functions is shown below. Figure 6 As shown. By using the mesh snapping and angle snapping functions, the model dimensions of the first component model can be automatically identified. Based on these dimensions, the various first component models can be automatically and perfectly aligned, such as... Figure 7 The two first component models shown are now complete.

[0060] When building the second component model onto the first component model, you first need to enable the ModularSnap System, as shown in the diagram below. Figure 8 As shown. This component snap-fit ​​system is an externally loaded plugin. In actual implementation, the operator only needs to move the second component model near the first component model. When the distance between the preset marker points of the first and second component models is less than a preset threshold, the second component model can be automatically snapped to the first component model. For example, the anchor points of the door and window models snap to the corresponding anchor points on the door and window frames. That is to say, initially, the window model needs to be manually moved roughly, but when the model enters the effective range of the anchor points, it will automatically be pulled to the correct position, just like an iron block entering the magnetic field of a magnet. The final generated initial virtual scene can be an architectural scene, a natural environment scene, an interior scene, etc. For example, as shown... Figure 9 The initial virtual scene shown is an architectural scene.

[0061] In this method, the first component model can be automatically controlled to splice by using the mesh capture function, the angle capture function, and the component snap-fit ​​system. At the same time, the second component model can be automatically snapped to the corresponding position of the first component model by using the pre-set anchor points. This improves the scene effect of the virtual scene, avoids splicing errors, and improves production efficiency.

[0062] The above-described step of controlling the second component model to be built at the target position of the first component model to generate the initial virtual scene when the distance is less than a preset threshold can be implemented as follows: When the distance is less than the preset threshold, it is determined that preset marker points in the first component model are associated with preset marker points in the second component model; based on the position of the associated marker points, the second component model is controlled to be built to the target position of the first component model to generate the initial virtual scene; wherein, the preset marker points of the second component model coincide with the preset marker points of the first component model. The aforementioned target position is the position of the marker points in the first component model associated with the second component model.

[0063] Typically, pre-set markers are interconnected. Therefore, when placing the second component model onto the corresponding position of the first component model, the two component models will automatically snap together only if their markers are interconnected. In other words, when the distance between the markers on the first and second component models is less than a preset distance, the two component models will automatically snap together, with the markers serving as the reference point for snapping. For example, if the first component model has a first and a second marker, and the second component model has a third and a fourth marker, with the first and third markers interconnected, the first marker on the first component model will be placed at the position of the third marker on the second component model, and the second marker on the first component model will be placed at the position of the fourth marker on the second component model.

[0064] Currently, placing a door in the correct position requires manual operation and visual observation, which is slow and prone to errors. Using anchor points (the interconnected markers mentioned above) acts like a magnet; simply placing the anchor point in the correct location allows the model to be automatically pulled into the correct position when moved near it. This method is highly efficient when constructing large buildings with many doors and windows.

[0065] When creating sci-fi scenes primarily featuring mechanical models, the wear and tear effects on the edges of mechanical parts are often achieved by hand-painting. Creating these effects by hand requires unUVing the model, adding a wear and tear layer to the texture file, and finally manually painting the edges. This process is repeated for each mechanical part, making it extremely time-consuming.

[0066] Therefore, the aforementioned virtual model refers to a mechanical model within a virtual scene; where the mechanical model in the virtual scene can be various metal machine models, such as generators, transformers, metal cabinets, etc.

[0067] One possible implementation of the above steps for processing the materials of a specified virtual model in a virtual model to obtain the target virtual model is as follows:

[0068] (1) Determine the edge region of the specified virtual model;

[0069] The aforementioned edge regions typically refer to the prominent edges of the model, for example, such as... Figure 10 The diagram shows a specified virtual model, where the white area represents the edge region of the specified virtual model. In other words, the aforementioned edge region can be understood as the area with sharp edges in the specified virtual model.

[0070] One possible implementation is as follows: obtain the vertex normal information of the specified virtual model, determine the surface curvature of the specified virtual model based on the vertex normal information, and determine the edge region of the specified virtual model based on the surface curvature.

[0071] Specifically, the material system's global vertex normal (VertexNormalMS) node, in conjunction with the (IF) node, is used to generate a function that identifies the surface curvature of the model to locate the model's prominent edges, i.e., the aforementioned edge regions. Specifically, the material system's global vertex normal (VertexNormalMS) node acquires and outputs the vertex normal information of the specified virtual model; then, based on the vertex normal information, the surface curvature of the specified virtual model is calculated; and the edge regions of the specified virtual model are determined based on the surface curvature using the IF node.

[0072] A higher curvature indicates a greater degree of curvature in the curve. Therefore, a curvature threshold can be set; if the curvature of the model surface exceeds this threshold, the model surface is defined as the edge region of the virtual model. In this method, specific functional nodes within the game engine can automatically determine the model's edges, eliminating the need for manual selection by developers and significantly improving production efficiency.

[0073] (2) Obtain the pre-generated first target material, assign the first target material to the edge area to obtain the target virtual model, so that the target virtual model has the display effect of edge metal wear; wherein, the first target material is a noise material that imitates damage.

[0074] The first target material mentioned above is pre-generated. Specifically, it can be generated based on the model material of a specified virtual model. For example, if the model material of the specified virtual model is metal, then a noise material with metal wear can be generated. For instance, as shown... Figure 11 The diagram shown simulates a damaged, noisy material.

[0075] Specifically, you can directly apply the first target material to the edge area. You can also use the edge area as a mask, such as... Figure 10 As shown, the white area is a mask. By adjusting certain parameters and multiplying the first target material by the mask, a target mask with an irregular wear effect at the edges can be obtained, as shown. Figure 12 As shown, the edge area at this point has an irregular wear effect. This allows us to obtain the aforementioned target virtual model, giving the edge area of ​​the target virtual model a metallic wear display effect.

[0076] Alternatively, the obtained mask can be used to generate a damaged material mask through a Linear Interpolate node and applied to the metal material (i.e., the area of ​​the specified virtual model excluding the edge areas). The resulting target virtual model will then exhibit a metal wear effect not only in the edge areas but also in other areas. For example, ... Figure 13 As shown, not only the edge areas have a metallic wear effect, but other areas also have a metallic wear effect.

[0077] In this method, the edges and corners of a specified virtual model are determined automatically through a programmed process, and pre-generated noise materials simulating damage are automatically applied to the edge and corner areas, intelligently achieving a metallic effect of edge wear. This eliminates the need for developers to manually draw textures, significantly saving time on texture drawing and improving production efficiency.

[0078] When creating natural scenes, blending different objects, such as large rocks or trees inserted into the ground, with the ground is often achieved by manually drawing textures or using vertex shaders. However, this method requires drawing each model individually based on the specific blending requirements, which is very time-consuming.

[0079] Based on this, the aforementioned designated virtual model refers to a natural scenery model in a virtual scene. The designated virtual model includes a first designated virtual model and a second designated virtual model. The first designated virtual model can be a rock in water, a rock on grass, a rock on a beach, a tree on the ground, etc. The second designated virtual model can be water, a desert, grassland, etc. For example,... Figure 14 As shown, the first designated virtual model is the stone model in the figure, and the second designated virtual model is the desert model located below the stone model.

[0080] Another possible implementation of the above steps of processing the material of a specified virtual model in a virtual model to obtain a target virtual model is as follows: Determine the contact area between the first specified virtual model and the second specified virtual model; wherein, the first specified virtual model is partially or entirely located on a specified surface of the second specified virtual model; obtain a pre-generated second target material, and apply the second target material to the contact area to obtain the target virtual model, so that the target virtual model has a display effect of natural material transition; wherein, the second target material is a mixed material of the material of the first specified virtual model and the material of the second specified virtual model.

[0081] Specifically, the material difference between the first specified virtual model and the second specified virtual model can be mixed to obtain a mixed material, which is the second target material mentioned above. In actual implementation, the DistanceFields function of the game engine can be enabled first, such as... Figure 15 The "Generate Mesh Distance Field" is shown. Then, the DistanceToNearestSurface node is used to identify the contact area, also known as the intersection range, between the first and second specified virtual models. Specifically, the absolute world position nodes can be used to determine the absolute world positions of the first and second specified virtual models, and the areas with the same position are identified as the contact area. Then, the second target material is applied to the contact area, finally resulting in a virtual model with a material blending effect. For example, as shown... Figure 16 As shown, the area where the stone contacts the ground has a natural transition in material properties.

[0082] In one possible approach, after determining the contact area, this area is multiplied by a second target material to obtain a natural transition effect. Using the area with this effect as a mask, the rock material and the ground material can be blended using linear interpolation. This results in a smart material that can automatically recognize the intersection of the model and the terrain and generate a natural transition. In use, the model with this material is simply placed in the scene, and it will automatically produce natural changes, saving a significant amount of processing time.

[0083] In the above method, the contact area between models is determined automatically through a program, and the display effect of material transition in the contact area is intelligently realized. There is no need for developers to draw manually, which saves a lot of production time and improves production efficiency.

[0084] Delayed decals are a very common and efficient way to enrich scenes. However, in game engines, delayed decals generally don't display correctly on semi-transparent materials, such as... Figure 17 As shown, time-lapse decals display correctly on regular materials, but not on transparent materials. Related techniques typically involve manually drawing time-lapse decals on transparent or semi-transparent virtual models, which is time-consuming.

[0085] Based on this, the above-mentioned virtual model is a virtual model with transparent or semi-transparent materials; a virtual model with transparent materials can be a glass virtual model, etc., and a semi-transparent virtual model can be a colored glass model, a patterned glass model, or a water model, etc.

[0086] Another possible approach to the steps described above for applying material processing to a specified virtual model within a virtual model to obtain the target virtual model is as follows:

[0087] (1) Obtain the virtual cube and preset texture;

[0088] The aforementioned virtual cube can also be called a virtual cube matrix. This virtual cube can be understood as being composed of many points, and these points can be called a virtual cube matrix. For example, such as... Figure 18 The diagram shows a virtual cube. After processing based on the virtual cube and preset textures, when this virtual cube comes into contact with any virtual model in the virtual scene, the preset texture will be displayed on the contact surface.

[0089] (2) Based on the virtual cube and the preset texture, when the specified virtual model intersects with the virtual cube, the preset texture is displayed on the intersection area of ​​the specified virtual model to obtain the target virtual model, so that the target virtual model has the display effect of delayed decal.

[0090] The above-described steps, based on a virtual cube and a preset texture, involve displaying the preset texture on the intersection area of ​​the specified virtual model and the virtual cube when the specified virtual model intersects, thus obtaining the target virtual model and giving it a delayed decal display effect. One possible implementation is as follows:

[0091] (1) Determine the target location points within the virtual cube;

[0092] The aforementioned target location point usually refers to the location point included in the virtual cube, and the target location point is also a location point on the virtual model in the current scene, or a location point in the current scene.

[0093] (2) Calculate the target coordinates of the target location point; where the target coordinates are two-dimensional coordinates, and the target coordinates are used to: indicate the display range of the preset texture;

[0094] Calculate the first coordinate of the target location point in the virtual cube; the first coordinate is a two-dimensional coordinate; determine the target coordinate of the target location point based on the second coordinate and the first coordinate of each pixel in the preset texture; wherein, the second coordinate is a two-dimensional coordinate.

[0095] One possible implementation of the above steps for calculating the first coordinates of the target location point in the virtual cube is as follows: calculate the third coordinates of the target location point in the virtual cube; the third coordinates are three-dimensional coordinates; sample the coordinate values ​​of the first and second coordinate axes in the third coordinates to obtain the first coordinates of the target location point in the virtual cube.

[0096] Specifically, the local coordinates (i.e., the third coordinates) of the current pixel (i.e., the target position point mentioned above) in the virtual cube matrix can be calculated using the absolute world position node, the camera position node, and the pixel depth node. Here, the current pixel refers to the pixel within the virtual cube matrix displayed on the screen.

[0097] Since the preset decal is a two-dimensional image, the coordinates of each point on the image are a set of (X,Y) values. Therefore, the (X,Y) values ​​of the current pixel are sampled using the BreakOutFloat3Components and MakeFloat2 functions. That is, the coordinate values ​​of the first and second coordinate axes in the third coordinate are sampled to obtain the first coordinates of the target position point in the virtual cube.

[0098] After obtaining the first coordinates of the target location point in the virtual cube, the second and first coordinates of each pixel in the preset texture are used as inputs to the Multipiy node, and the target coordinates of the target location point, i.e., the two-dimensional coordinates of the preset decal displayed within the virtual cube, can be output.

[0099] Additionally, it should be noted that this embodiment uses a virtual cube to simulate the function of a delayed decal. Therefore, it is necessary to calculate the range of this virtual cube, which is the area to be used to display the decal. Thus, it is necessary to determine whether all pixels are within the range of the virtual cube. If they are within the virtual cube, a preset decal will be displayed. If they are not within the virtual cube, no image will be displayed.

[0100] (3) Based on the target coordinates of the target location point and the preset texture, when the specified virtual model intersects with the virtual cube, the preset texture is displayed on the intersection area of ​​the specified virtual model to obtain the target virtual model, so that the target virtual model has the display effect of delayed decal.

[0101] The target coordinates of the target location point are stored in the alpha channel of the preset material sphere, and the preset texture is stored in the color channel of the material sphere. The material sphere is assigned to the static mesh. When the specified virtual model intersects with the virtual cube, the intersection area of ​​the specified virtual model and the target coordinates of the intersection point in the intersection area are determined. Using the material sphere, based on the target coordinates of the intersection point, the preset texture is displayed at the intersection point, and the preset texture is not displayed at other target locations besides the intersection point, thus obtaining the target virtual model, so that the target virtual model has a delayed decal display effect.

[0102] One possible implementation involves first calculating the positions of all points within a virtual cube using nodes, and then calculating the positions of points where the virtual cube intersects with other models. This result is then connected to the alpha channel of the material. The desired result is that the points at these intersections display the decal content, while points outside the intersections do not. Only the alpha channel in the material has this function (essentially, a function to control which points are displayed and which are not). Later, after applying an image to the color channel, the decal content will be displayed at specific locations on the model. For example,... Figure 19 As shown, preset textures are displayed on transparent glass. This method of simulating time-delay decals retains all the characteristics and working methods of the original time-delay decals, and can perfectly display patterns on semi-transparent materials, also compensating for the shortcomings of some game engines' original time-delay decals. Furthermore, this method can not only be applied to displaying patterns on glass, but also to displaying special effects such as skill releases on water surfaces. It can implement time-delay decal functionality on all materials, offering a wider range of applications than the time-delay decals built into game engines.

[0103] In the above method, transparent and semi-transparent models can be made to have the display effect of time-delay decals through a programmed automatic method. This not only retains all the characteristics and working methods of the original time-delay decals, but also perfectly displays the pattern on the semi-transparent material. There is no need for developers to draw manually, which saves a lot of production time and improves production efficiency.

[0104] Corresponding to the above method embodiments, this embodiment of the invention provides a virtual scene generation apparatus, such as... Figure 20 As shown, the device includes:

[0105] The virtual model acquisition module 201 is used to acquire a pre-generated virtual model; wherein the virtual model is used to generate at least one type of scene;

[0106] The initial virtual scene generation module 202 is used to identify the construction position of the virtual model in the virtual scene, and construct the virtual model according to the construction position to generate the initial virtual scene;

[0107] The target virtual model determination module 203 is used to perform material processing on a specified virtual model in the virtual model to obtain the target virtual model;

[0108] The target virtual scene generation module 204 is used to generate a target virtual scene based on the initial virtual scene and the target virtual model.

[0109] This invention provides a virtual scene generation apparatus that acquires a pre-generated virtual model; identifies the construction position of the virtual model in the virtual scene, and constructs the virtual model according to the construction position to generate an initial virtual scene; performs material processing on a specified virtual model in the virtual model to obtain a target virtual model; and generates the target virtual scene based on the initial virtual scene and the target virtual model. In this method, by programmatically constructing the virtual model and performing material processing on the specified virtual model, at least one type of virtual scene can be generated, eliminating the need to manually draw different types of virtual scenes, reducing the labor cost of creating virtual scenes, saving the production cycle, and thus improving the scene effect and production efficiency of virtual scenes.

[0110] The aforementioned virtual model includes a first component model and a second component model, which are used at least to generate an architectural scene. Each component model has pre-set marker points. These marker points indicate the connection points between the first and second component models. The initial virtual scene generation module is further configured to: detect the distance between the pre-set marker points of the first and second component models using a component snap-fit ​​system; wherein the component snap-fit ​​system is used to identify the pre-set marker points of the first and second component models in real time and calculate the distance between the pre-set marker points of different models; when the distance is less than a preset threshold, the second component model is controlled to be erected at the target position of the first component model to generate the initial virtual scene.

[0111] The aforementioned initial virtual scene generation module is also used to: when the distance is less than a preset threshold, determine that the preset marker points in the first component model are associated with the preset marker points in the second component model; based on the position of the associated marker points, control the second component model to be built to the target position of the first component model to generate an initial virtual scene; wherein the preset marker points of the second component model coincide with the preset marker points of the first component model.

[0112] The aforementioned device further includes a construction module, used to: determine the model size of the first component model by capturing a mesh and a capturing angle, and construct the first component model according to the model size; wherein, the capturing mesh and the capturing angle are used to determine the model size of each of the first component models, and to construct the first component models with the same model size.

[0113] The aforementioned specified virtual model is a mechanical model in a virtual scene; the aforementioned target virtual model determination module is also used to: determine the edge region of the specified virtual model; obtain a pre-generated first target material, assign the first target material to the edge region, and obtain the target virtual model so that the target virtual model has the display effect of edge metal wear; wherein, the first target material is a noise material that imitates damage.

[0114] The aforementioned target virtual model determination module is also used to: obtain vertex normal information of a specified virtual model, determine the surface curvature of the specified virtual model based on the vertex normal information, and determine the edge region of the specified virtual model based on the surface curvature.

[0115] The aforementioned designated virtual model is a natural scenery model in a virtual scene. The designated virtual model includes a first designated virtual model and a second designated virtual model. The aforementioned target virtual model determination module is also used to: determine the contact area between the first designated virtual model and the second designated virtual model; obtain a pre-generated second target material, and assign the second target material to the contact area to obtain the target virtual model; wherein, the second target material is a mixed material of the material of the first designated virtual model and the material of the second designated virtual model.

[0116] The aforementioned specified virtual model is a virtual model with transparent or semi-transparent material; the aforementioned target virtual model determination module is also used to: obtain a virtual cube and a preset texture; based on the virtual cube and the preset texture, when the specified virtual model intersects with the virtual cube, display the preset texture on the intersection area of ​​the specified virtual model to obtain the target virtual model, so that the target virtual model has a delayed decal display effect.

[0117] The aforementioned target virtual model determination module is also used to: determine the target location point within the virtual cube; calculate the target coordinates of the target location point; wherein the target coordinates are two-dimensional coordinates, and the target coordinates are used to: indicate the display range of the preset texture; based on the target coordinates of the target location point and the preset texture, when the specified virtual model intersects with the virtual cube, the preset texture is displayed on the intersection area of ​​the specified virtual model to obtain the target virtual model, so that the target virtual model has a delayed decal display effect.

[0118] The aforementioned target virtual model determination module is also used to: store the target coordinates of the target location points in the transparency channel of a preset material sphere, and store the preset texture in the color channel of the material sphere; assign the material sphere to the static mesh, and when the specified virtual model intersects with the virtual cube, determine the intersection area of ​​the specified virtual model and the target coordinates of the intersection location points in the intersection area; through the material sphere, based on the target coordinates of the intersection location points, control the display of the preset texture at the intersection location points, and control the other location points in the target location points other than the intersection location points not to display the preset texture, thereby obtaining the target virtual model so that the target virtual model has a delayed decal display effect.

[0119] The aforementioned target virtual model determination module is also used to: calculate the first coordinates of the target location point in the virtual cube; the first coordinates are two-dimensional coordinates; determine the target coordinates of the target location point based on the second coordinates and the first coordinates of each pixel in the preset texture; wherein, the second coordinates are two-dimensional coordinates.

[0120] The aforementioned target virtual model determination module is also used to: calculate the third coordinate of the target location point in the virtual cube; the third coordinate is a three-dimensional coordinate; sample the coordinate values ​​of the first and second coordinate axes in the third coordinate to obtain the first coordinate of the target location point in the virtual cube.

[0121] The virtual scene generation apparatus provided in this embodiment of the invention has the same technical features as the virtual scene generation method provided in the above embodiments, so it can also solve the same technical problems and achieve the same technical effects.

[0122] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the above-described method for generating virtual scenes. This electronic device can be a server or a terminal device.

[0123] See Figure 21 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-described method for generating virtual scenes.

[0124] Furthermore, Figure 21 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.

[0125] The memory 101 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 102 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 21 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0126] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. Processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101. The processor 100 reads information from memory 101 and, in conjunction with its hardware, completes the steps of the virtual scene generation method of the aforementioned embodiment, specifically including:

[0127] The process involves: acquiring a pre-generated virtual model; using the virtual model to generate at least one type of scene; identifying the construction position of the virtual model within the virtual scene; constructing the virtual model according to the construction position to generate an initial virtual scene; applying material processing to a specified virtual model within the virtual model to obtain a target virtual model; and generating the target virtual scene based on the initial virtual scene and the target virtual model. This method utilizes specified functional nodes within the game engine to pre-create blueprints through logical combinations, enabling the procedural construction of virtual models and the application of material processing to specified virtual models to generate at least one type of virtual scene. This eliminates the need for manually drawing different types of virtual scenes, reducing the labor costs of virtual scene creation, saving production time, and thus improving the scene effects and production efficiency of virtual scenes.

[0128] The virtual model includes a first component model and a second component model, which are used at least to generate an architectural scene. The first and second component models are each pre-set with marker points. These marker points indicate the connection points between the first and second component models. The process involves identifying the virtual model's placement within the virtual scene, constructing the virtual model based on these placements, and generating an initial virtual scene. This includes: detecting the distance between the pre-set marker points on the first and second component models using a component snap-fit ​​system. The component snap-fit ​​system is used to identify the pre-set marker points on the first and second component models in real time and calculate the distance between the pre-set marker points on different models. When the distance is less than a preset threshold, the second component model is controlled to be placed at the target position of the first component model, generating the initial virtual scene. In this method, the first component model can be automatically spliced ​​using the mesh and angle capture functions, as well as the component snap-fit ​​system. Simultaneously, the second component model can be automatically snapped to the corresponding position of the first component model using pre-set anchor points, improving the scene effect of the virtual scene, avoiding splicing errors, and increasing production efficiency.

[0129] The above-mentioned method of controlling the second component model to be built at the target position of the first component model and generating an initial virtual scene when the distance is less than a preset threshold includes: when the distance is less than the preset threshold, determining that the preset marker points in the first component model are associated with the preset marker points in the second component model; and controlling the second component model to be built at the target position of the first component model according to the position of the associated marker points to generate an initial virtual scene; wherein the preset marker points of the second component model coincide with the preset marker points of the first component model.

[0130] Before detecting the distance between the preset marker points of the first component model and the preset marker points of the second component model through the component snap-fit ​​system, the method further includes: determining the model size of the first component model by capturing a mesh and a capturing angle, and building the first component model according to the model size; wherein, the capturing mesh and the capturing angle are used to determine the model size of each of the first component models, and to build the first component models with the same model size.

[0131] The aforementioned designated virtual model is a mechanical model within a virtual scene. Material processing is applied to the designated virtual model within the virtual model to obtain the target virtual model. This includes: determining the edge region of the designated virtual model; obtaining a pre-generated first target material; and applying the first target material to the edge region to obtain the target virtual model, thus giving the target virtual model a display effect of edge metal wear. The first target material is a noise material that simulates damage. In this method, the edges of the designated virtual model are determined automatically in a programmed manner, and the pre-generated noise material simulating damage is automatically applied to the edge region, intelligently achieving the metal effect of edge wear. This eliminates the need for manual drawing by developers, significantly saving time on texture drawing and improving production efficiency.

[0132] The process of determining the edge regions in a specified virtual model includes: obtaining the vertex normal information of the specified virtual model; determining the surface curvature of the specified virtual model based on the vertex normal information; and determining the edge regions of the specified virtual model based on the surface curvature. In this method, model edges can be automatically determined through specific functional nodes in the game engine, eliminating the need for manual selection by developers and significantly improving production efficiency.

[0133] The aforementioned designated virtual models are natural scenery models in a virtual scene. These designated virtual models include a first designated virtual model and a second designated virtual model. Material processing is applied to the designated virtual models within the virtual models to obtain the target virtual model. This process includes: determining the contact area between the first and second designated virtual models; obtaining a pre-generated second target material; and applying the second target material to the contact area to obtain the target virtual model. The second target material is a mixture of the materials of the first and second designated virtual models. By automatically determining the contact area between models in a procedural manner, the display effect of material transitions in the contact area is intelligently achieved, eliminating the need for manual drawing by developers, significantly saving production time and improving production efficiency.

[0134] The aforementioned specified virtual model is a virtual model with transparent or semi-transparent materials; material processing is performed on the specified virtual model in the virtual model to obtain the target virtual model, including: obtaining a virtual cube and a preset texture; based on the virtual cube and the preset texture, when the specified virtual model intersects with the virtual cube, the preset texture is displayed on the intersection area of ​​the specified virtual model to obtain the target virtual model, so that the target virtual model has a delayed decal display effect.

[0135] The above method, based on a virtual cube and a preset texture, displays the preset texture on the intersection area of ​​the specified virtual model and the virtual cube when the specified virtual model intersects, thus obtaining the target virtual model and giving it a delayed decal display effect. This includes: determining the target position point within the virtual cube; calculating the target coordinates of the target position point; wherein the target coordinates are two-dimensional coordinates, used to indicate the display range of the preset texture; and based on the target coordinates of the target position point and the preset texture, displaying the preset texture on the intersection area of ​​the specified virtual model and the virtual cube when the specified virtual model intersects, thus obtaining the target virtual model and giving it a delayed decal display effect. This method automatically and programmatically enables transparent and semi-transparent models to have a delayed decal display effect, retaining all the characteristics and working methods of the original delayed decal, and perfectly displaying patterns on semi-transparent materials. It eliminates the need for manual drawing by developers, significantly saving production time and improving production efficiency.

[0136] The above-mentioned method, based on the target coordinates of the target location point and the preset texture, displays the preset texture on the intersection area of ​​the specified virtual model when the specified virtual model intersects with the virtual cube, thus obtaining the target virtual model and giving it a delayed decal display effect. This includes: storing the target coordinates of the target location point in the transparency channel of a preset material sphere and storing the preset texture in the color channel of the material sphere; assigning the material sphere to a static mesh; determining the intersection area of ​​the specified virtual model and the target coordinates of the intersection point within the intersection area when the specified virtual model intersects with the virtual cube; and controlling the display of the preset texture at the intersection point using the material sphere based on the target coordinates of the intersection point, while controlling the display of the preset texture at other target location points besides the intersection point, thus obtaining the target virtual model and giving it a delayed decal display effect.

[0137] The above calculation of the target coordinates of the target location point includes: calculating the first coordinate of the target location point in the virtual cube; the first coordinate is a two-dimensional coordinate; determining the target coordinates of the target location point based on the second coordinate and the first coordinate of each pixel in the preset texture; wherein, the second coordinate is a two-dimensional coordinate.

[0138] The above calculation of the first coordinate of the target location point in the virtual cube includes: calculating the third coordinate of the target location point in the virtual cube; the third coordinate is a three-dimensional coordinate; sampling the coordinate values ​​of the first and second coordinate axes in the third coordinate to obtain the first coordinate of the target location point in the virtual cube.

[0139] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the above-described method for generating the virtual scene, the method comprising:

[0140] The process involves: acquiring a pre-generated virtual model; using the virtual model to generate at least one type of scene; identifying the construction position of the virtual model within the virtual scene; constructing the virtual model according to the construction position to generate an initial virtual scene; applying material processing to a specified virtual model within the virtual model to obtain a target virtual model; and generating the target virtual scene based on the initial virtual scene and the target virtual model. This method utilizes specified functional nodes within the game engine to pre-create blueprints through logical combinations, enabling the procedural construction of virtual models and the application of material processing to specified virtual models to generate at least one type of virtual scene. This eliminates the need for manually drawing different types of virtual scenes, reducing the labor costs of virtual scene creation, saving production time, and thus improving the scene effects and production efficiency of virtual scenes.

[0141] The virtual model includes a first component model and a second component model, which are used at least to generate an architectural scene; the first component model and the second component model are each preset with marker points; the marker points are used to indicate the connection positions between the first component model and the second component model;

[0142] Identify the placement of the virtual model within the virtual scene, construct the virtual model based on the placement location, and generate an initial virtual scene, including:

[0143] The component snap-fit ​​system detects the distance between preset marker points on the first component model and the second component model. This system identifies these marker points in real-time and calculates the distance between them. When the distance is less than a preset threshold, the second component model is positioned at the target location of the first component model, generating an initial virtual scene. This method, through mesh and angle capture functions and the component snap-fit ​​system, automatically controls the splicing of the first component model. Simultaneously, pre-set anchor points allow the second component model to automatically snap to the corresponding position on the first component model, improving the scene effect of the virtual scene, avoiding splicing errors, and increasing production efficiency.

[0144] The above-mentioned method of controlling the second component model to be built at the target position of the first component model and generating an initial virtual scene when the distance is less than a preset threshold includes: when the distance is less than the preset threshold, determining that the preset marker points in the first component model are associated with the preset marker points in the second component model; and controlling the second component model to be built at the target position of the first component model according to the position of the associated marker points to generate an initial virtual scene; wherein the preset marker points of the second component model coincide with the preset marker points of the first component model.

[0145] Before detecting the distance between the preset marker points of the first component model and the preset marker points of the second component model through the component snap-fit ​​system, the method further includes: determining the model size of the first component model by capturing a mesh and a capturing angle, and building the first component model according to the model size; wherein, the capturing mesh and the capturing angle are used to determine the model size of each of the first component models, and to build the first component models with the same model size.

[0146] The aforementioned specified virtual model is a mechanical model in a virtual scene. Material processing of the specified virtual model within the virtual model to obtain the target virtual model includes: determining the edge region of the specified virtual model; obtaining a pre-generated first target material; and applying the first target material to the edge region to obtain the target virtual model, thus giving the target virtual model a display effect of edge metal wear. The first target material is a noise material that simulates damage. In this method, the edges of the specified virtual model are determined automatically in a programmed manner, and the pre-generated noise material simulating damage is automatically applied to the edge region, intelligently achieving the metal effect of edge wear. This eliminates the need for manual drawing by developers, significantly saving time on texture drawing and improving production efficiency.

[0147] The process of determining the edge regions in a specified virtual model includes: obtaining the vertex normal information of the specified virtual model; determining the surface curvature of the specified virtual model based on the vertex normal information; and determining the edge regions of the specified virtual model based on the surface curvature. In this method, model edges can be automatically determined through specific functional nodes in the game engine, eliminating the need for manual selection by developers and significantly improving production efficiency.

[0148] The aforementioned designated virtual models are natural scenery models in a virtual scene. These designated virtual models include a first designated virtual model and a second designated virtual model. Material processing is applied to the designated virtual models within the virtual models to obtain the target virtual model. This process includes: determining the contact area between the first and second designated virtual models; obtaining a pre-generated second target material; and applying the second target material to the contact area to obtain the target virtual model. The second target material is a mixture of the materials of the first and second designated virtual models. By automatically determining the contact area between models in a procedural manner, the display effect of material transitions in the contact area is intelligently achieved, eliminating the need for manual drawing by developers, significantly saving production time and improving production efficiency.

[0149] The aforementioned specified virtual model is a virtual model with transparent or semi-transparent materials; material processing is performed on the specified virtual model in the virtual model to obtain the target virtual model, including: obtaining a virtual cube and a preset texture; based on the virtual cube and the preset texture, when the specified virtual model intersects with the virtual cube, the preset texture is displayed on the intersection area of ​​the specified virtual model to obtain the target virtual model, so that the target virtual model has a delayed decal display effect.

[0150] The above method, based on a virtual cube and a preset texture, displays the preset texture on the intersection area of ​​the specified virtual model and the virtual cube when the specified virtual model intersects, thus obtaining the target virtual model and giving it a delayed decal display effect. This includes: determining the target position point within the virtual cube; calculating the target coordinates of the target position point; wherein the target coordinates are two-dimensional coordinates, used to indicate the display range of the preset texture; and based on the target coordinates of the target position point and the preset texture, displaying the preset texture on the intersection area of ​​the specified virtual model and the virtual cube when the specified virtual model intersects, thus obtaining the target virtual model and giving it a delayed decal display effect. This method automatically and programmatically enables transparent and semi-transparent models to have a delayed decal display effect, retaining all the characteristics and working methods of the original delayed decal, and perfectly displaying patterns on semi-transparent materials. It eliminates the need for manual drawing by developers, significantly saving production time and improving production efficiency.

[0151] The above-mentioned method, based on the target coordinates of the target location point and the preset texture, displays the preset texture on the intersection area of ​​the specified virtual model when the specified virtual model intersects with the virtual cube, thus obtaining the target virtual model and giving it a delayed decal display effect. This includes: storing the target coordinates of the target location point in the transparency channel of a preset material sphere and storing the preset texture in the color channel of the material sphere; assigning the material sphere to a static mesh; determining the intersection area of ​​the specified virtual model and the target coordinates of the intersection point within the intersection area when the specified virtual model intersects with the virtual cube; and controlling the display of the preset texture at the intersection point using the material sphere based on the target coordinates of the intersection point, while controlling the display of the preset texture at other target location points besides the intersection point, thus obtaining the target virtual model and giving it a delayed decal display effect.

[0152] The above calculation of the target coordinates of the target location point includes: calculating the first coordinate of the target location point in the virtual cube; the first coordinate is a two-dimensional coordinate; determining the target coordinates of the target location point based on the second coordinate and the first coordinate of each pixel in the preset texture; wherein, the second coordinate is a two-dimensional coordinate.

[0153] The above calculation of the first coordinate of the target location point in the virtual cube includes: calculating the third coordinate of the target location point in the virtual cube; the third coordinate is a three-dimensional coordinate; sampling the coordinate values ​​of the first and second coordinate axes in the third coordinate to obtain the first coordinate of the target location point in the virtual cube.

[0154] The computer program product of the virtual scene generation method, apparatus and system provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0155] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0156] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0157] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0158] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0159] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for generating a virtual scene, characterized in that, The method includes: Obtain a pre-generated virtual model; wherein the virtual model is used to generate at least one type of scene; Identify the construction position of the virtual model in the virtual scene, and construct the virtual model according to the construction position to generate an initial virtual scene; The specified virtual model in the virtual model is subjected to material processing to obtain the target virtual model; Based on the initial virtual scene and the target virtual model, a target virtual scene is generated; The virtual model includes a first component model and a second component model, which are used at least to generate an architectural scene; the first component model and the second component model are each preset with marker points; the marker points are used to indicate the connection positions between the first component model and the second component model; The process of identifying the construction position of the virtual model in the virtual scene, constructing the virtual model according to the construction position, and generating an initial virtual scene includes: The component snap-fit ​​system detects the distance between preset marker points of the first component model and preset marker points of the second component model; wherein, the component snap-fit ​​system is used to identify preset marker points of the first component model and preset marker points of the second component model in real time, and calculate the distance between preset marker points of different models; When the distance is less than a preset threshold, the second component model is controlled to be built at the target position of the first component model to generate an initial virtual scene.

2. The method according to claim 1, characterized in that, When the distance is less than a preset threshold, the second component model is positioned at the target location of the first component model to generate an initial virtual scene, including: When the distance is less than a preset threshold, it is determined that the preset marker point in the first component model is associated with the preset marker point in the second component model; Based on the location of the associated marker points, the second component model is controlled to be built to the target location of the first component model to generate an initial virtual scene; wherein the preset marker points of the second component model coincide with the preset marker points of the first component model.

3. The method according to claim 1, characterized in that, Before detecting the distance between preset marker points of the first component model and the second component model using the component snap-fit ​​system, the method further includes: The model size of the first component model is determined by capturing the mesh and capturing the angle, and the first component model is built according to the model size; wherein, the capturing mesh and capturing the angle are used to determine the model size of each first component model, and first component models with the same model size are built together.

4. The method according to claim 1, characterized in that, The specified virtual model is a mechanical model in a virtual scene; The specified virtual model in the virtual model is subjected to material processing to obtain the target virtual model, including: Determine the edge region of the specified virtual model; A pre-generated first target material is obtained, and the first target material is applied to the edge region to obtain the target virtual model, so that the target virtual model has the display effect of edge metal wear; wherein, the first target material is a noise material that imitates damage.

5. The method according to claim 4, characterized in that, Determining the edge region of the specified virtual model includes: Obtain the vertex normal information of the specified virtual model, and determine the surface curvature of the specified virtual model based on the vertex normal information; The edge region of the specified virtual model is determined based on the surface curvature of the model.

6. The method according to claim 1, characterized in that, The specified virtual model is a natural scene model in a virtual scene, and the specified virtual model includes a first specified virtual model and a second specified virtual model; The specified virtual model in the virtual model is subjected to material processing to obtain the target virtual model, including: Determine the contact area between the first specified virtual model and the second specified virtual model; Obtain a pre-generated second target material and apply the second target material to the contact area to obtain a target virtual model; wherein, the second target material is a mixture of the material of the first specified virtual model and the material of the second specified virtual model.

7. The method according to claim 1, characterized in that, The specified virtual model is a virtual model with transparent or semi-transparent materials; The specified virtual model in the virtual model is subjected to material processing to obtain the target virtual model, including: Get the virtual cube and preset texture; Based on the virtual cube and the preset texture, when the specified virtual model intersects with the virtual cube, the preset texture is displayed on the specified virtual model to obtain the target virtual model, so that the target virtual model has a delayed decal display effect.

8. The method according to claim 7, characterized in that, Based on the virtual cube and the preset texture, when the specified virtual model intersects with the virtual cube, the preset texture is displayed on the intersection area of ​​the specified virtual model to obtain the target virtual model, so that the target virtual model has a delayed decal display effect, including: Determine the target location points within the range of the virtual cube; Calculate the target coordinates of the target location point; wherein, the target coordinates are two-dimensional coordinates, and the target coordinates are used to: indicate the display range of the preset texture; Based on the target coordinates of the target location point and the preset texture, when the specified virtual model intersects with the virtual cube, the preset texture is displayed on the intersection area of ​​the specified virtual model to obtain the target virtual model, so that the target virtual model has a delayed decal display effect.

9. The method according to claim 8, characterized in that, Based on the target coordinates of the target location point and the preset texture, when the specified virtual model intersects with the virtual cube, the preset texture is displayed on the intersection area of ​​the specified virtual model to obtain the target virtual model, so that the target virtual model has a delayed decal display effect, including: The target coordinates of the target location point are stored in the transparency channel of the preset material sphere, and the preset texture is stored in the color channel of the material sphere; The material sphere is assigned to the static mesh. When the specified virtual model intersects with the virtual cube, the intersection area of ​​the specified virtual model and the target coordinates of the intersection point in the intersection area are determined. Using the material sphere, based on the target coordinates of the intersecting points, the system controls the display of the preset texture at the intersecting points and controls the other target points (excluding the intersecting points) not to display the preset texture, thereby obtaining the target virtual model and giving the target virtual model a delayed decal display effect.

10. The method according to claim 8, characterized in that, Calculating the target coordinates of the target location point includes: Calculate the first coordinates of the target location point within the virtual cube; the first coordinates are two-dimensional coordinates. The target coordinates of the target location point are determined based on the second coordinates and the first coordinates of each pixel in the preset texture; wherein the second coordinates are two-dimensional coordinates.

11. The method according to claim 10, characterized in that, Calculating the first coordinates of the target location point in the virtual cube includes: Calculate the third coordinate of the target location point within the virtual cube; the third coordinate is a three-dimensional coordinate. The coordinate values ​​of the first and second coordinate axes in the third coordinate system are sampled to obtain the first coordinate of the target location point in the virtual cube.

12. A device for generating virtual scenes, characterized in that, The device includes: A virtual model acquisition module is used to acquire a pre-generated virtual model; wherein the virtual model is used to generate at least one type of scene; An initial virtual scene generation module is used to identify the construction position of the virtual model in the virtual scene, and construct the virtual model according to the construction position to generate an initial virtual scene; The target virtual model determination module is used to perform material processing on a specified virtual model in the virtual model to obtain a target virtual model; The target virtual scene generation module is used to generate a target virtual scene based on the initial virtual scene and the target virtual model; The virtual model includes a first component model and a second component model, which are used at least to generate an architectural scene; the first component model and the second component model are each preset with marker points; the marker points are used to indicate the connection positions between the first component model and the second component model; The initial virtual scene generation module is further configured to: detect the distance between preset marker points of the first component model and preset marker points of the second component model through a component snap-fit ​​system; wherein, the component snap-fit ​​system is configured to identify preset marker points of the first component model and preset marker points of the second component model in real time, and calculate the distance between preset marker points of different models; when the distance is less than a preset threshold, control the second component model to be built at the target position of the first component model to generate an initial virtual scene.

13. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the method for generating a virtual scene according to any one of claims 1-11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method for generating a virtual scene according to any one of claims 1-11.