Hair highlight rendering method, device, equipment and storage medium

文档序号:1939518 发布日期:2021-12-07 浏览:14次 中文

阅读说明:本技术 一种头发高光渲染方法、装置、设备及存储介质 (Hair highlight rendering method, device, equipment and storage medium ) 是由 冯乐乐 贺甲 于 2020-06-01 设计创作,主要内容包括:本发明实施例公开了一种头发高光渲染方法、装置、设备及存储介质。该方法包括:获取目标发片的发片类型、待调整位置和待调整高光参数,根据发片类型从预先生成的曲线映射贴图中筛选出目标映射贴图;根据目标映射贴图得到与待调整位置对应的调整数值;根据调整数值对待调整高光参数进行数值调整,并根据数值调整结果对目标发片进行高光渲染。本发明实施例的技术方案,基于目标映射贴图提高了目标发片的高光渲染的自由度,以使目标发片更加接近美术原画绘制的风格化艺术效果,达到了对头发高光的渲染具有风格化控制的效果。(The embodiment of the invention discloses a hair highlight rendering method, a device, equipment and a storage medium. The method comprises the following steps: acquiring a hair piece type, a position to be adjusted and a highlight parameter to be adjusted of a target hair piece, and screening out a target mapping map from a pre-generated curve mapping map according to the hair piece type; obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping map; and carrying out numerical value adjustment on the highlight parameter to be adjusted according to the adjustment numerical value, and carrying out highlight rendering on the target hair piece according to a numerical value adjustment result. According to the technical scheme of the embodiment of the invention, the freedom degree of highlight rendering of the target hair piece is improved based on the target mapping chartlet, so that the target hair piece is closer to the stylized artistic effect drawn by the art original picture, and the stylized control effect on the highlight rendering of the hair is achieved.)

1. A hair highlight rendering method, comprising:

acquiring a hair piece type, a position to be adjusted and a highlight parameter to be adjusted of a target hair piece, and screening out a target mapping map from a pre-generated curve mapping map according to the hair piece type;

obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping map;

and performing numerical value adjustment on the highlight parameter to be adjusted according to the adjustment numerical value, and performing highlight rendering on the target hair piece according to a numerical value adjustment result.

2. The method according to claim 1, wherein the numerically adjusting the highlight parameter to be adjusted according to the adjustment value comprises:

and acquiring a reference value of the highlight parameter to be adjusted, and performing numerical value adjustment on the reference value according to the adjustment value.

3. The method of claim 1, wherein the target map is pre-generated by:

acquiring a mapping curve corresponding to the highlight parameter to be adjusted and the hair piece type;

and coding the mapping curve to generate the target mapping map.

4. The method according to claim 3, wherein the number of highlight parameters to be adjusted is at least two; the encoding the mapping curve to generate the target mapping map includes:

and coding the mapping curve corresponding to each highlight parameter to be adjusted, storing the coding result into a corresponding channel of a target mapping map, and generating the target mapping map according to the storage result.

5. The method of claim 3, wherein a first axial direction of the mapping curve includes the position to be adjusted and a second axial direction includes the adjustment value.

6. The method of claim 1, wherein the curve mapping map is pre-generated by:

and obtaining each target mapping chartlet corresponding to each hair piece type, and generating the curve mapping chartlet according to each target mapping chartlet.

7. The method according to claim 1, wherein the adjustment value comprises a scaling factor, and/or wherein the highlight parameter to be adjusted comprises at least one of highlight smoothness, highlight color and highlight offset.

8. A hair highlight rendering apparatus, comprising:

the data acquisition module is used for acquiring the hair piece type, the position to be adjusted and the highlight parameter to be adjusted of the target hair piece, and screening out a target mapping map from a pre-generated curve mapping map according to the hair piece type;

an adjustment value obtaining module, configured to obtain an adjustment value corresponding to the position to be adjusted according to the target mapping map;

and the hair highlight rendering module is used for carrying out numerical value adjustment on the highlight parameters to be adjusted according to the adjustment numerical value and carrying out highlight rendering on the target hair piece according to a numerical value adjustment result.

