Information processing method, device, readable storage medium and electronic device

By adding the stylized map data to the rendering data of the target model, the problem of low efficiency in generating stylized models in the prior art is solved, and the stylized effect of rapid adjustment and natural light and shadow changes is achieved.

CN114299211BActive Publication Date: 2025-04-25NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111520566.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2025-04-25
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

The prior art is inefficient when generating stylized models and cannot be adjusted quickly. The stylized map can only match one model and cannot be adjusted quickly.

Method used

By obtaining the map data of the target style information, adding it to the original rendering data of the target model, generating the target rendering data, and rendering and displaying the target model based on this data to achieve a stylized effect.

Benefits of technology

The efficiency of generating stylized models is improved, the model style can be quickly adjusted, and the stylized effect can naturally change with light and shadow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114299211B_ABST
    Figure CN114299211B_ABST
Patent Text Reader

Abstract

The present invention discloses an information processing method, device, readable storage medium and electronic device. The method comprises: obtaining a first target map, wherein the first target map comprises target style information; adding the map data of the first target map to the original rendering data of the target model to obtain the target rendering data of the target model, wherein the original rendering data is used to render and display the target model as an original image; rendering and displaying the target model based on the target rendering data to convert the original image into a target image, wherein the display content of the target image comprises: a target model having the target style information. The present invention solves the technical problem of low efficiency in generating stylized models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to an information processing method, device, readable storage medium and electronic device. Background Art

[0002] Currently, if you want to have a brushstroke effect in a stylized scene, you generally need to add various stylized maps on top of the map to achieve the brushstroke effect.

[0003] In the related art, stylized maps are hand-painted specifically for specific models. The stylized grid points and brush stroke points are all hand-painted directly on the model's map. It takes a lot of time to ensure that the density, depth, and size of the brush stroke map are just right. It can only match one model and cannot be adjusted quickly. There is a technical problem of low efficiency in generating stylized models.

[0004] With respect to the technical problem of low efficiency in generating stylized models in the prior art, no effective solution has been proposed so far. Summary of the invention

[0005] At least some embodiments of the present invention provide an information processing method, apparatus, readable storage medium and electronic device to at least solve the technical problem of low efficiency in generating stylized models.

[0006] In order to achieve the above-mentioned purpose, according to one embodiment of the present invention, an information processing method is provided. A first target map is obtained, wherein the first target map includes target style information; the map data of the first target map is added to the original rendering data of the target model to obtain the target rendering data of the target model, wherein the original rendering data is used to render and display the target model as an original image; the target model is rendered and displayed based on the target rendering data to convert the original image into a target image, wherein the display content of the target image includes: the target model with the target style information.

[0007] Optionally, based on the target rendering attributes, sub-original rendering data is determined in the original rendering data; and the texture data is added to the original rendering data to obtain the target rendering data, including: obtaining texture data from a first target texture, wherein the texture data has the target rendering attributes; and adding the texture data to the sub-original rendering data to obtain the target rendering data.

[0008] Optionally, adding the texture data to the sub-original rendering data to obtain the target rendering data includes: adjusting the sub-original rendering data based on the texture data to obtain the target rendering data.

[0009] Optionally, the sub-original rendering data is adjusted based on the map data to obtain target rendering data, including: determining a target threshold based on the map data; deleting target color scale information in the sub-original rendering data based on the target threshold to obtain target rendering data, wherein the target color scale information is used to represent gradient light and shadow.

[0010] Optionally, adjusting the sub-original rendering data based on the mapping data to obtain target rendering data includes: adjusting the shape data in the sub-original rendering data based on the mapping data to obtain the target rendering data, wherein the shape data is used to represent one of the following attributes on the target model: light, shadow, and intrinsic color.

[0011] Optionally, the target rendering attribute includes at least one of the following: a light attribute, used to determine the light shining on the target model; a shadow attribute, used to determine the shadow appearing on the target model; an intrinsic color attribute, used to determine the material color of the target model.

[0012] Optionally, adding the map data to the original rendering data to obtain target rendering data includes: converting the first target map into a grayscale image, and adding the data of the grayscale image to the original rendering data to obtain the target rendering data.

[0013] Optionally, a second target map is obtained, wherein the second target map is used to represent the material color of the target model; and the target model is established based on the second target map.

[0014] Optionally, rendering the target model based on the target rendering data to convert the original image into the target image includes: superimposing a third target map and a second target map corresponding to the target rendering data to convert the original image into the target image.

[0015] Optionally, the first target map is a stylized map including virtual brush traces, and the target rendering data includes target light and shadow data and brush stroke data corresponding to the virtual brush traces.

[0016] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, there is further provided an information processing device, which may include: an acquisition unit, used to acquire a first target map, wherein the first target map includes target style information; an adding unit, used to add the map data of the first target map to the original rendering data of the target model to obtain the target rendering data of the target model, wherein the original rendering data is used to render and display the target model as an original image; a rendering unit, used to render and display the target model based on the target rendering data to convert the original image into a target image, wherein the display content of the target image includes: a target model with the target style information.

[0017] In order to achieve the above object, according to another aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the information processing method of the embodiment of the present invention.

