Texture mapping method and device, electronic equipment, storage medium and program product

By performing two-dimensional expansion and adjustment of the surface of the target model, the problem that the texture map direction does not match the actual scene in the prior art is solved, and a more realistic visual effect and better user experience are achieved.

CN119810301APending Publication Date: 2025-04-11NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510019555.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

When processing texture maps with specific directionality, the sampling method has limitations, resulting in the mapping direction that does not match the actual application scenario, destroying the visual reality and affecting the user experience.

Method used

By expanding the surface of the target model into a two-dimensional planar image, the initial contour line and the target to be mapped area are determined, the UV coordinates are determined based on a specific direction, and the texture map is sampled, and the direction of the texture pattern is adjusted to match the physical direction of the actual scene.

Benefits of technology

The directional adjustment of the texture pattern is realized, making it consistent with the physical direction in the actual scene, and improving the visual reality and user experience, especially when dynamic viewing angle changes or observations in specific directions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810301A_ABST
    Figure CN119810301A_ABST
Patent Text Reader

Abstract

The invention provides a texture mapping method and device, electronic equipment, a storage medium and a program product, and the method comprises the steps: unfolding the surface of a target model into a two-dimensional plane image, and determining an initial contour line of an initial to-be-mapped region in the two-dimensional plane image; based on the initial contour line, determining a target to-be-mapped area within a specified range around the initial contour line; based on the first direction, determining UV coordinates of the target to-be-mapped area; and sampling a texture map based on the UV coordinates, and mapping textures in the texture map to the target to-be-mapped area to form a texture pattern of a target orientation. In the present disclosure, directivity adjustment is performed on the texture pattern, so that the direction of the texture pattern mapped to the target to-be-mapped area is consistent with the physical direction in the actual scene, and it is ensured that when the method is applied to the actual scene, the display effect conforms to the expected visual reality and physical direction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of graphics rendering technology, and in particular to a texture mapping method, device, electronic device, storage medium and program product. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] With the rapid development of video games, 3D graphics rendering technology plays a vital role in achieving visual effects. In these applications, texture mapping is one of the key elements to create realistic scenes. Texture mapping simulates complex materials and surface details by applying 2D images on the surface of 3D models, thereby enhancing the visual experience.

[0004] However, when processing texture maps with specific directionality, such as beach textures, farmland terrace textures, and desert textures, the texture sampling methods in related technologies often have limitations. In related technologies, uniform or random texture sampling methods are usually used, which will cause the texture direction to be inconsistent with the actual application scenario, especially when it involves dynamic perspective changes or observations in specific directions, such as simulating the scene of observing a beach from the coastline. Such inconsistency not only destroys the visual realism, but may also affect the user experience and immersion. Summary of the invention

[0005] In view of this, the purpose of the present disclosure is to provide a texture mapping method, device, electronic device, storage medium and program product, which at least to a certain extent solve one of the technical problems in the related art.

[0006] Based on the above purpose, the first aspect of the exemplary embodiment of the present disclosure provides a texture mapping method, including:

[0007] Expanding the surface of the target model into a two-dimensional plane image, and determining an initial contour line of an initial area to be mapped in the two-dimensional plane image;

[0008] Based on the initial contour line, determining a target area to be mapped within a specified range around the initial contour line;

[0009] Based on the first direction, determining the UV coordinates of the target area to be mapped;

[0010] The texture map is sampled based on the UV coordinates, and the texture in the texture map is mapped to the target area to be mapped to form a texture pattern facing the target.

[0011] Based on the same inventive concept, a second aspect of the exemplary embodiment of the present disclosure provides a texture mapping device, including:

[0012] An initial contour line determination module is configured to unfold the surface of the target model into a two-dimensional plane image, and determine an initial contour line of an initial area to be mapped in the two-dimensional plane image;

[0013] A target area to be mapped determining module is configured to determine, based on the initial contour line, a target area to be mapped within a specified range around the initial contour line;

[0014] A UV coordinate determination module is configured to determine the UV coordinates of the target area to be mapped based on the first direction;

[0015] The texture mapping module is configured to sample the texture map based on the UV coordinates, and map the texture in the texture map to the target area to be mapped to form a texture pattern facing the target.

[0016] Based on the same inventive concept, a third aspect of the exemplary embodiment of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect is implemented.

[0017] Based on the same inventive concept, a fourth aspect of the exemplary embodiments of the present disclosure provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method described in the first aspect.

[0018] Based on the same inventive concept, a fifth aspect of the exemplary embodiments of the present disclosure provides a computer program product, including computer program instructions. When the computer program instructions are executed on a computer, the computer executes the method described in the first aspect.

[0019] From the above, it can be seen that the texture mapping method, device, electronic device, storage medium and program product provided by the embodiments of the present disclosure include: unfolding the surface of the target model into a two-dimensional plane image, and determining the initial contour line of the initial area to be mapped in the two-dimensional plane image; based on the initial contour line, determining the target area to be mapped within a specified range around the initial contour line; based on a first direction, determining the UV coordinates of the target area to be mapped; sampling the texture map based on the UV coordinates, and mapping the texture in the texture map to the target area to be mapped to form a texture pattern in the target orientation. In the present disclosure, the texture pattern is directionally adjusted so that the direction of the texture pattern mapped to the target area to be mapped is consistent with the physical direction in the actual scene, ensuring that when applied to the actual scene, the display effect meets the expected visual realism and physical direction. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 A schematic diagram of an application scenario of a texture mapping method provided by an exemplary embodiment of the present disclosure;

