Edge light rendering method, device, computer equipment and storage medium

By using three-dimensional models and lighting models determined by lighting direction in edge light rendering technology, the problem of poor edge light rendering effect in the existing technology is solved, and an edge light rendering effect that is more realistic and conforms to natural laws is achieved, meeting the rendering needs of virtual objects.

CN114529655BActive Publication Date: 2025-04-11BEIJING SWEET SUGARSOFT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210158133.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-21
Publication Date
2025-04-11
Estimated Expiration
2042-02-21

AI Technical Summary

Technical Problem

When rendering edge light in the prior art, it usually only renders according to the camera direction, resulting in the entire object to be rendered being covered by edge light, which cannot meet the special rendering needs of virtual objects such as two-dimensional objects.

Method used

By obtaining a three-dimensional model of the target object, and determining the first lighting model and the second lighting model based on the camera direction and lighting direction, it is used to characterize the edge rendering information and the backlight rendering information, respectively, and then perform edge light rendering.

Benefits of technology

It realizes a more realistic and natural reflection law edge light rendering effect, ensuring that edge light only appears on the backlight surface of the target object, and does not affect the light and shadow level of the light-receiving surface, and meets the rendering needs of virtual objects such as two-dimensional objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114529655B_ABST
    Figure CN114529655B_ABST
Patent Text Reader

Abstract

The present disclosure provides an edge light rendering method, apparatus, computer equipment and storage medium, wherein the method comprises: obtaining a three-dimensional model of a target object, and determining a first illumination model corresponding to the target object based on a camera direction corresponding to the three-dimensional model; the first illumination model is used to characterize edge rendering information of the target object in the camera direction; based on the first illumination model, determining an edge rendering model used to characterize an edge light rendering area corresponding to the target object; and, based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model, determining a second illumination model of the target object, the second illumination model is used to characterize backlight rendering information of the target object, wherein the backlight rendering information is used to characterize the probability that each vertex of the three-dimensional model is located on the backlight surface in the illumination direction; and performing edge light rendering on the target object based on the second illumination model and the edge rendering model corresponding to the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to an edge light rendering method, device, computer equipment and storage medium. Background Art

[0002] When rendering two-dimensional objects such as cartoon characters, edge light rendering is added when rendering the two-dimensional objects in order to improve the rendering effect of the two-dimensional objects after rendering and display.

[0003] In the related art, when edge light rendering is performed, edge light rendering is often performed only according to the current camera direction. Although this can achieve the edge light rendering effect, the entire object to be rendered is often covered by the edge light. The edge light rendering effect of virtual objects with special rendering requirements such as two-dimensional objects needs to be improved. Summary of the invention

[0004] The embodiments of the present disclosure at least provide an edge light rendering method, apparatus, computer equipment, and storage medium.

[0005] In a first aspect, an embodiment of the present disclosure provides an edge light rendering method, comprising:

[0006] Acquire a three-dimensional model of a target object, and determine a first illumination model corresponding to the target object based on a camera direction corresponding to the three-dimensional model; the first illumination model is used to characterize edge rendering information of the target object in the camera direction, wherein the edge rendering information is used to represent the probability that each vertex of the three-dimensional model is an edge;

[0007] Based on the first illumination model, an edge rendering model for characterizing an edge light rendering area corresponding to the target object is determined; and based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model, a second illumination model of the target object is determined, the second illumination model being used to characterize backlight rendering information of the target object, wherein the backlight rendering information is used to characterize the probability that each vertex of the three-dimensional model is located on the backlight surface under the illumination direction;

[0008] Based on the second illumination model corresponding to the target object and the edge rendering model, edge light rendering is performed on the target object.

[0009] In a possible implementation, determining the first illumination model corresponding to the target object based on the camera direction corresponding to the three-dimensional model includes:

[0010] Determine the normal direction corresponding to each vertex in the three-dimensional model;

[0011] For any of the vertices, based on a camera direction corresponding to the three-dimensional model and a normal direction corresponding to the vertex, determining edge rendering information corresponding to the vertex;

[0012] The edge rendering information corresponding to each vertex constitutes the first illumination model.

[0013] In a possible implementation manner, the method further includes:

[0014] In response to a range adjustment instruction, obtaining a first target parameter corresponding to the edge rendering information and carried in the range adjustment instruction; wherein the first target parameter is used to adjust the edge range;

[0015] The edge light range of the target object is updated based on the first target parameter, and the target object is rendered according to the updated edge light range.

[0016] In this way, by adjusting the edge light range, the edge light rendering effect can meet user needs.

[0017] In a possible implementation, determining, based on the first illumination model, an edge rendering model for characterizing an edge light rendering area corresponding to the target object includes:

[0018] For any of the vertices, performing a power operation on the edge rendering information corresponding to the vertex based on a preset second target parameter; wherein the second target parameter is used to represent the size of an exponent when performing the power operation;

[0019] The edge rendering information after the power operation processing corresponding to each vertex constitutes the edge rendering model.

[0020] In this way, by performing a power operation on the edge rendering information, the numerical difference between each piece of edge rendering information can be expanded, thereby accurately determining the edge light range that needs to be edge light rendered, thereby achieving a better edge light rendering effect.

[0021] In a possible implementation, determining the second illumination model of the target object based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model includes:

[0022] Determine the normal direction corresponding to each vertex in the three-dimensional model;

[0023] For any of the vertices, based on the illumination direction and the normal direction corresponding to the vertex, determine the light-receiving surface rendering information corresponding to the vertex; the light-receiving surface rendering information is used to characterize the light-receiving surface range size of the target object;

[0024] Based on the light-receiving surface rendering information corresponding to each vertex, the backlight surface rendering information corresponding to each vertex is determined, and the backlight surface rendering information corresponding to each vertex constitutes the second illumination model.

[0025] In this way, by adding a second lighting model determined based on the three-dimensional model and the lighting direction corresponding to the three-dimensional model for edge light rendering, the edge light finally generated is only on the backlight side of the target object, and does not affect the light and shadow levels of the illuminated side of the target object, so that the edge light rendering effect is better.

[0026] In a possible implementation, performing edge light rendering on the target object based on the second illumination model corresponding to the target object and the edge rendering model includes:

[0027] Superimposing the second illumination model and the edge rendering model to obtain a target rendering model;

[0028] Based on the target rendering model, edge light rendering is performed on the target object.

[0029] In this way, by superimposing the second illumination model and the edge rendering model, the target rendering model finally obtained can meet the rendering requirements in multiple dimensions, so that the edge light rendering effect is better.

[0030] In a possible implementation manner, the method further includes:

[0031] Receiving edge color information corresponding to the three-dimensional model;

[0032] The performing edge light rendering on the target object based on the target rendering model includes:

[0033] Based on the target rendering model and the edge color information, edge light rendering is performed on the target object.

[0034] In a second aspect, the embodiment of the present disclosure further provides an edge light rendering device, comprising:

[0035] an acquisition module, configured to acquire a three-dimensional model of a target object, and determine a first illumination model corresponding to the target object based on a camera direction corresponding to the three-dimensional model; the first illumination model is used to characterize edge rendering information of the target object in the camera direction, wherein the edge rendering information is used to represent a probability that each vertex of the three-dimensional model is an edge;

[0036] A determination module, configured to determine, based on the first illumination model, an edge rendering model for characterizing an edge light rendering area corresponding to the target object; and, based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model, determine a second illumination model for the target object, wherein the second illumination model is used to characterize backlight rendering information of the target object, wherein the backlight rendering information is used to characterize the probability that each vertex of the three-dimensional model is located on the backlight surface under the illumination direction;

[0037] A rendering module is used to perform edge light rendering on the target object based on a second illumination model corresponding to the target object and the edge rendering model.

[0038] In a possible implementation manner, the acquisition module, when determining the first illumination model corresponding to the target object based on the camera direction corresponding to the three-dimensional model, is used to:

[0039] Determine the normal direction corresponding to each vertex in the three-dimensional model;

[0040] For any of the vertices, based on a camera direction corresponding to the three-dimensional model and a normal direction corresponding to the vertex, determining edge rendering information corresponding to the vertex;

[0041] The edge rendering information corresponding to each vertex constitutes the first illumination model.