[0018] To achieve the above object, according to another aspect of the present invention, an electronic device is provided. The electronic device may include a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the computer program to execute the information processing method of the embodiment of the present invention.

[0019] In at least some embodiments of the present invention, a first target map is obtained, wherein the first target map includes target style information; the map data of the first target map is added to the original rendering data of the target model to obtain the target rendering data of the target model, wherein the original rendering data is used to render and display the target model as an original image; the target model is rendered and displayed based on the target rendering data to convert the original image into a target image, wherein the display content of the target image includes: a target model with target style information. That is, the present invention directly adds the first target map (a separate stylized stroke map drawn) to the original rendering data (original light and shadow code) of the target model, so that the style of the target model can be controlled by the first target map, thereby achieving the technical effect of improving the efficiency of generating a stylized model and solving the technical problem of low efficiency in generating a stylized model. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0021] Figure 1 is a hardware structure block diagram of a mobile terminal according to an information processing method of one embodiment of the present invention;

[0022] Figure 2 is a flow chart of an information processing method according to one embodiment of the present invention;

[0023] Figure 3 is a schematic diagram of a stylized scene with a brushstroke effect according to the related art;

[0024] Figure 4 is a schematic diagram of a map drawn according to a non-physical shader method in the related art;

[0025] Figure 5is a schematic diagram of a result of a post-processing method in the related art;

[0026] Figure 6 is a schematic diagram of a selection interface of a post-processing program according to the related art;

[0027] Figure 7 It is a schematic diagram of a post-processing effect according to the related art;

[0028] Figure 8 It is a schematic diagram of a post-processing effect according to the related art;

[0029] Fig. 9 is a schematic diagram of a texture mapping effect according to the related art;

[0030] Fig.10 It is a schematic diagram of an artificial modeling according to the related art;

[0031] Fig.11 It is a schematic diagram of drawing a texture for a model according to one of the related technologies;

[0032] Fig.12 is a schematic diagram of an effect of a shader simulation according to an embodiment of the present invention;

[0033] Fig.13 is a schematic diagram of a material shader rendering effect according to an embodiment of the present invention;

[0034] Fig.14 is a schematic diagram of an information processing effect according to an embodiment of the present invention;

[0035] Fig.15 is a schematic diagram of a normal basic scene model according to an embodiment of the present invention;

[0036] Fig.16 is a schematic diagram of realizing light and dark effects according to an embodiment of the present invention;

[0037] Fig.17 is a schematic diagram of a stylized effect according to an embodiment of the present invention;

[0038] Fig.18 is a schematic diagram of a stylized map according to an embodiment of the present invention;

[0039] Fig.19 is a schematic diagram of a shadow added to a physical shader by a map according to an embodiment of the present invention;

[0040] Fig. 20 is a schematic diagram of a rendering effect according to an embodiment of the present invention;

[0041] Fig.21 It is a structural block diagram of a data object processing device according to one embodiment of the present invention. DETAILED DESCRIPTION

[0042] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0043] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0044] First, some nouns or terms that appear in the process of describing the embodiments of the present application are used for the following explanations:

[0045] 3D model, a mathematical representation of the surface of an object in three dimensions;

[0046] Mesh, geometry, a set of terms used to describe the vertex data and triangle face indicators of 3D models;

[0047] A vertex is a point in 3D space that contains information about normal directions, texture coordinates, and other mesh properties.

[0048] A triangle is a 3D face consisting of a set of three vertices;

[0049] Shader: A program that runs on the graphics card and performs pixel-by-pixel calculations on application objects. It is used to render code for objects in the engine.

[0050] Texture, a set of pixels projected onto the surface of a 3D model in real-time rendering;

[0051] Material ball / shader, the material using the shader, you can adjust the parameters to make the object have an effect;

[0052] DCC software, that is, digital art creation tools, such as Maya, Max, Blender, can create digital models, textures and other art content;

[0053] Space, a coordinate system consisting of three mutually perpendicular vectors (X, Y, Z);

[0054] Dot product, in mathematics, the dot product or scalar product is an algebraic operation that accepts two vectors on the real number R and returns a real-valued scalar;

[0055] The patch UV is the position of the patch in the drawing space, that is, the position point assigned by the texture;

[0056] Physical shader (PBR), available physical parameters to adjust the material ball, through a large number of physical simulations, to find the appropriate value, so that art students can easily adjust the physical parameters;

[0057] Screen post-processing is like a camera filter, which processes the entire image through filters to give it a special feel, such as black and white, or brushstrokes, which is effective for all objects on the screen.

[0058] The screen rendering map (RenderTex) integrates all the rendered images on the screen into a map and stores it in memory.

[0059] According to one embodiment of the present invention, an embodiment of an information processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0060] The method embodiment can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, the mobile terminal can be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID for short), a PAD, a game console and other terminal devices. Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal according to an information processing method of one embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a programmable logic device (FPGA), a neural network processor (NPU), a tensor processor (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. Optionally, the mobile terminal may also include a transmission device 106 for communication functions, an input and output device 108, and a display device 110. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0061] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the information processing method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above-mentioned information processing method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0062] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0063] The inputs in the input / output device 108 may come from a plurality of human interface devices (HIDs), such as keyboards and mice, game controllers, and other dedicated game controllers (such as steering wheels, fishing rods, dance mats, remote controls, etc.). In addition to providing input functions, some human interface devices may also provide output functions, such as force feedback and vibration of game controllers, audio output of controllers, etc.

