CN113470156A - Texture mapping hybrid processing method and device, electronic equipment and storage medium - Google Patents

Texture mapping hybrid processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113470156A
CN113470156A CN202110699283.3A CN202110699283A CN113470156A CN 113470156 A CN113470156 A CN 113470156A CN 202110699283 A CN202110699283 A CN 202110699283A CN 113470156 A CN113470156 A CN 113470156A
Authority
CN
China
Prior art keywords
pixel
information corresponding
color
processed
texture image
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
CN202110699283.3A
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 CN202110699283.3A priority Critical patent/CN113470156A/en
Publication of CN113470156A publication Critical patent/CN113470156A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/503Blending, e.g. for anti-aliasing

Abstract

The invention discloses a mixed processing method and device of texture maps, electronic equipment and a storage medium. Wherein, the method comprises the following steps: acquiring color information corresponding to each pixel in a texture image to be processed; determining height information corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel; and performing texture mixing processing on the texture image to be processed based on the height information corresponding to each pixel to obtain a target texture image. The method and the device solve the technical problem of low rendering efficiency in the prior art when the texture mixing is carried out on the image.

Description

Texture mapping hybrid processing method and device, electronic equipment and storage medium
Technical Field
The invention relates to the field of computer graphic rendering, in particular to a method and a device for hybrid processing of texture maps, electronic equipment and a storage medium.
Background
In computer graphics, it is generally required to render a virtual model, for example, in the field of games, it is required to render a virtual character, a virtual terrain, and the like in a game, wherein Texture Blend (Texture Blend) is a common rendering technique. In the construction process of some complex scenes, the texture mixing processing is carried out on the images, so that the four-side continuous textures made of various different materials can obtain soft and natural transition effects at the boundary.
In the process of constructing some large game scenes, if the UV maps of the ground surface in the game scene are all expanded and the texture map is given to each position of the map, great texture resources are consumed, and the pressure of texture reading on rendering power consumption is greatly increased. At present, four continuous maps are generally made for various earth surfaces, and the vertex color of the virtual model is used to record the texture map corresponding to the position in the map to be rendered. Because the to-be-rendered map is four-sided continuous, the to-be-rendered map does not generate a splicing seam, but texture mixing needs to be performed on the shader algorithm level when the transition effect of the to-be-rendered map is processed at the junction of different textures.
In the prior art, texture blending of a to-be-rendered map is usually implemented based on a height texture, that is, a height map (or an Alpha color channel of an existing map) is used to record height information of all parts of the height texture, and then the height information is used to participate in blending calculation, so as to obtain a blending effect, for example, a blending effect that conforms to a common real surface. However, in the hybrid algorithm based on the height texture, an additional texture map needs to be made to record the height information of all parts of the texture, and the additional map needs to be loaded when the map to be rendered is rendered.
In addition, in the prior art, the above-mentioned height information may also be recorded by using a textured Alpha color channel, however, in a scheme of recording the height information by using an Alpha color channel, the color channel is required to be in an idle state and cannot be occupied by other information, the data amount of an image is increased, and some rendering engines or mobile phone operating systems cannot read the data recorded by the channel.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a method and a device for mixing texture maps, electronic equipment and a storage medium, which are used for at least solving the technical problem of low rendering efficiency in the process of mixing textures of images in the prior art.
According to an aspect of the embodiments of the present invention, there is provided a method for hybrid processing of texture maps, including: acquiring color information of a texture image to be processed and position information corresponding to the color information; determining height information corresponding to the position information in the texture image to be processed according to the color information and the position information; and performing texture mixing processing on the texture image to be processed based on the height information and the position information to obtain a target texture image.
Further, the hybrid processing method of texture mapping further includes: determining a color value of each color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel; calculating to obtain brightness information corresponding to each pixel according to the color value of each color channel corresponding to each pixel in the texture image to be processed; and determining the height information corresponding to each pixel in the texture image to be processed according to the brightness information corresponding to each pixel.
Further, the hybrid processing method of texture mapping further includes: determining a color value of each color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel; acquiring a color coefficient of each color channel, wherein the color coefficient of each color channel is different; and carrying out weighted summation on the color value of each color channel and the color coefficient of each color channel to obtain the brightness information corresponding to each pixel in the texture image to be processed.
Further, the hybrid processing method of texture mapping further includes: determining a color value of each color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel; and calculating the average value of the color values of each color channel to obtain the brightness information corresponding to each pixel in the texture image to be processed.
Further, the hybrid processing method of texture mapping further includes: determining a target color value of a target color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel, wherein the target color channel is any one of a plurality of color channels corresponding to the texture image to be processed; and determining the target color value corresponding to each pixel as the brightness information corresponding to each pixel in the texture image to be processed.
Further, the hybrid processing method of texture mapping further includes: mapping a first numerical range corresponding to the brightness information corresponding to each pixel into a second numerical range; and adjusting the brightness information corresponding to each pixel based on a first numerical value and a second numerical value corresponding to a second numerical value range to obtain the height information corresponding to each pixel in the texture image to be processed, wherein the first numerical value is the upper limit value of the second numerical value range, and the second numerical value is the lower limit value of the second numerical value range.
Further, the hybrid processing method of texture mapping further includes: calculating the difference value between the first value and the second value to obtain a first result; calculating the product of the first result and the brightness information corresponding to each pixel to obtain a second result; and calculating the sum of the second result and the second numerical value to obtain the height information corresponding to each pixel.
Further, the hybrid processing method of texture mapping further includes: and after the brightness information corresponding to each pixel is adjusted based on the first numerical value and the second numerical value corresponding to the second numerical value range to obtain the height information corresponding to each pixel in the texture image to be processed, mapping the height information corresponding to each pixel to obtain target height information, wherein the target height information is in the first numerical value range.
According to another aspect of the embodiments of the present invention, there is also provided a texture mapping hybrid processing apparatus, including: the acquiring module is used for acquiring color information of the texture image to be processed and position information corresponding to the color information; the determining module is used for determining height information corresponding to the position information in the texture image to be processed according to the color information and the position information; and the processing module is used for carrying out texture mixing processing on the texture image to be processed based on the height information and the position information to obtain a target texture image.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is configured to execute the above-mentioned texture mapping hybrid processing method when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a hybrid processing method for executing a program, wherein the program is arranged to perform the above-described texture mapping when executed.
In the embodiment of the invention, a texture mixing processing mode of directly using the height information to the texture image is adopted, after the color information corresponding to each pixel in the texture image to be processed is obtained, the height information corresponding to each pixel in the texture image to be processed is determined according to the color information corresponding to each pixel, and the texture mixing processing is carried out on the texture image to be processed based on the height information corresponding to each pixel to obtain the target texture image.
In the process, in the process of texture mixing of the texture image to be processed, the original color information of the texture image to be processed is adopted to extract the height information, the height information is not required to be recorded by using a height map, the height information is not required to be recorded by an extra channel, and the height information can be directly used for texture mixing, so that the manufacturing process of the height map is reduced, the volume of the map used in the process of map mixing is reduced, the resource consumption in the process of texture mixing processing of the texture image is reduced, and the rendering efficiency is improved.
Therefore, the scheme provided by the application achieves the purpose of performing mixed rendering on the texture image to be processed, the technical effect of improving the mixed rendering efficiency of the texture image to be processed is achieved, and the technical problem that the rendering efficiency is low when the texture is mixed on the image in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of a method of hybrid processing of texture maps in accordance with an embodiment of the present invention;
FIG. 2 is a schematic diagram of an alternative texture map and height map in accordance with embodiments of the present invention;
FIG. 3 is a diagram illustrating an alternative texture map to luminance map according to an embodiment of the present invention;
FIG. 4 is a graphical illustration of an alternative high fit result according to an embodiment of the invention;
FIG. 5 is a schematic diagram of a texture mapping hybrid processing device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, 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 only a part of the embodiments of the present invention, and not all of the embodiments. 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 the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present invention, there is provided a method embodiment for hybrid processing of texture maps, it being noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than that presented herein.
In addition, it should be further noted that a rendering terminal that renders an image may be an execution subject of the present embodiment. The rendering terminal may have a display device to display the image before rendering and the image after rendering. The rendering terminal is also provided with a processor to perform hybrid rendering on the images by adopting the method provided by the embodiment.
Fig. 1 is a flowchart of a hybrid processing method of texture mapping according to an embodiment of the present invention, as shown in fig. 1, the method including the steps of:
step S102, color information corresponding to each pixel in the texture image to be processed is obtained.
In step S102, the texture image to be processed is composed of pixels, each pixel having corresponding color information, wherein the color information corresponding to each pixel can be determined by three color components of red, green and blue, which are stored in three color channels.
Optionally, when the user needs to perform hybrid texture rendering on the texture image to be processed, the user determines the texture image to be rendered from the plurality of images stored in the local memory through the rendering terminal. And the rendering terminal reads the texture image to be processed from the local memory according to the operation instruction of the user, and analyzes the texture image to be processed to obtain the color information corresponding to each pixel contained in the texture image to be processed.
And step S104, determining the height information corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel.
It should be noted that, the texture brightness change in the texture image to be processed generally has a corresponding relationship with the height information of the texture, for example, the height corresponding to the darker area in the texture image to be processed is relatively low, so in practical application, the rendering terminal may calculate the luminance information corresponding to each pixel according to the color information corresponding to each pixel, and finally, map the luminance information to obtain the height information.
In addition, it should be noted that the height information is extracted approximately through the color information included in the texture image to be processed, and a height map does not need to be created, so that the volume of the map used in the process of map mixing is reduced, and the rendering efficiency of the texture image to be processed is improved.
And step S106, performing texture mixing processing on the texture image to be processed based on the height information corresponding to each pixel to obtain a target texture image.
Optionally, in step S106, after obtaining the height information corresponding to the texture image to be processed, the rendering terminal does not record the height information in the height map or in a preset channel (e.g., Alpha color channel), but directly uses the height information for texture mixing. When the rendering terminal performs texture mixing processing on the texture image to be processed, the existing texture mixing algorithm can be adopted for texture mixing.
Based on the solutions defined in steps S102 to S106, it can be known that, in the embodiment of the present invention, a texture mixing processing manner is adopted for the texture image by directly using the height information, after the color information corresponding to each pixel in the texture image to be processed is obtained, the height information corresponding to each pixel in the texture image to be processed is determined according to the color information corresponding to each pixel, and the texture mixing processing is performed on the texture image to be processed based on the height information corresponding to each pixel, so as to obtain the target texture image.
It is easy to note that, in the above process, in the process of performing texture mixing on the texture image to be processed, the original color information of the texture image to be processed is used to extract the height information, and the height information is not required to be recorded by using a height map, or an additional channel, and the height information can be directly used for performing texture mixing, so that the manufacturing process of the height map is reduced, the map capacity used in the process of mixing the maps is reduced, the resource consumption in the process of performing texture mixing processing on the texture image is reduced, and the rendering efficiency is improved.
Therefore, the scheme provided by the application achieves the purpose of performing mixed rendering on the texture image to be processed, the technical effect of improving the mixed rendering efficiency of the texture image to be processed is achieved, and the technical problem that the rendering efficiency is low when the texture is mixed on the image in the prior art is solved.
In an optional embodiment, after obtaining the color information corresponding to each pixel in the texture image to be processed, the rendering terminal may determine the color value of each color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel, calculate the luminance information corresponding to each pixel according to the color value of each color channel corresponding to each pixel in the texture image to be processed, and finally determine the height information corresponding to each pixel in the texture image to be processed according to the luminance information corresponding to each pixel.
Optionally, the color channels in the texture image to be processed may include three color channels of red, green, and blue, where the three color channels respectively store color values of corresponding colors.
It should be noted that the brightness information corresponding to each pixel in the texture image to be processed represents the brightness of each pixel in the texture image to be processed, the brightness of all pixels represents the brightness change of the texture in the texture image to be processed, and the brightness change of the texture in the texture image to be processed has a corresponding relationship with the height information included in the texture image to be processed.
Optionally, the rendering terminal may calculate the luminance information corresponding to the texture image to be processed by using any one of the following three manners.
The first method is as follows: and the rendering terminal determines the color value of each color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel, acquires the color coefficient of each color channel, and then performs weighted summation on the color value of each color channel and the color coefficient of each color channel to obtain the brightness information corresponding to each pixel in the texture image to be processed. Wherein the color coefficient of each color channel is different.
Optionally, the color values corresponding to the three color channels of red, green, and blue are color.r, color.g, and color.b, respectively, and the luminance information corresponding to each pixel in the texture image to be processed may satisfy the following formula:
Brightness=Color.r*0.2125+Color.g*0.7154+Color.b*0.0721
in the above equation, Brightness is luminance information corresponding to each pixel, and 0.2125, 0.7154, and 0.0721 correspond to color coefficients of three color channels of red, green, and blue, respectively. The color depth coefficients of the three color channels are empirical values and can be adjusted according to actual application requirements.
The second method comprises the following steps: and the rendering terminal determines the color value of each color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel, and calculates the average value of the color values of each color channel to obtain the brightness information corresponding to each pixel in the texture image to be processed. Optionally, the luminance information corresponding to each pixel may satisfy the following formula:
Brightness=(Color.r+Color.g+Color.b)/3,
in the above equation, Brightness is luminance information corresponding to each pixel.
The third method comprises the following steps: and the rendering terminal determines a target color value of a target color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel, and determines the target color value corresponding to each pixel as the brightness information corresponding to each pixel in the texture image to be processed. The target color channel is any one of a plurality of color channels corresponding to the texture image to be processed. That is, in this manner, the color value corresponding to each color channel can be used as the luminance information, that is, the luminance information can satisfy the following formula:
bright ness color r or
Bright ness ═ color. g or
Brightness=Color.b;
It should be noted that the three calculation methods can be used as static branches in a shader, a macro switch is arranged in a rendering program on a rendering terminal, and a user can adjust the macro switch according to actual needs to select different calculation methods to calculate brightness information. For example, in actual rendering, when the rendering terminal has a high requirement for rendering power consumption (i.e., the rendering terminal cannot execute a rendering program with high power consumption), the user may select the mode with a smaller calculation amount to calculate the brightness information.
In addition, it should be further noted that, in this embodiment, hybrid texture rendering of the texture image to be processed is implemented by using the height information, and the height information is obtained by approximating the brightness information, so that the accuracy requirement on the calculation result of the brightness information is not high in this application.
In addition, since there may be too large or too small request for the light and shade variation interval of the texture of different materials, it is not enough to obtain the brightness information corresponding to each pixel by any one of the above-mentioned one-way to three-way methods as the height information, for example, fig. 2 shows a texture map and a height map, where the height map corresponding to the texture 01 is a texture 01 height map, the height map corresponding to the texture 02 is a texture 02 height map, and fig. 3 shows a brightness map corresponding to the texture 02, where the brightness map corresponding to the texture 01 is a texture 01 brightness, and the brightness map corresponding to the texture 02 is a texture 02 brightness, and as can be seen from fig. 2 and 3, if the brightness of the texture 01 and the brightness of the texture 02 are directly taken as the height of the texture image, the difference between the texture 01 brightness and the texture 01 height map is large, and similarly, the difference between the texture 02 brightness and the texture 02 height map is also large, therefore, rendering results obtained by rendering the rendering image to be processed are greatly different. Therefore, in order to avoid the above problem, the present embodiment further maps the luminance information to obtain the height information of the rendered image to be processed.
Specifically, the rendering terminal determines height information corresponding to each pixel in the texture image to be processed according to the brightness information corresponding to each pixel. Specifically, the rendering terminal maps a first numerical range corresponding to the brightness information corresponding to each pixel into a second numerical range, and adjusts the brightness information corresponding to each pixel based on a first numerical value and a second numerical value corresponding to the second numerical range to obtain height information corresponding to each pixel in the texture image to be processed, where the first numerical value is an upper limit value of the second numerical range, and the second numerical value is a lower limit value of the second numerical range.
Optionally, in the process of adjusting the brightness information corresponding to each pixel based on the first numerical value and the second numerical value corresponding to the second numerical value range to obtain the height information corresponding to each pixel in the texture image to be processed, the rendering terminal calculates a difference between the first numerical value and the second numerical value to obtain a first result, calculates a product of the first result and the brightness information corresponding to each pixel to obtain a second result, and then calculates a sum of the second result and the second numerical value to obtain the height information corresponding to each pixel. That is, the height information can be represented by the following equation:
Height0=Brightness*(B–A)+A
in the above formula, Height0 is Height information, B is a first value, and A is a second value.
From the above formula, when Brightness is 0, Height0 is a; when Brightness is 1, Height0 is B. Therefore, the change range of the brightness information can be changed from 0-1 (namely, the first numerical value range) to A-B (namely, the second numerical value range) by the above formula.
It should be noted that the first numerical value and the second numerical value in the rendering program running in the rendering terminal may be opened to the user, that is, the user may adjust the first numerical value and the second numerical value through the rendering terminal to obtain a numerical range of the required height information, so as to obtain an ideal mixed rendering result. For example, the sand texture is relatively gentle (i.e., the height difference is small), and therefore, the user may adjust the first value and the second value corresponding to the sand texture to two relatively close values, for example, adjust the first value and the second value to two values whose difference is smaller than a first preset difference; for another example, the difference between the height and the height of the masonry texture is large, the user may adjust the first value and the second value corresponding to the masonry texture by two values that are different from each other, and the height of the sand texture may form a better interpenetration, for example, the first value and the second value are adjusted by two values that are different from each other by a second preset difference, optionally, the a brick is < a sand, the B brick is > B sand, for example, the a sand is 0.3, the B sand is 0.7, the a brick is-0.4, and the B brick is 1.5. The sand A and the sand B respectively represent a first numerical value and a second numerical value corresponding to sand textures, and the brick A and the brick B respectively represent a first numerical value and a second numerical value corresponding to masonry textures.
In an optional embodiment, after the brightness information corresponding to each pixel is adjusted based on the first numerical value and the second numerical value corresponding to the second numerical value range to obtain the height information corresponding to each pixel in the texture image to be processed, the rendering terminal further performs mapping processing on the height information corresponding to each pixel to obtain target height information, and the target height information is within the first numerical value range.
It should be noted that, in the process of mapping the luminance information to the height information, a condition of a <0 > or B >1 may occur, so that the numerical range of the height information exceeds the interval of 0-1, and in order to ensure the correct row of the subsequent height texture mixing calculation result, the numerical range of the height information needs to be ensured to be between 0 and 1. Therefore, the height information can be subjected to the mapping process by the following equation:
Height=saturate(Height0)
in the above equation, Height is the target Height information, and the saturrate (x) function can force the value of x to be in the range of 0 to 1, i.e., if x <0, saturrate (x) returns a value of 0; if x >1, saturrate (x) returns a value of 1; if 0 ≦ x ≦ 1, then saturate (x) returns a value of x.
It should be noted that, a user may obtain approximately correct height fitting data by adjusting the first numerical value and the second numerical value of the above formula, for example, in the height fitting result diagram shown in fig. 4, the height fitting result of the texture 01 and the height fitting result of the texture 02 are height maps obtained by using the method provided in this embodiment, and are not different from the height maps of the texture 01 and the height maps of the texture 02.
According to the method, the height information is approximately extracted by utilizing the original color information of the texture, the manufacturing process of the height map is reduced, the volume of the map used when the map is mixed is reduced, the final mixing effect can be flexibly controlled, on one hand, the correct result close to the mixing effect of the height information can be achieved, on the other hand, the final effect can be more flexibly controlled by art manufacturing personnel, and the mixing result can better meet the art requirements.
In addition, under the condition that the height mapping is omitted, the height information of each position of the texture is approximately obtained through a simple algorithm and acts on a height-based texture mixing algorithm, so that the manufacturing cost of the height mapping is saved, the use and the loading of the mapping in the rendering process are reduced, and the rendering efficiency of texture mixing is improved.
According to an embodiment of the present invention, there is also provided an embodiment of a hybrid processing apparatus for texture mapping, where fig. 5 is a schematic diagram of the hybrid processing apparatus for texture mapping according to the embodiment of the present invention, as shown in fig. 5, the apparatus includes: an acquisition module 501, a determination module 503, and a processing module 505.
The acquiring module 501 is configured to acquire color information corresponding to each pixel in a texture image to be processed; a determining module 503, configured to determine, according to the color information corresponding to each pixel, height information corresponding to each pixel in the texture image to be processed; and the processing module 505 is configured to perform texture mixing processing on the texture image to be processed based on the height information corresponding to each pixel, so as to obtain a target texture image.
It should be noted that the acquiring module 501, the determining module 503 and the processing module 505 correspond to steps S102 to S106 in the foregoing embodiment, and the three modules are the same as the examples and application scenarios realized by the corresponding steps, but are not limited to the disclosure in the foregoing embodiment.
Optionally, the determining module includes: the device comprises a first determination module, a first calculation module and a second determination module. The first determining module is used for determining the color value of each color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel; the first calculation module is used for calculating and obtaining the brightness information corresponding to each pixel according to the color value of each color channel corresponding to each pixel in the texture image to be processed; and the second determining module is used for determining the height information corresponding to each pixel in the texture image to be processed according to the brightness information corresponding to each pixel.
Optionally, the first calculation module includes: the device comprises a third determining module, a first obtaining module and a second calculating module. The third determining module is used for determining the color value of each color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel; the first acquisition module is used for acquiring the color coefficient of each color channel, wherein the color coefficient of each color channel is different; and the second calculation module is used for performing weighted summation on the color value of each color channel and the color coefficient of each color channel to obtain the brightness information corresponding to each pixel in the texture image to be processed.
Optionally, the first calculation module includes: a fourth determination module and a third calculation module. The fourth determining module is configured to determine, according to the color information corresponding to each pixel, a color value of each color channel corresponding to each pixel in the texture image to be processed; and the third calculation module is used for calculating the average value of the color values of each color channel to obtain the brightness information corresponding to each pixel in the texture image to be processed.
Optionally, the first calculation module includes: a fifth determination module and a sixth determination module. The fifth determining module is configured to determine, according to the color information corresponding to each pixel, a target color value of a target color channel corresponding to each pixel in the texture image to be processed, where the target color channel is any one of a plurality of color channels corresponding to the texture image to be processed; and the sixth determining module is used for determining the target color value corresponding to each pixel as the brightness information corresponding to each pixel in the texture image to be processed.
Optionally, the second determining module includes: the device comprises a first mapping module and an adjusting module. The first mapping module is used for mapping a first numerical value range corresponding to the brightness information corresponding to each pixel into a second numerical value range; and the adjusting module is used for adjusting the brightness information corresponding to each pixel based on a first numerical value and a second numerical value corresponding to a second numerical value range to obtain the height information corresponding to each pixel in the texture image to be processed, wherein the first numerical value is the upper limit value of the second numerical value range, and the second numerical value is the lower limit value of the second numerical value range.
Optionally, the adjusting module includes: the device comprises a fourth calculation module, a fifth calculation module and a sixth calculation module. The fourth calculation module is configured to calculate a difference between the first value and the second value to obtain a first result; the fifth calculation module is used for calculating the product of the first result and the brightness information corresponding to each pixel to obtain a second result; and the sixth calculating module is used for calculating the sum of the second result and the second numerical value to obtain the height information corresponding to each pixel.
Optionally, the texture mapping hybrid processing apparatus further includes: and the second mapping module is used for adjusting the brightness information corresponding to each pixel based on the first numerical value and the second numerical value corresponding to the second numerical value range to obtain the height information corresponding to each pixel in the texture image to be processed, and then mapping the height information corresponding to each pixel to obtain target height information, wherein the target height information is in the first numerical value range.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is configured to execute the hybrid processing method of texture mapping in the above embodiments when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including one or more processors; a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement a hybrid processing method for executing a program, wherein the program is configured to execute a hybrid processing method for texture mapping in the above-described embodiments when executed.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple 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 through some interfaces, units or modules, and may be in an electrical 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 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 of the present invention 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 integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit 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, a server, or a network device) to execute 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 Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (11)

