Texture generation method and device of virtual model, storage medium and electronic device

By using a combination of model meshes and multiple base texture maps in a virtual model to generate a target random texture map, the problem of high texture repetition caused by four-dimensional continuous texture maps is solved, thus improving the user experience.

CN115731335BActive Publication Date: 2026-06-19NETEASE (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
2022-11-18
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In existing technologies, random texture maps generated using quadrature continuous mapping have high texture repetition over large areas, resulting in a poor user experience and making it difficult to meet the needs of artists.

Method used

By acquiring the model mesh and multiple basic texture maps of the virtual model, the first and second point sets are generated using the model mesh. The addition position and blending method of the basic texture maps are determined, and texture blending is performed to generate the target random texture map.

Benefits of technology

It reduces texture repetition, improves the random texture effect of large-area display of virtual models, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115731335B_ABST
    Figure CN115731335B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, storage medium, and electronic device for generating textures for a virtual model. The method includes: acquiring a model mesh and multiple basic texture maps of the virtual model, wherein the model mesh is used to determine the texture coordinate information of the virtual model's surface; generating a first point set and a second point set using the model mesh, wherein the first point set is used to determine the positions to be added to the multiple basic texture maps, and the second point set is used to determine the texture blending method of the multiple basic texture maps; adding the multiple basic texture maps to the surface of the virtual model according to the first point set, obtaining multiple processing results; and performing texture blending processing on the multiple processing results using the second point set to obtain a target random texture map of the virtual model. This application solves the technical problem in related technologies where using quadrature continuous texture maps to create texture details results in high repetition of generated random texture maps and poor user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a method, apparatus, storage medium, and electronic device for generating textures for a virtual model. Background Technology

[0002] In the creation of virtual scenes, it is often necessary to display random textures (such as random grass textures on a virtual surface) over a large area. Related technologies typically utilize tilling maps to create texture details and then generate random texture maps over a large area. However, this method has a drawback: the generated random texture maps have a high degree of texture repetition, making it difficult to meet the display requirements of random textures over a large area.

[0003] There is currently no effective solution to the above problems.

[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] At least some embodiments of this application provide a method, apparatus, storage medium, and electronic device for generating textures for virtual models, in order to at least solve the technical problem in the related art that the generation of random texture maps with high repetition and poor user experience is caused by using four-way continuous texture maps to create texture details.

[0006] According to one embodiment of this application, a texture generation method for a virtual model is provided, comprising: acquiring a model mesh and multiple basic texture maps of the virtual model, wherein the model mesh is used to determine the texture coordinate information of the surface of the virtual model; generating a first point set and a second point set using the model mesh, wherein the first point set is used to determine the positions to be added to the multiple basic texture maps, and the second point set is used to determine the texture blending method of the multiple basic texture maps; adding the multiple basic texture maps to the surface of the virtual model according to the first point set to obtain multiple processing results; and performing texture blending processing on the multiple processing results using the second point set to obtain a target random texture map of the virtual model.

[0007] According to one embodiment of this application, a random texture generation device for a virtual model is also provided, comprising: an acquisition module for acquiring a model mesh and multiple basic texture maps of a virtual model, wherein the model mesh is used to determine the texture coordinate information of the surface of the virtual model; a generation module for generating a first point set and a second point set using the model mesh, wherein the first point set is used to determine the positions to be added to the multiple basic texture maps, and the second point set is used to determine the texture blending method of the multiple basic texture maps; an addition module for adding the multiple basic texture maps to the surface of the virtual model according to the first point set, thereby obtaining multiple processing results; and a blending module for performing texture blending processing on the multiple processing results using the second point set, thereby obtaining a target random texture map of the virtual model.

[0008] According to one embodiment of this application, a computer-readable storage medium is also provided, in which a computer program is stored, wherein the computer program is configured to execute the random texture generation method of the virtual model in any of the above claims at runtime.

[0009] According to one embodiment of this application, an electronic device is also provided, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform a random texture generation method for a virtual model as described above.

[0010] In at least some embodiments of this application, by obtaining the model mesh and multiple basic texture maps of a virtual model, wherein the model mesh is used to determine the texture coordinate information of the surface of the virtual model, a first point set and a second point set are generated using the model mesh, wherein the first point set is used to determine the positions to be added to the multiple basic texture maps, and the second point set is used to determine the texture blending method of the multiple basic texture maps, and further, based on the first point set, the multiple basic texture maps are added to the surface of the virtual model to obtain multiple processing results, and the second point set is used to perform texture blending processing on the multiple processing results to obtain the target random texture map of the virtual model, thereby achieving the purpose of blending multiple basic texture maps to generate a random texture map of the virtual model, thus achieving the technical effect of reducing texture repetition for virtual models that need to display random textures over a large area, and thus solving the technical problem in related technologies that the use of quadrature continuous texture maps to create texture details results in high repetition of the generated random texture maps and poor user experience. Attached Figure Description

[0011] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0012] Figure 1This is a schematic diagram of a four-sided continuous texture based on existing technology;

[0013] Figure 2 This is a schematic diagram of a large-area random texture mapping based on existing technology;

[0014] Figure 3 This is a hardware structure block diagram of a mobile terminal for a random texture generation method for a virtual model according to one embodiment of this application.

[0015] Figure 4 This is a flowchart of a method for generating random textures for a virtual model according to one embodiment of this application;

[0016] Figure 5 This is a schematic diagram of an optional two-dimensional random vector according to one embodiment of this application;

[0017] Figure 6 This is a schematic diagram of an optional second point set according to one embodiment of this application;

[0018] Figure 7 This is a schematic diagram of an optional rotation result according to one embodiment of this application;

[0019] Figure 8 This is a schematic diagram of an optional round result according to one embodiment of this application;

[0020] Figure 9 This is a schematic diagram of an optional mixing result according to one embodiment of this application;

[0021] Figure 10 This is a structural block diagram of a texture generation apparatus for a virtual model according to one embodiment of this application;