[0064] The display device 110 may be, for example, a head-up display (HUD), a touch-screen liquid crystal display (LCD), and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable a user to interact with a user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), and a user may interact with the GUI by finger contacts and / or gestures on a touch-sensitive surface, wherein the human-computer interaction functions here may optionally include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or a readable storage medium executable by one or more processors.

[0065] In this embodiment, an information processing method running on the above mobile terminal is provided. Figure 2 FIG. 1 is a flow chart of an information processing method according to one embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0066] Step S202: obtaining a first target map, wherein the first target map includes target style information.

[0067] In the technical solution provided in the above step S202 of the present invention, the first target map can be a stylized scene map hand-drawn for a specific model, a stylized scene map drawn according to actual needs, a stylized scene map found or saved in a mobile terminal material library, or a stylized scene map that comes with the engine system; the target style information can include the brushstroke feel and stylized effect of the first target map, which can be texture points, brushstroke lines, brush materials, etc.

[0068] For example, a first target map, ie, a stylized map, is drawn through digital art creation tools such as maya, max, blender, etc., or a suitable first target map is found in a material library, thereby achieving the purpose of obtaining the first target map.

[0069] Step S204: adding the texture data of the first target texture to the original rendering data of the target model to obtain the target rendering data of the target model, wherein the original rendering data is used to render and display the target model as an original image.

[0070] In the technical solution provided in the above step S204 of the present invention, the mapping data may include code blocks for shadows, light and shadow, and light and dark effects of inherent colors, etc.; the target model may be a basic scene model; the original rendering data may be the light and shadow code of the original image of the target model, the code block of the physical shader light and shadow shader, etc.

[0071] Optionally, the target model may be a normal basic scene model drawn after repeated adjustments in the modeling software according to the requirements of the original painting. For example, a stylized scene map is drawn through a digital art creation tool, and a normal basic scene model representing the material of the actual object is obtained by repeatedly adjusting the drawn stylized scene map.

[0072] In this embodiment, the original rendering data of the target model is determined, and the texture data of the first target map is added to the original rendering data of the target model to obtain the target rendering data of the target model. For example, the original rendering data of the original image is determined, and the texture data of the stylized scene map to be used is obtained, and the texture data of the stylized scene map is added to the original rendering data of the original image to obtain the target rendering data of the target model.

[0073] Step S206 , rendering and displaying the target model based on the target rendering data, so as to convert the original image into the target image, wherein the display content of the target image includes: the target model with the target style information.

[0074] In the technical solution provided in the above step S206 of the present invention, the target model is rendered and displayed based on the target rendering data, and the original image can be converted into the target image. Optionally, if there are places in the target image that do not meet the target conditions, the parameters of the specific positions in the target image can be adjusted to obtain a target image that meets the conditions.

[0075] Through the above steps S202 to S206 of the present application, a first target map is obtained, wherein the first target map includes target style information; the map data of the first target map is added to the original rendering data of the target model to obtain the target rendering data of the target model, wherein the original rendering data is used to render and display the target model as an original image; the target model is rendered and displayed based on the target rendering data to convert the original image into a target image, wherein the display content of the target image includes: a target model with target style information. That is to say, the present invention directly adds the first target map (a separate stylized stroke map drawn) to these code blocks in the original rendering data (original light and shadow code) of the target model, so that the style of the target model can be controlled by the first target map, thereby achieving the technical effect of improving the efficiency of generating a stylized model and solving the technical problem of low efficiency in generating a stylized model.

[0076] The above method of this embodiment is further introduced below.

[0077] As an optional implementation, based on the target rendering attributes, sub-original rendering data is determined in the original rendering data; the texture data is added to the original rendering data to obtain the target rendering data, including: obtaining texture data from a first target texture, wherein the texture data has the target rendering attributes; and adding the texture data to the sub-original rendering data to obtain the target rendering data.

[0078] In this embodiment, the target rendering attributes may be lighting, shadows, and intrinsic colors, such as stylized brushstroke object effects that change with light and shadow; the sub-primitive rendering data may be codes related to lighting, codes related to shadows, and codes related to intrinsic colors.

[0079] Open the post-processing program in the engine software, use the code block of the physical shader and light and shadow shader to obtain the original rendering data, and after analyzing, summarizing and organizing the original rendering data, determine the sub-original rendering data. The sub-original rendering data can be previously written according to actual conditions, or can be the code automatically generated by the engine software; then determine the first target map to be used, process the first target map, and process the first target map in the digital art creation tool to obtain the texture data of the first target map, and combine the texture data with the sub-original rendering data to obtain the target rendering data with target rendering attributes.

[0080] As an optional implementation, adding the texture data to the sub-original rendering data to obtain the target rendering data includes: adjusting the sub-original rendering data based on the texture data to obtain the target rendering data.

[0081] In this embodiment, the texture data is added to the shader, so that the texture data affects the sub-primitive rendering data, thereby affecting the shapes of the highlights and shadows of the sub-primitive data, thereby forming the final desired stylized effect.