1. A method for hybrid processing of texture maps, comprising:
acquiring color information corresponding to each pixel in a texture image to be processed;
determining height information corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel;
and performing texture mixing processing on the texture image to be processed based on the height information corresponding to each pixel to obtain a target texture image.
2. The method according to claim 1, wherein determining the height information corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel comprises:
determining a color value of each color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel;
calculating to obtain brightness information corresponding to each pixel according to the color value of each color channel corresponding to each pixel in the texture image to be processed;
and determining the height information corresponding to each pixel in the texture image to be processed according to the brightness information corresponding to each pixel.
3. The method according to claim 2, wherein obtaining the luminance information corresponding to each pixel by calculating a color value of each color channel corresponding to each pixel in the texture image to be processed comprises:
determining a color value of each color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel;
acquiring a color coefficient of each color channel, wherein the color coefficient of each color channel is different;
and performing weighted summation on the color value of each color channel and the color coefficient of each color channel to obtain the brightness information corresponding to each pixel in the texture image to be processed.
4. The method according to claim 2, wherein obtaining the luminance information corresponding to each pixel by calculating a color value of each color channel corresponding to each pixel in the texture image to be processed comprises:
determining a color value of each color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel;
and calculating the average value of the color values of each color channel to obtain the brightness information corresponding to each pixel in the texture image to be processed.
5. The method according to claim 2, wherein obtaining the luminance information corresponding to each pixel by calculating a color value of each color channel corresponding to each pixel in the texture image to be processed comprises:
determining a target color value of a target color channel corresponding to each pixel in the texture image to be processed according to the color information corresponding to each pixel, wherein the target color channel is any one of a plurality of color channels corresponding to the texture image to be processed;
and determining the target color value corresponding to each pixel as the brightness information corresponding to each pixel in the texture image to be processed.
6. The method according to claim 2, wherein determining the height information corresponding to each pixel in the texture image to be processed according to the brightness information corresponding to each pixel comprises:
mapping a first numerical range corresponding to the brightness information corresponding to each pixel into a second numerical range;
and adjusting the brightness information corresponding to each pixel based on a first numerical value and a second numerical value corresponding to the second numerical value range to obtain the height information corresponding to each pixel in the texture image to be processed, wherein the first numerical value is an upper limit value of the second numerical value range, and the second numerical value is a lower limit value of the second numerical value range.
7. The method according to claim 6, wherein adjusting the luminance information corresponding to each pixel based on the first numerical value and the second numerical value corresponding to the second numerical value range to obtain the height information corresponding to each pixel in the texture image to be processed comprises:
calculating the difference value between the first numerical value and the second numerical value to obtain a first result;
calculating the product of the first result and the brightness information corresponding to each pixel to obtain a second result;
and calculating the sum of the second result and the second numerical value to obtain the height information corresponding to each pixel.
8. The method according to claim 6, wherein after adjusting the luminance information corresponding to each pixel based on the first numerical value and the second numerical value corresponding to the second numerical value range to obtain the height information corresponding to each pixel in the texture image to be processed, the method further comprises:
and mapping the height information corresponding to each pixel to obtain target height information, wherein the target height information is within the first numerical range.
9. A texture mapping hybrid processing apparatus, comprising:
the acquiring module is used for acquiring color information corresponding to each pixel in the texture image to be processed;
a determining module, configured to determine, according to the color information corresponding to each pixel, height information corresponding to each pixel in the texture image to be processed;
and the processing module is used for carrying out texture mixing processing on the texture image to be processed based on the height information corresponding to each pixel to obtain a target texture image.
10. A storage medium having stored thereon a computer program, wherein the computer program is configured to execute the method of blending texture maps according to any one of claims 1 to 8 when running.
11. An electronic device, wherein the electronic device comprises one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method for running a program, wherein the program is arranged to perform, when running, the method for hybrid processing of texture maps as claimed in any one of claims 1 to 8.
CN202110699283.3A 2021-06-23 2021-06-23 Texture mapping hybrid processing method and device, electronic equipment and storage medium Pending CN113470156A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110699283.3A CN113470156A (en) 2021-06-23 2021-06-23 Texture mapping hybrid processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110699283.3A CN113470156A (en) 2021-06-23 2021-06-23 Texture mapping hybrid processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113470156A true CN113470156A (en) 2021-10-01