[0022] Figure 2 A schematic flow chart of a texture mapping method provided for an exemplary embodiment of the present disclosure;

[0023] Figure 3 A schematic diagram of a silhouette edge provided for an exemplary embodiment of the present disclosure;

[0024] Figure 4 A schematic diagram of an outline provided for an exemplary embodiment of the present disclosure;

[0025] Figure 5 A schematic diagram of an initial contour line provided for an exemplary embodiment of the present disclosure;

[0026] Figure 6 A schematic diagram of a flow chart of a method for determining a target area to be mapped provided by an exemplary embodiment of the present disclosure;

[0027] Figure 7 A schematic diagram of an enlarged contour line provided for an exemplary embodiment of the present disclosure;

[0028] Figure 8 A schematic diagram of a contour segment provided for an exemplary embodiment of the present disclosure;

[0029] Fig. 9 A schematic diagram of a reduced profile provided for an exemplary embodiment of the present disclosure;

[0030] Fig.10 A schematic diagram of a target area to be mapped provided for an exemplary embodiment of the present disclosure;

[0031] Fig.11 A schematic diagram of a target area to be mapped after resampling provided by an exemplary embodiment of the present disclosure;

[0032] Fig.12 A schematic diagram of a U coordinate provided for an exemplary embodiment of the present disclosure;

[0033] Fig.13 A schematic diagram of a V coordinate provided for an exemplary embodiment of the present disclosure;

[0034] Fig.14A schematic diagram of reference directions provided for exemplary embodiments of the present disclosure;

[0035] Fig.15 A schematic diagram of a beach texture before direction adjustment provided by an exemplary embodiment of the present disclosure;

[0036] Fig.16 A schematic diagram of a beach texture after direction adjustment provided by an exemplary embodiment of the present disclosure;

[0037] Fig.17 A structural schematic diagram of a texture mapping device provided for an exemplary embodiment of the present disclosure;

[0038] Fig.18 A schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solutions and advantages of the present disclosure more clear, the principles and spirit of the present disclosure will be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0040] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.

[0041] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connecting" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly. The article "one" or "a" before an element does not exclude the existence of multiple such elements.

[0042] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.

[0043] As mentioned in the background, with the rapid development of electronic games, 3D graphics rendering technology plays a vital role in the realization of visual effects. In these applications, texture mapping is one of the key elements to create realistic scenes. Texture mapping simulates complex materials and surface details by applying 2D images on the surface of 3D models, thereby enhancing the visual experience.

[0044] However, when processing texture maps with specific directionality, such as beach textures, farmland terrace textures, and desert textures, the texture sampling methods in related technologies include the following:

[0045] Uniform map sampling method: The uniform map sampling method is one of the most common texture mapping techniques. It simulates material and surface details by uniformly applying a two-dimensional texture image to the surface of a three-dimensional model. The advantages of this method are simplicity, low computational complexity, and applicability to most common scenarios.

[0046] Random texture sampling method: Random texture sampling method reduces visual artifacts caused by repeated textures by randomly selecting sampling points of texture maps. This method can effectively reduce artificial traces and improve visual effects when processing repeated textures.

[0047] However, the inventors of the present disclosure have found that the methods in the related art often have limitations, which may cause the mapping direction to be inconsistent with the actual application scenario, especially when it involves dynamic perspective changes or observation in a specific direction, such as simulating a scene of observing a beach from a coastline. Such inconsistency not only destroys the visual realism, but may also affect the user experience and immersion. Specifically:

[0048] Insufficient directionality: For textures with specific directionality, such as beach textures, neither uniform mapping nor random mapping can accurately reflect the actual physical direction, especially when the dynamic perspective changes or is observed in a specific direction, inconsistencies are likely to occur.

[0049] Poor visual realism: Since the visual effect cannot match the physical direction in the actual scene, the visual effect is often not realistic enough, which affects the user's immersive experience.

[0050] Low applicability in complex scenes: In complex scenes, it is difficult to effectively simulate the physical direction. The computational overhead of effectively simulating the physical direction is very high, which has a certain impact on the performance of real-time rendering.

[0051] In order to solve the above problems, the present disclosure provides a texture mapping solution, which specifically includes: unfolding the surface of the target model into a two-dimensional plane image, and determining the initial contour line of the initial area to be mapped in the two-dimensional plane image; based on the initial contour line, determining the target area to be mapped within a specified range around the initial contour line; based on a first direction, determining the UV coordinates of the target area to be mapped; sampling the texture map based on the UV coordinates, and mapping the texture in the texture map to the target area to be mapped to form a texture pattern facing the target.

[0052] In the present disclosure, the texture pattern is directionally adjusted so that the direction of the texture pattern mapped to the target area to be mapped is consistent with the physical direction in the actual scene, ensuring that when applied to the actual scene, the display effect meets the expected visual realism and physical direction.

[0053] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.

[0054] refer to Figure 1 , which is a schematic diagram of an application scenario of the texture mapping method provided by an exemplary embodiment of the present disclosure.

[0055] This application scenario includes a terminal device 101, a server 102, and a data storage system 103. The terminal device 101, the server 102, and the data storage system 103 may be connected via a wired or wireless communication network to achieve data interaction.

[0056] The terminal device 101 may be an electronic device with data transmission and multimedia input / output functions close to the user side, including but not limited to a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA) or other electronic devices capable of realizing the above functions. The electronic device may include a processor and a display screen with a touch input function, the display screen is used to present a graphical user interface, the graphical user interface can display an application interface, and the processor is used to process application data, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0057] Server 102 and data storage system 103 can both be independent physical servers, or a server cluster or distributed system composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0058] In some exemplary embodiments, the texture mapping method may be executed on the server 102 or the terminal device 101 .