[0022] Figure 11 This is a schematic diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] It should be noted that, in the specification of this application, the word "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. In the following description, details are set forth for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid unnecessarily obscuring the description of this application. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0026] In related technologies, four-dimensional continuous texture maps are typically used to create texture details and then generate random texture maps over a large area. Figure 1 This is a schematic diagram of a four-sided continuous texture based on existing technology, such as... Figure 1 As shown, while quad contiguous texture mapping can ensure texture continuity in the vertical and horizontal directions, it cannot achieve texture continuity in directions such as left and top, or right and bottom. When using quad contiguous texture mapping to create texture details and then generate random texture maps over a large area, the problem of texture details being repeated in some areas will occur.

[0027] Figure 2 This is a schematic diagram of a large-area random texture mapping based on existing technology, such as... Figure 2 As shown, in a large area, especially when the viewpoint (such as a virtual observation camera) is far from the virtual model, the random texture maps generated by using quad continuous maps will have very obvious repetition, which is difficult to meet the art requirements of the application scenario.

[0028] In addition, the related technology also provides a method to reduce the repetition of random texture maps in a large area through algorithm rules. However, the textures generated by such algorithm rules are usually noisy textures or textures with certain rules, which still cannot meet the needs of generating irregular random textures in a large area in the application scenario. Furthermore, introducing algorithm rules will increase the device performance consumption.

[0029] It is worth noting that the above-mentioned methods provided by the relevant technologies are only applicable to generating random textures within a large area based on a single base texture map, and it is difficult to generate random textures within a large area based on multiple different base texture maps (such as texture maps of different types, or different texture maps of the same type).

[0030] In one possible implementation of this application, the inventors, after practice and careful research, found that the method commonly used in the field of computer technology, which utilizes four-dimensional continuous texture mapping to create texture details and generate random texture maps over a large area, still suffers from the technical problem of high repetition of the generated random texture maps and poor user experience. Based on this, the embodiments of this application can be applied to the field of computer technology, especially to scenarios involving the generation of random textures over a large area in the field of video games. The corresponding game types in this field of video games can be action, adventure, simulation, role-playing, and casual games, etc.

[0031] This application proposes a method for generating random texture maps of virtual models by mixing multiple basic texture maps. This method reduces the texture redundancy of virtual models that require large-area display of random textures, thereby solving the technical problem in related technologies where the use of quadrature continuous texture maps to create texture details results in high redundancy of the generated random texture maps and poor user experience.

[0032] The methods described in this application can be executed in a terminal device (e.g., a mobile terminal, a computer terminal, or a similar computing device). Taking a mobile terminal as an example, the mobile terminal can be a smartphone, tablet computer, PDA, mobile internet device, PAD, game console, or other terminal device.