9. An apparatus, comprising:

one or more processors;

a memory for storing one or more programs;

when executed by the one or more processors, cause the one or more processors to implement the hair highlight rendering method of any of claims 1-7.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a hair highlight rendering method according to any one of claims 1-7.

Technical Field

The embodiment of the invention relates to the technical field of computer application, in particular to a hair highlight rendering method, device, equipment and storage medium.

Background

The light source is reflected to the human eye after irradiating the object, and the brightest part of the object is called highlight. For a long time, the highlight hair rendering is the most important of the three-rendering two-card rendering, and compared with the photo-level realistic-writing rendering, the stylized rendering has stronger art controllability on highlight brightness and highlight shapes.

However, due to the difference of the hairstyle of each cartoon character, the control effect of the existing stylized rendering scheme on the highlight of the hair needs to be improved.

Disclosure of Invention

The embodiment of the invention provides a hair highlight rendering method, device and equipment and a storage medium, which are used for achieving the effect of stylized control on the hair highlight rendering.

In a first aspect, an embodiment of the present invention provides a hair highlight rendering method, which may include:

acquiring a hair piece type, a position to be adjusted and a highlight parameter to be adjusted of a target hair piece, and screening out a target mapping map from a pre-generated curve mapping map according to the hair piece type;

obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping map;

and carrying out numerical value adjustment on the highlight parameter to be adjusted according to the adjustment numerical value, and carrying out highlight rendering on the target hair piece according to a numerical value adjustment result.

Optionally, the value adjustment of the highlight parameter to be adjusted according to the adjustment value may include:

and acquiring a reference value of the highlight parameter to be adjusted, and performing numerical value adjustment on the reference value according to the adjustment value.

Optionally, the target mapping map may be generated in advance by:

acquiring a mapping curve corresponding to highlight parameters to be adjusted and hair piece types;

and coding the mapping curve to generate a target mapping map.

Optionally, the number of the highlight parameters to be adjusted is at least two, and the encoding of the mapping curve to generate the target mapping map may include:

and coding the mapping curves corresponding to the highlight parameters to be adjusted respectively, storing the coding result into the corresponding channel of the target mapping map, and generating the target mapping map according to the storage result.

Optionally, the first axis of the mapping curve includes the position to be adjusted, and the second axis includes the adjustment value.

Optionally, the curve mapping map may be generated in advance by:

and acquiring target mapping maps corresponding to the hair piece types respectively, and generating curve mapping maps according to the target mapping maps.

Optionally, the adjustment value includes a scaling factor, and/or the highlight parameter to be adjusted includes at least one of highlight smoothness, highlight color and highlight offset.

In a second aspect, an embodiment of the present invention further provides a hair highlight rendering apparatus, which may include:

the data acquisition module is used for acquiring the hair piece type, the position to be adjusted and the highlight parameter to be adjusted of the target hair piece, and screening out a target mapping map from a pre-generated curve mapping map according to the hair piece type;

the adjustment value obtaining module is used for obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping map;

and the hair highlight rendering module is used for carrying out numerical value adjustment on the highlight parameters to be adjusted according to the adjustment numerical values and carrying out highlight rendering on the target hair piece according to the numerical value adjustment result.

In a third aspect, an embodiment of the present invention further provides an apparatus, where the apparatus may include:

one or more processors;

a memory for storing one or more programs;

when executed by one or more processors, cause the one or more processors to implement a hair highlight rendering method provided by any of the embodiments of the present invention.

In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the hair highlight rendering method provided in any embodiment of the present invention.

According to the technical scheme of the embodiment of the invention, the hair piece type, the position to be adjusted and the highlight parameter to be adjusted of the target hair piece are obtained, so that the target mapping chartlet corresponding to the hair piece type is screened out from the pre-generated curve mapping chartlet according to the hair piece type, and the adjustment value corresponding to the position to be adjusted is obtained from the target mapping chartlet; and carrying out numerical value adjustment on the highlight parameter to be adjusted on the position to be adjusted according to the adjustment numerical value, and carrying out highlight rendering on the target hair piece according to the numerical value adjustment result. According to the technical scheme, the freedom degree of highlight rendering of each hair piece is improved based on the target mapping chartlet, so that each hair piece is closer to the stylized artistic effect drawn by the art original painting, and the effect of stylized control on the highlight rendering of the hair is achieved.