[0059] When the texture mapping method is run on the server 102, the server 102 is used to provide texture mapping services to the user of the terminal device 101. The terminal device 101 is installed with a client that communicates with the server 102. The user can input the target model or the two-dimensional plane image formed by unfolding the surface of the target model through the client. After clicking the processing button, the client sends the target model or the two-dimensional plane image to the server 102. The server 102 unfolds the surface of the target model into a two-dimensional plane image (if the input is a two-dimensional plane image formed by unfolding the surface of the target model, no further unfolding is required), and determines the initial contour line of the initial area to be mapped in the two-dimensional plane image; based on the initial contour line, determines the target area to be mapped within a specified range around the initial contour line; based on the first direction, determines the UV coordinates of the target area to be mapped; based on the UV coordinates, samples the texture map, and maps the texture in the texture map to the target area to be mapped to form a texture pattern facing the target.

[0060] The server 102 may send the two-dimensional plane image of the texture pattern forming the target orientation to the client, and the client displays the two-dimensional plane image of the texture pattern forming the target orientation to the user for the user to use when needed;

[0061] The server 102 can also export the two-dimensional plane image of the texture pattern forming the target orientation to the game engine for application in the actual scene to realize rendering, and send the rendered picture to the client, and the client shows the user the rendered picture including the target model realized based on the two-dimensional plane image of the texture pattern forming the target orientation.

[0062] In the above embodiment, the texture mapping method is described by taking the case where the texture mapping method is run on the server 102 as an example. However, the present disclosure is not limited thereto. In some exemplary embodiments, the texture mapping method may also be run on the terminal device 101 .

[0063] When the texture mapping method is run on the terminal device 101, the terminal device 101 may include a display screen and a processor. The terminal device 101 is installed with a client, and the user can input the target model or the two-dimensional plane image of the surface of the target model through the client. After clicking the processing button, the client sends the target model or the two-dimensional plane image to the processor, and the processor expands the surface of the target model into a two-dimensional plane image (if the input is a two-dimensional plane image of the surface of the target model, no further expansion is required), and determines the initial contour line of the initial area to be mapped in the two-dimensional plane image; based on the initial contour line, determines the target area to be mapped within a specified range around the initial contour line; based on the first direction, determines the UV coordinates of the target area to be mapped; based on the UV coordinates, samples the texture map, and maps the texture in the texture map to the target area to be mapped to form a texture pattern facing the target.

[0064] The processor may send the two-dimensional plane image of the texture pattern forming the target orientation to the client, and the client displays the two-dimensional plane image of the texture pattern forming the target orientation to the user for the user to use when needed;

[0065] The processor can also export the two-dimensional plane image of the texture pattern forming the target orientation to the game engine for application in the actual scene to realize rendering, and send the rendered picture to the client, which displays the rendered picture including the target model based on the two-dimensional plane image of the texture pattern forming the target orientation to the user.

[0066] The data storage system 103 is used to assist the terminal device 101 and the server 102 in storing data.

[0067] Combine the following Figure 1 The texture mapping method according to the exemplary embodiment of the present disclosure is described by using the application scenario. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principle of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.

[0068] refer to Figure 2 , which is a flow chart of a texture mapping method provided by an exemplary embodiment of the present disclosure.

[0069] The texture mapping method comprises the following steps:

[0070] Step S210: unfold the surface of the target model into a two-dimensional plane image, and determine the initial contour line of the initial area to be mapped in the two-dimensional plane image.

[0071] In this exemplary embodiment, the target model includes a two-dimensional model or a three-dimensional model. When the target model is a three-dimensional model, the surface of the three-dimensional model is unfolded into a two-dimensional plane image; when the target model is a two-dimensional model, its texture is directly obtained.

[0072] In this exemplary embodiment, the determining of the initial contour line of the initial area to be mapped in the two-dimensional plane image includes:

[0073] Determine a contour edge of a target object in the two-dimensional plane image;

[0074] Grouping the contour edges to obtain a plurality of contour edge groups;

[0075] The contour edge groups corresponding to the initial to-be-mapped area in the plurality of contour edge groups are converted into contour lines, and the initial contour lines are obtained based on the contour lines.

[0076] In specific implementation, the method for determining the initial area to be mapped includes:

[0077] When the two-dimensional plane image includes multiple regions, the initial region to be mapped can be freely specified by the user;

[0078] The initial area to be mapped may also be automatically identified by rules pre-configured by the user.

[0079] In a specific implementation, when the two-dimensional plane image includes multiple regions, the contour edge groups that do not correspond to the initial region to be mapped can be removed from the multiple contour edge groups, and then the contour edge groups corresponding to the initial region to be mapped can be converted into contour lines;

[0080] Alternatively, all contour edge groups corresponding to all regions may be converted into contour lines first, and then contour lines that do not correspond to the initial region to be mapped are removed from the plurality of contour lines.

[0081] In this exemplary embodiment, converting the contour edge group corresponding to the initial to-be-mapped area in the plurality of contour edge groups into a contour line to obtain the initial contour line includes:

[0082] The contour line is resampled to obtain the initial contour line.

[0083] In a specific implementation, after the contour edge groups corresponding to the initial to-be-mapped area in the plurality of contour edge groups are converted into contour lines, the contour lines are resampled to obtain the initial contour lines.

