CN114359468A - Method and device for generating texture of mountain model - Google Patents

Method and device for generating texture of mountain model Download PDF

Info

Publication number
CN114359468A
CN114359468A CN202111652835.1A CN202111652835A CN114359468A CN 114359468 A CN114359468 A CN 114359468A CN 202111652835 A CN202111652835 A CN 202111652835A CN 114359468 A CN114359468 A CN 114359468A
Authority
CN
China
Prior art keywords
target
mountain
texture
mountain model
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111652835.1A
Other languages
Chinese (zh)
Inventor
周创
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202111652835.1A priority Critical patent/CN114359468A/en
Publication of CN114359468A publication Critical patent/CN114359468A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Generation (AREA)

Abstract

The invention provides a method and a device for generating texture of a mountain model, which relate to the technical field of computer graphics, and comprise the following steps: obtaining UV coordinates of each two-dimensional plane of the target mountain model in a three-dimensional space; respectively sampling the mountain basic texture maps according to the UV coordinates to obtain textures of the target mountain model in each dimension direction of the three-dimensional space; according to the weight of the normal of the vertex of the target mountain model in each dimension direction of the three-dimensional space, carrying out mixed processing on the texture of the target mountain model in each dimension direction of the three-dimensional space to generate a target texture mapping; the target texture mapping is divided into at least two areas based on the height information, corresponding action factors are distributed, and therefore texture mapping of the target mountain model based on the target texture mapping is achieved.

Description