[0033] Figure 3 This is a hardware structure block diagram of a mobile terminal according to a method for generating random textures of a virtual model based on one embodiment of this application. Figure 3 As shown, a mobile terminal may include one or more ( Figure 3(Only one is shown) Processor 302, memory 304, transmission device 306, input / output device 308, and display device 310. Taking the application of the random texture generation method of the virtual model to a video game scene through this mobile terminal as an example, processor 302 calls and runs the computer program stored in memory 304 to execute the random texture generation method of the virtual model. The generated target random texture map of the virtual model is transmitted to input / output device 308 and / or display device 310 through transmission device 306, thereby providing the virtual model with the corresponding random texture to the player.

[0034] Still as Figure 3 As shown, processor 302 may include, but is not limited to, processing devices such as: central processing unit (CPU), graphics processing unit (GPU), digital signal processing (DSP) chip, microprocessor (MCU), field programmable gate array (FPGA), neural network processing unit (NPU), tensor processing unit (TPU), artificial intelligence (AI) type processor, etc.

[0035] Those skilled in the art will understand that Figure 3 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 3 The more or fewer components shown, or having the same Figure 3 The different configurations shown.

[0036] In some optional embodiments primarily focused on gaming scenarios, the aforementioned terminal device may also provide a human-computer interaction interface with a touch-sensitive surface. This interface can sense finger contact and / or gestures to interact with a graphical user interface (GUI). The human-computer interaction functions may include the following: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. Executable instructions for performing the aforementioned human-computer interaction functions are configured / stored in one or more processor-executable computer program products or readable storage media.

[0037] The methods described in this application can also be executed on a server. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Taking the random texture generation method for virtual models applied to a video game scene via a video game server as an example, the video game server can generate target random texture maps of virtual models in the video game scene based on this random texture generation method, and provide the virtual model with the corresponding random texture to the player (e.g., it can be rendered and displayed on the player's terminal screen, or provided to the player through holographic projection, etc.).

[0038] According to one embodiment of this application, an embodiment of a method for generating random textures for a virtual model is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0039] This embodiment provides a method for generating random textures for a virtual model running on the aforementioned mobile terminal. Figure 4 This is a flowchart of a random texture generation method for a virtual model according to one embodiment of this application, such as... Figure 4 As shown, the method includes the following steps:

[0040] Step S41: Obtain the model mesh and multiple basic texture maps of the virtual model, wherein the model mesh is used to determine the texture coordinate information of the surface of the virtual model;

[0041] The aforementioned virtual model can be a model to be rendered in a virtual scene (such as a terrain model in a virtual scene). This virtual scene can be a game screen design scene in the fields of computer technology and image processing that involves generating random textures over a large area. The game type corresponding to this game screen design scene can be: action games (e.g., first-person or third-person shooter games, 2D or 3D fighting games, war action games, and sports action games), adventure games (e.g., exploration games, collection games, puzzle games), simulation games (e.g., sandbox simulation games, simulation games, strategy simulation games, city-building simulation games, business simulation games), role-playing games, and casual games (e.g., board games, casual competitive games, music rhythm games, dress-up games, etc.).

[0042] The model mesh of the aforementioned virtual model can be the UV coordinate mesh of the virtual model's surface, containing multiple mesh cells and multiple mesh nodes (i.e., mesh line intersections). This model mesh can be used to determine the texture coordinate information of the virtual model's surface, which may include the UV coordinate values ​​of multiple mesh nodes, UV section information of multiple mesh cells, etc.

[0043] The aforementioned multiple base texture maps are pre-specified textures used to create random texture maps for the aforementioned virtual model. The rendering area of ​​the virtual model is a relatively large region, and the size of each of the multiple base texture maps is typically much smaller than the size of the aforementioned large region.

[0044] It should be noted that, in order to enhance the randomness of the textures in the generated virtual model's random texture maps, the aforementioned multiple base texture maps can be texture maps of different types (such as a grass texture, a bare ground texture, a water texture, etc.), or they can be different texture maps of the same type (such as two different sand textures, etc.).

[0045] Step S42: Generate a first point set and a second point set using the model mesh. The first point set is used to determine the positions to be added to multiple basic texture maps, and the second point set is used to determine the texture blending method of multiple basic texture maps.

[0046] By using the aforementioned model mesh to determine the texture coordinate information of the virtual model's surface, the first point set can be generated. Multiple points in this first point set are used to determine the locations on the virtual model's surface where the various base texture maps will be added.

[0047] By using the aforementioned model mesh to determine the texture coordinate information of the virtual model's surface, the second point set can be generated. Multiple points in this second point set are used to determine the texture blending method of the multiple base texture maps. This texture blending method can include: the blending method of each base texture map across multiple locations to be added, the blending method between any two base texture maps, and the blending method between multiple base texture maps, etc.

[0048] Specifically, the above-described method of generating the first and second point sets using model mesh may also include other methods and steps, which can be referred to in the further description of the embodiments of this application below, and will not be repeated here.

[0049] Step S43: Based on the first point set, add multiple basic texture maps to the surface of the virtual model to obtain multiple processing results;

[0050] Based on the positions of the multiple base texture maps determined by the first point set above on the surface of the virtual model, the multiple base texture maps are added to the surface of the virtual model. Adding multiple base texture maps to the surface of the virtual model may include: placing the multiple base texture maps on the surface of the virtual model, and processing the placed multiple base texture maps (such as rotation, translation, sampling, etc.).

[0051] Each of the above processing results corresponds to the result of adding each of the multiple base texture maps to the surface of the virtual model.

[0052] Specifically, based on the first point set, multiple basic texture maps are added to the surface of the virtual model to obtain multiple processing results. Other methods and steps may also be included, which can be referred to in the further description of the embodiments of this application below, and will not be repeated here.

[0053] Step S44: Using the second point set, perform texture blending on multiple processing results to obtain the target random texture map of the virtual model.

[0054] Using the texture blending methods of the multiple base texture maps determined by the second point set, texture blending processing is performed on the multiple processing results to obtain the target random texture map of the virtual model. The texture blending processing may include blending the corresponding processing results at multiple locations to be added, according to the texture blending method of each base texture map, and may also include blending the multiple processing results among themselves. The target random texture map is used to store the random texture data after texture blending processing of the multiple processing results.

[0055] Specifically, the above-mentioned use of the second point set to perform texture blending on multiple processing results to obtain the target random texture map of the virtual model may also include other methods and steps, which can be referred to in the further description of the embodiments of this application below, and will not be repeated here.

[0056] It is noteworthy that, compared with existing technologies that only generate random textures based on a single base texture map, the random texture maps created using multiple base texture maps in the embodiments of this application have higher texture randomness.

[0057] In at least some embodiments of this application, by obtaining the model mesh and multiple basic texture maps of a virtual model, wherein the model mesh is used to determine the texture coordinate information of the surface of the virtual model, a first point set and a second point set are generated using the model mesh, wherein the first point set is used to determine the positions to be added to the multiple basic texture maps, and the second point set is used to determine the texture blending method of the multiple basic texture maps, and further, based on the first point set, the multiple basic texture maps are added to the surface of the virtual model to obtain multiple processing results, and the second point set is used to perform texture blending processing on the multiple processing results to obtain the target random texture map of the virtual model, thereby achieving the purpose of blending multiple basic texture maps to generate a random texture map of the virtual model, thus achieving the technical effect of reducing texture repetition for virtual models that need to display random textures over a large area, and thus solving the technical problem in related technologies that the use of quadrature continuous texture maps to create texture details results in high repetition of the generated random texture maps and poor user experience.

[0058] The methods described in the embodiments of this application will be further described below.

[0059] Optionally, in step S42, generating the first point set using the model mesh may include the following steps:

[0060] Step S421: Obtain the texture coordinate information of the virtual model based on the model mesh;

[0061] Step S422: Perform coordinate calculations based on texture coordinate information and preset point density parameters to determine the first point set, wherein the first point set includes multiple first random points corresponding to multiple grid cells of the model mesh.

[0062] In the optional embodiments provided in steps S421 to S422 above, obtaining the texture coordinate information of the virtual model based on the model mesh can be achieved by obtaining the UV coordinate information of the virtual model surface from the mesh data corresponding to the model mesh. The aforementioned preset point density parameter can be a texture repeatability parameter predetermined by the artist.

[0063] Based on the UV coordinate information of the virtual model surface and the texture repeatability parameters, coordinate calculations can be performed to determine the aforementioned plurality of first random points on the surface of the virtual model. These plurality of first random points may include a point randomly determined from each of the plurality of mesh cells of the model mesh. These plurality of first random points can be used to determine the locations on the surface of the virtual model where texture maps will be added.

[0064] The random texture generation method for virtual models provided in this application can be applied to scenarios involving the generation of random textures over a large area in the field of video games, such as generating random textures for virtual terrain in a game scene. The following uses the scenario of generating random textures for virtual terrain in a game scene as an example to specifically illustrate the technical solution of this application's embodiments.

[0065] According to the above optional embodiments of this application, when generating random surface textures for virtual terrain in a game scene, the model mesh file of the virtual terrain model is obtained, denoted as Grid; two pre-specified surface base texture maps, denoted as P01 (in this example, such as...), are obtained. Figure 1 The texture maps shown are used as base texture maps P01 and P02. Furthermore, the surface UV coordinate information of the virtual terrain model (equivalent to the texture coordinate information mentioned above) can be obtained from the model mesh file Grid, denoted as frag.

[0066] Based on the above surface UV coordinate information frag and the texture repetition level Tilling preset by the artists, multiple first random points (equivalent to the above first point set) can be calculated according to the following formula (1):

[0067]

[0068] In the above formula (1), frag.uv represents the UV coordinates of a point in the above surface UV coordinate information frag, (u, v) represents the coordinate position of the point in the world coordinate system, and Section represents the grid cell where the point is located (the value is the maximum of u and v).

[0069] It should be noted that each of the aforementioned multiple first random points can be located at the center of the grid cell in which it resides. Since the multiple grid cells are uniformly distributed in the surface grid model, the multiple first random points will not cluster in a specific area of ​​the virtual surface, but will be evenly distributed across the virtual surface. In other words, the point density of the multiple first random points is the same in any area of ​​the virtual surface. However, the coordinates (u, v) of the multiple first random points can be used as seeds for a random function to create corresponding random values ​​for these points, thereby reflecting the randomness of the multiple points and ensuring the randomness of the surface texture generated using these multiple first random points.

[0070] Optionally, in step S42, generating the second point set using the model mesh may include the following steps:

[0071] Step S423: Create a random value for each of the multiple grid nodes in the model mesh to obtain multiple first random values;

[0072] Step S424: Based on the coordinate information of multiple grid nodes, offset positioning is performed according to multiple first random values ​​to generate a second point set, wherein the second point set includes multiple second random points corresponding to multiple grid nodes.

[0073] In the optional embodiments provided by steps S423 to S423 above, creating a random value for each of the multiple grid nodes in the model mesh to obtain multiple first random values ​​can be done by: obtaining the UV coordinate information of multiple grid nodes on the virtual model surface from the grid data corresponding to the model mesh, using the UV coordinate of each grid node in the multiple grid nodes as the seed of the random function, creating a random value for each grid node, and thus obtaining the random value corresponding to each grid node in the multiple grid nodes (equivalent to the above multiple first random values).

[0074] It should be noted that the above model mesh can be a two-dimensional planar mesh or a three-dimensional solid mesh. Correspondingly, each of the above multiple first random values ​​can be a two-dimensional random value (such as a two-dimensional random vector) or a three-dimensional random value (such as a three-dimensional random vector).

[0075] Based on the coordinate information of multiple grid nodes, and by performing offset positioning using multiple first random values, the second point set can be generated as follows: Based on the UV coordinates of the aforementioned multiple grid nodes, offset positioning can be performed using the aforementioned multiple first random values ​​as offsets to determine the aforementioned second point set. The multiple second random points in this second point set can be random points corresponding to each of the aforementioned multiple grid nodes.

[0076] According to the above optional embodiments of this application, when generating random surface textures of virtual terrain in a game scene, the UV coordinate information frag2 of multiple grid nodes can be obtained from the model grid file Grid.

[0077] Figure 5 This is a schematic diagram of an optional two-dimensional random vector according to one embodiment of this application, as shown below. Figure 5 As shown, based on the UV coordinates frag2.uv of each of the multiple grid nodes, a two-dimensional random vector (equivalent to the multiple first random values ​​mentioned above) is created using the Random function. Taking the grid node with coordinates frag2.uv as (2, 1) as an example, the two-dimensional random vector created for this grid node is (-0.71, 0.93). That is, the offset in the U direction between this grid node (2, 1) and the corresponding second random point is -0.71 (multiplied by the size of a grid cell), and the offset in the V direction is 0.93 (multiplied by the size of a grid cell).

[0078] Figure 6 This is a schematic diagram of an optional second point set according to one embodiment of this application, such as... Figure 6 As shown, based on the UV coordinates frag2.uv of each grid node and the corresponding two-dimensional random vector, multiple second random points can be determined. Figure 6 The multiple black dots shown are part of a plurality of second random dots.

[0079] It is easy to understand that since the second point set is determined by the multiple first random values, the randomness of the multiple second random points in the second point set can be guaranteed, thereby guaranteeing the randomness of the surface texture generated using the multiple second random points.

[0080] Optionally, in step S43, adding multiple base texture maps to the surface of the virtual model based on the first point set to obtain multiple processing results may include the following execution steps:

[0081] Step S431: Based on multiple first random points in the first point set, determine multiple locations to be added on the surface of the virtual model;

[0082] Step S432: According to multiple locations to be added, multiple basic texture maps are randomly added in multiple rounds to obtain multiple processing results.

[0083] In the optional embodiments provided in steps S431 to S432 above, based on multiple first random points corresponding to multiple mesh units in the first point set, the multiple positions to be added are determined on the surface of the virtual model. The multiple positions to be added can be the positions of the multiple first random points on the surface of the virtual model. That is, according to the positions of the multiple first random points on the surface of the virtual model, the multiple basic texture maps are added to the surface of the virtual model through multiple rounds of random addition.

[0084] Optionally, in step S432, the multiple processing results are the results of each round of random addition, and each round of random addition may include the following execution steps:

[0085] Step S4321: Determine the target texture to be randomly added in the current round from multiple base texture maps;

[0086] Step S4322: Repeatedly add the target texture at each of the multiple locations to be added, to obtain the addition result;

[0087] Step S4323: Randomly rotate the target texture at each location to be added in the addition result to obtain the rotation result;

[0088] Step S4324: Perform texture gap processing on the rotation result according to the preset sampling method to obtain the result of the current round randomly added to the corresponding round.

[0089] The multiple processing results are the results of multiple rounds of random addition. In other words, when multiple rounds of random addition are performed on the above multiple basic texture maps, each round of random addition will result in a current round result. The multiple round results corresponding to these multiple rounds of random addition are used as the multiple processing results.

[0090] In the optional embodiments provided by steps S4321 to S4324 above, the specific implementation process of random addition in each round of multiple rounds of random addition can be as follows: based on the round information of the current round of random addition, determine the target texture to be used in the current round from multiple base texture maps; add a target texture to be used in the current round at each of the multiple positions to be added on the surface of the virtual model, and obtain the addition result; randomly rotate the target texture at each position to be added in the addition result, and obtain the rotation result; perform UV resampling according to the sampling method preset by the technician to eliminate the texture gaps between the target textures corresponding to the multiple positions to be added in the above rotation result, and thus obtain the round result corresponding to the current round of random addition.

[0091] Optionally, in step S4323, randomly rotating the target texture at each location to be added in the addition result to obtain the rotation result may include the following steps:

[0092] Step S43231: Create a random value for each position to be added, and obtain a second random value;

[0093] Step S43232: Rotate the target texture at each position to be added in the addition result according to the second random value to obtain the rotation result.

[0094] In the optional embodiments provided by steps S43231 to S43232 above, the specific implementation process of randomly rotating the target texture at each position to be added in the addition result in each round of random addition can be as follows: traverse multiple positions to be added on the surface of the virtual model, create random values ​​using the Random function based on the UV coordinates of the current position to be added, and obtain multiple second random values ​​(the second random values ​​are values ​​between -1 and 1) corresponding to multiple positions to be added. Further, use the multiple second random values ​​as the rotation angle coefficient of random rotation (for example, the rotation angle is the second random value multiplied by π radians) to rotate the target texture to be used in the current round at each position to be added in the addition result to obtain the rotation result.

[0095] According to the above optional embodiments of this application, when generating random surface textures of virtual terrain in a game scene, the positions of multiple first random points on the surface of the virtual terrain model can be used as multiple positions to be added to the above-mentioned basic texture map P01 and basic texture map P02 based on the UV coordinates of multiple first random points.

[0096] Based on the multiple locations to be added, two rounds of random addition of the base texture map are performed: In the first round, the base texture map P01 is randomly added to each of the multiple locations to be added, resulting in the first round result; in the second round, the base texture map P02 is randomly added to each of the multiple locations to be added, resulting in the second round result. The results of the first round and the second round are equivalent to the multiple processing results described above.

[0097] Figure 7 This is a schematic diagram of an optional rotation result according to one embodiment of this application. Figure 8 This is a schematic diagram of an optional round result according to one embodiment of this application. Taking the first round of random addition as an example, the specific implementation process of randomly adding the basic texture map P01 to each of the multiple positions to be added can be:

[0098] The first step is to repeatedly place the base texture map P01 at each position to be added, in a center-aligned manner, that is, the center point of the base texture map P01 coincides with the position to be added, thus obtaining the result of adding P01.

[0099] The second step involves creating a corresponding second random value for each location to be added, and then rotating the base texture map P01 at that location (centered on the location to be added) according to this second random value, resulting in the following: Figure 7 The rotation result shown ( Figure 7 The image shows some of the locations to be added among multiple locations. For ease of observation, the textures are represented by black rectangular blocks instead of showing specific texture details. The white areas are the gaps between textures.

[0100] The third step is to perform UV sampling according to the preset method. Figure 7 The rotation results shown are repeatedly sampled until the gaps between textures are eliminated (e.g., Figure 7 (The white area shown) yields the following result: Figure 8 The results of the rounds are shown.

[0101] It is easy to notice that, such as Figure 8 In the round results shown, there are obvious block boundary lines, and the textures on both sides of the block boundary lines are not aligned. This situation will result in low realism of the surface texture and poor visual effect of the final generated virtual terrain model. Therefore, the method provided in this application uses a second point set to process multiple processing results again to eliminate the above situation.

[0102] Optionally, in step S44, using the second point set to perform texture blending on multiple processing results to obtain the target random texture map of the virtual model may include the following execution steps:

[0103] Step S441: Using multiple second random points in the second point set, perform texture blending on each of the multiple processing results to obtain multiple blended results;

[0104] Step S442: Based on multiple height maps corresponding to multiple base texture maps, multiple blending results are blended to obtain the target random texture map of the virtual model.

[0105] In the optional embodiments provided in steps S441 to S442 above, multiple second random points corresponding to each grid node of the model grid are used in the second point set to perform texture blending on each of the above multiple processing results to obtain the above multiple blending results. Each processing result is texture blended to obtain one of the multiple blending results, and each blending result can be a blended texture map.

[0106] Furthermore, based on the multiple height maps corresponding to the aforementioned multiple base texture maps, the multiple blending results are blended to obtain the target random texture map of the virtual model. This can be achieved by: obtaining the height information corresponding to each blending result in the multiple blending results based on the multiple height maps corresponding to the aforementioned multiple base texture maps; and then blending the multiple blending results again into a single texture map based on the height information, which is the target random texture map of the aforementioned virtual model.

[0107] Since all the above blending results are generated based on the model mesh of the virtual model surface, each blending result (texture) has the same size, and each blending result also has the same size as the target random texture map generated above. Based on the height information, blending the multiple blending results again into the target random texture map can be done by: traversing each pixel of the texture map, and based on the height information of the texture displayed at the corresponding pixel in the multiple blending results, displaying the highest texture at the corresponding pixel in the target random texture map.

[0108] Optionally, in step S441, using multiple second random points in the second point set to perform texture blending on each of the multiple processing results to obtain multiple blending results may include: traversing multiple mesh nodes of the virtual model's mesh and performing the following execution steps on the current mesh node:

[0109] Step S4411: Select the target random point that is closest to the current grid node from multiple second random points in the second point set;

[0110] Step S4412: Determine the texture blending parameters of the current mesh node based on the distance information between the target random point and the current mesh node;

[0111] Step S4413: Using texture blending parameters, the texture data within the eight connected grid cells corresponding to the target random point in each of the multiple processing results are blended to obtain multiple blending results.

[0112] In the optional embodiments provided in steps S4411 to S4413 above, the texture blending parameter of the current mesh node can be a weight parameter for texture blending of the current mesh node. The 8-connected mesh cell corresponding to the target random point is a plurality of mesh cells that have an N8-connectivity relationship with the mesh cell corresponding to the target random point. The texture data in the 8-connected mesh cell corresponding to the target random point in each of the multiple processing results of the texture blending parameters above are linearly blended to obtain multiple blending results, wherein each blending result can be a blended texture map.

[0113] According to the above optional embodiments of this application, when generating random surface textures of virtual terrain in a game scene, multiple grid nodes are traversed, and a target random point TP that is closest to the current grid node is selected from multiple second random points based on the UV coordinates of the current grid node. The distance d between the two points is calculated based on the UV coordinates of the current grid node and the UV coordinates of the target random point TP.

[0114] Figure 9 This is a schematic diagram of an optional mixing result according to one embodiment of this application, such as... Figure 9 As shown, taking the blending of the processing result generated based on the base texture map P01 (denoted as texture H1) as an example, when traversing multiple mesh nodes, texture H1 is blended based on the aforementioned distance d corresponding to the current mesh node, resulting in the following: Figure 9 The blending result shown is denoted as texture A1. The blending method is as shown in the following formula (2):

[0115]

[0116] In formula (2) above, color represents the color information of the grid cell where the target random point TP corresponding to the current grid node is located, and Section (m,n) The color information of the grid cell (m, n) is represented by (u, v), and the UV coordinates of the target random point TP are represented by (u, v).

[0117] Furthermore, based on the height map G01 corresponding to the base texture map P01 and the height map G02 corresponding to the base texture map P02, the blending result (map A1) corresponding to the base texture map P01 and the blending result (map A2, generated using the same method as map A1 above) corresponding to the base texture map P02 are blended again to obtain the surface random texture map of the virtual terrain (equivalent to the target random texture map above).

[0118] It should be noted that when blending multiple blending results based on multiple height maps corresponding to multiple base texture maps, other specified height blending methods can also be used, such as displaying the texture with the highest height in a texture area of ​​a specified terrain type, and displaying the texture with the lowest height in a texture area of ​​another specified terrain type, etc.

[0119] It is readily understood that, through the method provided in the embodiments of this application, based on multiple different (or even different types) base texture maps, a target random texture map can be generated for the virtual model using multiple first random points with randomness in the first point set and multiple second random points with randomness in the second point set. In this target random texture map, the texture can present a completely randomized visual effect, avoiding the situation of high texture repetition when the viewing angle is far away, which is beneficial to practical application scenarios.

[0120] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a magnetic disk or optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0121] This embodiment also provides a random texture generation device for a virtual model, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0122] Figure 10 This is a structural block diagram of a random texture generation device for a virtual model according to one embodiment of this application, such as... Figure 10As shown, the device includes: an acquisition module 1001, used to acquire a model mesh and multiple basic texture maps of a virtual model, wherein the model mesh is used to determine the texture coordinate information of the surface of the virtual model; a generation module 1002, used to generate a first point set and a second point set using the model mesh, wherein the first point set is used to determine the positions to be added to the multiple basic texture maps, and the second point set is used to determine the texture blending method of the multiple basic texture maps; an addition module 1003, used to add the multiple basic texture maps to the surface of the virtual model according to the first point set, to obtain multiple processing results; and a blending module 1004, used to perform texture blending processing on the multiple processing results using the second point set, to obtain a target random texture map of the virtual model.

[0123] Optionally, the generation module 1002 is further configured to: obtain the texture coordinate information of the virtual model based on the model mesh; perform coordinate calculations based on the texture coordinate information and preset point density parameters to determine a first point set, wherein the first point set includes multiple first random points corresponding to multiple grid cells of the model mesh.

[0124] Optionally, the above-mentioned generation module 1002 is further configured to: create a random value for each of the multiple grid nodes in the model grid to obtain multiple first random values; based on the coordinate information of the multiple grid nodes, perform offset positioning according to the multiple first random values ​​to generate a second point set, wherein the second point set includes multiple second random points corresponding to the multiple grid nodes.

[0125] Optionally, the above-mentioned adding module 1003 is further used to: determine multiple positions to be added on the surface of the virtual model based on multiple first random points in the first point set; and randomly add multiple basic texture maps in multiple rounds according to the multiple positions to be added, so as to obtain multiple processing results.

[0126] Optionally, the above-mentioned adding module 1003 is further configured to: determine the target texture to be randomly added in the current round from multiple base texture maps; repeatedly add the target texture at each of the multiple positions to be added to obtain the adding result; randomly rotate the target texture at each position to be added in the adding result to obtain the rotation result; and process the texture gaps in the rotation result according to a preset sampling method to obtain the round result of the random addition in the current round.

[0127] Optionally, the above-mentioned adding module 1003 is further configured to: create a random value for each position to be added, and obtain a second random value; rotate the target texture at each position to be added in the adding result according to the second random value, and obtain a rotation result.

[0128] Optionally, the above-mentioned mixing module 1004 is further configured to: use multiple second random points in the second point set to perform texture mixing on each of the multiple processing results to obtain multiple mixing results; and mix the multiple mixing results based on multiple height maps corresponding to multiple base texture maps to obtain a target random texture map of the virtual model.

[0129] Optionally, the above-mentioned mixing module 1004 is further configured to: traverse multiple grid nodes of the model mesh of the virtual model, and perform the following steps on the current grid node: select the target random point closest to the current grid node from multiple second random points in the second point set; determine the texture mixing parameters of the current grid node based on the distance information between the target random point and the current grid node; and use the texture mixing parameters to mix the texture data in the eight connected grid cells corresponding to the target random point in each of the multiple processing results to obtain multiple mixing results.

[0130] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0131] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.