[0082] Optionally, adjusting the sub-original rendering data based on the map data may include: adjusting the light and shadow effect of the sub-original data, that is, the shadow; and adjusting the light attenuation value of the sub-original data, that is, the highlight.

[0083] Optionally, a physically based lighting (Lighting Physically Based) calculation method is used to calculate the light and shadow effects of the target rendering data. This calculation method can design calculation rules according to actual needs to achieve the purpose of adjusting the shadow effects in the sub-original data, which may include:

[0084] half Ndotl=saturate(dot(normalWS,lightDirectionWS));

[0085] half3 radiance=lightColor*(lightAttenuation*Ndotl);

[0086] half result=OnmyojiDirectBDRF(brdfDate.diffuse,brdfDate.specular,brdfDate.perceptualRoughness,lightDirectionWS,viewDirectionWS,normalWS)*radiance.

[0087] Optionally, NDotL can be the normal dot multiplied by the light direction of the target rendering data; saturate is used to take the absolute value; dot(normalWS,lightDirectionWS)) can be the world space normal dot multiplied by the light direction of the map data of the sub-original rendering data, so as to obtain the normal dot multiplied by the light direction of the target rendering data; Radiance can be the light attenuation value of the target rendering data; lightColor can be the light color of the sub-original data; lightAttenuation can be the light attenuation value of the target original data, and the light color of the sub-original data is multiplied by the light attenuation value of the target original data multiplied by the normal dot multiplied by the light direction of the target rendering data, so as to obtain the light attenuation value of the target rendering data; OnmyojiDirectBDRF is used to calculate the final result, and Return max(0,result) is used to limit the value of result to above 0, so as to obtain the light and shadow data in the target rendering data after adjusting the light and shadow data in the sub-original data based on the target data.

[0088] half3 HAL=light.direction;