Method and device for generating texture of mountain model
Technical Field
The invention relates to the technical field of computer graphics, in particular to a method and a device for generating textures of a mountain model.
Background
With the rise of national wind culture trend, more and more games and animations gradually develop from rough manufacture to fine manufacture. In traditional Chinese painting and calligraphy works, landscape subject matters account for a large proportion, so that in game works taking the Chinese painting style as a theme, scene making of the traditional landscape painting and calligraphy works is always required to be accurately restored. The idea of rendering the mountains in the traditional Chinese painting style mainly lies in internal texture rendering, and rendering performance of the internal texture is to follow various chaps (namely, a drawing method for expressing veins of mountains, peaks and tree skins) of the traditional Chinese painting, so that in a traditional Chinese painting style game with numerous mountain content expressions, high-quality restoration of the veins of the mountains has certain difficulty.
In the existing three-dimensional game works, textures drawn on a common mountain model can be generated according to texture coordinates (UV) hand-drawing production mapping materials of the model, so that the cost of art production is increased undoubtedly, and the use flexibility is reduced. Or the existing traditional Chinese painting style mapping materials are used for conducting mapping and superposition of the brush-stroke textures, but due to the fact that the manufacturing requirement of the brush-stroke textures is high, due to blocking, stretching and the like when UV is unfolded, a series of problems that joints of superposed expression parts of the brush-stroke textures are broken, mapping is stretched and the like are caused are often caused, and therefore the mountain model textures cannot be accurately restored. That is, the conventional method for generating a mountain model texture has problems of high production cost and low restoration degree.
Disclosure of Invention
The invention aims to provide a method and a device for generating textures of a mountain model, which are used for solving the technical problems of high manufacturing cost and low reduction degree in the prior art.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a method for generating a texture of a mountain model, including: acquiring UV coordinates of each two-dimensional plane in the three-dimensional space corresponding to a target mountain model based on the position coordinates of the three-dimensional space of the target mountain model;
respectively sampling mountain basic texture maps according to the UV coordinates to obtain textures of the target mountain model in each dimension direction of the three-dimensional space;
mixing textures of the target mountain model in each dimension direction of the three-dimensional space according to the weight of the normal line of the vertex of the target mountain model in each dimension direction of the three-dimensional space, and generating a target texture map;
dividing the target texture mapping into at least two regions based on the height information of the target mountain model, and respectively allocating corresponding action factors to the at least two regions to realize texture mapping of the target mountain model based on the target texture mapping; the action factor is used for indicating the number of texture strokes of the corresponding area.
In some possible embodiments, the method further comprises: scanning the traditional Chinese painting image to generate a texture resource library, wherein the texture resource library comprises a mountain element map which is matched with the traditional Chinese painting image and has a traditional Chinese painting style; preprocessing the mountain element graph in the drawing style to generate an initial texture pattern; and performing square continuous tiling processing on the initial texture pattern to generate a mountain basic texture mapping.
In some possible embodiments, the method further comprises: and determining the weight of the normal in each dimension direction based on the orientation information of the normal of the vertex of the target mountain model.
In some possible embodiments, the dividing the target texture map into at least two regions based on the height information of the target mountain model, and assigning corresponding factors to the at least two regions respectively includes: dividing the second texture map sampling result into a top sampling area and a bottom sampling area based on the height information of the target mountain model; allocating a first action factor to the top sampling region and a second action factor to the bottom sampling region;
performing texture mapping on the target mountain model based on the target texture map, including: multiplying a mapping area corresponding to the top sampling area in the target texture mapping by the first action factor to generate a top texture mapping sampling result; multiplying a mapping area corresponding to the bottom sampling area in the target texture mapping by the second action factor to generate a bottom texture mapping sampling result; and performing texture mapping on the target mountain model based on the top texture map sampling result and the bottom texture map sampling result.
In some possible embodiments, the first contributing factor is smaller than the second contributing factor to achieve that the number of brush textures of the top sampling region is larger than the number of brush textures of the bottom sampling region.
In some possible embodiments, the height information includes a height value of each vertex of the target mountain model from a mountain bottom to a mountain top; determining a first mountain area from a mountain top plane of the target mountain model to an area of a first segmentation plane, and determining the top sampling area according to the first mountain area; determining a region from the mountain bottom plane of the target mountain model to the first split surface as a second mountain region, and determining the bottom sampling region according to the second mountain region; the distance between the first dividing plane and the mountain bottom plane of the target mountain model is three-quarters of the total height of the target mountain model.
In some possible embodiments, before the sampling the mountain base texture maps according to the UV coordinates respectively, the method further includes: rotating the UV coordinate in the three-dimensional space according to a first preset parameter to generate a rotated UV coordinate; the first preset parameter includes at least one of: rotation center coordinates, rotation angle, and rotation order.
In some possible embodiments, the method further comprises: according to a second preset parameter, shifting the UV coordinate in the three-dimensional space to generate a shifted UV coordinate; the second preset parameter includes at least one of the following: offset center coordinates, offset displacements, and offset orders.
In some possible embodiments, the method further comprises: zooming the UV coordinate in the three-dimensional space according to a third preset parameter to generate a zoomed UV coordinate; the third preset parameter includes at least one of the following: zoom center coordinates, zoom scale, and zoom order.
In a second aspect, an embodiment of the present invention provides a texture generation apparatus for a mountain model, where the apparatus includes: the coordinate acquisition module is used for acquiring UV coordinates of each two-dimensional plane in the three-dimensional space corresponding to the target mountain model based on the position coordinates of the three-dimensional space of the target mountain model;
the sampling module is used for respectively sampling the mountain basic texture maps according to the UV coordinates to obtain textures of the target mountain model in each dimension direction of the three-dimensional space;
a target texture mapping generation module, configured to perform hybrid processing on textures of the target mountain model in each dimension direction of the three-dimensional space according to a weight of a normal of a vertex of the target mountain model in each dimension direction of the three-dimensional space, so as to generate a target texture mapping;
a segmentation module, configured to segment the target texture map into at least two regions based on height information of the target mountain model, and allocate corresponding action factors to the at least two regions, respectively, so as to implement texture mapping on the target mountain model based on the target texture map; the action factor is used for indicating the number of texture strokes of the corresponding area.
In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, where the memory stores a computer program operable on the processor, and the processor implements the steps of the method according to any one of the first aspect when executing the computer program.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium storing machine executable instructions that, when invoked and executed by a processor, cause the processor to perform the method of any of the first aspects.
The invention provides a method and a device for generating textures of a mountain model, wherein the method comprises the following steps: firstly, obtaining UV coordinates of each two-dimensional plane of a target mountain model in a three-dimensional space; respectively sampling the mountain basic texture maps according to the UV coordinates to obtain textures of the target mountain model in each dimension direction of the three-dimensional space; mixing the textures of the target mountain model in each dimension direction of the three-dimensional space according to the weight of the normal of the vertex of the target mountain model in each dimension direction of the three-dimensional space, and generating a target texture mapping; and finally, dividing the target texture mapping into at least two areas based on the height information, and distributing corresponding action factors to realize texture mapping of the target mountain model based on the target texture mapping. By the method, the technical problems of high manufacturing cost and low restoration degree of the mountain model texture in the prior art can be solved, the brush touch texture of the mountain is highly restored, and the effect of improving the restoration precision of the mountain texture is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flow chart of a method for generating a texture of a mountain model according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a display effect of a method for generating textures of a mountain model according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a rotation display effect of a method for generating textures of a mountain model according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating a zoom display effect of a method for generating textures of a mountain model according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a texture generation apparatus for a mountain model according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
In the existing three-dimensional game works, textures drawn on a common mountain model can be generated according to a space three-dimensional position coordinate (UV coordinate) hand-drawing making mapping material of the model, so that the cost of art making is undoubtedly increased, and the use flexibility is reduced; or the existing traditional Chinese painting style mapping materials are used for conducting mapping and superposition of the brush-stroke textures, but due to the fact that the manufacturing requirement of the brush-stroke textures is high, due to blocking, stretching and the like when UV is unfolded, a series of problems that joints of superposed expression parts of the brush-stroke textures are broken, mapping is stretched and the like are caused are often caused, and therefore the mountain model textures cannot be accurately restored. That is, the conventional method for generating a mountain model texture has problems of high production cost and low restoration degree.
Based on this, the embodiment of the invention provides a method for generating a mountain model texture, so as to solve the problems of high manufacturing cost and low reduction degree of the existing method for generating the mountain model texture.
To facilitate understanding of the present embodiment, first, a detailed description is given of a method for generating a texture of a mountain model disclosed in the present embodiment, referring to a flowchart of the method for generating a texture of a mountain model shown in fig. 1, where the method may be executed by an electronic device and mainly includes the following steps S110 to S140:
s110: acquiring UV coordinates of each two-dimensional plane in the three-dimensional space corresponding to the target mountain model based on the position coordinates of the three-dimensional space of the target mountain model;
the target mountain model can be established in advance through three-dimensional modeling software, and the established target mountain model comprises a plurality of mesh vertex information. Further, since the vertex information includes: the three-dimensional space coordinates of the vertices and the normal orientation information of the vertices, so the UV coordinates of each vertex in each two-dimensional plane of the three-dimensional (i.e., X, Y, Z three directions) space can be determined in the shader based on the three-dimensional space coordinates of the vertices. That is, the positional coordinates of the three-dimensional space include spatial three-dimensional positional coordinates of each vertex in three dimensions within the three-dimensional space coordinates.
It should be noted that, in the coordinate description of the present embodiment, the three-dimensional space coordinate may be a model space coordinate where the target mountain model is located, or may also be a world space coordinate, the three dimensions are an X dimension, a Y dimension, and a Z dimension, and the two-dimensional planes respectively corresponding to the three dimensions include: the YZ plane, the XZ plane, and the ZY plane.
S120: respectively sampling the mountain basic texture maps according to the UV coordinates to obtain textures of the target mountain model in each dimension direction of the three-dimensional space;
s130: according to the weight of the normal of the vertex of the target mountain model in each dimension direction of the three-dimensional space, carrying out mixed processing on the texture of the target mountain model in each dimension direction of the three-dimensional space to generate a target texture mapping;
the weight of the normal of the vertex in each dimension direction of the three-dimensional space can be determined by the orientation information of the normal of the vertex of the target mountain model, and if the normal vector of one vertex is upward along the Y axis and is vertical to the XZ plane, the weight of the vertex relative to the XZ plane is larger.
The texture of the target mountain model in each dimension direction of the three-dimensional space is subjected to mixing processing, namely: and multiplying and accumulating the pixel values of the vertexes in the three dimensions by the weights of the corresponding dimensions respectively to obtain the target texture mapping.
S140: dividing the target texture mapping into at least two areas based on the height information of the target mountain model, and respectively distributing corresponding action factors for the at least two areas so as to realize texture mapping of the target mountain model based on the target texture mapping;
wherein, the action factor is used for expressing the number of texture strokes of the corresponding area. The texture brush touch is lines drawn by various techniques of traditional Chinese paintings, such as wrinkle (painting for representing veins of mountain stones, peaks and mountains and tree skins), and the like.
In an embodiment, before step S110, the method may further include: obtaining a mountain basic texture mapping; the method specifically comprises the following steps:
(1) generating a texture resource library by scanning the traditional Chinese painting image; the texture resource library comprises a mountain element map which is matched with the traditional Chinese painting style;
(2) preprocessing the mountain element graph in the drawing style to generate an initial texture pattern;
(3) and performing square continuous tiling processing on the initial texture pattern to generate a mountain basic texture mapping.
In the embodiment of the present invention, the mountain basic texture map may be obtained from a texture resource library, and the texture resource library may be obtained by scanning a picture album, a photograph, and the like containing elements of a mountain in the style of traditional Chinese painting. That is, the preset pattern can be obtained by scanning and preprocessing such as desaturation and clipping with the help of the existing painting album with the traditional Chinese painting style, and the preset pattern is the mountain texture map conforming to the style of the Chinese painting.
The mountain base texture map can be a four-side continuous tile texture of a predetermined pattern. Namely, edge splicing, edge information diffusion and fuzzy fusion are carried out on the preset pattern, and the mountain basic texture mapping is obtained from the preset pattern.
In an embodiment, in the step S140, dividing the target texture map into at least two regions based on the height information of the target mountain model, and assigning corresponding action factors to the at least two regions respectively includes:
(1) dividing the target texture map into a top sampling area and a bottom sampling area based on the height information of the target mountain model;
(2) a first contributing factor is assigned to the top sampling region and a second contributing factor is assigned to the bottom sampling region. And the first action factor is smaller than the second action factor so as to realize that the number of the brush texture in the top sampling area is larger than that in the bottom sampling area.
In the step S140, performing texture mapping on the target mountain model based on the target texture map includes:
(1) multiplying a mapping area corresponding to a top sampling area in the target texture mapping by a first action factor to generate a top texture mapping sampling result;
(2) multiplying a mapping area corresponding to a bottom sampling area in the target texture mapping by a second action factor to generate a bottom texture mapping sampling result;
(3) and performing texture mapping on the target mountain model based on the top texture map sampling result and the bottom texture map sampling result.
As a specific example, the height information includes a height value of each vertex of the target mountain model from the bottom of the mountain to the top of the mountain. Determining a region from a mountain top plane of the target mountain model to the first segmentation plane as a first mountain region, and determining a top sampling region according to the first mountain region; determining a region from the mountain bottom plane of the target mountain model to the first splitting plane as a second mountain region, and determining a bottom sampling region according to the second mountain region; the distance between the first dividing plane and the mountain bottom plane of the target mountain model is three-quarters of the total height of the target mountain model (see fig. 2).
Wherein, the action factor can be used for representing the number of the texture strokes of the corresponding region; as a specific example, when the action factor is set to 0, the number of texture strokes in the corresponding region is not decreased; when the effect factor is set to 1, the texture stroke is reduced to the maximum extent. Because the action factors of the bottom and the top of the mountain are different and are respectively controlled by the two action factors, the left side of the figure 2 shows that the effect of height distribution is not carried out, and the detail degrees of the top and the bottom of the mountain are approximately the same; the bottom of the right drawing has less stroke details and the top has more stroke details, thereby further conforming to the drawing style of the traditional Chinese painting.
In some possible embodiments, before the step S120 of sampling the mountain base texture maps according to the UV coordinates respectively, the method may further include: rotating the UV coordinate in a three-dimensional space according to a first preset parameter to generate a rotated UV coordinate; the first preset parameter includes at least one of: rotation center coordinates, rotation angle, and rotation order.
As a specific example, referring to fig. 3, the right image is an effect of rotating the left image by 90 degrees with a preset UV center (0.5 ) to the X dimension (i.e., YZ plane dimension), and it can be seen that the posture of the mountain texture in the left image is oriented to the left and down direction, and the posture of the mountain texture in the rotated right image is oriented to the right and down direction.
In some possible embodiments, the method may further include: according to a second preset parameter, shifting the UV coordinate in the three-dimensional space to generate a shifted UV coordinate; the second preset parameter includes at least one of: offset center coordinates, offset displacements, and offset orders.
In some possible embodiments, the method further comprises: zooming the UV coordinate in the three-dimensional space according to a third preset parameter to generate a zoomed UV coordinate; the third preset parameter includes at least one of: zoom center coordinates, zoom scale, and zoom order.
As a specific example, referring to fig. 4, the right image is the effect of scaling the left image by the preset second parameter, and it can be seen that the stroke spot of the mountain texture in the scaled right image is larger than that in the left image.
The method realizes rotation, offset and scaling of the spatial three-dimensional position coordinates in three dimensions, and can provide higher control flexibility for generating the mountain model texture. And setting a mountain height value according to the parameters, and performing texture detail density distribution from top to bottom according to the vertex Y-axis position of the model space so as to accord with the visual expression of the style rule of the traditional Chinese painting.
The embodiment provides a method for generating a texture of a mountain model, which comprises the following steps: firstly, obtaining UV coordinates of each two-dimensional plane of a target mountain model in a three-dimensional space; respectively sampling the mountain basic texture maps according to the UV coordinates to obtain textures of the target mountain model in each dimension direction of the three-dimensional space; mixing the textures of the target mountain model in each dimension direction of the three-dimensional space according to the weight of the normal of the vertex of the target mountain model in each dimension direction of the three-dimensional space, and generating a target texture mapping; and finally, dividing the target texture mapping into at least two areas based on the height information, and distributing corresponding action factors to realize texture mapping of the target mountain model based on the target texture mapping. By the method, the technical problems of high manufacturing cost and low restoration degree of the mountain model texture in the prior art can be solved, the brush touch texture of the mountain is highly restored, and the effect of improving the restoration precision of the mountain texture is realized.
In addition, an embodiment of the present application further provides a texture generation apparatus for a mountain model, and referring to fig. 5, the apparatus includes:
a coordinate obtaining module 510, configured to obtain, based on the position coordinates of the three-dimensional space of the target mountain model, UV coordinates of each two-dimensional plane in the three-dimensional space corresponding to the target mountain model;
the sampling module 520 is configured to sample the mountain basic texture maps according to the UV coordinates, and obtain textures of the target mountain model in each dimension direction of the three-dimensional space;
a target texture mapping generating module 530, configured to perform mixing processing on the textures of the target mountain model in each dimension direction of the three-dimensional space according to the weight of the normal of the vertex of the target mountain model in each dimension direction of the three-dimensional space, so as to generate a target texture mapping;
a dividing module 540, configured to divide the target texture map into at least two regions based on the height information of the target mountain model, and allocate corresponding action factors to the at least two regions, so as to implement texture mapping on the target mountain model based on the target texture map; wherein, the action factor is used for expressing the number of texture strokes of the corresponding area.
In one embodiment, the apparatus further comprises: the mountain basic texture mapping generation module is used for generating a texture resource library including a mountain element map which is matched with the traditional Chinese painting image and has the traditional Chinese painting style by scanning the traditional Chinese painting image; preprocessing the mountain element graph in the drawing style to generate an initial texture pattern; and performing square continuous tiling processing on the initial texture pattern to generate a mountain basic texture mapping.
In one embodiment, the apparatus further comprises: and the normal weight determining module is used for determining the weight of the normal in each dimension direction based on the orientation information of the normal of the vertex of the target mountain model.
In one embodiment, the segmentation module is further configured to: based on the height information of the target mountain model, dividing the second texture mapping sampling result into a top sampling area and a bottom sampling area; allocating a first action factor for the top sampling area and a second action factor for the bottom sampling area; multiplying a mapping area corresponding to a top sampling area in the target texture mapping by a first action factor to generate a top texture mapping sampling result; multiplying a mapping area corresponding to a bottom sampling area in the target texture mapping by a second action factor to generate a bottom texture mapping sampling result; and performing texture mapping on the target mountain model based on the top texture map sampling result and the bottom texture map sampling result.
And the first action factor is smaller than the second action factor so as to realize that the number of the brush texture in the top sampling area is larger than that in the bottom sampling area.
As a specific example, the height information includes a height value of each vertex of the target mountain model from the bottom of the mountain to the top of the mountain; determining a first mountain area from a mountain top plane of the target mountain model to the area of the first segmentation plane, and determining a top sampling area according to the first mountain area; determining a region from the mountain bottom plane of the target mountain model to the first splitting plane as a second mountain region, and determining a bottom sampling region according to the second mountain region; the distance between the first dividing surface and the mountain bottom plane of the target mountain model is three-quarters of the total height of the target mountain model.
In one embodiment, the apparatus further comprises: the rotation module is used for rotating the UV coordinate in the three-dimensional space according to a first preset parameter to generate a rotated UV coordinate; the first preset parameter includes at least one of: rotation center coordinates, rotation angle, and rotation order.
In one embodiment, the apparatus further comprises: the offset module is used for offsetting the UV coordinate in the three-dimensional space according to a second preset parameter to generate an offset UV coordinate; the second preset parameter includes at least one of: offset center coordinates, offset displacements, and offset orders.
In one embodiment, the apparatus further comprises: the zooming module is used for zooming the UV coordinate in the three-dimensional space according to a third preset parameter to generate a zoomed UV coordinate; the third preset parameter includes at least one of: zoom center coordinates, zoom scale, and zoom order.
The embodiment provides a method and a device for generating textures of a mountain model, wherein the method comprises the following steps: firstly, sampling a mountain basic texture map based on a spatial three-dimensional position coordinate of a target mountain model to generate a first texture map sampling result; then, according to the weight of the normal of the vertex of the target mountain model in the three-dimensional space coordinate, distributing the sampling result of the first texture mapping to generate a sampling result of a second texture mapping; and based on the height information of the target mountain model, dividing the second texture mapping sampling result into at least two areas, and respectively distributing corresponding action factors for the at least two areas to realize texture mapping of the target mountain model. By the method, the technical problems of high manufacturing cost and low restoring degree in the prior art can be solved, the brush-touch textures of the mountain are highly restored, and the effect of improving the restoring precision of the mountain textures is achieved.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device 400 includes: a processor 40, a memory 41, a bus 42 and a communication interface 43, wherein the processor 40, the communication interface 43 and the memory 41 are connected through the bus 42; the processor 40 is arranged to execute executable modules, such as computer programs, stored in the memory 41.
The Memory 41 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 43 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
The bus 42 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
The memory 41 is used for storing a program, the processor 40 executes the program after receiving an execution instruction, and the method executed by the apparatus defined by the flow process disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 40, or implemented by the processor 40.
The processor 40 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 40. The Processor 40 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory 41, and the processor 40 reads the information in the memory 41 and completes the steps of the method in combination with the hardware thereof.
Corresponding to the method, the embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores machine executable instructions, and when the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to execute the steps of the method.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters indicate like items in the figures, and thus once an item is defined in a figure, it need not be further defined or explained in subsequent figures, and moreover, the terms "first," "second," "third," etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (12)