[0084] In a specific implementation, a two-dimensional plane image including the initial area to be mapped is imported into three-dimensional computer graphics software for processing, and the contour line of the initial area to be mapped is extracted using the three-dimensional computer graphics software.

[0085] As a specific example, the two-dimensional plane image containing the initial area to be mapped is a map containing a beach area, wherein the initial area to be mapped is a beach area, and the three-dimensional computer graphics software is Houdini. Specifically:

[0086] First, use the Group node to expand the surface of the target model into contour edges in a two-dimensional plane image and group the contour edges:

[0087] In specific implementation, the method of determining the contour edge includes:

[0088] Determine the edges that are not shared by two faces as contour edges;

[0089] In specific implementation, the method of grouping the contour edges includes:

[0090] The contour edges are grouped based on brightness. For example, a threshold may be set to group the contour edges with brightness higher than the threshold into one group.

[0091] refer to Figure 3 , wherein a first silhouette edge group 301 and a second silhouette edge group 302 obtained after determining the silhouette edges and grouping the silhouette edges are shown.

[0092] The first contour edge group 301 is a contour edge group corresponding to the initial area to be mapped.

[0093] Then, use the Labs Edge Group To Curve node to convert the silhouette edge group to silhouette lines:

[0094] Converts a group of silhouette edges to curves, to be used as outlines.

[0095] refer to Figure 4 , wherein a contour line 401 obtained after converting the first contour edge group 301 into a curve is shown.

[0096] Finally, use Resample, Connectivity and other nodes to resample the contours:

[0097] In specific implementation, the Resample node can resample the contour lines into contour lines of uniform length, ensuring that the contour lines are smooth and consistent.

[0098] In the Resample node, you can change the number of interpolation points by adjusting the Length parameter, thereby controlling the smoothness and detail of the contour line.

[0099] The Connectivity node is used to determine whether contours are connected. Each point in a contour has its own unique number. If two points share the same number, then the two points are connected.

[0100] The Connectivity node can establish a common attribute for connected points, which is used to identify and process connected geometric parts.

[0101] refer to Figure 5 , wherein an initial contour line 501 obtained after resampling the contour line 401 is shown.

[0102] Through the above exemplary embodiments, the surface of the target model can be unfolded into the boundary between the initial area to be mapped and other parts in the two-dimensional plane image, thereby providing a basis for the implementation of subsequent steps. For example, when the two-dimensional plane image contains a beach and an ocean, and the beach is used as the initial area to be mapped, the boundary between the beach and the ocean can be determined.

[0103] Step S220: Based on the initial contour line, determine a target area to be mapped within a specified range around the initial contour line.

[0104] refer to Figure 6 In this exemplary embodiment, the step of determining the target area to be mapped within a specified range around the initial contour line based on the initial contour line includes:

[0105] Step S610: enlarge the initial contour line to obtain an enlarged contour line.

[0106] In this exemplary embodiment, the step of enlarging the initial contour line to obtain an enlarged contour line includes:

[0107] Determine the position of each point on the initial contour line;

[0108] Determine the normal direction of each point;

[0109] Determine the preset enlargement distance parameters;

[0110] Each point is moved along the normal direction by the enlarged distance parameter to obtain the enlarged contour line.

[0111] When implementing it, we will take Houdini as an example to explain it. Specifically:

[0112] The preset Maxdist parameter is used as the preset enlargement distance parameter and the preset reduction distance parameter.

[0113] In specific implementation, the normalize function is used to obtain the unit normal vector, which is then multiplied by the Maxdist parameter to obtain the expanded point position, and the calculated new point position is assigned to the point on the initial contour line, thereby expanding the curve and obtaining the expanded contour line.

[0114] refer to Figure 7 , wherein the enlarged contour line 701 obtained after the initial contour line 501 is enlarged is shown.

[0115] Step S620: Reduce the initial contour line to obtain a reduced contour line.

[0116] In this exemplary embodiment, the step of reducing the initial contour line to obtain a reduced contour line includes:

[0117] Determining a preset length parameter, and dividing the enlarged contour line into a plurality of contour line segments based on the length parameter;

[0118] Perform the following operations on all the contour segments to obtain the reduced contour:

[0119] Determining a preset reduction distance parameter, a preset reduction direction parameter, and a preset reduction angle parameter;

[0120] Determine a first position of a point on each of the contour line segments, and determine a second position matching the first position based on the reduction distance parameter, the reduction direction parameter, and the reduction angle parameter;

[0121] Points between the first position and the second position are removed.

[0122] refer to Figure 8 , wherein a contour line 801 is obtained after dividing the enlarged contour line 701.

[0123] refer to Fig. 9 , wherein the reduced contour line 901 obtained after the enlarged contour line 701 is reduced is shown.

[0124] Step S630: Determine the area between the enlarged contour line and the reduced contour line as the target area to be mapped.

[0125] In this exemplary embodiment, determining the area between the enlarged contour line and the reduced contour line as the target area to be mapped includes:

[0126] The enlarged contour line and the reduced contour line are combined, and an area between the enlarged contour line and the reduced contour line is determined as the target area to be mapped.

[0127] In a specific implementation, combining the enlarged contour line and the reduced contour line includes:

[0128] Use the Merge node to combine the expanded and reduced contours.

[0129] refer to Fig.10 , wherein a target area to be mapped 1001 formed between the enlarged contour line 701 and the reduced contour line 901 is shown.