Drawings

FIG. 1 is a flowchart illustrating a method for highlighting hair according to a first embodiment of the present invention;

FIG. 2 is a schematic diagram of highlight for hair according to a first embodiment of the present invention;

FIG. 3 is a flowchart of a hair highlight rendering method according to a second embodiment of the present invention;

FIG. 4a is a diagram illustrating a mapping curve of highlight smoothness according to a second embodiment of the present invention;

FIG. 4b is a diagram illustrating a mapping curve of high optical shift amount according to a second embodiment of the present invention;

FIG. 4c is a diagram illustrating a mapping curve of highlight colors in the second embodiment of the present invention;

FIG. 5 is a block diagram of a hair highlight rendering apparatus according to a third embodiment of the present invention;

fig. 6 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention.

Detailed Description

The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.

Before the embodiment of the present invention is described, an application scenario of the embodiment of the present invention is exemplarily described: three-rendering two-card rendering is to render a 3D model into a two-dimensional (2D) image, which has high production efficiency and allows some 2D images with difficult hand-drawing to be rapidly formed. In order to simulate the real situation, a three-dimensional (3D) model is provided with a protrusion and a recess, a region facing a light source is also provided with a region back to the light source, and different light and shade effects can be presented when the light source irradiates different regions of the 3D model. After rendering the 3D model into a 2D image, the 2D image also needs to retain the light and shadow characteristics of the 3D model. However, if the 3D model is directly rendered on the 2D image, the highlight shadow of the 3D model projected on the 2D image after shadow illumination is very broken, which is especially obvious in highlight rendering of hair, and poor controllability of the shadow property causes poor aesthetics of the 2D image.

To solve this problem, stylized rendering schemes have been developed via which 2D images generated via rendering can be made to conform to light and shadow characteristics while maintaining aesthetics. Specifically, the 2D image generated based on stylized rendering only needs to conform to the light and shadow characteristics, and does not need to be exactly the same as the light and shade effect exhibited by the light and shadow characteristics of the real world. For example, on a 2D image, a bright area is still bright, a dark area is still dark, but how bright is dark, what the shape of highlight in the bright area is, and what the shape of shadow in the dark area is are controllable, which is not necessarily exactly the same as highlight shadow in the real world.

However, various highlight parameters involved in the stylized rendering scheme, such as highlight smoothness, highlight color, highlight offset and the like, are mostly single fixed constant values, so that the calculated highlight shape is too single, and the stylized control effect of the highlight of the hair is poor.

Example one

Fig. 1 is a flowchart of a hair highlight rendering method according to an embodiment of the present invention. The embodiment is applicable to the condition of rendering the highlight of the hair, and is particularly suitable for the condition of stylized rendering of the highlight of the hair. The method can be executed by the hair highlight rendering device provided by the embodiment of the invention, the device can be realized by software and/or hardware, and the device can be integrated on various user terminals or servers. Referring to fig. 1, the method of the embodiment of the present invention specifically includes the following steps:

s110, obtaining the hair piece type, the position to be adjusted and the highlight parameter to be adjusted of the target hair piece, and screening out a target mapping chartlet from pre-generated curve mapping chartlets according to the hair piece type.

The hair comprises at least one hair piece, and the target hair piece is the hair piece which needs to carry out numerical adjustment on the highlight parameter to be adjusted in each hair piece. The hair piece types of the hair pieces may be the same or different, each hair piece type has a target mapping chartlet corresponding to the hair piece type, and a curve mapping chartlet can be generated based on the target mapping chartlets respectively corresponding to the hair piece types, for example, a set of the target mapping chartlets is used as the curve mapping chartlet; generating curve mapping maps after merging the target mapping maps, wherein each target mapping map is a row or a column in the curve mapping maps; etc., and are not specifically limited herein. Therefore, after the hair piece type of the target hair piece is obtained, the target mapping chartlet can be screened out from the curve mapping chartlet generated in advance according to the hair piece type. The positions to be adjusted are positions on the target hair pieces, which need to be subjected to numerical value adjustment, and the number of the positions to be adjusted on each target hair piece can be one, two or more. The highlight parameter to be adjusted is a highlight parameter that needs to be numerically adjusted on the target hair piece, such as at least one of highlight smoothness, highlight color and highlight offset, and further such as highlight jitter degree.