Family

ID=77872554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110699283.3A Pending CN113470156A (en) 2021-06-23 2021-06-23 Texture mapping hybrid processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113470156A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115690246A (en) * 2022-10-20 2023-02-03 北京国电通网络技术有限公司 Image texture information generation method, apparatus, device, medium, and program product

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102170530A (en) * 2010-02-25 2011-08-31 夏普株式会社 Signal processing device and method, solid image capture device and electronic information device
KR101189687B1 (en) * 2012-05-11 2012-10-11 (주) 엔소울즈 Method for creating 3d character
US20140184596A1 (en) * 2012-12-28 2014-07-03 Microsoft Corporation Image based rendering
CN104113617A (en) * 2013-04-16 2014-10-22 深圳富泰宏精密工业有限公司 Backlight brightness adjusting system and backlight brightness adjusting method
CN104995903A (en) * 2013-02-21 2015-10-21 皇家飞利浦有限公司 Improved HDR image encoding and decoding methods and devices
US20150348285A1 (en) * 2014-05-30 2015-12-03 Apple Inc. Systems and methods for generating refined, high fidelity normal maps for 2d and 3d textures
US20150348315A1 (en) * 2014-05-30 2015-12-03 Apple Inc. Dynamic Lighting Effects For Textures Without Normal Maps
US20150348316A1 (en) * 2014-05-30 2015-12-03 Apple Inc. Equivalent Lighting For Mixed 2D and 3D Scenes
CN105979400A (en) * 2016-06-28 2016-09-28 乐视控股(北京)有限公司 Screen brightness adjusting method, device and terminal
CN108022223A (en) * 2017-12-18 2018-05-11 中山大学 A kind of tone mapping method based on the processing fusion of logarithmic mapping function piecemeal
CN108389176A (en) * 2018-03-09 2018-08-10 网易(杭州)网络有限公司 Method, apparatus, storage medium, processor and the terminal of image blend processing
CN108510557A (en) * 2018-04-09 2018-09-07 湖南国科微电子股份有限公司 image tone mapping method and device
CN109584366A (en) * 2018-12-10 2019-04-05 浙江科澜信息技术有限公司 A kind of terrain rendering method, apparatus, equipment and readable storage medium storing program for executing
CN109658341A (en) * 2018-10-26 2019-04-19 深圳市华星光电技术有限公司 Enhance the method and device thereof of picture contrast
CN112446833A (en) * 2019-09-02 2021-03-05 武汉Tcl集团工业研究院有限公司 Image processing method, intelligent terminal and storage medium
CN112561906A (en) * 2020-12-24 2021-03-26 百果园技术(新加坡)有限公司 Image processing method, device, equipment and medium

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102170530A (en) * 2010-02-25 2011-08-31 夏普株式会社 Signal processing device and method, solid image capture device and electronic information device
KR101189687B1 (en) * 2012-05-11 2012-10-11 (주) 엔소울즈 Method for creating 3d character
US20140184596A1 (en) * 2012-12-28 2014-07-03 Microsoft Corporation Image based rendering
CN104995903A (en) * 2013-02-21 2015-10-21 皇家飞利浦有限公司 Improved HDR image encoding and decoding methods and devices
CN104113617A (en) * 2013-04-16 2014-10-22 深圳富泰宏精密工业有限公司 Backlight brightness adjusting system and backlight brightness adjusting method
US20150348285A1 (en) * 2014-05-30 2015-12-03 Apple Inc. Systems and methods for generating refined, high fidelity normal maps for 2d and 3d textures
US20150348315A1 (en) * 2014-05-30 2015-12-03 Apple Inc. Dynamic Lighting Effects For Textures Without Normal Maps
US20150348316A1 (en) * 2014-05-30 2015-12-03 Apple Inc. Equivalent Lighting For Mixed 2D and 3D Scenes
CN105979400A (en) * 2016-06-28 2016-09-28 乐视控股(北京)有限公司 Screen brightness adjusting method, device and terminal
CN108022223A (en) * 2017-12-18 2018-05-11 中山大学 A kind of tone mapping method based on the processing fusion of logarithmic mapping function piecemeal
CN108389176A (en) * 2018-03-09 2018-08-10 网易(杭州)网络有限公司 Method, apparatus, storage medium, processor and the terminal of image blend processing
CN108510557A (en) * 2018-04-09 2018-09-07 湖南国科微电子股份有限公司 image tone mapping method and device
CN109658341A (en) * 2018-10-26 2019-04-19 深圳市华星光电技术有限公司 Enhance the method and device thereof of picture contrast
CN109584366A (en) * 2018-12-10 2019-04-05 浙江科澜信息技术有限公司 A kind of terrain rendering method, apparatus, equipment and readable storage medium storing program for executing
CN112446833A (en) * 2019-09-02 2021-03-05 武汉Tcl集团工业研究院有限公司 Image processing method, intelligent terminal and storage medium
CN112561906A (en) * 2020-12-24 2021-03-26 百果园技术(新加坡)有限公司 Image processing method, device, equipment and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115690246A (en) * 2022-10-20 2023-02-03 北京国电通网络技术有限公司 Image texture information generation method, apparatus, device, medium, and program product

