Texture effect processing method and device, electronic equipment and storage medium
By performing lighting baking and light and dark adjustment on the scene, and dividing areas to map different textures, the problem of poor control of scene comic texture effects in the existing technology is solved, and a unified and accurate texture processing effect is achieved.
Patent Information
- Application Number
- CN202410874664.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-09-10
AI Technical Summary
When the existing technology realizes the scene comic texture effect, it is difficult to globally control the entire scene, resulting in rough texture processing results and poor effects, and it is difficult to accurately control the light and dark distribution of the scene.
By performing lighting baking operations on the target scene, the scene baking global illumination map is obtained, and its light and dark contrast and dividing lines are adjusted, and multiple areas are divided to map different types of comic texture maps to achieve global control of the texture effect of the entire scene.
It achieves unified control over the texture effect of the entire target scene, and obtains a target comic texture with a relatively uniform comic texture effect, and maps it based on the global illumination information of the scene baked global illumination map, which improves the accuracy and effect of texture processing.
Smart Images

Figure CN118628631A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a texture effect processing method, device, electronic device and storage medium. Background Art
[0002] With the development of game demand, comic-style games have increasingly higher requirements for stylized art performance of scenes. Comic texture, as an important part of the comic style of the scene, can enhance the comic sense of the scene, and the demand for its performance accuracy is also increasing. In order to express the detailed scene comic texture style effect, it is necessary to set the comic texture effect according to the light and dark distribution of the scene, and in the animation based on the timeline, the scene comic texture effect needs to be configured according to time.
[0003] In the prior art, scene comic texture is mainly achieved through material expression.
[0004] However, the material texture method is mainly used to control the comic texture expression on objects of the same material, and the obtained processing results are relatively rough and the effect is not good. Summary of the invention
[0005] The purpose of the present application is to provide a texture effect processing method, device, electronic device and storage medium to address the deficiencies in the above-mentioned prior art, so as to obtain a target comic texture with a relatively uniform comic texture effect.
[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] In a first aspect, the present invention provides a texture effect processing method, the method comprising:
[0008] Performing a lighting baking operation on a target scene to obtain a scene-baked global illumination map corresponding to the target scene, wherein the scene-baked global illumination map is used to indicate a light map corresponding to the target scene, wherein the target scene includes at least one static object;
[0009] Adjusting the light-dark contrast and the light-dark dividing line of the scene baked global illumination map, and dividing the scene baked global illumination map to obtain a plurality of divided areas, wherein the grayscale value range corresponding to the pixel points in each divided area is different;
[0010] Different types of comic texture images are mapped to each of the divided areas to obtain a target comic texture.
[0011] In a second aspect, the present invention provides a texture effect processing device, comprising:
[0012] An acquisition module, used to perform a lighting baking operation on a target scene, and acquire a scene-baked global illumination map corresponding to the target scene, wherein the scene-baked global illumination map is used to indicate a light map corresponding to the target scene, and the target scene includes at least one static object;
[0013] An adjustment module, used to adjust the light-dark contrast and light-dark dividing line of the scene baked global illumination map, and divide the scene baked global illumination map to obtain a plurality of divided areas, wherein the grayscale value range corresponding to the pixel points in each divided area is different;
[0014] The mapping module is used to map different types of comic texture images to each of the divided areas to obtain a target comic texture.
[0015] In a third aspect, the present invention provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the texture effect processing method as described in any of the aforementioned implementations.
[0016] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the texture effect processing method as described in any of the aforementioned embodiments are executed.
[0017] The beneficial effects of this application are:
[0018] In the texture effect processing method, device, electronic device and storage medium provided in the embodiments of the present application, a scene-baked global illumination map corresponding to the target scene is obtained by performing a lighting baking operation on the target scene, and the scene-baked global illumination map is used to indicate the illumination map corresponding to the target scene, and the target scene includes at least one static object; the light-dark contrast and light-dark dividing line of the scene-baked global illumination map are adjusted, and the scene-baked global illumination map is divided to obtain multiple divided areas, wherein the grayscale value range corresponding to the pixel points in each divided area is different; different types of comic texture maps are mapped to each divided area to obtain a target comic texture, thereby realizing global control of the texture effect of the entire target scene without distinguishing the material category, and because mapping can be performed based on the global illumination information of the scene-baked global illumination map, a target comic texture with a relatively uniform comic texture effect can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A schematic diagram of a process flow of a texture effect processing method provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of a flow chart of another texture effect processing method provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of baking a global illumination map for a scene provided in an embodiment of the present application;
[0023] Figure 4 A schematic flow chart of another texture effect processing method provided by an embodiment of the present invention;
[0024] Figure 5 A schematic diagram of a scene baking enhancement graph provided in an embodiment of the present application;
[0025] Figure 6 A schematic flow chart of another texture effect processing method provided by an embodiment of the present invention;
[0026] Figure 7 A schematic diagram of a diffuse reflection map provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of a mixed map provided in an embodiment of the present application;
[0028] Fig. 9 A schematic diagram of area division provided in an embodiment of the present application;
[0029] Fig.10 A schematic diagram of cartoon texture mapping provided in an embodiment of the present application;
[0030] Fig.11 Another cartoon texture mapping schematic diagram provided in an embodiment of the present application;
[0031] Fig.12 A schematic diagram of functional modules of another comic texture mapping device provided in an embodiment of the present application;
[0032] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0034] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0035] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0036] In the related technology, scene comic texture is mainly realized through material expression, wherein the material texture method is to render the texture on the object by modifying the material shader, sample the comic texture with screen space, and realize the comic texture effect on the object of the same material.
[0037] However, the material texture method is mainly used to control the comic texture performance on objects of the same material. However, objects in a general scene have multiple material categories, and it is difficult to globally control the texture parameters of the entire scene. Therefore, the existing texture effect processing results are relatively rough and the effect is not good.
[0038] In addition, although the related technologies also use post-processing and transparent texture patch overlay to achieve scene comic texture, they all have problems to varying degrees. Among them, the transparent texture patch method is to achieve texture expression by overlaying transparent patches on the scene camera or object; the post-processing method is to process the image after rendering, and by overlaying the comic texture picture on the image space according to a certain color and transparency, the entire screen will be covered with comic texture effect.
[0039] However, the transparent texture patch method requires manual customization of the texture range, and it is difficult to accurately control the range of dots according to the brightness of the scene. In addition, rendering a large number of transparent patches will result in high performance consumption. The post-processing method will make the distribution of comic textures more even, lacking changes in texture areas under different brightness, and lacking the ability to distinguish different types of objects, such as characters and scenes. Moreover, post-processing usually requires adding new channels (Pass) to the rendering pipeline, which consumes a lot of rendering performance.
[0040] In view of this, the present application provides a texture effect processing method, which can render materials in a scene in batches, so that while streamlining the art process, the influence range of the comic texture can be accurately and flexibly controlled to improve the texture processing effect.
[0041] Figure 1 A flow chart of a texture effect processing method provided by an embodiment of the present invention is shown as follows: Figure 1 As shown, the method includes:
[0042] Step 101: Perform a lighting baking operation on a target scene to obtain a scene-baked global illumination map corresponding to the target scene, where the scene-baked global illumination map is used to indicate a light map corresponding to the target scene.
[0043] The target scene includes at least one static object. The present application does not limit the number of static objects, and the target scene may include one or more static objects according to the actual application scene.
[0044] When performing lighting baking operations on the target scene, it can be achieved with the help of a corresponding light source. Optionally, the light source can be a point light source, a spotlight, a parallel light, etc., which is not limited here. Through this lighting baking, the static objects in the target scene can be baked, so that the light and dark information of the static objects can be baked into the target scene to obtain a scene baking global illumination map. Compared with the method of obtaining scene light and dark information through real-time light and shadow, the present application can obtain a softer and more delicate scene light and dark distribution.
[0045] Step 102: Adjust the light-dark contrast and light-dark dividing line of the scene baked global illumination map, and divide the scene baked global illumination map to obtain multiple divided areas.
[0046] The grayscale value ranges corresponding to the pixels in each divided area are different.
[0047] The light-dark contrast of the scene's baked global illumination map is the brightness difference between the brightest and darkest areas in the scene's baked global illumination map. The light-dark dividing line of the scene's baked global illumination map is the dividing line between the bright and dark areas in the scene's baked global illumination map.
[0048] Optionally, the specific adjustment can be achieved with the help of a material shader. By adjusting the light-dark contrast and light-dark dividing line of the scene's baked global illumination map, the distribution area of light and dark in the scene can be accurately adjusted to obtain a light and dark distribution that meets the requirements, thereby achieving global control of the texture effect of the entire target scene without distinguishing between material categories.
[0049] Each divided area may correspond to a different grayscale value range. For example, if two divided areas are obtained by division, the first divided area may correspond to a first grayscale value range, and the second divided area may correspond to a second grayscale value range.
[0050] Step 103: Map different types of comic texture images to each divided area to obtain a target comic texture.
[0051] Furthermore, the adjusted scene baked global illumination map can be divided according to the distribution of light and dark to obtain multiple divided areas, and different types of comic texture maps can be mapped to each divided area, thereby achieving mapping based on the global illumination information of the scene baked global illumination map to obtain a target comic texture with consistent texture parameters, that is, a target comic texture with a relatively uniform comic texture effect.
[0052] In summary, an embodiment of the present application provides a texture effect processing method, which includes: performing a lighting baking operation on a target scene, obtaining a scene-baked global illumination map corresponding to the target scene, the scene-baked global illumination map being used to indicate a lighting map corresponding to the target scene, and the target scene including at least one static object; adjusting the light-dark contrast and light-dark dividing line of the scene-baked global illumination map, and dividing the scene-baked global illumination map to obtain a plurality of divided areas, wherein the grayscale value range corresponding to the pixels in each divided area is different; mapping different types of comic texture maps to each divided area to obtain a target comic texture, thereby achieving global control of the texture effect of the entire target scene without distinguishing between material categories, and since mapping can be performed based on the global illumination information of the scene-baked global illumination map, a target comic texture with a relatively uniform comic texture effect can be obtained.
[0053] Figure 2 A schematic flow chart of another texture effect processing method provided by an embodiment of the present invention. Figure 3 A schematic diagram of a scene baking global illumination map provided in an embodiment of the present application. In an optional implementation, as Figure 2 As shown, the above-mentioned lighting baking operation is performed on the target scene to obtain the scene baking global illumination map corresponding to the target scene, including:
[0054] Step 201: Acquire static objects in the target scene.
[0055] Optionally, the static objects in the target scene may include, but are not limited to, houses, tables, rockery, and any other objects without any motion.
[0056] It should be noted that, according to the actual application scenario, the static object in the target scene may include one or more, which is not limited here; of course, the size information of each static object is not limited. In addition, according to the actual application scenario, some static objects in the target scene may be selected for texture effect processing, for example, static objects whose material is the target material in the target scene may be selected.
[0057] Step 202: Perform a lighting baking operation on the static object to bake the light and dark information corresponding to the static object into the target scene, and obtain a scene-baked global illumination map corresponding to the target scene.
[0058] Among them, performing a lighting baking operation on a static object can bake the static object, so that the light and dark information of the static object can be baked into the target scene to obtain a scene baking global illumination map. The scene baking global illumination map can reflect the scene light and dark information of the baked target scene. Figure 3 From the display effect, it can be seen that, compared with the method of obtaining scene brightness and darkness information through real-time light and shadow, the application of the embodiment of the present application can obtain a softer and more delicate scene brightness and darkness distribution.
[0059] Figure 4 A schematic diagram of a flow chart of another texture effect processing method provided by an embodiment of the present invention, Figure 5 A schematic diagram of a scene baking enhancement graph provided in an embodiment of the present application. In an optional implementation, as Figure 4 As shown, the above adjustment scene bakes the light and dark contrast and light and dark dividing line of the global illumination map, including:
[0060] Step 301: Enhance the initial baking parameters of the scene baking global illumination map to obtain a scene baking enhanced map.
[0061] Among them, the light-dark contrast of the scene baking enhancement map is greater than the light-dark contrast of the scene baking global illumination map. That is, the brightness difference between the brightest area and the darkest area in the scene baking enhancement map is greater than the brightness difference between the brightest area and the darkest area in the scene baking global illumination map.
[0062] Reference Figures 3 to 5 ,in, Figure 5 The scene baking enhancement diagram shown is for Figure 3 The scene shown in the figure is baked with the global illumination map enhanced. It can be seen that Figure 5 The light and dark contrast of the baked enhancement image of the scene shown is greater than Figure 3 The light-dark contrast of the baked global illumination map of the scene shown, that is, the light-dark contrast in the scene baking enhancement map is larger.
[0063] Step 302: Use a preset interpolation algorithm to perform an interpolation operation on the scene baking enhancement image to adjust the light and dark boundary of the scene baking enhancement image.
[0064] Among them, the preset interpolation algorithm is used to perform interpolation operations on the grayscale values in the scene baking enhancement image. Through this interpolation operation, the light and dark transition areas in the scene baking enhancement image can be smoothly transitioned according to the transformation form indicated by the preset interpolation algorithm, thereby achieving a gradual transition of the light and dark areas, so that a more natural comic texture can be obtained later.
[0065] Figure 6 A schematic diagram of a flow chart of another texture effect processing method provided by an embodiment of the present invention, Figure 7 A schematic diagram of a diffuse reflection map provided in an embodiment of the present application, Figure 8 A schematic diagram of a mixed map provided in an embodiment of the present application. Optionally, Figure 6 As shown, the above-mentioned preset interpolation algorithm is used to perform an interpolation operation on the scene baking enhancement map to adjust the light and dark dividing line of the scene baking enhancement map, including:
[0066] Step 401: Based on the mixing coefficient, linearly mix the preset diffuse map and the scene baking enhancement map to obtain a mixed map.
[0067] Among them, the light and dark dividing line in the mixed map is different from the light and dark dividing line in the scene baking enhancement map.
[0068] The mixing coefficient is used to control the degree of grayscale mixing between the preset diffuse map and the scene baking enhancement map. The larger the mixing coefficient, the greater the influence of the scene baking enhancement map on the mixed map.
[0069] Optionally, when performing linear mixing, the following formula may be used:
[0070] Gray=α·BakedGI+(1-α)*Diffuse
[0071] Among them, α represents the mixing coefficient, BakedGI represents the grayscale value corresponding to the scene baking enhancement map, Diffuse represents the grayscale value corresponding to the preset diffuse map, and Gray represents the grayscale value of the mixed map. It should be noted that BakedGI, Diffuse, and Gray can all be the grayscale values of each pixel.
[0072] Reference Figures 5 to 7 , it can be seen that compared with Figure 5 The scene baking enhancement diagram shown is Figure 6 The introduction of the diffuse map shown in the figure gives Figure 7 The mixed map shown can enrich the texture details of the light and dark distribution in the target scene.
[0073] Step 402: Use a preset interpolation algorithm to perform an interpolation operation on the mixed map to adjust the light and dark boundary of the mixed map.
[0074] Among them, by adopting a preset interpolation algorithm to interpolate the mixed map, the light and dark transition areas in the mixed map can be smoothly transitioned according to the transformation form indicated by the preset interpolation algorithm, and the gradual transition of light and dark areas based on the texture details of rich light and dark distribution can be achieved, thereby obtaining a more natural and rich comic texture.
[0075] It should be noted that, when making specific adjustments, optionally, the preset interpolation algorithm can be a smooth step function, then the light and dark dividing line of the mixed map can be adjusted by adjusting the pp Texture offset parameter in the smooth step function, wherein the pp Texture offset parameter represents the middle value of the light and dark transition range.
[0076] Of course, the present application does not limit the specific number of adjustments. Depending on the actual application scenario, one or more adjustments can be performed until the preset adjustment expectations are met.
[0077] In an optional implementation, the initial baking parameters of the scene baking global illumination map are enhanced to obtain the scene baking enhanced map, including:
[0078] The initial baking parameters of the scene baking global illumination map are calculated to the Nth power to obtain the calculated enhanced baking parameters, where N is a number greater than 0; according to the enhanced baking parameters, the scene baking enhancement map is obtained.
[0079] Optionally, when performing enhancement, the following formula may be used:
[0080] BakedGI=Power(BakedGI′,N)
[0081] Among them, BakedGI′ represents the initial baking parameters of the scene baking global illumination map, Power() represents the power operation function, N represents the exponent of the power operation, and BakedGI represents the enhanced baking parameters of the scene baking global illumination map.
[0082] Fig. 9 A schematic diagram of area division provided in an embodiment of the present application, Fig.10 A schematic diagram of cartoon texture mapping provided in an embodiment of the present application is shown in FIG. Fig.11 Another schematic diagram of comic texture mapping provided in an embodiment of the present application.
[0083] In an optional implementation, the above-mentioned dividing the scene baked global illumination map to obtain multiple divided areas includes:
[0084] Based on the light-dark dividing line of the mixed map and according to the grayscale value of each pixel in the mixed map, the mixed map is divided to obtain a first divided area, a second divided area and a third divided area.
[0085] The grayscale value of each pixel in the first divided area is 1, the grayscale value of each pixel in the second divided area is 0, and the grayscale value of each pixel in the third divided area is any value between 0 and 1.
[0086] Reference Fig. 9 As shown, after adjusting the light and dark dividing line of the mixed map, further division operations can be performed according to the grayscale value of each pixel in the mixed map.
[0087] like Fig. 9 As shown, the white bright area can be recorded as the first divided area, the black dark area can be recorded as the second divided area, and the gray area can be recorded as the third area, which is used to perform a linear transition between the first divided area and the second divided area, wherein the grayscale value of each pixel in the white bright area is 1, the grayscale value of each pixel in the black dark area is 0, and the grayscale value of each pixel in the gray area is any value between 0 and 1.
[0088] Accordingly, different types of comic texture images are mapped to each divided area to obtain target comic textures, including:
[0089] The first comic texture and the second comic texture are mapped to the first divided area and the second divided area respectively to obtain a target comic texture.
[0090] Among them, the first comic texture and the second comic texture are two different types of comic texture images, which can be any of the following comic textures: stripe texture, dot texture, checkered texture, and diamond texture.
[0091] In some embodiments, the first comic texture may be a dot texture, and the second comic texture may be a stripe texture. Then, after mapping the first divided area, the following may be obtained: Fig.10 The comic texture effect shown in the figure can be obtained by mapping the second divided area. Fig.11 Comic texture effect shown.
[0092] Optionally, when performing the mapping, the following formula may be used:
[0093] Tex=Gray·Tex light +(1-Gray)*Tex dark
[0094] Among them, Tex represents the pixel value of each pixel in the target comic texture, Gray represents the grayscale value of the mixed map, and Texlight Represents the pixel value obtained by sampling the first comic texture, Tex dark Represents the pixel value obtained by sampling the second comic texture.
[0095] Based on the above description, after mapping the first divided area and the second divided area respectively to obtain the first area texture and the second area texture mapping, the first area texture and the second area texture mapping can be superimposed to obtain the final target comic texture.
[0096] In an optional implementation, the texture effect processing method may also be applied to a sequence editing tool, wherein the sequence editing tool may be used to create an animation, and in some embodiments, the sequence editing tool may be a TimeLine tool. Optionally, the method further includes:
[0097] In response to a triggering operation on a preset control in a sequence editing tool, a texture editing operation is performed on a target scene to obtain a target animation, wherein the target animation contains at least one target comic texture.
[0098] The preset control is used to perform texture editing operations on the target scene, and by editing, at least one target comic texture can be present in the target animation.
[0099] Optionally, the texture editing operation is specifically performed by adjusting to a target frame through a sequence editing tool, and then performing a texture editing operation on a target scene in the target frame.
[0100] It should be noted that different timestamps in the target animation may correspond to the same or different target comic textures. For example, the target animation has a first target comic texture at the first timestamp (such as a scene comic texture effect that produces stripes or dots of specified color and transparency), and a second target comic texture at the second timestamp; or, the target animation has a first target comic texture at the first timestamp, cancels the first target comic texture at the second timestamp, and continues to have the first target comic timestamp at the third timestamp. This is not limited here and can be flexibly set according to the actual application scenario.
[0101] The second timestamp is a timestamp after the first timestamp, and the third timestamp is a timestamp after the second timestamp.
[0102] By using the embodiments of the present application, scene texture can be dynamically adjusted in animation with less art manpower input and a simple and flexible editing method, so as to achieve gradual adjustment of scene texture effects between different time segments, making the dynamic expression of scene texture more flexible.
[0103] In an optional embodiment, the preset control includes at least one of the following: a texture switch, a texture selection control, a texture attribute setting control, a blending coefficient setting control, an enhancement parameter adjustment control, a light-dark contrast adjustment control, and a light-dark boundary adjustment control.
[0104] The texture switch (Use Tex) is used to turn on or off the texture setting function, that is, it can be used to turn on or off the texture setting function of the scene in the target animation. Optionally, it can further include: a first divided area texture switch (Use Tex Light) and a second divided area texture switch, wherein the first divided area texture switch is used to turn on or off the bright scene comic texture, and the second divided area texture switch is used to turn on or off the dark scene comic texture.
[0105] The texture selection control is used to select the comic texture map for mapping, that is, to select the comic texture map for mapping in the first divided area and the second divided area.
[0106] The texture property setting control is used to set the property parameters of the texture in the comic texture image. The property parameters include at least one of the following: the size of the unit texture (pp Texture Size Light), the color of the texture (pp Texture color Light), the rotation angle of the texture (PP Texture angle), and the color transparency of the texture (pp Texture transparency).
[0107] The rotation angle of the texture can represent the rotation angle of the texture compared to the default state. Take the unit of the checkered texture as an example, that is, the size, color, color transparency, and rotation angle of the checkered texture in the scene can be set through the texture property setting control.
[0108] It should be noted that the style of the unit texture is not limited to the grid texture, and other styles may be included according to actual application scenarios.
[0109] The mixing coefficient setting control (pp Texture lerp) is used to set the mixing coefficient of the preset diffuse map and the scene baking enhancement map. For the description of the mixing coefficient, please refer to the above-mentioned related instructions, which will not be repeated here.
[0110] The light and dark contrast adjustment control (pp Texture Pow) is used to adjust the baking parameters of the scene baking global illumination map. Optionally, the enhanced parameter adjustment control can be the above-mentioned N-power adjustment control. The light and dark boundary adjustment control (pp Texture offset) is used to adjust the light and dark boundary of the mixed map corresponding to the target scene.
[0111] By using the embodiments of the present application, the processing process of the above-mentioned texture effect can be embedded in the sequence editing tool in the form of a control, so that rich dynamic comic texture effects can be displayed in the time and space dimensions.
[0112] In summary, the embodiments of the present application can obtain a scene light and dark distribution that is softer and more delicate than general real-time light and shadow by baking a global illumination map of the scene; by adjusting the contrast and light and dark boundary of the scene baked global illumination map, the distribution area of the scene light and dark can be accurately adjusted; by combining the baked GI with the preset diffuse reflection map to obtain a mixed map and perform texture mapping, the texture details of the light and dark distribution can be enriched; in addition, the type of static objects that need to achieve texture effects can be selected in the target scene; at the same time, by setting the sequence editing tool with preset controls, texture editing can be achieved for the target scene, achieving rich dynamic comic texture effects in time and space dimensions with less art manpower investment and simple and flexible editing methods.
[0113] Fig.12 This is a functional module diagram of another comic texture mapping device provided in the embodiment of the present application. The basic principle and technical effects of the device are the same as those of the corresponding method embodiment described above. For the sake of brief description, the parts not mentioned in this embodiment can be referred to the corresponding contents in the method embodiment. Fig.12 As shown, the comic texture mapping device 100 includes:
[0114] An acquisition module 110 is used to perform a lighting baking operation on a target scene, and acquire a scene-baked global illumination map corresponding to the target scene, wherein the scene-baked global illumination map is used to indicate a light map corresponding to the target scene, and the target scene includes at least one static object;
[0115] An adjustment module 120, configured to adjust the light-dark contrast and the light-dark dividing line of the scene baked global illumination map, and divide the scene baked global illumination map to obtain a plurality of divided areas, wherein the grayscale value range corresponding to the pixel points in each divided area is different;
[0116] The mapping module 130 is used to map different types of comic texture images to each of the divided areas to obtain a target comic texture.
[0117] In an optional implementation, the acquisition module 110 is specifically used to acquire a static object in the target scene;
[0118] A lighting baking operation is performed on the static object, so that the light and dark information corresponding to the static object is baked into the target scene, and a scene-baked global illumination map corresponding to the target scene is obtained.
[0119] In an optional implementation, the adjustment module 120 is specifically used to enhance the initial baking parameters of the scene baking global illumination map to obtain a scene baking enhancement map, wherein the light-dark contrast of the scene baking enhancement map is greater than the light-dark contrast of the scene baking global illumination map;
[0120] An interpolation operation is performed on the scene baking enhancement map using a preset interpolation algorithm to adjust the light and dark dividing line of the scene baking enhancement map.
[0121] In an optional implementation, the adjustment module 120 is specifically configured to linearly mix the preset diffuse map with the scene baking enhancement map based on a mixing coefficient to obtain a mixed map;
[0122] An interpolation operation is performed on the mixed map using a preset interpolation algorithm to adjust the light and dark boundary of the mixed map.
[0123] In an optional implementation, the adjustment module 120 is specifically used to perform N-power calculation on the initial baking parameters of the scene baking global illumination map to obtain the calculated enhanced baking parameters, where N is a number greater than 0;
[0124] According to the enhanced baking parameters, a scene baking enhancement map is obtained.
[0125] In an optional implementation, the adjustment module 120 is specifically configured to divide the mixed map based on the light-dark dividing line of the mixed map and according to the grayscale value of each pixel in the mixed map to obtain a first divided area, a second divided area, and a third divided area, wherein the grayscale value of each pixel in the first divided area is 1, the grayscale value of each pixel in the second divided area is 0, and the grayscale value of each pixel in the third divided area is any value between 0 and 1;
[0126] The mapping module 130 is specifically configured to map the first comic texture and the second comic texture to the first divided area and the second divided area respectively to obtain a target comic texture.
[0127] In an optional embodiment, the texture effect processing device also includes: an editing module, which is used to respond to a trigger operation on a preset control in a sequence editing tool, perform a texture editing operation on the target scene to obtain a target animation, wherein there is at least one target comic texture in the target animation.
[0128] In an optional embodiment, the preset control includes at least one of the following: a texture switch, a texture selection control, a texture attribute setting control, a blending coefficient setting control, a light-dark contrast adjustment control, and a light-dark boundary adjustment control;
[0129] The texture switch is used to turn on or off the texture setting function; the texture selection control is used to select the comic texture map to be mapped;
[0130] The texture attribute setting control is used to set the attribute parameters of the texture in the comic texture image, and the attribute parameters include at least one of the following: the size of the unit texture, the color of the texture, the rotation angle of the texture, and the color transparency of the texture;
[0131] The mixing coefficient setting control is used to set the mixing coefficient of the preset diffuse map and the scene baking enhancement map; the light and dark contrast adjustment control is used to adjust the baking parameters of the scene baking global illumination map; the light and dark boundary adjustment control is used to adjust the light and dark boundary of the mixed map corresponding to the target scene.
[0132] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0133] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0134] Fig.13 The present invention provides a schematic diagram of an electronic device structure, which can be integrated into a comic texture mapping device. Fig.13 As shown, the electronic device may include: a processor 210, a storage medium 220 and a bus 230, the storage medium 220 stores machine-readable instructions executable by the processor 210, when the electronic device is running, the processor 210 and the storage medium 220 communicate through the bus 230, and the processor 210 executes the machine-readable instructions to perform the following method embodiments:
[0135] Performing a lighting baking operation on a target scene to obtain a scene-baked global illumination map corresponding to the target scene, wherein the scene-baked global illumination map is used to indicate a light map corresponding to the target scene, wherein the target scene includes at least one static object;
[0136] Adjusting the light-dark contrast and the light-dark dividing line of the scene baked global illumination map, and dividing the scene baked global illumination map to obtain a plurality of divided areas, wherein the grayscale value range corresponding to the pixel points in each divided area is different;
[0137] Different types of comic texture images are mapped to each of the divided areas to obtain a target comic texture.
[0138] In an optional implementation, performing a lighting baking operation on a target scene to obtain a scene-baked global illumination map corresponding to the target scene includes:
[0139] Acquire static objects in the target scene;
[0140] A lighting baking operation is performed on the static object, so that the light and dark information corresponding to the static object is baked into the target scene, and a scene-baked global illumination map corresponding to the target scene is obtained.
[0141] In an optional implementation, adjusting the light-dark contrast and the light-dark boundary of the scene baked global illumination map includes:
[0142] enhancing initial baking parameters of the scene-baked global illumination map to obtain a scene-baked enhanced map, wherein the light-dark contrast of the scene-baked enhanced map is greater than the light-dark contrast of the scene-baked global illumination map;
[0143] An interpolation operation is performed on the scene baking enhancement map using a preset interpolation algorithm to adjust the light and dark dividing line of the scene baking enhancement map.
[0144] In an optional implementation, the interpolation operation is performed on the scene baking enhancement map by using a preset interpolation algorithm to adjust the light and dark boundary of the scene baking enhancement map, including:
[0145] Based on the mixing coefficient, linearly mix the preset diffuse map and the scene baking enhancement map to obtain a mixed map;
[0146] An interpolation operation is performed on the mixed map using a preset interpolation algorithm to adjust the light and dark boundary of the mixed map.
[0147] In an optional implementation, the step of enhancing the initial baking parameters of the scene baking global illumination map to obtain the scene baking enhancement map includes:
[0148] Performing N-power calculation on the initial baking parameters of the scene baking global illumination map to obtain the calculated enhanced baking parameters, where N is a number greater than 0;
[0149] According to the enhanced baking parameters, a scene baking enhancement map is obtained.
[0150] In an optional implementation, dividing the scene baked global illumination map to obtain a plurality of divided areas includes:
[0151] Based on the light-dark dividing line of the mixed map, the mixed map is divided according to the grayscale value of each pixel in the mixed map to obtain a first divided area, a second divided area and a third divided area, wherein the grayscale value of each pixel in the first divided area is 1, the grayscale value of each pixel in the second divided area is 0, and the grayscale value of each pixel in the third divided area is any value between 0 and 1;
[0152] The step of mapping different types of comic texture images to each of the divided areas to obtain a target comic texture comprises:
[0153] A first comic texture and a second comic texture are mapped to the first divided area and the second divided area respectively to obtain a target comic texture.
[0154] In an optional embodiment, the method further comprises:
[0155] In response to a triggering operation on a preset control in a sequence editing tool, a texture editing operation is performed on the target scene to obtain a target animation, wherein the target animation contains at least one target comic texture.
[0156] In an optional embodiment, the preset control includes at least one of the following: a texture switch, a texture selection control, a texture attribute setting control, a blending coefficient setting control, a light-dark contrast adjustment control, and a light-dark boundary adjustment control;
[0157] The texture switch is used to turn on or off the texture setting function; the texture selection control is used to select the comic texture map to be mapped;
[0158] The texture attribute setting control is used to set the attribute parameters of the texture in the comic texture image, and the attribute parameters include at least one of the following: the size of the unit texture, the color of the texture, the rotation angle of the texture, and the color transparency of the texture;
[0159] The mixing coefficient setting control is used to set the mixing coefficient of the preset diffuse map and the scene baking enhancement map; the light and dark contrast adjustment control is used to adjust the baking parameters of the scene baking global illumination map; the light and dark boundary adjustment control is used to adjust the light and dark boundary of the mixed map corresponding to the target scene.
[0160] The specific implementation method and technical effects of the above embodiments can be found in the above content and will not be repeated here.
[0161] Optionally, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following method embodiments are executed:
[0162] Performing a lighting baking operation on a target scene to obtain a scene-baked global illumination map corresponding to the target scene, wherein the scene-baked global illumination map is used to indicate a light map corresponding to the target scene, wherein the target scene includes at least one static object;
[0163] Adjusting the light-dark contrast and the light-dark dividing line of the scene baked global illumination map, and dividing the scene baked global illumination map to obtain a plurality of divided areas, wherein the grayscale value range corresponding to the pixel points in each divided area is different;
[0164] Different types of comic texture images are mapped to each of the divided areas to obtain a target comic texture.
[0165] In an optional implementation, performing a lighting baking operation on a target scene to obtain a scene-baked global illumination map corresponding to the target scene includes:
[0166] Acquire static objects in the target scene;
[0167] A lighting baking operation is performed on the static object, so that the light and dark information corresponding to the static object is baked into the target scene, and a scene-baked global illumination map corresponding to the target scene is obtained.
[0168] In an optional implementation, adjusting the light-dark contrast and the light-dark boundary of the scene baked global illumination map includes:
[0169] enhancing initial baking parameters of the scene-baked global illumination map to obtain a scene-baked enhanced map, wherein the light-dark contrast of the scene-baked enhanced map is greater than the light-dark contrast of the scene-baked global illumination map;
[0170] An interpolation operation is performed on the scene baking enhancement map using a preset interpolation algorithm to adjust the light and dark dividing line of the scene baking enhancement map.
[0171] In an optional implementation, the interpolation operation is performed on the scene baking enhancement map by using a preset interpolation algorithm to adjust the light and dark boundary of the scene baking enhancement map, including:
[0172] Based on the mixing coefficient, linearly mix the preset diffuse map and the scene baking enhancement map to obtain a mixed map;
[0173] An interpolation operation is performed on the mixed map using a preset interpolation algorithm to adjust the light and dark boundary of the mixed map.
[0174] In an optional implementation, the step of enhancing the initial baking parameters of the scene baking global illumination map to obtain the scene baking enhancement map includes:
[0175] Performing N-power calculation on the initial baking parameters of the scene baking global illumination map to obtain the calculated enhanced baking parameters, where N is a number greater than 0;
[0176] According to the enhanced baking parameters, a scene baking enhancement map is obtained.
[0177] In an optional implementation, dividing the scene baked global illumination map to obtain a plurality of divided areas includes:
[0178] Based on the light-dark dividing line of the mixed map, the mixed map is divided according to the grayscale value of each pixel in the mixed map to obtain a first divided area, a second divided area and a third divided area, wherein the grayscale value of each pixel in the first divided area is 1, the grayscale value of each pixel in the second divided area is 0, and the grayscale value of each pixel in the third divided area is any value between 0 and 1;
[0179] The step of mapping different types of comic texture images to each of the divided areas to obtain a target comic texture comprises:
[0180] A first comic texture and a second comic texture are mapped to the first divided area and the second divided area respectively to obtain a target comic texture.
[0181] In an optional embodiment, the method further comprises:
[0182] In response to a triggering operation on a preset control in a sequence editing tool, a texture editing operation is performed on the target scene to obtain a target animation, wherein the target animation contains at least one target comic texture.
[0183] In an optional embodiment, the preset control includes at least one of the following: a texture switch, a texture selection control, a texture attribute setting control, a blending coefficient setting control, a light-dark contrast adjustment control, and a light-dark boundary adjustment control;
[0184] The texture switch is used to turn on or off the texture setting function; the texture selection control is used to select the comic texture map to be mapped;
[0185] The texture attribute setting control is used to set the attribute parameters of the texture in the comic texture image, and the attribute parameters include at least one of the following: the size of the unit texture, the color of the texture, the rotation angle of the texture, and the color transparency of the texture;
[0186] The mixing coefficient setting control is used to set the mixing coefficient of the preset diffuse map and the scene baking enhancement map; the light and dark contrast adjustment control is used to adjust the baking parameters of the scene baking global illumination map; the light and dark boundary adjustment control is used to adjust the light and dark boundary of the mixed map corresponding to the target scene.
[0187] The specific implementation method and technical effects of the above embodiments can be found in the above content and will not be repeated here.
[0188] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0189] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0190] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0191] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0192] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0193] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A texture effect processing method, characterized in that: The method comprises: Performing a lighting baking operation on a target scene to obtain a scene-baked global illumination map corresponding to the target scene, wherein the scene-baked global illumination map is used to indicate a light map corresponding to the target scene, wherein the target scene includes at least one static object; Adjusting the light-dark contrast and the light-dark dividing line of the scene baked global illumination map, and dividing the scene baked global illumination map to obtain a plurality of divided areas, wherein the grayscale value range corresponding to the pixel points in each divided area is different; Different types of comic texture images are mapped to each of the divided areas to obtain a target comic texture.
2. The method according to claim 1, characterized in that The performing a lighting baking operation on the target scene to obtain a scene baking global illumination map corresponding to the target scene includes: Acquire static objects in the target scene; A lighting baking operation is performed on the static object, so that the light and dark information corresponding to the static object is baked into the target scene, and a scene-baked global illumination map corresponding to the target scene is obtained.
3. The method according to claim 1, characterized in that: The step of adjusting the light-dark contrast and the light-dark boundary of the scene baked global illumination map comprises: enhancing initial baking parameters of the scene-baked global illumination map to obtain a scene-baked enhanced map, wherein the light-dark contrast of the scene-baked enhanced map is greater than the light-dark contrast of the scene-baked global illumination map; An interpolation operation is performed on the scene baking enhancement map using a preset interpolation algorithm to adjust the light and dark dividing line of the scene baking enhancement map.
4. The method according to claim 3, characterized in that The adopting a preset interpolation algorithm to perform an interpolation operation on the scene baking enhancement map to adjust the light and dark boundary line of the scene baking enhancement map includes: Based on the mixing coefficient, linearly mix the preset diffuse map and the scene baking enhancement map to obtain a mixed map; An interpolation operation is performed on the mixed map using a preset interpolation algorithm to adjust the light and dark boundary of the mixed map.
5. The method according to claim 3, characterized in that: The step of enhancing the initial baking parameters of the scene baking global illumination map to obtain the scene baking enhancement map includes: Performing N-power calculation on the initial baking parameters of the scene baking global illumination map to obtain the calculated enhanced baking parameters, where N is a number greater than 0; According to the enhanced baking parameters, a scene baking enhancement map is obtained.
6. The method according to claim 4, characterized in that The step of dividing the scene baked global illumination map to obtain a plurality of divided areas includes: Based on the light-dark dividing line of the mixed map, the mixed map is divided according to the grayscale value of each pixel in the mixed map to obtain a first divided area, a second divided area and a third divided area, wherein the grayscale value of each pixel in the first divided area is 1, the grayscale value of each pixel in the second divided area is 0, and the grayscale value of each pixel in the third divided area is any value between 0 and 1; The step of mapping different types of comic texture images to each of the divided areas to obtain a target comic texture comprises: A first comic texture and a second comic texture are mapped to the first divided area and the second divided area respectively to obtain a target comic texture.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: In response to a triggering operation on a preset control in a sequence editing tool, a texture editing operation is performed on the target scene to obtain a target animation, wherein the target animation contains at least one target comic texture.
8. The method according to claim 7, characterized in that The preset controls include at least one of the following: a texture switch, a texture selection control, a texture attribute setting control, a blending coefficient setting control, a light-dark contrast adjustment control, and a light-dark boundary adjustment control; The texture switch is used to turn on or off the texture setting function; the texture selection control is used to select the comic texture map to be mapped; The texture attribute setting control is used to set the attribute parameters of the texture in the comic texture image, and the attribute parameters include at least one of the following: the size of the unit texture, the color of the texture, the rotation angle of the texture, and the color transparency of the texture; The mixing coefficient setting control is used to set the mixing coefficient of the preset diffuse map and the scene baking enhancement map; the light and dark contrast adjustment control is used to adjust the baking parameters of the scene baking global illumination map; the light and dark boundary adjustment control is used to adjust the light and dark boundary of the mixed map corresponding to the target scene.
9. A texture effect processing device, characterized in that: include: An acquisition module, used to perform a lighting baking operation on a target scene, and acquire a scene-baked global illumination map corresponding to the target scene, wherein the scene-baked global illumination map is used to indicate a light map corresponding to the target scene, and the target scene includes at least one static object; An adjustment module, used to adjust the light-dark contrast and light-dark dividing line of the scene baked global illumination map, and divide the scene baked global illumination map to obtain a plurality of divided areas, wherein the grayscale value range corresponding to the pixel points in each divided area is different; The mapping module is used to map different types of comic texture images to each of the divided areas to obtain a target comic texture.
10. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the texture effect processing method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the texture effect processing method according to any one of claims 1 to 8 are executed.