And S120, obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping map.

The mapping curve which can be used for remapping the highlight parameter to be adjusted is stored in the target mapping map, the first axial direction of the mapping curve can be a position to be adjusted, and the second axial direction of the mapping curve can be an adjusting value, so that a corresponding adjusting value can be obtained from the target mapping map according to the position to be adjusted, and numerical adjustment is carried out on the highlight parameter to be adjusted on the position to be adjusted according to the adjusting value. In particular, if the number of the positions to be adjusted is two or more, the adjustment values corresponding to the respective positions to be adjusted can be obtained from the target map. More particularly, if the number of the highlight parameters to be adjusted at a certain position to be adjusted is two or more, the adjustment values corresponding to the highlight parameters to be adjusted can be obtained from the target mapping map. It should be understood by those skilled in the art that the adjustment values of the highlight parameters to be adjusted at each position to be adjusted may be the same or different; accordingly, the adjustment values of the same highlight parameter to be adjusted at each position to be adjusted may be the same or different, and are not limited herein.

S130, carrying out numerical value adjustment on the highlight parameter to be adjusted according to the adjustment numerical value, and carrying out highlight rendering on the target hair piece according to the numerical value adjustment result.

After the adjustment value corresponding to the position to be adjusted is obtained, the highlight parameter to be adjusted on the position to be adjusted can be subjected to numerical value adjustment according to the adjustment value, so that the same highlight parameter to be adjusted at different positions to be adjusted on the target hair piece is no longer a single fixed constant value, therefore, after highlight rendering is performed on the target hair piece according to the numerical value adjustment result, highlight hair with more styles can be obtained, such as narrow middle and wide sides (as shown in fig. 2), such as wide middle and narrow sides, such as sharp change, such as gentle change and the like, and the freedom of highlight rendering of the target hair piece is improved. Particularly, if the number of the adjustment values on the same position to be adjusted is at least two, the corresponding highlight parameter to be adjusted is subjected to value adjustment according to each adjustment value. If the highlight parameters to be adjusted comprise highlight smoothness and highlight color, an adjustment value A corresponding to the highlight smoothness and an adjustment value B corresponding to the highlight color are obtained from the target mapping map, so that the highlight smoothness can be adjusted according to A, and the highlight color can be adjusted according to B.

On the basis, optionally, when the highlight parameter to be adjusted is subjected to numerical adjustment according to the adjustment value, the reference value of the highlight parameter to be adjusted can be obtained first, and then the reference value is subjected to numerical adjustment according to the adjustment value. For example, if the adjustment value is a scaling factor, the reference value may be scaled based on the scaling factor; if the adjustment value and the reference value are the same magnitude value, the reference value can be subjected to addition and subtraction processing based on the adjustment value; etc., and are not specifically limited herein. For example, taking the adjustment value as a scaling factor and the highlight parameter to be adjusted as highlight smoothness as an example, the reference value of the highlight smoothness is 1000, the scaling factors corresponding to 4 positions to be adjusted are 1.2, 1.0, 0.8 and 0.6 respectively, and the highlight smoothness adjusted by the scaling factors are 1200, 1000, 800 and 600 respectively, so that the widths of highlight lines at different positions to be adjusted on the same target hair piece are not the same any more, some highlight lines are wider, and some highlight lines are narrower, thereby improving the degree of freedom of highlight rendering of the target hair piece.

It should be noted that when the hair is composed of at least two pieces of hair, the highlight parameter to be adjusted can be modified from piece to piece. Because the hair piece types of different hair pieces may have differences, the target mapping maps corresponding to different hair pieces may have differences, and further, the numerical adjustment results of the same highlight parameter to be adjusted of different hair pieces may have differences, so that the highlight rendering freedom of each hair piece is improved, and each hair piece has a highlight rendering effect with higher style.