Similar Documents

Publication Publication Date Title
CN109377546B (en) Virtual reality model rendering method and device
US7545384B2 (en) Image generation method and apparatus
EP1056050B1 (en) Image processing device
US7265761B2 (en) Multilevel texture processing method for mapping multiple images onto 3D models
CN103503032A (en) Texturing in graphics hardware
CN103440674A (en) Method for rapidly generating crayon special effect of digital image
CN112675545B (en) Method and device for displaying surface simulation picture, storage medium and electronic equipment
CN111127576A (en) Game picture rendering method and device and electronic equipment
CN111784817B (en) Shadow display method and device, storage medium and electronic device
CN107465939A (en) The processing method and processing device of vedio data stream
CN113470156A (en) Texture mapping hybrid processing method and device, electronic equipment and storage medium
CN100476879C (en) Method for rendering graphical objects
CN112231020A (en) Model switching method and device, electronic equipment and storage medium
US20220139023A1 (en) Apparatus and method for generating a light intensity image
CN108235024B (en) Method and device for compressing image
CN115345976A (en) Model rendering method and device, computer equipment and computer readable storage medium
CN112085855B (en) Interactive image editing method, device, storage medium and computer equipment
US9064347B2 (en) Method, medium, and system rendering 3 dimensional graphics data considering fog effect
Cheok et al. Humanistic Oriental art created using automated computer processing and non-photorealistic rendering
CN109584328B (en) Mapping processing method and device for model
CN116777739A (en) Image processing method, game rendering method, device, equipment and storage medium
CN116645491A (en) Virtual object generation method, device, equipment and storage medium
CN117197276A (en) Grassland rendering method and device
CN116958363A (en) Execution method and device of rendering operation, storage medium and electronic equipment
US20130265303A1 (en) Mosaic image processing apparatus using three-dimensional information, and program

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