[0089] half NoHAL=saturate(abs(dot(HAL,input.worldSpaceNormal)+1e-5);

[0090] SpecularShal=D_GGX_mobile(bradfDate.roughness,Nohal).

[0091] Among them, HAL can be a half-angle vector value; light.direction can be the light direction, which can be directly obtained from the engine software; NoHAL can be the normal dot multiplication of the half-angle vector, and saturate can be used to take the absolute value; dot is used to indicate the multiplication of the parameters in the brackets, input.worldSpaceNormal can be the world space normal, 1e-5 is used to multiply 1 by 10 to the negative fifth power, that is, 0.000001; SpecularShal can be the final highlight effect, mobile can be the engine software's built-in highlight calculation formula, bradfDate.roughness can be the engine software's built-in object normal, and the built-in highlight formula can be used to obtain the highlight data result in the target rendering data after adjusting the highlight data in the sub-original data based on the target data.

[0092] As an optional implementation, the sub-original rendering data is adjusted based on the map data to obtain target rendering data, including: determining a target threshold based on the map data; deleting target color level information in the sub-original rendering data based on the target threshold to obtain target rendering data, wherein the target color level information is used to represent gradient light and shadow.

[0093] In this embodiment, the target threshold is used to delete target color scale information in the sub-original rendering data, and can be obtained by processing the map data, wherein the target color scale information is used to represent gradient light and shadow.

[0094] Optionally, the positions of shadows, light and shadow, and intrinsic colors in the texture data and the sub-original rendering data are calculated through a smoothing function, so as to achieve a combination of light and dark effects, and finally obtain stylized target rendering data that changes with light and shadow in real time.

[0095] Among them, the smoothing function (smoothStep) is to remove the gradient color levels of the original realistic light and shadow with obvious gradient through threshold calculation, so as to obtain the target rendering data, that is, to form a stylized light and shadow effect. Among them, the threshold can be the result calculated by the system according to the input, or it can be a value set in advance according to the actual situation.

[0096] Optionally, based on threshold processing, the map data is added to the shader to remove color levels that do not meet the conditions, and then the map data that meets the conditions is inserted into the sub-primitive data to obtain the final target rendering data, thereby using the map data to affect the sub-primitive rendering data and affect the shape of the highlights and shadows of the sub-primitive data.

[0097] As an optional implementation, sub-primitive rendering data is adjusted based on the texture data to obtain target rendering data, including: adjusting shape data in the sub-primitive rendering data based on the texture data to obtain target rendering data, wherein the shape data is used to represent one of the following attributes on the target model: light, shadow, and inherent color.

[0098] In this embodiment, multiple attribute data in the sub-original rendering data are adjusted to obtain target rendering data, wherein the shape data may be an attribute of one of light, shadow and intrinsic color.

[0099] Optionally, the map data is inserted into the location of the code representing the shadow, light and intrinsic color in the sub-original data, so as to obtain the target rendering data.

[0100] As an optional implementation, the target rendering attributes include at least one of the following: a light attribute, used to determine the light shining on the target model; a shadow attribute, used to determine the shadow appearing on the target model; an intrinsic color attribute, used to determine the material color of the target model.

[0101] In this embodiment, the light attribute is used to determine the light shining on the target model; the shadow attribute is used to determine the shadow that appears on the target model; the intrinsic color attribute is used to determine the material color of the target model; optionally, by controlling the shape of the target model's shadow, highlight and intrinsic color, a brushstroke feel and stylized effect are formed.

[0102] As an optional implementation, adding the map data to the original rendering data to obtain target rendering data includes: converting the first target map into a grayscale image, and adding the grayscale image data to the original rendering data to obtain the target rendering data.

[0103] In this embodiment, the first target map can be used as a grayscale image in a stylized shader, which can include calculating the positions of shadows, light and intrinsic colors in the grayscale image of the first target map and the original code block to obtain target rendering data.

[0104] Optionally, the grayscale image may be a grayscale image of a brush material.

[0105] As an optional implementation, a second target map is obtained, wherein the second target map is used to represent the material color of the target model; and the target model is established based on the second target map.

[0106] In this embodiment, the second target map may be an intrinsic color map, a basic realistic map, used to represent the material color of the target model, such as the paper texture of a book, the leather texture of a leather sofa, and so on.

[0107] Optionally, a target model is established based on the second target map, for example, the stylized light and shadow effects and brush stroke effects are superimposed on the original intrinsic color map to form a final rendering effect, thereby obtaining a model with intrinsic color.

[0108] As an optional implementation, rendering the target model based on the target rendering data to convert the original image into the target image includes: superimposing a third target map and a second target map corresponding to the target rendering data to convert the original image into the target image.

[0109] In this embodiment, the third target map may be an image obtained based on the first target map and the original image, that is, the target image corresponding to the target rendering data may be an image with stylized light and shadow effects and brushstroke effects.

[0110] Optionally, the third target map and the second target map corresponding to the target rendering data are superimposed to convert the original image into the target image. For example, the third target map and the second target map corresponding to the target rendering data are superimposed to obtain an image having both stylized light and shadow effects and brushstroke effects and inherent colors.

[0111] As an optional implementation manner, the first target map is a stylized map including virtual brush traces, and the target rendering data includes target light and shadow data and brush stroke data corresponding to the virtual brush traces.

[0112] In this embodiment, the first target map is a picture of stylized light and shadow effects and brush stroke effects.

[0113] In this embodiment, a first target map is obtained, wherein the first target map includes target style information; the map data of the first target map is added to the original rendering data of the target model to obtain the target rendering data of the target model, wherein the original rendering data is used to render and display the target model as an original image; the target model is rendered and displayed based on the target rendering data to convert the original image into a target image, wherein the target model has the target style information. That is to say, the present invention directly adds the first target map (a separate stylized stroke map drawn) to the original rendering data (original light and shadow code) of the target model, so that the style of the target model can be controlled by the first target map, thereby achieving the technical effect of improving the efficiency of generating a stylized model and solving the technical problem of low efficiency in generating a stylized model.

[0114] The technical solution of the embodiment of the present invention is further introduced below with examples in combination with preferred implementation modes.

[0115] The current stylized scene wants to have a brushstroke effect. The brushstroke effect is based on the original map, simulating the traces of the brush drawn with a brush to form a hand-painted texture. Figure 3 is a schematic diagram of a stylized scene with a brushstroke effect according to the related art, such as Figure 3 As shown, brush stroke effects generally require drawing various stylized textures on the texture. This method first greatly increases the workload of art students. At the same time, because more textures need to be drawn, the size of the texture is also greatly increased.

[0116] At the same time, the non-physical shader method of drawing the map, Figure 4 is a schematic diagram of a map drawn according to a non-physical shader method in the related art, such as Figure 4As shown, this method also cannot guarantee that the scene is correctly affected by light. All hand-painted brushstroke maps are dead and cannot change with the rotation of the light direction and the rotation of the viewing angle, which will be very uncomfortable.

[0117] Another method is through post-processing. Figure 5 is a schematic diagram of the result of a post-processing method in the related art, such as Figure 5 As shown in the figure, this method is to convert all realistic scene objects into stylized ones through shader code, including: Figure 6 is a schematic diagram of a selection interface of a post-processing program in the related art, such as Figure 6 As shown, open the post-processing program in the engine software, set up the programmable shading pipeline in the drawing, and get the post-processing code; then use the shader code to process the current picture into a stylized cartoon effect. Figure 7 is a schematic diagram of a post-processing effect according to the related art, such as Figure 7 Finally, fine-tune various preset parameters to achieve the post-processing cartoon scene effect you want. Figure 8 is a schematic diagram of a post-processing effect according to the related art, such as Figure 8 shown.

[0118] This method consumes a lot of resources. It needs to store the current picture as a texture (render tex) as large as the screen resolution (such as 1920*1080), and then process this texture to form a stylized effect. The method of obtaining the rendering texture consumes too much resources, which is unacceptable for ordinary mobile phones. This program is not recommended for use on mobile phones. At the same time, it only has one set of parameters that are valid for the entire picture, but there is no way to adjust the performance of each object individually, and it is impossible to achieve a good refined effect, so the effect is not good.

[0119] Another method is texture mapping. Fig. 9 is a schematic diagram of a texture mapping effect according to the related art, such as Fig. 9 As shown, texture mapping is a technology that projects a two-dimensional image onto a three-dimensional model. This process requires the three-dimensional model to have texture coordinates that can create a two-dimensional representation of the three-dimensional model. Textures are used to store high-frequency details and surface information, such as color, transparency, and lighting information. However, this method requires art students to greatly increase the workload and cost, and repeatedly drawing the color, size, and shape of the brush map requires a lot of time.

[0120] Another method is to manually hand-paint the texture. Fig.10 It is a schematic diagram based on an artificial modeling in the related art, such as Fig.10As shown, through manual modeling, that is, directly create a new model in three-dimensional (3D) software; then draw a map for the model, Fig.11 It is a schematic diagram of drawing a map for a model according to one of the related technologies, such as Fig.11 As shown, while expanding the UV coordinates, all the stylized grid points and brush strokes are directly drawn on the map. These stylized grid points and brush strokes will always appear on the same map position and cannot be modified or adjusted. Therefore, this process is very time-consuming and needs to be repeated dozens of times. At the same time, the density, depth, and size of the brush stroke map must be just right, and then merged into a map for output. If we want to modify the position, size, depth, etc. of the brush stroke map again, we cannot do it and can only ask the art students to draw a new map again.

[0121] The original method of drawing brush stroke maps still has the following problems: (1) It greatly increases the workload and cost, and requires repeatedly drawing the color, size, and shape of the brush stroke map, which takes a lot of time; (2) It can only match one model and cannot be adjusted quickly; (3) The stylized brush stroke effect cannot change naturally with light and shadow.

[0122] For stylized brushstroke scene objects, the present invention only needs to provide a model and a common color map. Fig.12 is a schematic diagram of the effect of a shader simulation according to an embodiment of the present invention, such as Fig.12 As shown, through the shader simulation method, a stylized scene object effect with the original painting standard is directly generated; Fig.13 is a schematic diagram of the effect of rendering by a material shader according to an embodiment of the present invention, such as Fig.13 As shown, high-quality stylized fields can be achieved through material shaders.

[0123] The core of the present invention is: in the original light and shadow code, by inserting the original physical shader highlight, shadow, inherent color process, the drawn separate stylized brushstroke map is directly inserted into the original ordinary light and shadow code. This code can be the engine software itself, or the code block of the realistic material effect code provided according to actual needs, so that the shape of the shadow, highlight, and inherent color can be controlled by adding the stylized map, thereby forming a brushstroke feeling and stylized effect. Fig.14 is a schematic diagram of an information processing effect according to an embodiment of the present invention, such as Fig.14 shown.

[0124] Next, the method for producing the stylized brushstroke scene texture provided by the present invention is further introduced. The method for producing the stylized brushstroke scene texture includes:

[0125] The first step is to make a model with inherent color normally. Model it in the digital art creation tool (Digital ContectCreation, referred to as DCC) software. After modeling, in the digital art creation tool software, draw the correct inherent color map according to the original painting requirements, that is, lay a map representing the color of the original object material. After repeated adjustments, you can have a normal basic scene model. Fig.15 is a schematic diagram of a normal basic scene model according to an embodiment of the present invention, such as Fig.15 shown.

[0126] The second step is to go deep into the code block of the original physical shader and light and shadow shader, and directly look for the control modules related to light, shadow and intrinsic color. These codes can be previously written into the system or automatically generated by the engine software. After analyzing the code line by line and summarizing it, determine the location of the light, shadow and intrinsic color code in the shader program, and create a stylized shader effect for the determined location. This includes:

[0127] half Ndotl=saturate(dot(normalWS,lightDirectionWS));

[0128] half3 radiance=lightColor*(lightAttenuation*Ndotl);

[0129] half result=OnmyojiDirectBDRF(brdfDate.diffuse,brdfDate.specular,brdfDate.perceptualRoughness,lightDirectionWS,viewDirectionWS,normalWS)*radiance.

[0130] Among them, the LightingPhysicallyBased method can be used to calculate the light and shadow effects. This method can be obtained by customizing the calculation formula according to actual needs; NDotL=saturate(dot(normalWS,lightDirectionWS)) can be the normal point multiplied by the light direction = absolute value (world space normal point multiplied by the light direction), which is used to obtain the normal point multiplied by the light direction; Radiance=lightColor*lightAttenuation*NDotL can be the light attenuation value = light color multiplied by the light attenuation value provided by the engine software multiplied by the normal point multiplied by the light direction, which is used to obtain the light attenuation value of the target image; Result=OnmyojiDirectBDRF(.....) can be calculated using OnmyojiDirectBDRF to obtain the final result; Return max(0,result) can be used to limit the value of result to above 0;

[0131] half3 HAL=light.direction;

[0132] half NoHAL=saturate(abs(dot(HAL,input.worldSpaceNormal)+1e-5);

[0133] SpecularShal=D_GGX_mobile(bradfDate.roughness,Nohal).

[0134] Among them, HAL can be a half-angle vector value; light.direction can be the light direction, which can be directly obtained from the engine software; NoHAL can be the normal dot multiplied by the half-angle vector, and saturate can be used to take the absolute value; dot is used to indicate the multiplication of the parameters in the brackets, input.worldSpaceNormal can be the world space normal, 1e-5 is used to multiply 1 by 10 to the negative fifth power, that is, 0.000001; SpecularShal can be the final highlight effect, mobile can be the engine software's built-in highlight calculation formula, and bradfDate.roughness can be the engine software's built-in object normal value.

[0135] The third step is to prepare stylized maps. These maps can be stylized brush stroke maps that meet the painting requirements. They can be drawn in PS or provided by the material library directly. These maps include texture points, brush stroke lines, and brush materials. Ultimately, these maps will be used as grayscale images in the stylized shader. Among them, the stylized maps only need to restore the requirements of the original painting designer and the main aesthetic requirements to form the texture and expression of the original painting.

[0136] The fourth step is to directly calculate the grayscale image of the brush in the stylized map and the shadows, light and shadows, and inherent colors in the original code block through the smooth step function (smoothStep) method. That is, the brush is inserted as a grayscale image into the position of the code representing the shadows, light and shadows, and inherent colors for calculation, so as to achieve a combination of light and dark effects. Finally, a stylized brushstroke object effect that changes with light and shadow in real time can be obtained. The smooth step function removes the gradient color levels of the original realistic light and shadow with obvious gradient through threshold calculation, thereby forming a stylized light and shadow effect. Fig.16 is a schematic diagram of realizing a light and dark effect according to an embodiment of the present invention, such as Fig.16 shown.

[0137] The fifth step is to add all the previously prepared stylized brushstroke maps to the shader based on the threshold processing, and use these stylized maps to affect the shape of the original highlights and shadows, thus forming the final stylized effect. Fig.17 is a schematic diagram of a stylized effect according to an embodiment of the present invention, such as Fig.17 shown.

[0138] The present invention brings the following beneficial effects: (1) only inherent color maps need to be produced, and there is no need to draw textures and brush strokes, which greatly saves costs; (2) it can be affected by real-time light and shadow, and the effect is outstanding; (3) the shader algorithm is simple and efficient; (4) the stylized map can be replaced at any time to quickly change the effect.

[0139] Next, the preparation method of the present invention is further introduced.

[0140] The first step is to find a suitable stylized map. Fig.18 is a schematic diagram of a stylized map according to an embodiment of the present invention, such as Fig.18 shown.

[0141] The second step is to add the texture to the shadow and highlight code flow of the physical shader to change the light and shadow effects calculated by the physical shader. Fig.19 is a schematic diagram of a shadow added to a physical shader according to an embodiment of the present invention, such as Fig.19 As shown. Lighting and shading effects that change the physical shader calculations can include:

[0142] Half4 tempDiffuse=dot(mainLight.direction,worldNormal).

[0143] Among them, tempDiffuse is used to represent the light map; mainLight.direction can be the main light source vector angle; worldNormal is used to represent the world space normal.

[0144] The third step is to overlay the stylized light and shadow effects and brush stroke effects with the original inherent color map to form the final rendering effect. Fig. 20 is a schematic diagram of a rendering effect according to an embodiment of the present invention, such as Fig. 20 As shown, the stylized light and shadow effects and brush stroke effects are superimposed on the original inherent color map to obtain a rendered image with brush strokes and stylized effects.

[0145] The fourth step is to fine-tune the parameters based on the final effect.

[0146] The present invention provides the following steps for making stylized brushstroke scene objects: (1) modeling in DCC software such as Maya, drawing a correct intrinsic color map, and establishing a normal basic scene model; (2) determining the code position of a control module related to light, shadow, and intrinsic color in an original PBR light and shadow shader code block; (3) preparing a stylized map, including texture points, brush stroke lines, and brush materials; (4) combining the stylized brush map as a grayscale map with the light and shade effects of shadow, light, and intrinsic color in the original code block through a smoothStep method to obtain a stylized brushstroke object effect that changes with light and shadow in real time; (5) adding the stylized brushstroke map to a shader to form a final stylized effect. The present invention solves the technical problem of high consumption of stylized maps in the current stylized scene construction process that presents a brushstroke effect, and achieves the technical effect of reducing the consumption of stylized maps in the stylized scene construction process that presents a brushstroke effect.

[0147] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0148] The embodiment of the present invention further provides an information processing device, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "unit" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0149] Fig.21 is a structural block diagram of an object processing device according to an embodiment of the present invention. Fig.21 As shown, the object processing device 210 may include: an acquisition unit 211 , a generation unit 212 and a conversion unit 213 .