[0132] Optionally, in this embodiment, the computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0133] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0134] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0135] S1, obtain the model mesh and multiple basic texture maps of the virtual model, where the model mesh is used to determine the texture coordinate information of the surface of the virtual model;

[0136] S2, using the model mesh to generate a first point set and a second point set, wherein the first point set is used to determine the positions to be added to multiple basic texture maps, and the second point set is used to determine the texture blending method of multiple basic texture maps;

[0137] S3: Based on the first point set, multiple basic texture maps are added to the surface of the virtual model to obtain multiple processing results;

[0138] S4. Using the second point set, perform texture blending on multiple processing results to obtain the target random texture map of the virtual model.

[0139] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: obtaining texture coordinate information of a virtual model based on the model mesh; performing coordinate calculations based on the texture coordinate information and preset point density parameters to determine a first point set, wherein the first point set includes multiple first random points corresponding to multiple mesh cells of the model mesh.

[0140] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: creating a random value for each of the multiple grid nodes in the model grid to obtain multiple first random values; based on the coordinate information of the multiple grid nodes, performing offset positioning according to the multiple first random values ​​to generate a second point set, wherein the second point set includes multiple second random points corresponding to the multiple grid nodes.

[0141] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining multiple positions to be added on the surface of the virtual model based on multiple first random points in a first point set; and randomly adding multiple base texture maps in multiple rounds according to the multiple positions to be added, thereby obtaining multiple processing results.