According to the technical scheme of the embodiment of the invention, the hair piece type, the position to be adjusted and the highlight parameter to be adjusted of the target hair piece are obtained, so that the target mapping chartlet corresponding to the hair piece type is screened out from the pre-generated curve mapping chartlet according to the hair piece type, and the adjustment value corresponding to the position to be adjusted is obtained from the target mapping chartlet; and carrying out numerical value adjustment on the highlight parameter to be adjusted on the position to be adjusted according to the adjustment numerical value, and carrying out highlight rendering on the target hair piece according to the numerical value adjustment result. According to the technical scheme, the freedom degree of highlight rendering of each hair piece is improved based on the target mapping chartlet, so that each hair piece is closer to the stylized artistic effect drawn by the art original painting, and the effect of stylized control on the highlight rendering of the hair is achieved.

Example two

Fig. 3 is a flowchart of a hair highlight rendering method according to a second embodiment of the present invention. The present embodiment is optimized based on the above technical solutions. In this embodiment, optionally, the target mapping map may be generated in advance through the following steps: acquiring a mapping curve corresponding to highlight parameters to be adjusted and hair piece types; and coding the mapping curve to generate a target mapping map. The same or corresponding terms as those in the above embodiments are not explained in detail herein.

Referring to fig. 3, the method of this embodiment may specifically include the following steps:

s210, obtaining a mapping curve corresponding to the highlight parameter to be adjusted and the hair piece type, and coding the mapping curve to generate a target mapping map.

The highlight parameter to be adjusted of the same hair piece type may correspond to different mapping curves, and the highlight parameter to be adjusted of the different hair piece types may also correspond to different mapping curves, so that the mapping curve is a curve corresponding to both the highlight parameter to be adjusted and the hair piece type, optionally, a first axial direction of the mapping curve may be a position to be adjusted, a second axial direction may be an adjustment value, the first axial direction may be a horizontal axis, the second axial direction may be a vertical axis, and of course, vice versa, which is not specifically limited herein.

After the mapping curve is obtained, the mapping curve can be coded to generate a target mapping map, and the target mapping map has a corresponding relation with the hair piece type and possibly has a corresponding relation with the highlight parameter to be adjusted. For example, considering that the number of highlight parameters to be adjusted on a certain hairpiece type may be at least two, after the mapping curves corresponding to the highlight parameters to be adjusted are encoded, a target mapping map may be generated based on the encoding result of each mapping curve, and at this time, there is a corresponding relationship between the target mapping map and the hairpiece type as well as between the highlight parameters to be adjusted; or storing the coding result of each mapping curve into different channels of the target mapping map, and generating the target mapping map according to the storage result, if the number of the highlight parameters to be adjusted is M, respectively storing the M mapping curves into M channels of the target mapping map, wherein M is a positive integer, and at the moment, the target mapping map only has a corresponding relation with the hair piece type.

S220, obtaining the hair piece type, the position to be adjusted and the highlight parameter to be adjusted of the target hair piece, and screening out a target mapping map from the pre-generated curve mapping maps according to the hair piece type.

And S230, obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping map.

S240, carrying out numerical value adjustment on the highlight parameters to be adjusted according to the adjustment numerical values, and carrying out highlight rendering on the target hair piece according to the numerical value adjustment result.

It should be noted that, in practical applications, the mapping curve may be generated in advance according to actual rendering requirements, and if it is expected that the variation trend of the width of the highlight of the hair on a certain hair piece type is a wavy line, the wavy line may be used as the mapping curve, and it is considered that the variation degree of the highlight of the hair is brought by the highlight smoothness, so that after the target mapping map is generated based on the mapping curve, the highlight smoothness may be numerically adjusted based on the target mapping map, so that the variation trend of the highlight smoothness after the numerical adjustment is changed from a linear form to a wavy line form with peaks and valleys, and the stylized rendering effect of the highlight of the hair is achieved.