[0150] The acquisition unit 211 is used to acquire a first target map, wherein the first target map includes target style information.

[0151] The generating unit 212 is configured to add the texture data of the first target texture to the original rendering data of the target model to obtain the target rendering data of the target model, wherein the original rendering data is used to render and display the target model as an original image.

[0152] The conversion unit 213 is used to render and display the target model based on the target rendering data, so as to convert the original image into the target image, wherein the display content of the target image includes: the target model image with the target style information.

[0153] In the information processing device of this embodiment, the present invention directly adds the first target map (a separately drawn stylized brush stroke map) into these code blocks in the original rendering data of the target model (the original light and shadow code), so that the style of the target model can be controlled by the first target map, thereby achieving the technical effect of improving the efficiency of generating stylized models and solving the technical problem of low efficiency in generating stylized models.

[0154] It should be noted that the above-mentioned units can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned units are all located in the same processor; or the above-mentioned units are located in different processors in any combination.

[0155] An embodiment of the present invention further provides a non-volatile storage medium, in which a computer program is stored, wherein the computer program is configured to execute the data processing method of the embodiment of the present invention when executed by a processor.

[0156] Optionally, in this embodiment, the non-volatile storage medium may be configured to store a computer program for performing the following steps:

[0157] S1, obtaining a first target map, wherein the first target map includes target style information;