[0142] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining the target texture to be randomly added in the current round from multiple base texture maps; repeatedly adding the target texture at each of the multiple locations to be added, to obtain the addition result; randomly rotating the target texture at each location to be added in the addition result, to obtain the rotation result; and performing texture gap processing on the rotation result according to a preset sampling method to obtain the round result of the random addition in the current round.

[0143] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: creating a random value for each location to be added, thereby obtaining a second random value; and rotating the target texture at each location to be added in the addition result according to the second random value, thereby obtaining a rotation result.

[0144] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: using multiple second random points in the second point set, performing texture blending on each of the multiple processing results to obtain multiple blending results; and blending the multiple blending results based on multiple height maps corresponding to multiple base texture maps to obtain a target random texture map of the virtual model.

[0145] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: traversing multiple grid nodes of the model mesh of the virtual model, and performing the following steps on the current grid node: selecting a target random point that is closest to the current grid node from multiple second random points in the second point set; determining the texture blending parameters of the current grid node based on the distance information between the target random point and the current grid node; and using the texture blending parameters to blend the texture data within the eight-connected grid cells corresponding to the target random point in each of the multiple processing results to obtain multiple blending results.

[0146] In the computer-readable storage medium of the above embodiments, a technical solution is provided for implementing a method for generating random textures for virtual models. By acquiring a model mesh and multiple basic texture maps of a virtual model, wherein the model mesh is used to determine the texture coordinate information of the virtual model's surface, a first point set and a second point set are generated using the model mesh. The first point set is used to determine the positions to be added to the multiple basic texture maps, and the second point set is used to determine the texture blending method of the multiple basic texture maps. Further, based on the first point set, the multiple basic texture maps are added to the surface of the virtual model, resulting in multiple processing results. Using the second point set, texture blending processing is performed on the multiple processing results to obtain the target random texture map of the virtual model. This achieves the purpose of blending multiple basic texture maps to generate random texture maps for virtual models that require large-area display of random textures, thereby reducing texture redundancy and solving the technical problem in related technologies where using quadrature continuous texture maps to create texture details results in high redundancy of the generated random texture maps and poor user experience.