According to the technical scheme of the embodiment of the invention, the mapping curve is encoded to generate the target mapping chartlet by acquiring the pre-generated mapping curve corresponding to the highlight parameter to be adjusted and the hair piece type, so that after the highlight parameter to be adjusted is subjected to numerical adjustment based on the target mapping chartlet, the variation trend of the numerical adjustment result is consistent with the variation trend of the mapping curve, and a more stylized highlight effect is achieved.

In order to better understand the specific implementation process of the above steps, the hair highlight rendering method of the present embodiment is exemplarily described below with reference to specific examples. Illustratively, the whole hair is divided into a plurality of hair patch types, and in order to obtain the hair highlight effect shown in fig. 2, a mapping curve shown in fig. 4a-4c is set. Specifically, fig. 4a is a highlight smoothness mapping curve, where the range of the horizontal axis and the range of the vertical axis are both 0 to 1, the horizontal axis represents the horizontal coordinate of the hair piece, the position to be adjusted can be determined according to the horizontal coordinate, and the vertical axis represents the scaling coefficient of the highlight smoothness, and the highlight smoothness adjusted by the mapping curve can make the highlight shape on the hair piece have an expected variation trend of narrow middle and wide sides. Fig. 4b is a mapping curve of the highlight shift amount, wherein the range of the horizontal axis and the range of the vertical axis are both 0-1, the horizontal axis represents the horizontal coordinate of the hair piece, and the vertical axis represents the scaling factor of the highlight shift amount, and the highlight shift amount adjusted by the mapping curve can enable the highlight on the hair piece to have the expected variation trend of the jitter degree. Fig. 4c is a mapping curve of highlight color, wherein the horizontal axis range and the vertical axis range are both 0-1, the horizontal axis represents the horizontal coordinate of the hair piece, the vertical axis represents the scaling factor for the highlight color, and the highlight color adjusted by the mapping curve can make the highlight on the hair piece have the expected brightness variation trend.

Further, the three mapping curves shown in fig. 4a-4c are encoded respectively onto RGB three channels of a target map with a resolution Nx1, where N is a positive integer, which controls the size of the target map, and may affect the encoding precision, and optionally increase or decrease, and N may be 128 or 256. The horizontal axis of each mapping curve corresponds to the horizontal coordinate of the target map, the horizontal coordinate ranging from 1 to N, and the vertical axis of the mapping curve corresponds to the pixel value at the horizontal coordinate of the target map.

On this basis, if the number of hair pin types is at least two, the target map maps of Nx1 for each hair pin type can be merged into one larger curve map, each target map being a row in the curve map. Therefore, in practical application, the transverse coordinate and the issue type of each issue sheet can be stored in the vertex data of the issue sheet, the vertex data and the curve mapping map or the target mapping map are input into the rendering engine together, which row in the curve mapping map needs to be sampled is judged based on the issue type of the issue sheet during highlight rendering, and then the pixel value of the row is sampled according to the transverse coordinate of the issue sheet; and then, numerical value adjustment is respectively carried out on the highlight smoothness, the highlight offset and the highlight color according to the sampled RGB pixel values, and the stylized rendering effect of highlight of the hair is achieved according to the numerical value adjustment result.

EXAMPLE III

Fig. 5 is a block diagram of a hair highlight rendering apparatus according to a third embodiment of the present invention, which is configured to execute the hair highlight rendering method according to any of the embodiments. The device and the hair highlight rendering method of the embodiments belong to the same inventive concept, and details which are not described in detail in the embodiments of the hair highlight rendering device can refer to the embodiments of the hair highlight rendering method.

Referring to fig. 5, the apparatus specifically includes: a data acquisition module 310, an adjustment value obtaining module 320 and a hair highlight rendering module 330. The data acquisition module 310 is configured to acquire a hair piece type, a position to be adjusted, and a highlight parameter to be adjusted of a target hair piece, and screen out a target mapping map from a pre-generated curve mapping map according to the hair piece type; an adjustment value obtaining module 320, configured to obtain an adjustment value corresponding to the position to be adjusted according to the target mapping map; the hair highlight rendering module 330 is configured to perform numerical adjustment on the highlight parameter to be adjusted according to the adjustment value, and perform highlight rendering on the target hair piece according to a numerical adjustment result.