[0130] In the above exemplary embodiments, the method for determining the target area to be mapped is described by taking "enlarging the initial contour to obtain an enlarged contour; reducing the initial contour to obtain a reduced contour; and determining the area between the enlarged contour and the reduced contour as the target area to be mapped" as an example. However, the present disclosure is not limited thereto. In some exemplary embodiments, the method for determining the target area to be mapped also includes at least the following:

[0131] Expanding the initial contour line to obtain an expanded contour line;

[0132] The area between the enlarged contour line and the initial contour line is determined as the target area to be mapped.

[0133] Performing a reduction process on the initial contour line to obtain a reduced contour line;

[0134] The area between the initial contour line and the reduced contour line is determined as the target area to be mapped.

[0135] Performing a first expansion process on the initial contour line to obtain a first expanded contour line;

[0136] Performing a second enlargement process on the initial contour line to obtain a second enlarged contour line;

[0137] An area between the first enlarged contour line and the second enlarged contour line is determined as the target area to be mapped.

[0138] Performing a first reduction process on the initial contour line to obtain a first reduced contour line;

[0139] Performing a second reduction process on the initial contour line to obtain a second reduced contour line;

[0140] An area between the first reduced outline and the second reduced outline is determined as the target area to be mapped.

[0141] Step S230: Determine the UV coordinates of the target area to be mapped based on the first direction.

[0142] In this exemplary embodiment, the first direction represents a physical direction in the actual scene. Taking the beach texture as an example, the first direction is the direction in which the waves rush toward the beach.

[0143] refer to Fig.11 In a specific implementation, resampling is performed while or before determining the UV coordinates of the target area to be mapped, so that the distances between points in the target area to be mapped are more uniform.

[0144] In this exemplary embodiment, the first direction includes the normal direction of the reduced contour line;

[0145] Then, determining the UV coordinates of the target area to be mapped based on the first direction includes:

[0146] The normal direction of the reduced contour line is taken as the direction of the V coordinate axis;

[0147] The direction perpendicular to the V coordinate axis is the direction of the U coordinate axis;

[0148] Based on the V coordinate axis and the U coordinate axis, a UV coordinate of the target area to be mapped is determined.

[0149] In specific implementation, the resample node is used to create a curveu attribute to provide a normalized position parameter for each point in the target area to be mapped, ranging from 0 to 1, indicating the position of the point in the target area to be mapped along the extension direction of the contour line.

[0150] refer to Fig.12 In the specific implementation, curveu is a value representing the position of each point in the curve. A value of 0 represents the starting point of the curve, and a value of 1 represents the end point of the curve. In order to avoid the map being stretched when the U direction changes too much, it is divided into multiple segments for calculation.

[0151] In specific implementation, the dist attribute is created through the attribcreate node to provide a normalized distance parameter for each point in the target area to be mapped, ranging from 0 to 1, indicating the distance of the point in the target area to be mapped from the reduced contour line to the expanded contour line.

[0152] refer to Fig.13 In the specific implementation, since the change of the texture in the V direction is not very large, there is little problem of texture stretching, so it does not need to be divided into multiple segments for calculation like the U direction.

[0153] The generation process of the above curveu and dist is expressed in the form of parameters as follows:

[0154] float u = @curveu;

[0155] float v = @dist;

[0156] v@uv=set(u,v,0).

[0157] In the above exemplary embodiments, the first direction includes the normal direction of the reduced contour line as an example, however, the present disclosure is not limited thereto:

[0158] In some exemplary embodiments, the first direction includes a normal direction of the enlarged contour line;

[0159] Then, determining the UV coordinates of the target area to be mapped based on the first direction includes:

[0160] The normal direction of the enlarged contour line is taken as the direction of the V coordinate axis;

[0161] The direction perpendicular to the V coordinate axis is the direction of the U coordinate axis;

[0162] Based on the V coordinate axis and the U coordinate axis, a UV coordinate of the target area to be mapped is determined.

[0163] In some exemplary embodiments, the first direction includes a normal direction of the initial contour line;

[0164] Then, determining the UV coordinates of the target area to be mapped based on the first direction includes:

[0165] The normal direction of the initial contour line is taken as the direction of the V coordinate axis;

[0166] The direction perpendicular to the V coordinate axis is the direction of the U coordinate axis;

[0167] Based on the V coordinate axis and the U coordinate axis, a UV coordinate of the target area to be mapped is determined.

[0168] Step S240: sampling the texture map based on the UV coordinates, and mapping the texture in the texture map to the target area to be mapped to form a texture pattern facing the target.

[0169] In this exemplary embodiment, the sampling of the texture map based on the UV coordinates and mapping the texture in the texture map to the target area to be mapped to form a texture pattern facing the target include:

[0170] Sampling a color value from the texture map based on the UV coordinates;

[0171] The color value is applied to a corresponding position in the target area to be mapped to form a texture pattern facing the target.

[0172] refer to Fig.14 In the specific implementation, curveu is finally set to U and dist is set to V to obtain the UV of the target area to be mapped. The map is sampled in this direction to achieve direction transformation.

[0173] In this exemplary embodiment, a two-dimensional plane image of a texture pattern forming a target orientation is exported to a game engine to be applied to an actual scene for rendering, and the rendered screen is sent to a client. The client displays to the user a rendered screen including a target model based on the two-dimensional plane image of the texture pattern forming the target orientation, on which the texture pattern of the target orientation is present.

[0174] refer to Fig.15 Before the beach texture direction is adjusted, the beach texture direction is inconsistent with the physical direction in the actual scene, such as the texture of the first area 1501 and the texture of the second area 1502, resulting in visual inconsistency, and the beach texture appears unnatural and unreal.