[0147] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this application.

[0148] In exemplary embodiments of this application, a computer-readable storage medium stores a program product capable of implementing the methods described above in this embodiment. In some possible implementations, various aspects of the embodiments of this application may also be implemented as a program product including program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this embodiment according to various exemplary embodiments of this application.

[0149] The program product for implementing the above-described method according to embodiments of this application may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the embodiments of this application is not limited thereto. In the embodiments of this application, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0150] The aforementioned program product may take the form of any combination of one or more computer-readable media. Such computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not exhaustive) of computer-readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0151] It should be noted that the program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0152] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0153] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0154] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0155] S1, obtain the model mesh and multiple basic texture maps of the virtual model, where the model mesh is used to determine the texture coordinate information of the surface of the virtual model;

[0156] S2, using the model mesh to generate a first point set and a second point set, wherein the first point set is used to determine the positions to be added to multiple basic texture maps, and the second point set is used to determine the texture blending method of multiple basic texture maps;

[0157] S3: Based on the first point set, multiple basic texture maps are added to the surface of the virtual model to obtain multiple processing results;

[0158] S4. Using the second point set, perform texture blending on multiple processing results to obtain the target random texture map of the virtual model.

[0159] Optionally, the processor may also be configured to perform the following steps via a computer program: obtaining texture coordinate information of the virtual model based on the model mesh; performing coordinate calculations based on the texture coordinate information and preset point density parameters to determine a first point set, wherein the first point set includes multiple first random points corresponding to multiple grid cells of the model mesh.