[0158] S2, adding the texture data of the first target texture to the original rendering data of the target model to obtain the target rendering data of the target model, wherein the original rendering data is used to render and display the target model as an original image;

[0159] S3, rendering and displaying the target model based on the target rendering data to convert the original image into a target image, wherein the display content of the target image includes: a target model with target style information.

[0160] Optionally, in this embodiment, the above-mentioned non-volatile storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0161] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0162] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0163] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0164] S1, obtaining a first target map, wherein the first target map includes target style information;

[0165] S2, adding the texture data of the first target texture to the original rendering data of the target model to obtain the target rendering data of the target model, wherein the original rendering data is used to render and display the target model as an original image;

[0166] S3, rendering and displaying the target model based on the target rendering data to convert the original image into a target image, wherein the display content of the target image includes: a target model with target style information.

[0167] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0168] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0169] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0170] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, 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 units or modules, which can be electrical or other forms.

[0171] 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0172] In addition, each functional unit in each embodiment of the present invention 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 software functional units.

[0173] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product 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.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0174] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. An information processing method, characterized in that: include: Acquire a first target map, wherein the first target map includes target style information; Adding the texture data of the first target texture to the original rendering data of the target model to obtain the target rendering data of the target model, wherein the original rendering data is used to render and display the target model as an original image; Rendering and displaying the target model based on the target rendering data to convert the original image into a target image, wherein the display content of the target image includes: the target model having the target style information; Among them, adding the texture data of the first target map to the original rendering data of the target model to obtain the target rendering data of the target model includes: based on the texture data of the first target map, adjusting the sub-original rendering data in the original rendering data to obtain the target rendering data.