1. A method for generating a texture of a mountain model, comprising:
acquiring UV coordinates of each two-dimensional plane in the three-dimensional space corresponding to a target mountain model based on the position coordinates of the three-dimensional space of the target mountain model;
respectively sampling mountain basic texture maps according to the UV coordinates to obtain textures of the target mountain model in each dimension direction of the three-dimensional space;
according to the weight of the normal of the vertex of the target mountain model in each dimension direction of the three-dimensional space, carrying out mixed processing on the texture of the target mountain model in each dimension direction of the three-dimensional space to generate a target texture map;
dividing the target texture mapping into at least two areas based on the height information of the target mountain model, and respectively distributing corresponding action factors for the at least two areas so as to realize texture mapping on the target mountain model based on the target texture mapping;
wherein the effect factor is used for representing the number of texture strokes of the corresponding area.
2. The method for generating texture of a mountain model according to claim 1, further comprising:
scanning the traditional Chinese painting image to generate a texture resource library, wherein the texture resource library comprises a mountain element map which is matched with the traditional Chinese painting image and has a traditional Chinese painting style;
preprocessing the mountain element graph in the drawing style to generate an initial texture pattern;
and performing square continuous tiling processing on the initial texture pattern to generate a mountain basic texture mapping.
3. The method for generating texture of a mountain model according to claim 1, further comprising:
and determining the weight of the normal in each dimension direction based on the orientation information of the normal of the vertex of the target mountain model.
4. The method as claimed in claim 1, wherein the dividing the target texture map into at least two regions based on the height information of the target mountain model, and assigning the at least two regions with corresponding factors comprises:
based on the height information of the target mountain model, dividing the target texture map into a top sampling area and a bottom sampling area;
allocating a first action factor to the top sampling area and a second action factor to the bottom sampling area;
the texture mapping the target mountain model based on the target texture map comprises:
multiplying a mapping area corresponding to the top sampling area in the target texture mapping by the first action factor to generate a top texture mapping sampling result;
multiplying a mapping area corresponding to the bottom sampling area in the target texture mapping by the second action factor to generate a bottom texture mapping sampling result;
and performing texture mapping on the target mountain model based on the top texture map sampling result and the bottom texture map sampling result.
5. The mountain model texture generating method according to claim 4,
the first effect factor is smaller than the second effect factor so as to realize that the brush texture number of the top sampling area is larger than that of the bottom sampling area.
6. The method of generating texture of a mountain model according to claim 5, wherein the height information includes a height value of each vertex of the target mountain model from a bottom of a mountain to a top of a mountain;
determining a region from a mountain top plane to a first splitting plane of the target mountain model as a first mountain region, and determining the top sampling region according to the first mountain region;
determining a region from the mountain bottom plane of the target mountain model to the first splitting plane as a second mountain region, and determining the bottom sampling region according to the second mountain region;
the distance between the first dividing plane and the mountain bottom plane of the target mountain model is three-quarters of the total height of the target mountain model.
7. The method for generating texture of a mountain model as claimed in claim 1, wherein before sampling the mountain base texture map according to the UV coordinates, the method further comprises:
rotating the UV coordinate in the three-dimensional space according to a first preset parameter to generate a rotated UV coordinate; the first preset parameter comprises at least one of: rotation center coordinates, rotation angle, and rotation order.
8. The method for generating texture of a mountain model according to claim 1, further comprising:
according to a second preset parameter, shifting the UV coordinate in the three-dimensional space to generate a shifted UV coordinate; the second preset parameter comprises at least one of: offset center coordinates, offset displacements, and offset orders.
9. The method for generating texture of a mountain model according to claim 1, further comprising:
zooming the UV coordinate in the three-dimensional space according to a third preset parameter to generate a zoomed UV coordinate; the third preset parameter comprises at least one of: zoom center coordinates, zoom scale, and zoom order.
10. A texture generation device for a mountain model, comprising:
the coordinate acquisition module is used for acquiring UV coordinates of each two-dimensional plane in the three-dimensional space corresponding to the target mountain model based on the position coordinates of the three-dimensional space of the target mountain model;
the sampling module is used for respectively sampling mountain basic texture maps according to the UV coordinates to obtain textures of the target mountain model in each dimension direction of the three-dimensional space;
the target texture mapping generation module is used for mixing the textures of the target mountain model in each dimension direction of the three-dimensional space according to the weight of the normal of the vertex of the target mountain model in each dimension direction of the three-dimensional space to generate a target texture mapping;
the segmentation module is used for segmenting the target texture mapping into at least two regions based on the height information of the target mountain model, and distributing corresponding action factors for the at least two regions respectively so as to realize texture mapping on the target mountain model based on the target texture mapping; wherein the effect factor is used for representing the number of texture strokes of the corresponding area.
11. An electronic device comprising a memory and a processor, wherein the memory stores a computer program operable on the processor, and wherein the processor implements the steps of the method of any of claims 1 to 9 when executing the computer program.
12. A computer readable storage medium having stored thereon machine executable instructions which, when invoked and executed by a processor, cause the processor to execute the method of any of claims 1 to 9.
CN202111652835.1A 2021-12-30 2021-12-30 Method and device for generating texture of mountain model Pending CN114359468A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111652835.1A CN114359468A (en) 2021-12-30 2021-12-30 Method and device for generating texture of mountain model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111652835.1A CN114359468A (en) 2021-12-30 2021-12-30 Method and device for generating texture of mountain model