[0160] Optionally, the processor may also be configured to perform the following steps via a computer program: create a random value for each of the multiple grid nodes in the model grid to obtain multiple first random values; based on the coordinate information of the multiple grid nodes, perform offset positioning according to the multiple first random values ​​to generate a second point set, wherein the second point set includes multiple second random points corresponding to the multiple grid nodes.

[0161] Optionally, the processor may also be configured to perform the following steps via a computer program: determining multiple positions to be added on the surface of the virtual model based on multiple first random points in the first point set; and randomly adding multiple base texture maps in multiple rounds according to the multiple positions to be added, to obtain multiple processing results.

[0162] Optionally, the processor may also be configured to perform the following steps via a computer program: determine the target texture to be randomly added in the current round from multiple base texture maps; repeatedly add the target texture at each of the multiple locations to be added to obtain the addition result; randomly rotate the target texture at each location to be added in the addition result to obtain the rotation result; process the texture gaps in the rotation result according to a preset sampling method to obtain the round result of the random addition in the current round.

[0163] Optionally, the processor may also be configured to perform the following steps via a computer program: create a random value for each location to be added, to obtain a second random value; and rotate the target texture at each location to be added in the addition result according to the second random value, to obtain a rotation result.

[0164] Optionally, the processor may also be configured to perform the following steps via a computer program: using multiple second random points in the second point set, performing texture blending on each of the multiple processing results to obtain multiple blending results; and blending the multiple blending results based on multiple height maps corresponding to multiple base texture maps to obtain a target random texture map of the virtual model.

[0165] Optionally, the processor may also be configured to perform the following steps via a computer program: traversing multiple grid nodes of the model mesh of the virtual model, and performing the following steps on the current grid node: selecting the target random point closest to the current grid node from multiple second random points in the second point set; determining the texture blending parameters of the current grid node based on the distance information between the target random point and the current grid node; and using the texture blending parameters to blend the texture data within the eight connected grid cells corresponding to the target random point in each of the multiple processing results to obtain multiple blending results.

[0166] In the electronic device described in the above embodiments, a technical solution is provided for a method to generate random textures for virtual models. By acquiring a model mesh and multiple basic texture maps of the virtual model, where the model mesh is used to determine the texture coordinate information of the virtual model's surface, a first point set and a second point set are generated using the model mesh. The first point set is used to determine the positions where the multiple basic texture maps will be added, and the second point set is used to determine the texture blending method of the multiple basic texture maps. Further, based on the first point set, the multiple basic texture maps are added to the surface of the virtual model, resulting in multiple processing results. Using the second point set, texture blending processing is performed on the multiple processing results to obtain the target random texture map of the virtual model. This achieves the purpose of blending multiple basic texture maps to generate random texture maps for the virtual model, thereby reducing texture redundancy for virtual models that require large-area display of random textures. This solves the technical problem in related technologies where using quadrature continuous texture maps to create texture details results in high redundancy of the generated random texture maps and a poor user experience.