2. The method according to claim 1, characterized in that: The method further comprises: The sub-primitive rendering data is determined in the primitive rendering data based on a target rendering attribute.

3. The method according to claim 2, characterized in that The method further comprises: adjusting the sub-primitive rendering data in the primitive rendering data based on the texture data of the first target texture to obtain the target rendering data, including: Acquire the texture data from the first target texture, wherein the texture data has the target rendering attribute; The sub-original rendering data is adjusted based on the map data to obtain the target rendering data.

4. The method according to claim 3, characterized in that The sub-original rendering data is adjusted based on the texture data to obtain the target rendering data, including: Determining a target threshold based on the map data; The target color scale information is deleted from the sub-original rendering data based on the target threshold to obtain the target rendering data, wherein the target color scale information is used to represent gradient light and shadow.

5. The method according to claim 3, characterized in that: The sub-original rendering data is adjusted based on the texture data to obtain the target rendering data, including: The shape data in the sub-primitive rendering data is adjusted based on the mapping data to obtain the target rendering data, wherein the shape data is used to represent one of the following attributes on the target model: light, shadow, and intrinsic color.

6. The method according to claim 2, characterized in that The target rendering attribute includes at least one of the following: Light attributes, used to determine the light shining on the target model; A shadow attribute, used to determine the shadow that appears on the target model; The intrinsic color attribute is used to determine the material color of the target model.

7. The method according to claim 1, characterized in that Adding the texture data to the original rendering data to obtain the target rendering data includes: The first target map is converted into a grayscale image, and data of the grayscale image is added to the original rendering data to obtain the target rendering data.

8. The method according to claim 1, characterized in that The method further comprises: Acquire a second target map, wherein the second target map is used to represent the material color of the target model; The target model is established based on the second target map.

9. The method according to claim 8, characterized in that Rendering the target model based on the target rendering data to convert the original image into a target image includes: A superposition process is performed on a third target map and the second target map corresponding to the target rendering data to convert the original image into the target image.

10. The method according to any one of claims 1 to 9, characterized in that The first target map is a stylized map including virtual brush traces, and the target rendering data includes target light and shadow data and brush stroke data corresponding to the virtual brush traces.

11. An information processing device, characterized in that: include: An acquisition unit, configured to acquire a first target map, wherein the first target map includes target style information; an adding unit, configured to add the texture data of the first target texture to the original rendering data of the target model to obtain the target rendering data of the target model, wherein the original rendering data is used to render and display the target model as an original image; a rendering unit, configured to render and display the target model based on the target rendering data, so as to convert the original image into a target image, wherein the display content of the target image includes: the target model having the target style information; Among them, the adding unit is used to add the texture data of the first target map to the original rendering data of the target model through the following steps to obtain the target rendering data of the target model: based on the texture data of the first target map, the sub-original rendering data in the original rendering data is adjusted to obtain the target rendering data.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 10 when executed by a processor.

13. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Method for automatically adjusting three-dimensional face model according to one face picture

    CN101968892A

  • Rendering method and device and terminal equipment

    CN111369655A