Optionally, the hair highlight rendering module 330 may specifically include:

and the numerical value adjusting unit is used for acquiring a reference numerical value of the highlight parameter to be adjusted and performing numerical value adjustment on the reference numerical value according to the adjustment numerical value.

Optionally, on the basis of the above apparatus, the apparatus may further include:

and the target mapping map generating module is used for acquiring a mapping curve corresponding to the highlight parameter to be adjusted and the hair piece type, coding the mapping curve and generating a target mapping map.

Optionally, the target map generating module may specifically include:

and the target mapping map generating unit is used for coding the mapping curves corresponding to the highlight parameters to be adjusted respectively, storing the coding result into the corresponding channel of the target mapping map and generating the target mapping map according to the storage result, wherein the number of the highlight parameters to be adjusted is at least two.

Optionally, the first axis of the mapping curve includes the position to be adjusted, and the second axis includes the adjustment value.

Optionally, on the basis of the above apparatus, the apparatus may further include:

and the curve mapping map generating module is used for acquiring each target mapping map corresponding to each hair piece type and generating the curve mapping map according to each target mapping map.

Optionally, the adjustment value includes a scaling factor, and/or the highlight parameter to be adjusted includes at least one of highlight smoothness, highlight color and highlight offset.

According to the hair highlight rendering device provided by the third embodiment of the invention, the hair piece type, the position to be adjusted and the highlight parameter to be adjusted of the target hair piece are obtained through the data obtaining module, so that the target mapping chartlet corresponding to the hair piece type is screened out from the pre-generated curve mapping chartlet according to the hair piece type; an adjustment value obtaining module obtains an adjustment value corresponding to the position to be adjusted from the target mapping map; and the hair highlight rendering module performs numerical value adjustment on the highlight parameter to be adjusted on the position to be adjusted according to the adjustment numerical value, and performs highlight rendering on the target hair piece according to a numerical value adjustment result. The device improves the freedom degree of highlight rendering of each hair piece based on the target mapping chartlet, so that each hair piece is closer to the stylized artistic effect drawn by the art original painting, and the effect of stylized control on the highlight rendering of the hair is achieved.

The hair highlight rendering device provided by the embodiment of the invention can execute the hair highlight rendering method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

It should be noted that, in the embodiment of the hair highlight rendering apparatus, the units and modules included in the embodiment are only divided according to the functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.

Example four

Fig. 6 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention, as shown in fig. 6, the apparatus includes a memory 410, a processor 420, an input device 430, and an output device 440. The number of processors 420 in the device may be one or more, and one processor 420 is taken as an example in fig. 6; the memory 410, processor 420, input device 430, and output device 440 of the apparatus may be connected by a bus or other means, such as by bus 450 in fig. 6.

The memory 410 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the hair highlight rendering method in the embodiment of the present invention (for example, the data obtaining module 310, the adjustment value obtaining module 320, and the hair highlight rendering module 330 in the hair highlight rendering apparatus). The processor 420 executes various functional applications of the device and data processing, i.e., implements the hair highlight rendering method described above, by executing software programs, instructions, and modules stored in the memory 410.

The memory 410 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the device, and the like. Further, the memory 410 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 410 may further include memory located remotely from processor 420, which may be connected to devices through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.

The input device 430 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the device. The output device 440 may include a display device such as a display screen.

EXAMPLE five

An embodiment of the present invention provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a hair highlight rendering method, including:

acquiring a hair piece type, a position to be adjusted and a highlight parameter to be adjusted of a target hair piece, and screening out a target mapping map from a pre-generated curve mapping map according to the hair piece type;

obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping map;

and carrying out numerical value adjustment on the highlight parameter to be adjusted according to the adjustment numerical value, and carrying out highlight rendering on the target hair piece according to a numerical value adjustment result.

Of course, the storage medium provided by the embodiments of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the method operations described above, and may also perform related operations in the hair highlight rendering method provided by any embodiments of the present invention.

From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. With this understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.

It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:单张图像的逼真动态光照变化合成方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!