[0175] refer to Fig.16 After the beach texture direction is adjusted, the beach texture direction is consistent with the physical direction in the actual scene. For example, the textures of the third area 1601 and the fourth area 1602 appear natural and real no matter from which angle they are observed.

[0176] It can be seen from the above that the texture mapping method provided by the embodiment of the present disclosure includes: unfolding the surface of the target model into a two-dimensional plane image, and determining the initial contour line of the initial area to be mapped in the two-dimensional plane image; based on the initial contour line, determining the target area to be mapped within a specified range around the initial contour line; based on a first direction, determining the UV coordinates of the target area to be mapped; sampling the texture map based on the UV coordinates, and mapping the texture in the texture map to the target area to be mapped to form a texture pattern facing the target.

[0177] In the present disclosure, the texture pattern is directionally adjusted so that the direction of the texture pattern mapped to the target area to be mapped is consistent with the physical direction in the actual scene, ensuring that when applied to the actual scene, the display effect meets the expected visual realism and physical direction.

[0178] Specifically, the technical solution for processing a texture map with a specific direction proposed in any of the above embodiments realizes efficient matching of the texture map direction with the physical direction in the actual scene through a series of automated processing steps, and the specific beneficial effects brought about are as follows:

[0179] Significant improvement in visual realism:

[0180] Physical consistency: By calculating the UV coordinates of the texture and adjusting the direction of the map, the direction of the beach texture is consistent with the physical direction in the actual scene, thus avoiding the visual inconsistency caused by texture direction mismatch in traditional methods. This consistency is especially important when observing changes in perspective, ensuring that the beach texture appears natural and real no matter from which angle it is observed.

[0181] Improve user experience and immersion:

[0182] Immersive experience: For immersive games and virtual reality applications, realism is the key to user experience. The present invention makes the virtual beach scene more realistic by automatically processing the texture direction, and users will feel a stronger sense of immersion and involvement when moving and interacting in these scenes.

[0183] Automation and efficient processing:

[0184] Automated workflow: The technical solution of the present invention realizes the automated processing of the adjustment of the beach texture direction. Only a map containing the beach area needs to be input to automatically extract the beach contour, calculate the UV coordinates and adjust the texture direction, which greatly reduces the need for manual intervention.

[0185] Time and cost saving: Due to the automation and efficiency of the processing steps, the workload of artists to manually adjust the texture direction is reduced, thus saving a lot of time and labor costs. At the same time, automated processing ensures the consistency and high quality of each processing result, avoiding the errors and inconsistencies that may be caused by manual adjustment.

[0186] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.

[0187] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0188] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a texture mapping device.

[0189] refer to Fig.17 , texture mapping device, including the following modules:

[0190] The initial contour line determination module 1710 is configured to unfold the surface of the target model into a two-dimensional plane image, and determine the initial contour line of the initial area to be mapped in the two-dimensional plane image;

[0191] The target area to be mapped determining module 1720 is configured to determine, based on the initial contour line, a target area to be mapped within a specified range around the initial contour line;

[0192] The UV coordinate determination module 1730 is configured to determine the UV coordinates of the target area to be mapped based on the first direction;

[0193] The texture mapping module 1740 is configured to sample the texture map based on the UV coordinates, and map the texture in the texture map to the target area to be mapped to form a texture pattern facing the target.

[0194] In some exemplary embodiments, the target to-be-mapped area determination module 1720 is specifically configured to:

[0195] Expanding the initial contour line to obtain an expanded contour line;

[0196] Performing a reduction process on the initial contour line to obtain a reduced contour line;

[0197] The area between the enlarged contour line and the reduced contour line is determined as the target area to be mapped.

[0198] In some exemplary embodiments, the initial contour determination module 1710 is specifically configured to:

[0199] Determine a contour edge of a target object in the two-dimensional plane image;

[0200] Grouping the contour edges to obtain a plurality of contour edge groups;

[0201] The contour edge groups corresponding to the initial to-be-mapped area in the plurality of contour edge groups are converted into contour lines, and the initial contour lines are obtained based on the contour lines.

[0202] In some exemplary embodiments, the target to-be-mapped area determination module 1720 is further configured to:

[0203] The contour line is resampled to obtain the initial contour line.

[0204] In some exemplary embodiments, the target to-be-mapped area determination module 1720 is specifically configured to:

[0205] Determine the position of each point on the initial contour line;

[0206] Determine the normal direction of each point;

[0207] Determine the preset enlargement distance parameters;

[0208] Each point is moved along the normal direction by the enlarged distance parameter to obtain the enlarged contour line.

[0209] In some exemplary embodiments, the target to-be-mapped area determination module 1720 is specifically configured to:

[0210] Determining a preset length parameter, and dividing the enlarged contour line into a plurality of contour line segments based on the length parameter;

[0211] Perform the following operations on all the contour segments to obtain the reduced contour:

[0212] Determining a preset reduction distance parameter, a preset reduction direction parameter, and a preset reduction angle parameter;

[0213] Determine a first position of a point on each of the contour line segments, and determine a second position matching the first position based on the reduction distance parameter, the reduction direction parameter, and the reduction angle parameter;

[0214] Points between the first position and the second position are removed.

[0215] In some exemplary embodiments, the target to-be-mapped area determination module 1720 is specifically configured to:

[0216] The enlarged contour line and the reduced contour line are combined, and an area between the enlarged contour line and the reduced contour line is determined as the target area to be mapped.

[0217] In some exemplary embodiments, the first direction includes the normal direction of the reduced contour line, and the texture direction adjustment module 1730 is specifically configured as follows:

[0218] The normal direction of the reduced contour line is taken as the direction of the V coordinate axis;

[0219] The direction perpendicular to the V coordinate axis is the direction of the U coordinate axis;

[0220] Based on the V coordinate axis and the U coordinate axis, a UV coordinate of the target area to be mapped is determined.

[0221] In some exemplary embodiments, the texture mapping module 1740 is specifically configured to:

[0222] Sampling a color value from the texture map based on the UV coordinates;

[0223] The color value is applied to a corresponding position in the target area to be mapped to form a texture pattern facing the target.

[0224] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0225] The device of the above embodiment is used to implement the corresponding texture mapping method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0226] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the texture mapping method described in any of the above embodiments is implemented.

[0227] Fig.18 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1810, a memory 1820, an input / output interface 1830, a communication interface 1840, and a bus 1850. The processor 1810, the memory 1820, the input / output interface 1830, and the communication interface 1840 are connected to each other in communication within the device through the bus 1850.

[0228] The processor 1810 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0229] The memory 1820 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1820 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1820 and are called and executed by the processor 1810.

[0230] The input / output interface 1830 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0231] The communication interface 1840 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0232] The bus 1850 includes a path that transmits information between the various components of the device (eg, the processor 1810, the memory 1820, the input / output interface 1830, and the communication interface 1840).

[0233] It should be noted that, although the above device only shows the processor 1810, the memory 1820, the input / output interface 1830, the communication interface 1840 and the bus 1850, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0234] The electronic device of the above embodiment is used to implement the corresponding texture mapping method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0235] The memory 1820 stores machine-readable instructions executable by the processor 1810. When the electronic device is running, the processor 1810 communicates with the memory 1820 via the bus 1830, so that the processor 1810 executes the following instructions when running:

[0236] Expanding the surface of the target model into a two-dimensional plane image, and determining an initial contour line of an initial area to be mapped in the two-dimensional plane image;

[0237] Based on the initial contour line, determining a target area to be mapped within a specified range around the initial contour line;

[0238] Based on the first direction, determining the UV coordinates of the target area to be mapped;

[0239] The texture map is sampled based on the UV coordinates, and the texture in the texture map is mapped to the target area to be mapped to form a texture pattern facing the target.

[0240] In a possible implementation manner, in the instructions executed by the processor 1810, determining, based on the initial contour line, a target area to be mapped within a specified range around the initial contour line includes:

[0241] Expanding the initial contour line to obtain an expanded contour line;

[0242] Performing a reduction process on the initial contour line to obtain a reduced contour line;

[0243] The area between the enlarged contour line and the reduced contour line is determined as the target area to be mapped.

[0244] In a possible implementation manner, in the instruction executed by the processor 1810, the determining an initial contour line of the initial area to be mapped in the two-dimensional plane image includes:

[0245] Determine a contour edge of a target object in the two-dimensional plane image;

[0246] Grouping the contour edges to obtain a plurality of contour edge groups;

[0247] The contour edge groups corresponding to the initial to-be-mapped area in the plurality of contour edge groups are converted into contour lines, and the initial contour lines are obtained based on the contour lines.

[0248] In a possible implementation manner, in the instruction executed by the processor 1810, obtaining the initial contour line based on the contour line includes:

[0249] The contour line is resampled to obtain the initial contour line.

[0250] In a possible implementation manner, in the instructions executed by the processor 1810, the step of enlarging the initial contour line to obtain an enlarged contour line includes:

[0251] Determine the position of each point on the initial contour line;

[0252] Determine the normal direction of each point;

[0253] Determine the preset enlargement distance parameters;

[0254] Each point is moved along the normal direction by the enlarged distance parameter to obtain the enlarged contour line.

[0255] In a possible implementation manner, in the instructions executed by the processor 1810, the step of reducing the initial contour line to obtain a reduced contour line includes:

[0256] Determining a preset length parameter, and dividing the initial contour line into a plurality of contour line segments based on the length parameter;

[0257] Perform the following operations on all the contour segments to obtain the reduced contour:

[0258] Determining a preset reduction distance parameter, a preset reduction direction parameter, and a preset reduction angle parameter;

[0259] Determine a first position of a point on each of the contour line segments, and determine a second position matching the first position based on the reduction distance parameter, the reduction direction parameter, and the reduction angle parameter;

[0260] Points between the first position and the second position are removed.

[0261] In a possible implementation manner, in the instruction executed by the processor 1810, determining the area between the enlarged contour line and the reduced contour line as the target area to be mapped includes:

[0262] The enlarged contour line and the reduced contour line are combined, and an area between the enlarged contour line and the reduced contour line is determined as the target area to be mapped.

[0263] In a possible implementation, in the instruction executed by the processor 1810, the first direction includes the normal direction of the reduced contour line;

[0264] Then, determining the UV coordinates of the target area to be mapped based on the first direction includes:

[0265] The normal direction of the reduced contour line is taken as the direction of the V coordinate axis;

[0266] The direction perpendicular to the V coordinate axis is the direction of the U coordinate axis;

[0267] Based on the V coordinate axis and the U coordinate axis, a UV coordinate of the target area to be mapped is determined.

[0268] In a possible implementation manner, in the instructions executed by the processor 1810, sampling the texture map based on the UV coordinates, and mapping the texture in the texture map to the target area to be mapped to form a texture pattern facing the target, includes:

[0269] Sampling a color value from the texture map based on the UV coordinates;

[0270] The color value is applied to a corresponding position in the target area to be mapped to form a texture pattern facing the target.

