Rendering method, device, computer device and storage medium
By using grayscale values in the mask texture to determine the luminescence intensity and generating a target color texture, the problem of insufficient realism in rendering two-dimensional objects in existing technologies is solved, achieving a stronger self-illumination effect and greater realism.
Patent Information
- Application Number
- CN202210157049.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-21
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2042-02-21
AI Technical Summary
Existing technologies, when rendering glowing effects on two-dimensional objects, use hand-drawn highlights, resulting in poor realism and an inability to directly display self-illumination effects.
The light intensity of pixels in the color map is determined by using the grayscale values in the mask map, and the target color map is generated through self-illumination processing to directly render the light effect.
It improves the rendering realism of two-dimensional objects, enabling the direct display of self-illumination effects and enhancing the realism and plausibility of the target objects.
Smart Images

Figure CN114529625B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and in particular, to a rendering method and device, a computer device and a storage medium. BACKGROUND
[0002] When rendering a two-dimensional object, the two-dimensional object capable of self-illumination is usually rendered with a light effect, such as rendering a lantern, a gem, etc. with a light effect, so as to improve the authenticity of the rendered two-dimensional object.
[0003] When rendering a two-dimensional object with a light effect, a hand-drawn highlight is usually used to reflect that the two-dimensional object is self-illuminating by using the displayed highlight area. This indirect display of the light effect of the two-dimensional object is less authentic. SUMMARY
[0004] The embodiments of the present disclosure at least provide a rendering method, device, computer device and storage medium.
[0005] In a first aspect, the embodiments of the present disclosure provide a rendering method, comprising: obtaining a color map of a target object and a mask map; a gray value of each first pixel point in the mask map is used to represent an illumination intensity of a second pixel point corresponding to the first pixel point; wherein the second pixel point is located in the color map, and the position of the second pixel point in the color map is consistent with the position of the corresponding first pixel point in the mask map; performing self-illumination processing on the color map based on the mask map to obtain a target color map with a light effect.
[0006] In this way, since the mask map can be used to accurately determine the region of the target object to be rendered with a light effect, and the gray value can be used to determine the corresponding illumination intensity, the region of the target object to be displayed with light can be directly determined in this way, and the mask map and the color map are used for self-illumination processing to obtain a target color map with a light effect. Thus, the target object can be directly rendered with a light effect by using the target color map, and the authenticity is stronger.
[0007] In an optional implementation, the self-illumination processing on the color map based on the mask map to obtain a target color map with a light effect comprises: determining illumination attribute information of each second pixel point based on target illumination configuration information and pixel values of the first pixel points corresponding to the second pixel points respectively; determining target pixel values corresponding to the second pixel points respectively based on the illumination attribute information corresponding to the second pixel points respectively and the pixel values corresponding to the second pixel points respectively; and generating the target color map based on the target pixel values corresponding to the second pixel points respectively.
[0008] In an optional implementation, the target light-emitting configuration information includes at least one of a target light-emitting color and a target light-emitting intensity threshold.
[0009] In an optional implementation, before the target light-emitting configuration information is determined based on the target light-emitting configuration information and the pixel values of the first pixel points corresponding to the second pixel points in the color map, the method further includes: in response to an adjustment operation on the light-emitting configuration information, determining the target light-emitting configuration information.
[0010] In this way, the target light-emitting configuration information can be artificially modified, and more flexible.
[0011] In an optional implementation, the method further includes: obtaining a three-dimensional model of the target object; and rendering the three-dimensional model by using the target color map to obtain a rendered image of the target object.
[0012] In this way, since the target color map has the attribute information of the self-luminous effect generated when the target object is rendered, the rendered image obtained after the three-dimensional model is rendered by using the target color map can reflect the self-luminous effect of the target object, so that the displayed target object is more realistic.
[0013] In an optional implementation, the method further includes: performing a floodlight processing on the rendered image to obtain a target rendered image.
[0014] In this way, compared with the rendered image, the target rendered image after the floodlight processing has the halo effect displayed beside the light-emitting object and the effect of the self-luminous target object on the light illumination of the surrounding objects. These effects are closer to the display effect of the light-emitting object in the display world, so that the rendered and displayed target object is more realistic, and the obtained target rendered image is more consistent with the display logic of the real world.
[0015] In an optional implementation, the method further includes: obtaining a texture map corresponding to the three-dimensional model; and the rendering of the three-dimensional model by using the target color map to obtain the rendered image of the target object includes: performing a rendering on the three-dimensional model by using the target color map and performing a texture rendering on the three-dimensional model by using the texture map to obtain the rendered image of the target object.
[0016] In this way, the obtained rendered image can also have texture characteristics.
[0017] In a second aspect, the embodiments of the present disclosure further provide a rendering device, comprising: an acquisition module, configured to acquire a color map of a target object and a mask map; a gray value of each first pixel point in the mask map is used to represent a light intensity of a second pixel point corresponding to the first pixel point; wherein the second pixel point is located in the color map, and a position of the second pixel point in the color map is consistent with a position of the corresponding first pixel point in the mask map; and a first processing module, configured to perform self-luminous processing on the color map based on the mask map to obtain a target color map with a luminous effect.
[0018] In an optional implementation, when the first processing module performs self-luminous processing on the color map based on the mask map to obtain the target color map with the luminous effect, the first processing module is configured to: determine luminous attribute information of each second pixel point based on target luminous configuration information and pixel values of the first pixel points corresponding to the second pixel points respectively; determine target pixel values corresponding to the second pixel points respectively based on the luminous attribute information corresponding to the second pixel points respectively and the pixel values corresponding to the second pixel points respectively; and generate the target color map based on the target pixel values corresponding to the second pixel points respectively.
[0019] In an optional implementation, the target luminous configuration information comprises at least one of the following: a target luminous color and a target luminous intensity threshold.
[0020] In an optional implementation, before the first processing module determines the luminous attribute information of each second pixel point based on the target luminous configuration information and the pixel values of the first pixel points corresponding to the second pixel points respectively, the first processing module is further configured to: determine the target luminous configuration information in response to an adjustment operation on the luminous configuration information.
[0021] In an optional implementation, the rendering device further comprises a second processing module, configured to: acquire a three-dimensional model of the target object; and perform rendering processing on the three-dimensional model by using the target color map to obtain a rendering image of the target object.
[0022] In an optional implementation, the second processing module is further configured to: perform a floodlight processing on the rendering image to obtain a target rendering image.
[0023] In an alternative implementation, the second processing module is further configured to: acquire a texture map corresponding to the three-dimensional model; and when rendering the three-dimensional model using the target color map to obtain a rendering image of the target object, the second processing module is configured to render the three-dimensional model using the target color map and perform texture rendering on the three-dimensional model using the texture map to obtain the rendering image of the target object.
[0024] In a third aspect, the disclosure provides a computer device, a processor, and a memory. The memory stores machine readable instructions executable by the processor. The processor is configured to execute the machine readable instructions stored in the memory. When the machine readable instructions are executed by the processor, the machine readable instructions perform the steps of the first aspect or any possible implementation of the first aspect.
[0025] In a fourth aspect, the disclosure provides a computer readable storage medium. The computer readable storage medium stores a computer program. When the computer program is executed, the computer program performs the steps of the first aspect or any possible implementation of the first aspect.
[0026] The effects of the rendering device, the computer device, and the computer readable storage medium are described above in the description of the rendering method, and will not be repeated here.
[0027] In order to make the above objectives, characteristics and advantages of the disclosure more apparent, the following will describe a preferred embodiment in detail, and the accompanying drawings will be described as follows. BRIEF DESCRIPTION OF DRAWINGS
[0028] In order to more clearly illustrate the technical solutions of the embodiments of the disclosure, the following will briefly introduce the drawings needed to be used in the embodiments. The drawings are incorporated into the specification and form a part of the specification. The drawings show the embodiments consistent with the disclosure, and are used to explain the technical solutions of the disclosure together with the specification. It should be understood that the following drawings only show some embodiments of the disclosure, and therefore should not be considered as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0029] Figure 1 A flow chart of a rendering method provided by an embodiment of the disclosure is shown;
[0030] Figure 2 A schematic diagram of a color map provided by an embodiment of the disclosure is shown;
[0031] Figure 3A schematic diagram of a mask map provided by an embodiment of the present disclosure is shown.
[0032] Figure 4 An operation interface diagram of adjusting light-emitting configuration information provided by an embodiment of the present disclosure is shown.
[0033] Figure 5 A schematic diagram of a three-dimensional model of a target object provided by an embodiment of the present disclosure is shown.
[0034] Figure 6 A comparison diagram before and after the rendering image is processed by a floodlight provided by an embodiment of the present disclosure is shown.
[0035] Figure 7 A schematic diagram of a rendering device provided by an embodiment of the present disclosure is shown.
[0036] Figure 8 A schematic diagram of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0037] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be described below in connection with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure and are not all the embodiments. The components of the embodiments of the present disclosure described and shown herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the claimed present disclosure, but only represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0038] It is found through research that, for target objects such as lanterns and gemstones that can self-illuminate, after rendering the light-emitting effect of the target objects, the display of these objects can be more consistent with the display logic in the real world, thereby improving the authenticity of the target objects after rendering and display. When rendering the light-emitting effect of a target object, a hand-drawn method is usually used to add a highlight effect to the target object to indirectly express the self-illumination effect of the target object. Since this method can only express the light-emitting effect of the target object indirectly and cannot make the target object directly display the light-emitting effect, the authenticity of the target object after rendering is poor.
[0039] Based on the above research, the present disclosure provides a rendering method, which determines the light intensity of the corresponding second pixel point in the color map by using the gray value of each first pixel point in the mask map of the target object, so as to perform self-luminous processing on the color map by using the mask map. Since the region of the target object to be rendered with the light-emitting effect can be accurately determined by using the mask map, and the corresponding light-emitting intensity can also be determined by using the gray value, the region of the target object to be displayed with the light-emitting effect can be directly determined in this way, and the mask map and the color map are used for self-luminous processing to obtain the target color map with the light-emitting effect. Thus, the target object can be directly rendered with the light-emitting effect by using the target color map, and the authenticity is stronger.
[0040] The above-mentioned defects are the results of the inventors' practice and careful research, and therefore, the discovery process of the above-mentioned problems and the solutions proposed by the present disclosure to solve the above-mentioned problems should be the contributions of the inventors to the present disclosure.
[0041] It should be noted that similar reference numerals and letters refer to similar items throughout the accompanying drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0042] To facilitate the understanding of the present embodiment, first, a rendering method disclosed by the present embodiment is introduced in detail, and the execution subject of the rendering method provided by the present embodiment is generally a computer device with certain computing capability, which for example includes a terminal device or a server or other processing device. The terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementation manners, the rendering method can be realized by a processor calling computer readable instructions stored in a memory.
[0043] The rendering method provided by the embodiments of the present disclosure is described below. The rendering method provided by the embodiments of the present disclosure can be used to determine a target color map with self-luminous effect of a target object, and the target color map can be specifically applied to rendering the self-luminous effect of the target object. The target object described herein can specifically include a two-dimensional object, such as a cartoon image, a game character, a virtual pet, and the like. Therefore, the rendering method provided by the embodiments of the present disclosure can be specifically applied to different application fields such as game picture production or generation, animation and film production, and the like. After the target color map is determined by using the rendering method provided by the embodiments of the present disclosure, the two-dimensional object can be further rendered by using the determined target color map, so that the target object is more realistic and reasonable through the self-luminous effect displayed by the rendering.
[0044] Referring to Figure 1 FIG. 1 is a flowchart of a rendering method provided by the embodiments of the present disclosure, and the method includes steps S101-S102, wherein:
[0045] S101: Obtain a color map and a mask map of a target object; a gray value of each first pixel point in the mask map is used to represent a luminous intensity of a second pixel point corresponding to the first pixel point; wherein the second pixel point is located in the color map, and a position of the second pixel point in the color map is consistent with a position of the corresponding first pixel point in the mask map;
[0046] S102: Perform self-luminous processing on the color map based on the mask map to obtain a target color map with luminous effect.
[0047] The embodiments of the present disclosure can obtain a mask map corresponding to a target object, which can reflect the luminous intensity of each pixel point, and perform self-luminous processing on the color map corresponding to the target object, so as to obtain a target color map with luminous effect. Since the mask map can be used to accurately determine the region of the target object to be rendered with luminous effect, and the gray value can be used to determine the corresponding luminous intensity, the region of the target object to be displayed with luminous effect can be directly determined in this way, and the mask map and the color map are used for self-luminous processing to obtain the target color map with luminous effect. Therefore, the target object can be directly rendered with luminous effect by using the target color map, and the reality is stronger.
[0048] The above S101-S102 are described in detail below.
[0049] For the above S101, the color map and the mask map of the target object are described respectively.
[0050] First, for the color map of the target object, referring to Figure 2As shown, it is a schematic diagram of a color map provided by an embodiment of the present disclosure, and in fact different regions on the color map have different colors. Among them, since the color map is specifically composed of a plurality of pixel points, which are recorded as second pixel points for convenience of distinction; the plurality of second pixel points in the color map each correspond to a specific color, and the color on the second pixel point can render the color of the corresponding position of the target object.
[0051] Specifically, the color map is specifically used to add color effects when rendering the target object, and in a specific implementation, the color map is specifically used to add color effects when rendering the three-dimensional model corresponding to the target object, that is, to realize the coloring processing of the three-dimensional model. After rendering the three-dimensional model of the target object by using the color map, the obtained rendering image can specifically reflect the patterns and corresponding colors of the five senses and clothing.
[0052] Among them, the three-dimensional model corresponding to the target object can be referred to the description below, which will not be repeated here.
[0053] For the mask map corresponding to the target object, refer to Figure 3 As shown, it is a schematic diagram of a mask map provided by an embodiment of the present disclosure. The mask map specifically includes a plurality of pixel points corresponding to different gray values, which are recorded as first pixel points for convenience of distinction. When the mask map is obtained, since the color map and the mask map to be obtained each correspond to the target object, the size of the mask map can be determined according to the size of the color map, and thus the one-to-one correspondence relationship between the first pixel points in the mask map and the second pixel points in the color map can be determined.
[0054] For each of the plurality of first pixel points in the mask map, the gray value corresponding to the first pixel point can be used to determine the light intensity of the first pixel point when rendering the self-luminous effect. For example, if the gray value of the first pixel point is smaller, the color reflected in the mask map is darker, and the light intensity during rendering is lower; if the gray value of the first pixel point is larger, the color reflected in the mask map is lighter, and the light intensity during rendering is higher.
[0055] For example, taking the range of gray values as 0-255, if the gray value of a certain first pixel point is 0, the corresponding black color will be presented in the mask map, and the light intensity during rendering is the lowest, which can be considered as no light emission. If the gray value of a certain first pixel point is 255, the corresponding white color will be presented in the mask map, and the light intensity during rendering is the highest, which can be considered as unobstructed full-brightness display. For the first pixel point with a gray value between 0 and 255, for example, the first pixel point with a gray value of 200, the corresponding gray color will be presented in the mask map, and the light will be emitted during rendering, but the light brightness under the maximum light intensity will not be displayed, but a slightly dark light effect will be displayed.
[0056] Therefore, by using a mask map, the luminescence intensity of each second pixel on the color map can be determined when rendering the self-illumination effect. By processing the color map using the mask map, the luminescence color and other attribute information of the self-illumination effect can also be further determined based on the colors of each second pixel in the color map.
[0057] Regarding S102 above, if the color map and mask map of the target object are determined according to S101 above, the mask map can be used to perform self-illumination processing on the color map to obtain a target color map with an illuminating effect.
[0058] In specific implementation, the target color map can be obtained in the following way: based on the target luminescence configuration information and the pixel value of the first pixel corresponding to each second pixel in the color map, the luminescence attribute information of each second pixel is determined; based on the luminescence attribute information corresponding to each second pixel and the pixel value corresponding to each second pixel, the target pixel value corresponding to each second pixel is determined; based on the target pixel value corresponding to each second pixel, the target color map is generated.
[0059] The target luminescence configuration information includes at least one of the following: target luminescence color and target luminescence intensity threshold. Specifically, before determining the luminescence attribute information of each second pixel in the color map using the target luminescence configuration information, the target luminescence configuration information can also be determined in response to an adjustment operation on the luminescence configuration information.
[0060] For example, see Figure 4 The diagram shown illustrates an operation interface for adjusting light emission configuration information according to an embodiment of this disclosure. Specifically, the operation interface includes a color picker 41 for determining the target light emission color, a color card 42 for displaying the currently selected color, a color wheel 43 for directly selecting colors, a color selection card 44 for further color selection from the selected color wheel color, a color band 45 supporting color channel selection, and a display box 46 for displaying the currently selected value. These different types of color picking tools can all be used to determine the target light emission color.
[0061] In addition, the user interface also includes buttons for adjusting the target luminous intensity threshold. The slider 47 is used to determine the maximum selectable range of the target luminous intensity threshold; adjustments to the threshold must not exceed this maximum range. Within this maximum range, the target luminous intensity can be adjusted using the slider 48.
[0062] Here, the luminous intensity of each first pixel point in the mask map can be determined by the gray value, and the difference in luminous intensity between each first pixel point in the mask map when performing self-luminous processing can be specifically reflected. The target luminous intensity threshold described here is specifically used to affect the maximum luminous intensity of each first pixel point.
[0063] After adjusting the luminous configuration information, the luminous attribute information of each second pixel point can be determined by using the determined target luminous configuration information and the pixel value of the first pixel point corresponding to each second pixel point in the color map. Specifically, the luminous attribute information of each second pixel point is related to self-luminous processing and includes attribute information reflecting the luminous color and luminous intensity of the second pixel point. The target pixel value corresponding to each second pixel point is obtained by using the luminous attribute information corresponding to each second pixel point and the pixel value corresponding to each second pixel point, and specifically includes the related attribute information when rendering the self-luminous effect at each second pixel point. Therefore, the target color map for performing self-luminous rendering can be generated by using the target pixel value corresponding to each second pixel point.
[0064] In another embodiment of the present disclosure, after obtaining the target color map of the target object, the target object can also be rendered by using the target color map to obtain a rendered image of the target object. In this way, the self-luminous effect of the target object can be displayed in the obtained rendered image, making the displayed target object more realistic.
[0065] In specific implementation, the rendered image of the target object can be determined in the following manner: obtaining a three-dimensional model of the target object; rendering the three-dimensional model by using the target color map to obtain a rendered image of the target object.
[0066] Among them, for the three-dimensional model of the target object, since the target object is a virtual object and does not actually exist, the body features such as height and fatness of the target object can be represented by constructing a three-dimensional model corresponding to the target object, and the three-dimensional model is used to simulate the image that the target object hopes to present in the real world. For example, see Figure 5 The three-dimensional model of the target object provided by the embodiment of the present disclosure is a virtual model constructed artificially; for the three-dimensional model, specific features such as facial features and dressing features can also be refined, which are not shown in Figure 5 In addition, for different target objects, the corresponding three-dimensional model can be determined accordingly. The three-dimensional model generally includes a plurality of vertices located on the surface of the three-dimensional model and a mesh formed by the mutual connection relationship between the vertices.
[0067] Thus, the three-dimensional model is rendered by using the target color map, so that the rendering image of the target object is obtained, and the rendered target object further displays a self-luminous effect.
[0068] In addition, after obtaining the rendering image of the target object, the rendering image can be subjected to a bloom process to obtain a target rendering image. Here, the bloom process can be performed by using a bloom post-processing method, which will not be described in detail herein.
[0069] For example, referring to FIG. 6, Figure 6 FIG. 6 shows a comparison between a rendering image before and after a bloom process is performed on the rendering image, Figure 6 (a) shows a rendering image of a target object, Figure 6 (b) shows a target rendering image obtained by performing a bloom process on the rendering image in (a). Compared with the rendering image, the target rendering image after the bloom process has a halo effect displayed beside the luminous object and an effect of the self-luminous target object on the light illumination of the surrounding objects. These effects are closer to the display effect of the luminous object in the display world, so that the target object displayed by the rendering is more realistic, and the target rendering image is more consistent with the display logic of the real world.
[0070] In another embodiment of the present disclosure, in addition to rendering the three-dimensional model by using the target color map, the three-dimensional model can be further rendered by using a texture map corresponding to the three-dimensional model to obtain a rendering image of the target object. The texture map can be used to change the appearance of the target object, such as making a certain property of the surface of the target object exhibit anisotropy, so that the target object changes in a manner not limited to diffuse reflection color, concave-convex effect, highlight, opacity, and the like.
[0071] Specifically, in the texture rendering, a mapping method can be established to correspond the property of the surface of the target object with the data of the corresponding position of the texture map, and then the data of the corresponding position of the texture map is used to change the property of the surface of the target object, so that the appearance of the surface of the target object changes in texture. Thus, in the obtained rendering image, in addition to the color and luminous effect of the target object, the texture characteristics of the object, such as smoothness or roughness, can be displayed to represent the material characteristics of the luminous object.
[0072] In addition, since the rendering method provided by the embodiment of the present disclosure, the specific calculation involved includes self-luminous processing and map rendering using the mask map and the color map, and the required computing power is small when performing these calculations. Therefore, the rendering method provided by the embodiment of the present disclosure can make the object of the sight mark more realistic, and the requirement for the computer device is also lower, and it is easier to deploy in a computer device such as a mobile device.
[0073] Meanwhile, since the rendering method provided by the embodiment of the present disclosure requires less computing power, and can make the two-dimensional object display the self-luminous effect and the halo effect after rendering, it can support the computer device to generate continuous pictures for the two-dimensional object, such as generating animation pictures or movie pictures. Compared with the way of determining the map for rendering frame by frame or the way of pipeline post-processing, the efficiency is also higher.
[0074] The rendering method provided by the present disclosure determines the light intensity of the corresponding second pixel point in the color map by using the gray value of each first pixel point in the mask map of the target object, so as to perform self-luminous processing on the color map by using the mask map. Since the mask map can accurately determine the area of the target object to be rendered with the light-emitting effect, and the gray value can be used to adjust the light-emitting intensity, the area of the target object to be displayed with light-emitting effect can be directly determined in this way, and the mask map is used to perform self-luminous processing on the color map to obtain a target color map with light-emitting effect, so that the target object can be directly rendered with light-emitting effect by using the target color map, and the reality is stronger.
[0075] Those skilled in the art can understand that in the above method of the specific embodiment, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0076] Based on the same inventive concept, the present disclosure also provides a rendering device corresponding to the rendering method. Since the principle of solving the problem of the device in the embodiment of the present disclosure is similar to the above-mentioned rendering method of the embodiment of the present disclosure, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described.
[0077] Referring to Figure 7 FIG. 7 is a schematic diagram of a rendering device provided by an embodiment of the present disclosure. The device comprises an acquisition module 71 and a first processing module 72.
[0078] The acquisition module 71 is configured to acquire a color map of a target object and a mask map. A gray value of each first pixel point in the mask map is used to represent a light intensity of a second pixel point corresponding to the first pixel point. The second pixel point is located in the color map, and a position of the second pixel point in the color map is consistent with a position of the corresponding first pixel point in the mask map.
[0079] The first processing module 72 is configured to perform self-luminous processing on the color map based on the mask map to obtain a target color map with a light-emitting effect.
[0080] In an optional implementation, when the first processing module 72 performs self-luminous processing on the color map based on the mask map to obtain a target color map with a light-emitting effect, the first processing module 72 is configured to: determine light-emitting attribute information of each second pixel point based on target light-emitting configuration information and pixel values of first pixel points corresponding to the second pixel point respectively; determine target pixel values corresponding to the second pixel point respectively based on the light-emitting attribute information corresponding to the second pixel point respectively and the pixel values corresponding to the second pixel point respectively; and generate the target color map based on the target pixel values corresponding to the second pixel point respectively.
[0081] In an optional implementation, the target light-emitting configuration information includes at least one of the following: a target light-emitting color and a target light-emitting intensity threshold.
[0082] In an optional implementation, before the first processing module 72 determines the light-emitting attribute information of each second pixel point based on target light-emitting configuration information and pixel values of first pixel points corresponding to the second pixel point respectively, the first processing module 72 is further configured to: determine the target light-emitting configuration information in response to an adjustment operation on light-emitting configuration information.
[0083] In an optional implementation, the rendering device further includes a second processing module 73 configured to: acquire a three-dimensional model of the target object; and perform rendering processing on the three-dimensional model by using the target color map to obtain a rendering image of the target object.
[0084] In an optional implementation, the second processing module 73 is further configured to: perform floodlight processing on the rendering image to obtain a target rendering image.
[0085] In an alternative implementation, the second processing module 73 is further configured to: acquire a texture map corresponding to the three-dimensional model; and when rendering the three-dimensional model using the target color map to obtain a rendering image of the target object, the second processing module 73 is configured to: render the three-dimensional model using the target color map and perform texture rendering on the three-dimensional model using the texture map to obtain the rendering image of the target object.
[0086] The processing flow of each module in the device and the interaction flow between the modules can refer to the related description in the above method embodiments, and will not be described in detail here.
[0087] The present disclosure also provides a computer device, as shown in Figure 8 The computer device structure schematic diagram provided by the present disclosure includes:
[0088] a processor 10 and a memory 20; the memory 20 stores machine readable instructions executable by the processor 10, and the processor 10 is configured to execute the machine readable instructions stored in the memory 20; when the machine readable instructions are executed by the processor 10, the processor 10 performs the following steps:
[0089] acquire a color map and a mask map of a target object; the gray value of each first pixel point in the mask map is used to represent the luminous intensity of a second pixel point corresponding to the first pixel point; wherein the second pixel point is located in the color map, and the position in the color map is consistent with the position of the corresponding first pixel point in the mask map; perform self-luminous processing on the color map based on the mask map to obtain a target color map with luminous effect.
[0090] The memory 20 includes an internal memory 210 and an external memory 220; the internal memory 210 is also called an internal storage, and is used to temporarily store operation data in the processor 10 and exchange data with the external memory 220 such as a hard disk; the processor 10 exchanges data with the external memory 220 through the internal memory 210.
[0091] The specific execution process of the instructions can refer to the steps of the rendering method described in the present disclosure, which will not be described here.
[0092] The present disclosure also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to perform the steps of the rendering method described in the above method embodiments. The storage medium can be a volatile or non-volatile computer readable storage medium.
[0093] The embodiment of the present disclosure further provides a computer program product carrying program codes, the program codes comprising instructions for executing the steps of the rendering method described in the above method embodiments, which can be specifically referred to the above method embodiments and will not be repeated here.
[0094] The computer program product can be specifically implemented by means of hardware, software or combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium. In another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) or the like.
[0095] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system and device can refer to the corresponding process in the above method embodiments, which will not be repeated here. In several embodiments provided by the present disclosure, it should be understood that the disclosed system, device and method can be implemented by other means. The above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interface, device or unit, which can be electrical, mechanical or other forms.
[0096] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment.
[0097] In addition, each functional unit in each embodiment of the present disclosure can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0098] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a nonvolatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present disclosure essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0099] Finally, it should be noted that: the above-described embodiments are only specific embodiments of the present disclosure, used to illustrate the technical solutions of the present disclosure, and not to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art who is familiar with the technology in the art can still make modifications or easily think of changes to the technical solutions described in the foregoing embodiments, or make equivalent replacements to some of the technical features; and these modifications, changes or replacements do not cause the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. A rendering method, characterized by, The method comprises: obtaining a color map and a mask map of a target object; a gray value of each first pixel point in the mask map is used to represent the light intensity of a corresponding second pixel point; wherein the second pixel point is located in the color map, and the position of the second pixel point in the color map is consistent with the position of the corresponding first pixel point in the mask map; based on the mask map, performing self-luminous processing on the color map to obtain a target color map with a luminous effect; the method further comprises: based on target luminous configuration information and pixel values of the first pixel points corresponding to each second pixel point in the color map, determining the luminous attribute information of the second pixel points; based on the luminous attribute information corresponding to each second pixel point and the pixel value corresponding to each second pixel point, determining the target pixel value corresponding to each second pixel point; based on the target pixel value corresponding to each second pixel point, generating the target color map.
2. The method of claim 1, wherein, The target luminous configuration information comprises at least one of the following: target luminous color and target luminous intensity threshold.
3. The method according to claim 1 or 2, characterized in that, The method further comprises: in response to an adjustment operation on the luminous configuration information, determining the target luminous configuration information.
4. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: obtaining a three-dimensional model of the target object; rendering the three-dimensional model using the target color map to obtain a rendering image of the target object.
5. The method of claim 4, wherein, The method further comprises: performing floodlight processing on the rendering image to obtain a target rendering image.
6. The method of claim 4, wherein, The method further comprises: obtaining a texture map corresponding to the three-dimensional model; the method further comprises: performing rendering on the three-dimensional model using the target color map and performing texture rendering on the three-dimensional model using the texture map to obtain the rendering image of the target object.
7. A rendering device, characterized in that The method comprises: an obtaining module, configured to obtain a color map and a mask map of a target object; a gray value of each first pixel point in the mask map is used to represent the light intensity of a corresponding second pixel point; wherein the second pixel point is located in the color map, and the position of the second pixel point in the color map is consistent with the position of the corresponding first pixel point in the mask map; a first processing module, configured to perform self-luminous processing on the color map based on the mask map to obtain a target color map with a luminous effect; the first processing module is specifically configured to: based on target luminous configuration information and pixel values of the first pixel points corresponding to each second pixel point in the color map, determine the luminous attribute information of the second pixel points; based on the luminous attribute information corresponding to each second pixel point and the pixel value corresponding to each second pixel point, determine the target pixel value corresponding to each second pixel point; based on the target pixel value corresponding to each second pixel point, generate the target color map. determine a target pixel value corresponding to each of the second pixel points based on the light-emitting attribute information corresponding to each of the second pixel points and the pixel value corresponding to each of the second pixel points; generate the target color map based on the target pixel value corresponding to each of the second pixel points.
8. A computer device, comprising: The method comprises the following steps: a processor and a memory, wherein the memory stores machine readable instructions executable by the processor, and the processor is configured to execute the machine readable instructions stored in the memory, and the machine readable instructions, when executed by the processor, cause the processor to perform the steps of the rendering method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program, when executed by a computer device, causes the computer device to perform the steps of the rendering method according to any one of claims 1 to 6.