[0167] Figure 11 This is a schematic diagram of an electronic device according to an embodiment of this application. Figure 11 As shown, the electronic device 1100 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0168] like Figure 11As shown, the electronic device 1100 is presented in the form of a general-purpose computing device. The components of the electronic device 1100 may include, but are not limited to: at least one processor 1110, at least one memory 1120, a bus 1130 connecting different system components (including memory 1120 and processor 1110), and a display 1140.

[0169] The memory 1120 stores program code that can be executed by the processor 1110, causing the processor 1110 to perform the steps described in the method section of the embodiments of this application according to various exemplary implementations of this application.

[0170] The memory 1120 may include a readable medium in the form of volatile memory cells, such as random access memory (RAM) 11201 and / or cache memory 11202, and may further include read-only memory (ROM) 11203, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0171] In some instances, memory 1120 may also include programs / utilities 11204 having a set (at least one) of program modules 11205, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Memory 1120 may further include memory remotely located relative to processor 1110, which can be connected to electronic device 1100 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0172] Bus 1130 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processor 1110, or a local bus using any of the various bus structures.

[0173] The display 1140 may be, for example, a touch-screen liquid crystal display (LCD) that allows a user to interact with the user interface of the electronic device 1100.

[0174] Optionally, the electronic device 1100 can also communicate with one or more external devices 1200 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 1100, and / or any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via the input / output (I / O) interface 1150. Furthermore, the electronic device 1100 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via the network adapter 1160. Figure 11 As shown, network adapter 1160 communicates with other modules of electronic device 1100 via bus 1130. It should be understood that, although... Figure 11 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, Redundant Arrays of Independent Disks (RAID) systems, tape drives, and data backup storage systems.

[0175] The aforementioned electronic device 1100 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.

[0176] Those skilled in the art will understand that Figure 11 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, electronic device 1100 may also include components that are more... Figure 11 The more or fewer components shown, or having the same Figure 11 Different configurations are shown. The memory 1120 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the random texture generation method for the virtual model in this embodiment. The processor 1110 executes various functional applications and data processing by running the computer program stored in the memory 1120, thereby implementing the aforementioned random texture generation method for the virtual model.

[0177] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0178] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0179] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0180] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0181] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0182] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part 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 application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0183] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method of texture generation for a virtual model, the method comprising: include: Obtain the model mesh and multiple base texture maps of the virtual model, wherein the model mesh is used to determine the texture coordinate information of the surface of the virtual model; The model mesh is used to generate a first point set and a second point set, wherein the first point set is used to determine the positions to be added to the multiple basic texture maps, and the second point set is used to determine the texture blending method of the multiple basic texture maps; Based on multiple first random points in the first point set, multiple locations to be added are determined on the surface of the virtual model; According to the multiple locations to be added, the multiple basic texture maps are randomly added in multiple rounds to obtain multiple processing results; Using multiple second random points in the second point set, texture blending is performed on each of the multiple processing results to obtain multiple blending results; Based on the multiple height maps corresponding to the multiple base texture maps, the multiple blending results are blended to obtain the target random texture map of the virtual model.

2. The method of claim 1, wherein, Generating the first point set using the model mesh includes: Based on the model mesh, obtain the texture coordinate information of the virtual model; Based on the texture coordinate information and preset point density parameters, coordinate calculations are performed to determine the first point set, wherein the first point set includes multiple first random points corresponding to multiple grid cells of the model mesh.

3. The method of claim 1, wherein, Generating the second point set using the model mesh includes: A random value is created for each of the multiple grid nodes in the model grid, resulting in multiple first random values; Based on the coordinate information of the multiple grid nodes, offset positioning is performed according to the multiple first random values ​​to generate the second point set, wherein the second point set includes multiple second random points corresponding to the multiple grid nodes.

4. The method of claim 1, wherein, The multiple processing results are the round results corresponding to each round of random addition in the multiple rounds of random addition, and each round of random addition includes: The target texture map to be randomly added in the current round is determined from the multiple base texture maps; At each of the plurality of locations to be added, the target texture is repeatedly added to obtain the addition result; The target texture at each position to be added in the addition result is randomly rotated to obtain the rotation result; The rotation result is processed for texture gaps according to a preset sampling method to obtain the current round result with the corresponding round result randomly added.

5. The method of claim 4, wherein, The target texture at each location to be added in the added result is randomly rotated to obtain the rotation result, which includes: For each position to be added, a random value is created to obtain a second random value; According to the second random value, the target texture at each position to be added in the addition result is rotated to obtain the rotation result.

6. The method of claim 1, wherein, Using the plurality of second random points in the second point set, texture blending is performed on each of the plurality of processing results to obtain the plurality of blending results, including: Traverse multiple mesh nodes of the model mesh of the virtual model, and perform the following steps on the current mesh node: Select the target random point that is closest to the current grid node from multiple second random points in the second point set; Based on the distance information between the target random point and the current grid node, the texture blending parameters of the current grid node are determined; Using the texture blending parameters, the texture data within the eight connected grid cells corresponding to the target random point in each of the multiple processing results are blended to obtain multiple blending results.

7. An apparatus for random texture generation of a virtual model, characterized by include: The acquisition module is used to acquire the model mesh and multiple basic texture maps of the virtual model, wherein the model mesh is used to determine the texture coordinate information of the surface of the virtual model; A generation module is used to generate a first point set and a second point set using the model mesh, wherein the first point set is used to determine the positions to be added to the multiple basic texture maps, and the second point set is used to determine the texture blending method of the multiple basic texture maps; The addition module is used to determine multiple positions to be added on the surface of the virtual model based on multiple first random points in the first point set; and to randomly add multiple base texture maps in multiple rounds according to the multiple positions to be added, so as to obtain multiple processing results. The blending module is used to perform texture blending on each of the multiple processing results using multiple second random points in the second point set to obtain multiple blending results; and to blend the multiple blending results based on multiple height maps corresponding to the multiple base texture maps to obtain the target random texture map of the virtual model.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute, when run by a processor, the texture generation method for the virtual model as described in any one of claims 1 to 6.

9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the texture generation method for the virtual model as described in any one of claims 1 to 6.