[0271] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the texture mapping method described in any of the above embodiments.

[0272] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0273] The above-mentioned non-transitory computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)), etc.

[0274] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the texture mapping method described in any embodiment in the above exemplary method part, and have the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0275] Based on the same inventive concept, corresponding to the texture mapping method described in any of the above embodiments, the present disclosure further provides a computer program product, which includes computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer so that the computer and / or the processor executes the texture mapping method. Corresponding to the execution subject corresponding to each step in each embodiment of the texture mapping method, the processor that executes the corresponding step can belong to the corresponding execution subject.

[0276] The computer program product of the above embodiment is used to enable the computer and / or the processor to execute the texture mapping method described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0277] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, method, or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." In addition, in some embodiments, the present disclosure may also be implemented in the form of a computer program product in one or more computer-readable media, which contains computer-readable program code.

[0278] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive examples) of computer-readable storage media may include, for example: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.

[0279] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0280] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0281] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0282] It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine, and these computer program instructions are executed by a computer or other programmable data processing device to produce a device that implements the functions / operations specified in the boxes in the flowchart and / or block diagram.

[0283] These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable medium produce a product that includes an instruction device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0284] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby enabling the instructions executed on the computer or other programmable device to provide a process for implementing the functions / operations specified in the blocks in the flowchart and / or block diagram.

[0285] In addition, although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flow chart can be performed in a different order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.

[0286] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0287] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0288] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0289] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0290] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0291] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.

[0292] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims. The scope of the attached claims conforms to the broadest interpretation, thereby including all such modifications and equivalent structures and functions.

Claims

1. A texture mapping method, characterized in that: include: Expanding the surface of the target model into a two-dimensional plane image, and determining an initial contour line of an initial area to be mapped in the two-dimensional plane image; Based on the initial contour line, determining a target area to be mapped within a specified range around the initial contour line; Based on the first direction, determining the UV coordinates of the target area to be mapped; The texture map is sampled based on the UV coordinates, and the texture in the texture map is mapped to the target area to be mapped to form a texture pattern facing the target.

2. The method according to claim 1, characterized in that The determining, based on the initial contour line, a target area to be mapped within a specified range around the initial contour line comprises: Expanding the initial contour line to obtain an expanded contour line; Performing a reduction process on the initial contour line to obtain a reduced contour line; The area between the enlarged contour line and the reduced contour line is determined as the target area to be mapped.

3. The method according to claim 1, characterized in that The determining of the initial contour line of the initial area to be mapped in the two-dimensional plane image comprises: Determine a contour edge of a target object in the two-dimensional plane image; Grouping the contour edges to obtain a plurality of contour edge groups; The contour edge groups corresponding to the initial to-be-mapped area in the plurality of contour edge groups are converted into contour lines, and the initial contour lines are obtained based on the contour lines.

4. The method according to claim 3, characterized in that The obtaining the initial contour line based on the contour line comprises: The contour line is resampled to obtain the initial contour line.

5. The method according to claim 2, characterized in that: The step of enlarging the initial contour line to obtain an enlarged contour line includes: Determine the position of each point on the initial contour line; Determine the normal direction of each point; Determine the preset expansion distance parameters; Each point is moved along the normal direction by the enlarged distance parameter to obtain the enlarged contour line.

6. The method according to claim 2, characterized in that The step of reducing the initial contour line to obtain a reduced contour line includes: Determining a preset length parameter, and dividing the initial contour line into a plurality of contour line segments based on the length parameter; Perform the following operations on all the contour segments to obtain the reduced contour: Determining a preset reduction distance parameter, a preset reduction direction parameter, and a preset reduction angle parameter; Determine a first position of a point on each of the contour line segments, and determine a second position matching the first position based on the reduction distance parameter, the reduction direction parameter, and the reduction angle parameter; Points between the first position and the second position are removed.

7. The method according to claim 2, characterized in that The step of determining the area between the enlarged contour line and the reduced contour line as the target area to be mapped includes: The enlarged contour line and the reduced contour line are combined, and an area between the enlarged contour line and the reduced contour line is determined as the target area to be mapped.

8. The method according to claim 2, characterized in that: The first direction includes the normal direction of the reduced contour line; Then, determining the UV coordinates of the target area to be mapped based on the first direction includes: The normal direction of the reduced contour line is taken as the direction of the V coordinate axis; The direction perpendicular to the V coordinate axis is the direction of the U coordinate axis; Based on the V coordinate axis and the U coordinate axis, a UV coordinate of the target area to be mapped is determined.

9. The method according to claim 1, characterized in that: The step of sampling the texture map based on the UV coordinates and mapping the texture in the texture map to the target area to be mapped to form a texture pattern facing the target includes: Sampling a color value from the texture map based on the UV coordinates; The color value is applied to a corresponding position in the target area to be mapped to form a texture pattern facing the target.

10. A texture mapping device, characterized in that: include: An initial contour line determination module is configured to unfold the surface of the target model into a two-dimensional plane image, and determine an initial contour line of an initial area to be mapped in the two-dimensional plane image; A target area to be mapped determining module is configured to determine, based on the initial contour line, a target area to be mapped within a specified range around the initial contour line; A UV coordinate determination module is configured to determine the UV coordinates of the target area to be mapped based on the first direction; The texture mapping module is configured to sample the texture map based on the UV coordinates, and map the texture in the texture map to the target area to be mapped to form a texture pattern facing the target.

11. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 9 is implemented.

12. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The method comprises computer program instructions, and when the computer program instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 9.