[0042] In a possible implementation manner, the rendering module is further used for:

[0043] In response to a range adjustment instruction, obtaining a first target parameter corresponding to the edge rendering information and carried in the range adjustment instruction; wherein the first target parameter is used to adjust the edge range;

[0044] The edge light range of the target object is updated based on the first target parameter, and the target object is rendered according to the updated edge light range.

[0045] In a possible implementation manner, when determining the edge rendering model for characterizing the edge light rendering area corresponding to the target object based on the first illumination model, the determining module is configured to:

[0046] For any of the vertices, performing a power operation on the edge rendering information corresponding to the vertex based on a preset second target parameter; wherein the second target parameter is used to represent the size of an exponent when performing the power operation;

[0047] The edge rendering information after the power operation processing corresponding to each vertex constitutes the edge rendering model.

[0048] In a possible implementation manner, the determination module, when determining the second illumination model of the target object based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model, is configured to:

[0049] Determine the normal direction corresponding to each vertex in the three-dimensional model;

[0050] For any of the vertices, based on the illumination direction and the normal direction corresponding to the vertex, determine the light-receiving surface rendering information corresponding to the vertex; the light-receiving surface rendering information is used to characterize the light-receiving surface range size of the target object;

[0051] Based on the light-receiving surface rendering information corresponding to each vertex, the backlight surface rendering information corresponding to each vertex is determined, and the backlight surface rendering information corresponding to each vertex constitutes the second illumination model.

[0052] In a possible implementation manner, the rendering module, when performing edge light rendering on the target object based on the second illumination model corresponding to the target object and the edge rendering model, is configured to:

[0053] Superimposing the second illumination model and the edge rendering model to obtain a target rendering model;

[0054] Based on the target rendering model, edge light rendering is performed on the target object.

[0055] In a possible implementation manner, the rendering module is further used for:

[0056] Receiving edge color information corresponding to the three-dimensional model;

[0057] The rendering module, when performing edge light rendering on the target object based on the target rendering model, is used to:

[0058] Based on the target rendering model and the edge color information, edge light rendering is performed on the target object.

[0059] In a third aspect, an embodiment of the present disclosure further provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.

[0060] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.

[0061] For a description of the effects of the edge light rendering apparatus, computer device, and computer readable storage medium, please refer to the description of the edge light rendering method, which will not be repeated here.

[0062] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments are briefly introduced below.

[0064] Figure 1 A flow chart of an edge light rendering method provided by an embodiment of the present disclosure is shown;

[0065] Figure 2 A schematic diagram of a three-dimensional model of a target object in the edge light rendering method provided by an embodiment of the present disclosure is shown;

[0066] Figure 3 A flowchart showing a specific method for determining a first illumination model corresponding to a target object in the edge light rendering method provided by an embodiment of the present disclosure;

[0067] Figure 4 A flowchart showing a specific method for determining a second illumination model corresponding to a target object in the edge light rendering method provided by an embodiment of the present disclosure;

[0068] Figure 5 A schematic diagram of a setting page for edge light rendering parameter information in the edge light rendering method provided by an embodiment of the present disclosure is shown;

[0069] Figure 6 A schematic diagram of the architecture of an edge light rendering device provided by an embodiment of the present disclosure is shown;

[0070] Figure 7 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure more clear, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure.

[0072] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0073] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0074] Research has found that when edge light rendering is performed, edge light rendering is often only performed based on the current camera direction. Although this can achieve the edge light rendering effect, it often causes the entire object to be rendered to be covered by edge light. The edge light rendering effect for virtual objects with special rendering requirements such as two-dimensional objects needs to be improved.

[0075] Based on the above research, the present disclosure provides an edge light rendering method, device, computer equipment and storage medium. In the process of edge light rendering, by adding a first illumination model determined based on the camera direction corresponding to the three-dimensional model for rendering, the final edge light rendering effect is more realistic, ensuring that the final edge light effect conforms to the reflection law of natural objects; on the other hand, by adding a second illumination model determined based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model for edge light rendering, the finally generated edge light is only on the backlight side of the target object, and does not affect the light and shadow level of the illuminated side of the target object. Compared with edge light rendering only according to the camera direction, the final rendering effect can better meet the user's rendering requirements for virtual objects such as two-dimensional objects, and the edge light rendering effect is better.

[0076] To facilitate understanding of the present embodiment, an edge light rendering method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the edge light rendering method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, 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 implementations, the edge light rendering method can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0077] See also Figure 1 FIG. 1 is a flow chart of an edge light rendering method provided by an embodiment of the present disclosure, wherein the method includes S101 to S103, wherein:

[0078] S101: Acquire a three-dimensional model of a target object, and determine a first illumination model corresponding to the target object based on a camera direction corresponding to the three-dimensional model; the first illumination model is used to characterize edge rendering information of the target object in the camera direction, wherein the edge rendering information is used to represent the probability that each vertex of the three-dimensional model is an edge.

[0079] S102: Based on the first illumination model, determine an edge rendering model for characterizing an edge light rendering area corresponding to the target object; and, based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model, determine a second illumination model of the target object, wherein the second illumination model is used to characterize backlight rendering information of the target object, wherein the backlight rendering information is used to characterize the probability that each vertex of the three-dimensional model is located on the backlight surface under the illumination direction.

[0080] S103: Perform edge light rendering on the target object based on the second illumination model corresponding to the target object and the edge rendering model.

[0081] The following is a detailed description of the above steps.

[0082] With respect to S101, the target object may specifically include a two-dimensional object. Since the two-dimensional object is a virtual object and does not actually exist, the height, fatness, and other body characteristics of the two-dimensional object can be determined by constructing a three-dimensional model corresponding to the two-dimensional object, and the determined three-dimensional model can be used to simulate the image that the two-dimensional object wants to present in the real world.

[0083] For example, Figure 2 FIG. 1 is a schematic diagram of a three-dimensional model of a target object provided by an embodiment of the present disclosure, wherein the three-dimensional model is an artificially constructed virtual model; the three-dimensional model can refine and express the facial features and clothing features of a person. Figure 2 Different three-dimensional models can be determined for different two-dimensional objects, and 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 interconnection relationship between the vertices.

[0084] In a possible implementation, Figure 3 As shown, the first illumination model corresponding to the target object can be determined by the following steps:

[0085] S301: Determine the normal direction corresponding to each vertex in the three-dimensional model.

[0086] S302: For any of the vertices, based on the camera direction corresponding to the three-dimensional model and the normal direction corresponding to the vertex, determine edge rendering information corresponding to the vertex, and the edge rendering information corresponding to each vertex constitutes the first illumination model.

[0087] Here, the normal direction of the vertex can be as follows Figure 2 As shown in , for any vertex, based on the position information of the vertex in the three-dimensional model, the vertex normal direction corresponding to the vertex can be determined, and the normal direction of the vertex can be represented by vector coordinates in the plane rectangular coordinate system corresponding to the three-dimensional model, such as the normal direction is (1, 1, 1); the camera direction corresponding to the three-dimensional model can be represented by vector coordinates in the plane rectangular coordinate system corresponding to the three-dimensional model, such as the camera direction a is (0, 0, 1).

[0088] Specifically, when determining the edge rendering information corresponding to the vertex based on the camera direction corresponding to the three-dimensional model and the normal direction corresponding to the vertex, the camera direction and the normal direction corresponding to the vertex can be used to perform a dot product operation to obtain an initial probability that the target object is not an edge under the camera direction (in the range of 0 to 1, and vertices with values ​​close to or equal to 0 are edges). By performing a subtraction operation with the initial probability, the edge rendering information that can characterize the probability that the vertex is an edge can be obtained.

[0089] It should be noted that in order to make the obtained edge rendering information better represent the probability that each vertex of the three-dimensional model is an edge, in the process of determining the edge rendering information, the intermediate data can be processed using remapping processing, normalization processing and other processing methods so that the obtained edge rendering information has a numerical range of 0 to 1.

[0090] S102: Based on the first illumination model, determine an edge rendering model for characterizing an edge light rendering area corresponding to the target object; and, based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model, determine a second illumination model of the target object, wherein the second illumination model is used to characterize backlight rendering information of the target object, wherein the backlight rendering information is used to characterize the probability that each vertex of the three-dimensional model is located on the backlight surface under the illumination direction.

[0091] In one possible implementation, when determining the edge rendering model, for any of the vertices, edge rendering information corresponding to the vertex may be subjected to power operation processing based on a preset second target parameter; wherein the second target parameter is used to characterize the size of the exponent when performing the power operation processing, and the edge rendering information corresponding to each vertex after the power operation processing constitutes the edge rendering model.

[0092] Here, since the numerical value corresponding to the edge rendering information is between 0 and 1, in order to make the determined edge light rendering area more accurate, the edge rendering information can be processed to better screen out the edge light range of the target object that requires edge light rendering. The target range of the edge rendering information corresponding to each vertex in the edge light range can be preset, and the vertices whose corresponding edge rendering information is within the target range are the vertices that require edge light rendering.

[0093] Exemplarily, taking the edge rendering information corresponding to vertex A as 0.8 and the second target parameter as 3 as an example, the edge rendering information after the power operation is 0.8×0.8×0.8=0.512.

[0094] In this way, by performing a power operation on the edge rendering information, the numerical difference between each piece of edge rendering information can be expanded, thereby accurately determining the edge light range that needs to be edge light rendered, thereby achieving a better edge light rendering effect.

[0095] In a possible implementation, Figure 4 As shown, the second illumination model corresponding to the target object can be determined by the following steps:

[0096] S401: Determine the normal direction corresponding to each vertex in the three-dimensional model.

[0097] S402: For any of the vertices, based on the illumination direction and the normal direction corresponding to the vertex, determine the light-receiving surface rendering information corresponding to the vertex; the light-receiving surface rendering information is used to characterize the light-receiving surface range size of the target object.

[0098] S403: Determine the backlight surface rendering information corresponding to each vertex based on the light-receiving surface rendering information corresponding to each vertex, and the backlight surface rendering information corresponding to each vertex constitutes the second illumination model.

[0099] Here, for any of the vertices, a dot product operation is performed between the illumination direction and the normal direction corresponding to the vertex to obtain the light-receiving surface rendering information corresponding to the vertex.

[0100] Specifically, when determining the backlight surface rendering information corresponding to each vertex based on the light-receiving surface rendering information corresponding to each vertex, a subtraction operation is performed with the light-receiving surface rendering information to obtain the backlight surface rendering information that can characterize the probability that the vertex is located on the backlight surface under the illumination direction.

[0101] In this way, by adding a second lighting model determined based on the three-dimensional model and the lighting direction corresponding to the three-dimensional model for edge light rendering, the edge light finally generated is only on the backlight side of the target object, and does not affect the light and shadow levels of the illuminated side of the target object, so that the edge light rendering effect is better.

[0102] S103: Perform edge light rendering on the target object based on the second illumination model corresponding to the target object and the edge rendering model.

[0103] In a possible implementation, when edge-light rendering is performed, the second illumination model and the edge rendering model may be superimposed to obtain a target rendering model; and edge-light rendering may be performed on the target object based on the target rendering model.

[0104] Here, for any vertex in the three-dimensional model, when the second illumination model and the edge rendering model are superimposed, the backlight rendering information in the second illumination model corresponding to the vertex and the edge rendering information in the edge rendering model corresponding to the vertex can be added or multiplied to obtain the target rendering information corresponding to the vertex, and the target rendering information corresponding to each vertex constitutes the target rendering model.

[0105] Exemplarily, taking the edge rendering information corresponding to vertex A as 0.6, the backlight rendering information corresponding to vertex A as 0.2, and the superposition processing as addition, the target rendering information corresponding to vertex A is 0.8.

[0106] In this way, by superimposing the second illumination model and the edge rendering model, the target rendering model finally obtained can meet the rendering requirements in multiple dimensions, so that the edge light rendering effect is better.

[0107] In one possible implementation, after determining the edge rendering model, it is also possible to respond to a range adjustment instruction and obtain a first target parameter corresponding to the edge rendering information carried in the range adjustment instruction; wherein the first target parameter is used to adjust the edge range; based on the first target parameter, the edge light range of the target object is updated, and the target object is rendered according to the updated edge light range.

[0108] Here, when the edge light range of the target object is updated based on the first target parameter, the edge rendering information may be processed according to the first target parameter, and the edge light range of the target object may be re-determined according to the edge rendering information after the data processing.

[0109] Exemplarily, taking the edge rendering information corresponding to vertex A as 0.8 and the first target parameter as 0.9 as an example, the edge rendering information after data processing according to the first target parameter may be 0.8×0.9=0.72.

[0110] Furthermore, edge color information corresponding to the three-dimensional model may be received, and edge light rendering may be performed on the target object based on the target rendering model and the edge color information.

[0111] Here, the edge color information may be set by the user in a setting page of edge light rendering parameter information according to actual needs.

[0112] Exemplarily, the schematic diagram of the setting page of the edge light rendering parameter information can be as follows: Figure 5 As shown, Figure 5 It includes adjustment areas respectively set for the first target parameter, the second target parameter and the edge light color, the first target parameter is set to "0.8", the second target parameter is set to "0.5", and the edge light color is set to "gray".

[0113] In this way, the edge light rendering effect can be adjusted more flexibly by adjusting the edge light rendering parameter information to obtain a desired edge light rendering effect.

[0114] The edge light rendering method provided by the embodiment of the present disclosure, during the edge light rendering process, by adding a first illumination model determined based on the camera direction corresponding to the three-dimensional model for rendering, the final edge light rendering effect is made more realistic, ensuring that the final edge light effect complies with the reflection law of natural objects; on the other hand, by adding a second illumination model determined based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model for edge light rendering, the finally generated edge light is only on the backlight side of the target object, and does not affect the light and shadow level of the illuminated side of the target object. Compared with edge light rendering only according to the camera direction, the final rendering effect can better meet the user's rendering requirements for virtual objects such as two-dimensional objects, and the edge light rendering effect is better.

[0115] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0116] Based on the same inventive concept, an edge light rendering device corresponding to the edge light rendering method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned edge light rendering method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0117] Reference Figure 6 , which is a schematic diagram of the architecture of an edge light rendering device provided by an embodiment of the present disclosure, the device comprises: an acquisition module 601, a determination module 602, and a rendering module 603; wherein,

[0118] An acquisition module 601 is used to acquire a three-dimensional model of a target object, and determine a first illumination model corresponding to the target object based on a camera direction corresponding to the three-dimensional model; the first illumination model is used to characterize edge rendering information of the target object in the camera direction, wherein the edge rendering information is used to indicate a probability that each vertex of the three-dimensional model is an edge;

[0119] A determination module 602 is used to determine, based on the first illumination model, an edge rendering model for characterizing an edge light rendering area corresponding to the target object; and, based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model, determine a second illumination model for the target object, wherein the second illumination model is used to characterize backlight rendering information of the target object, wherein the backlight rendering information is used to characterize the probability that each vertex of the three-dimensional model is located on the backlight surface under the illumination direction;

[0120] The rendering module 603 is configured to perform edge light rendering on the target object based on the second illumination model corresponding to the target object and the edge rendering model.

[0121] In a possible implementation, the acquisition module 601, when determining the first illumination model corresponding to the target object based on the camera direction corresponding to the three-dimensional model, is configured to:

[0122] Determine the normal direction corresponding to each vertex in the three-dimensional model;

[0123] For any of the vertices, based on a camera direction corresponding to the three-dimensional model and a normal direction corresponding to the vertex, determining edge rendering information corresponding to the vertex;

[0124] The edge rendering information corresponding to each vertex constitutes the first illumination model.

[0125] In a possible implementation manner, the rendering module 603 is further configured to:

[0126] In response to a range adjustment instruction, obtaining a first target parameter corresponding to the edge rendering information and carried in the range adjustment instruction; wherein the first target parameter is used to adjust the edge range;

[0127] The edge light range of the target object is updated based on the first target parameter, and the target object is rendered according to the updated edge light range.

[0128] In a possible implementation manner, the determining module 602, when determining the edge rendering model for characterizing the edge light rendering area corresponding to the target object based on the first illumination model, is configured to:

[0129] For any of the vertices, performing a power operation on the edge rendering information corresponding to the vertex based on a preset second target parameter; wherein the second target parameter is used to represent the size of an exponent when performing the power operation;

[0130] The edge rendering information after the power operation processing corresponding to each vertex constitutes the edge rendering model.

[0131] In a possible implementation, the determination module 602, when determining the second illumination model of the target object based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model, is configured to:

[0132] Determine the normal direction corresponding to each vertex in the three-dimensional model;

[0133] For any of the vertices, based on the illumination direction and the normal direction corresponding to the vertex, determine the light-receiving surface rendering information corresponding to the vertex; the light-receiving surface rendering information is used to characterize the light-receiving surface range size of the target object;

[0134] Based on the light-receiving surface rendering information corresponding to each vertex, the backlight surface rendering information corresponding to each vertex is determined, and the backlight surface rendering information corresponding to each vertex constitutes the second illumination model.

[0135] In a possible implementation manner, the rendering module 603, when performing edge light rendering on the target object based on the second illumination model corresponding to the target object and the edge rendering model, is configured to:

[0136] Superimposing the second illumination model and the edge rendering model to obtain a target rendering model;

[0137] Based on the target rendering model, edge light rendering is performed on the target object.

[0138] In a possible implementation manner, the rendering module 603 is further configured to:

[0139] Receiving edge color information corresponding to the three-dimensional model;

[0140] The rendering module 603, when performing edge light rendering on the target object based on the target rendering model, is used to:

[0141] Based on the target rendering model and the edge color information, edge light rendering is performed on the target object.

[0142] The edge light rendering device provided by the embodiment of the present disclosure, during the edge light rendering process, by adding a first illumination model determined based on the camera direction corresponding to the three-dimensional model for rendering, makes the final edge light rendering effect more realistic, and ensures that the final edge light effect complies with the reflection law of natural objects; on the other hand, by adding a second illumination model determined based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model for edge light rendering, the finally generated edge light is only on the backlight side of the target object, and does not affect the light and shadow level of the illuminated side of the target object. Compared with edge light rendering only according to the camera direction, the final rendering effect can better meet the user's rendering requirements for virtual objects such as two-dimensional objects, and the edge light rendering effect is better.

[0143] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0144] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Figure 7 As shown, it is a schematic diagram of the structure of a computer device 700 provided in an embodiment of the present disclosure, including a processor 701, a memory 702, and a bus 703. Among them, the memory 702 is used to store execution instructions, including a memory 7021 and an external memory 7022; the memory 7021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 701, and the data exchanged with the external memory 7022 such as a hard disk. The processor 701 exchanges data with the external memory 7022 through the memory 7021. When the computer device 700 is running, the processor 701 communicates with the memory 702 through the bus 703, so that the processor 701 executes the following instructions:

[0145] Acquire a three-dimensional model of a target object, and determine a first illumination model corresponding to the target object based on a camera direction corresponding to the three-dimensional model; the first illumination model is used to characterize edge rendering information of the target object in the camera direction, wherein the edge rendering information is used to represent the probability that each vertex of the three-dimensional model is an edge;

[0146] Based on the first illumination model, an edge rendering model for characterizing an edge light rendering area corresponding to the target object is determined; and based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model, a second illumination model of the target object is determined, the second illumination model being used to characterize backlight rendering information of the target object, wherein the backlight rendering information is used to characterize the probability that each vertex of the three-dimensional model is located on the backlight surface under the illumination direction;

[0147] Based on the second illumination model corresponding to the target object and the edge rendering model, edge light rendering is performed on the target object.

[0148] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the edge light rendering method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0149] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the edge light rendering method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0150] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0151] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only 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 communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0152] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0153] In addition, each functional unit in each embodiment of the present disclosure 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.

[0154] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several 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 disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0155] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. An edge light rendering method, characterized in that: include: Acquire a three-dimensional model of a target object, and determine a first illumination model corresponding to the target object based on a camera direction corresponding to the three-dimensional model; The first illumination model is used to characterize edge rendering information of the target object in the direction of the camera, wherein the edge rendering information is used to represent the probability that each vertex of the three-dimensional model is an edge; Based on the first illumination model, determining an edge rendering model for characterizing an edge light rendering area corresponding to the target object; and, based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model, determining a second illumination model of the target object, wherein the second illumination model is used to characterize backlight rendering information of the target object, wherein the backlight rendering information is used to characterize the probability that each vertex of the three-dimensional model is located on the backlight surface under the illumination direction; Based on the second illumination model corresponding to the target object and the edge rendering model, edge light rendering is performed on the target object.

2. The method according to claim 1, characterized in that The determining the first illumination model corresponding to the target object based on the camera direction corresponding to the three-dimensional model includes: Determine the normal direction corresponding to each vertex in the three-dimensional model; For any of the vertices, based on a camera direction corresponding to the three-dimensional model and a normal direction corresponding to the vertex, determining edge rendering information corresponding to the vertex; The edge rendering information corresponding to each vertex constitutes the first illumination model.

3. The method according to claim 2, characterized in that The method further comprises: In response to a range adjustment instruction, obtaining a first target parameter corresponding to the edge rendering information and carried in the range adjustment instruction; wherein the first target parameter is used to adjust the edge range; The edge light range of the target object is updated based on the first target parameter, and the target object is rendered according to the updated edge light range.

4. The method according to any one of claims 1 to 3, characterized in that: The step of determining, based on the first illumination model, an edge rendering model for characterizing an edge light rendering area corresponding to the target object comprises: For any of the vertices, performing a power operation on the edge rendering information corresponding to the vertex based on a preset second target parameter; wherein the second target parameter is used to represent the size of an exponent when performing the power operation; The edge rendering information after the power operation processing corresponding to each vertex constitutes the edge rendering model.

5. The method according to any one of claims 1 to 4, characterized in that: The determining, based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model, a second illumination model of the target object comprises: Determine the normal direction corresponding to each vertex in the three-dimensional model; For any of the vertices, based on the illumination direction and the normal direction corresponding to the vertex, determine the light-receiving surface rendering information corresponding to the vertex; the light-receiving surface rendering information is used to characterize the light-receiving surface range size of the target object; Based on the light-receiving surface rendering information corresponding to each vertex, the backlight surface rendering information corresponding to each vertex is determined, and the backlight surface rendering information corresponding to each vertex constitutes the second illumination model.

6. The method according to any one of claims 1 to 5, characterized in that: The performing edge light rendering on the target object based on the second illumination model corresponding to the target object and the edge rendering model includes: Superimposing the second illumination model and the edge rendering model to obtain a target rendering model; Based on the target rendering model, edge light rendering is performed on the target object.

7. The method according to claim 6, characterized in that The method further comprises: Receiving edge color information corresponding to the three-dimensional model; The performing edge light rendering on the target object based on the target rendering model includes: Based on the target rendering model and the edge color information, edge light rendering is performed on the target object.

8. An edge light rendering device, characterized in that: include: An acquisition module, used to acquire a three-dimensional model of a target object, and determine a first illumination model corresponding to the target object based on a camera direction corresponding to the three-dimensional model; The first illumination model is used to characterize edge rendering information of the target object in the direction of the camera, wherein the edge rendering information is used to represent the probability that each vertex of the three-dimensional model is an edge; A determination module, configured to determine, based on the first illumination model, an edge rendering model for characterizing an edge light rendering area corresponding to the target object; and, based on the three-dimensional model and the illumination direction corresponding to the three-dimensional model, determining a second illumination model of the target object, wherein the second illumination model is used to characterize backlight rendering information of the target object, wherein the backlight rendering information is used to characterize the probability that each vertex of the three-dimensional model is located on the backlight surface under the illumination direction; A rendering module is used to perform edge light rendering on the target object based on a second illumination model corresponding to the target object and the edge rendering model.

9. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the edge light rendering method as described in any one of claims 1 to 7 are performed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the edge light rendering method according to any one of claims 1 to 7 are executed.

Citation Information

Patent Citations

  • Model rendering method and device, storage medium and terminal

    CN111127623A

  • Model rendering method, device and equipment and storage medium

    CN112316420A