Publications (1)

Publication Number Publication Date
CN114359468A true CN114359468A (en) 2022-04-15

Family

ID=81102741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111652835.1A Pending CN114359468A (en) 2021-12-30 2021-12-30 Method and device for generating texture of mountain model

Country Status (1)

Country Link
CN (1) CN114359468A (en)

Similar Documents

Publication Publication Date Title
EP2969483B1 (en) Slicing and/or texturing for three-dimensional printing
CN105678683B (en) A kind of two-dimensional storage method of threedimensional model
US8368714B2 (en) Curved surface rendering system and method
CN107256573B (en) Tile-based computer graphics
CN108154548A (en) Image rendering method and device
CN105574931B (en) A kind of electronic map road method for drafting and device
US11600044B2 (en) Rendering textures utilizing sharpness maps
CN112288665A (en) Image fusion method and device, storage medium and electronic equipment
CN111583381B (en) Game resource map rendering method and device and electronic equipment
CN114693856B (en) Object generation method and device, computer equipment and storage medium
CN111494944A (en) Terrain texture loading method and related device
RU2680355C1 (en) Method and system of removing invisible surfaces of a three-dimensional scene
CN111583398A (en) Image display method and device, electronic equipment and computer readable storage medium
US11593992B2 (en) Rendering three-dimensional objects utilizing sharp tessellation
US11100707B2 (en) Computer graphics method for terrain rendering
CN114359468A (en) Method and device for generating texture of mountain model
CN110738719A (en) Web3D model rendering method based on visual range hierarchical optimization
CN112560126A (en) Data processing method, system and storage medium for 3D printing
US8659600B2 (en) Generating vector displacement maps using parameterized sculpted meshes
CN115803782A (en) Augmented reality effect of perception geometry with real-time depth map
Jahrmann et al. Interactive grass rendering using real-time tessellation
CN113368498B (en) Model generation method and device and electronic equipment
CN117557710B (en) Texture rendering method and device, terminal equipment and storage medium
US11321899B1 (en) 3D animation of 2D images
EP4386685A1 (en) Method for 3d visualization of sensor data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination