Edge description method, device and equipment of virtual role

文档序号:26140 发布日期:2021-09-24 浏览:22次 中文

阅读说明:本技术 虚拟角色的边缘描绘方法、装置和设备 (Edge description method, device and equipment of virtual role ) 是由 刘舟 袁尧 沈琳焘 施坤省 黎煌达 张志稳 于 2021-05-28 设计创作,主要内容包括:本发明公开了一种虚拟角色的边缘描绘方法、装置和设备,所述方法包括:获取目标虚拟角色在当前的显示界面中的角色边缘;获取所述角色边缘的断线处,并分析所述角色边缘的断线处的断线类型;其中,所述断线类型包括身体轮廓断线类型和非身体轮廓断线类型;对为身体轮廓断线类型的所述断线处进行衔接处理;根据预设的且与所述角色边缘的断线处的断线类型对应的角色边缘渲染策略,对所述目标虚拟角色的角色边缘进行渲染。采用本发明实施例,能根据角色边缘的不同断线类型进行对应的渲染操作,有效地提高虚拟角色的边缘描绘效果,提高用户体验。(The invention discloses a method, a device and equipment for depicting edges of virtual roles, wherein the method comprises the following steps: acquiring a role edge of a target virtual role in a current display interface; acquiring a broken line position of the role edge, and analyzing the broken line type of the broken line position of the role edge; wherein the type of line break comprises a body contour line break type and a non-body contour line break type; performing linking processing on the broken line part which is of a body contour broken line type; and rendering the role edge of the target virtual role according to a preset role edge rendering strategy corresponding to the type of the broken line at the broken line position of the role edge. By adopting the embodiment of the invention, the corresponding rendering operation can be carried out according to different broken line types of the role edge, the edge description effect of the virtual role is effectively improved, and the user experience is improved.)

1. An edge description method for a virtual character, comprising:

acquiring a role edge of a target virtual role in a current display interface;

acquiring a broken line position of the role edge, and analyzing the broken line type of the broken line position of the role edge; wherein the type of line break comprises a body contour line break type and a non-body contour line break type;

performing linking processing on the broken line part which is of a body contour broken line type;

and rendering the role edge of the target virtual role according to a preset role edge rendering strategy corresponding to the type of the broken line at the broken line position of the role edge.

2. The method for depicting an edge of a virtual character according to claim 1, wherein the obtaining of the broken line of the character edge and the analyzing of the broken line type of the broken line of the character edge specifically include:

acquiring a broken line point of an edge line segment where each broken line of the role edge is located in the display interface;

extending the preset length of the broken line part in the line breaking direction of the broken line part by taking the broken line point as a starting point;

judging whether each broken line is extended and then is intersected with other extended broken lines;

if so, judging the line breaking type at the line breaking position as a body contour line breaking type;

if not, judging the line breaking type at the line breaking position as a non-body contour line breaking type.

3. The method for depicting an edge of a virtual character according to claim 2, wherein the joining process is performed on the broken line part of which the broken line type is a body contour broken line, and specifically comprises:

acquiring coordinate information of two broken lines with intersection points after the preset length is prolonged;

determining the shortest distance between the two broken lines according to the coordinate information of the two broken lines;

acquiring a corresponding arc line segment with a preset radian according to the shortest distance between the two broken line positions;

and connecting the two broken line positions according to the arc line segment.

4. The method for depicting an edge of a virtual character according to claim 1, wherein the preset character edge rendering strategy comprises a first character edge rendering strategy corresponding to a non-body contour type and a second character edge rendering strategy corresponding to a body contour type;

rendering the role edge of the target virtual role according to a preset role edge rendering strategy corresponding to the type of the broken line at the broken line position of the role edge, specifically comprising:

rendering a first type of edge line segment of the target virtual character according to the first character edge rendering strategy; the first type of edge line segment is an edge line segment where a broken line of a non-body contour broken line type is located in the role edge;

rendering a second type of edge line segment of the target virtual character according to the second character edge rendering strategy; the second type of edge line segment is an edge line segment except the first type of edge line segment in the role edge.

5. The method for depicting an edge of a virtual character according to claim 4, wherein the edge line segment where a broken line of the character edge which is a non-body contour broken line type is located comprises a hair line segment of the target virtual character.

6. The method for edge tracing of a virtual character according to claim 1, wherein the character edge rendering policy includes: setting parameters of the display color of the role edge, setting parameters of the display light effect of the role edge and setting parameters of the display dynamic effect of the role edge.

7. The method for depicting an edge of a virtual character according to claim 6, wherein the setting parameters of the display color include: the display color type and the single display time length of the display color type in each preset time interval;

the setting parameters for displaying the light effect comprise: displaying a light effect type;

the setting parameters for displaying the dynamic effect comprise: the dynamic effect type is displayed.

8. The method for depicting an edge of a virtual character according to claim 1, wherein pixel brightness values of both the target virtual character and a display background of the display interface are preset to different values;

then, the obtaining of the role edge of the target virtual role in the current display interface includes:

acquiring a display model of a target virtual character;

acquiring brightness values of all role pixels of a display model of a target virtual role, and acquiring brightness values of all background pixels of a display background of a current display interface;

and determining the role edge of the target virtual role in the current display interface according to the brightness value of each role pixel and the brightness value of each background pixel.

9. An edge tracing apparatus for a virtual character, comprising:

the role edge obtaining module is used for obtaining the role edge of the target virtual role in the current display interface;

the broken line type analysis module is used for acquiring the broken line position of the role edge and analyzing the broken line type of the broken line position of the role edge; wherein the type of line break comprises a body contour line break type and a non-body contour line break type;

the broken line connection processing module is used for connecting the broken line part which is the type of the broken line of the body contour;

and the role edge rendering module is used for rendering the role edge of the target virtual role according to a preset role edge rendering strategy corresponding to the type of the broken line at the broken line position of the role edge.

10. An edge tracing apparatus for a virtual character, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the edge tracing method for a virtual character according to any one of claims 1 to 8 when executing the computer program.

Technical Field

The invention relates to the technical field of role rendering, in particular to a method, a device and equipment for depicting an edge of a virtual role.

Background

With the continuous development of social economy and computer technology, the game entertainment industry is also developed correspondingly, and virtual characters are set in many games at present, wherein the virtual characters comprise player-controlled characters and non-player-controlled characters. When a certain virtual character in the game is detected to be selected by a player, in order to make the virtual character selected by the player more prominent and facilitate observation of the player, the virtual character is often stroked to improve user experience.

In the prior art, when a model of a game character is subjected to edge tracing processing, an original model is generally expanded according to the normal direction of the original model, so that the edge tracing processing of the original model is realized. However, the inventors found that the prior art has at least the following problems: the line-line connection or the line corner of the outline of the general model can be broken, when the breaks occur on the outline of the body (including trunk, head and limbs) of the game character, the body outline of the game character can be incomplete, and when the body outline of the game character is stroked, the breaks of the body outline can be more abrupt, so that the stroking effect of the game character is poor. In addition, the existing delineation is to carry out unified whole delineation to the game role, and can not realize to rationally distinguish the delineation effect of the outline of the game role, and the result is relatively poor to the delineation effect of the outline of the game role.

Disclosure of Invention

The embodiment of the invention aims to provide a method, a device and equipment for depicting the edge of a virtual character, which can perform corresponding rendering operation according to different broken line types of the edge of the character, effectively improve the edge depicting effect of the virtual character and improve the user experience.

To achieve the above object, an embodiment of the present invention provides an edge tracing method for a virtual character, including:

acquiring a role edge of a target virtual role in a current display interface;

acquiring a broken line position of the role edge, and analyzing the broken line type of the broken line position of the role edge; wherein the type of line break comprises a body contour line break type and a non-body contour line break type;

performing linking processing on the broken line part which is of a body contour broken line type;

and rendering the role edge of the target virtual role according to a preset role edge rendering strategy corresponding to the type of the broken line at the broken line position of the role edge.

As an improvement of the above scheme, the acquiring the broken line of the character edge and analyzing the type of the broken line of the character edge specifically includes:

acquiring a broken line point of an edge line segment where each broken line of the role edge is located in the display interface;

extending the preset length of the broken line part in the line breaking direction of the broken line part by taking the broken line point as a starting point;

judging whether each broken line is extended and then is intersected with other extended broken lines;

if so, judging the line breaking type at the line breaking position as a body contour line breaking type;

if not, judging the line breaking type at the line breaking position as a non-body contour line breaking type.

As an improvement of the above scheme, the joining process is performed on the broken line part of which the broken line type is body contour broken line, specifically including:

acquiring coordinate information of two broken lines with intersection points after the preset length is prolonged;

determining the shortest distance between the two broken lines according to the coordinate information of the two broken lines;

acquiring a corresponding arc line segment with a preset radian according to the shortest distance between the two broken line positions;

and connecting the two broken line positions according to the arc line segment.

As an improvement of the above scheme, the preset role edge rendering strategy includes a first role edge rendering strategy corresponding to a non-body contour line breaking type and a second role edge rendering strategy corresponding to a body contour line breaking type;

rendering the role edge of the target virtual role according to a preset role edge rendering strategy corresponding to the type of the broken line at the broken line position of the role edge, specifically comprising:

rendering a first type of edge line segment of the target virtual character according to the first character edge rendering strategy; the first type of edge line segment is an edge line segment where a broken line of a non-body contour broken line type is located in the role edge;

rendering a second type of edge line segment of the target virtual character according to the second character edge rendering strategy; the second type of edge line segment is an edge line segment except the first type of edge line segment in the role edge.

As an improvement of the above solution, the edge line segment where the broken line of the character edge which is a non-body contour broken line type is located includes a hair line segment of the target virtual character.

As an improvement of the above solution, the role edge rendering policy includes: setting parameters of the display color of the role edge, setting parameters of the display light effect of the role edge and setting parameters of the display dynamic effect of the role edge.

As an improvement of the above solution, the setting parameters of the display color include: the display color type and the single display time length of the display color type in each preset time interval;

the setting parameters for displaying the light effect comprise: displaying a light effect type;

the setting parameters for displaying the dynamic effect comprise: the dynamic effect type is displayed.

As an improvement of the above scheme, the pixel brightness values of the target virtual character and the display background of the display interface are preset to different values;

then, the obtaining of the role edge of the target virtual role in the current display interface includes:

acquiring a display model of a target virtual character;

acquiring brightness values of all role pixels of a display model of a target virtual role, and acquiring brightness values of all background pixels of a display background of a current display interface;

and determining the role edge of the target virtual role in the current display interface according to the brightness value of each role pixel and the brightness value of each background pixel.

An embodiment of the present invention further provides an edge tracing apparatus for a virtual character, including:

the role edge obtaining module is used for obtaining the role edge of the target virtual role in the current display interface;

the broken line type analysis module is used for acquiring the broken line position of the role edge and analyzing the broken line type of the broken line position of the role edge; wherein the type of line break comprises a body contour line break type and a non-body contour line break type;

the broken line connection processing module is used for connecting the broken line part which is the type of the broken line of the body contour;

and the role edge rendering module is used for rendering the role edge of the target virtual role according to a preset role edge rendering strategy corresponding to the type of the broken line at the broken line position of the role edge.

An embodiment of the present invention further provides an edge tracing apparatus for a virtual character, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor implements an edge tracing method for a virtual character as described in any one of the above items when executing the computer program.

Compared with the prior art, the method, the device and the equipment for depicting the edge of the virtual character disclosed by the embodiment of the invention have the advantages that the broken line part of the edge of the target virtual character is obtained, the broken line type of the broken line part of the edge of the character is analyzed to be the body contour broken line type or the non-body contour broken line type, so that the broken line part of the body contour broken line type is subjected to connection processing, and finally, the edge of the character of the target virtual character is rendered according to a preset character edge rendering strategy corresponding to the broken line type of the broken line part of the edge of the character. The original model rendering effect of the virtual character can be improved by performing connection processing on the broken line part of the body contour broken line type, so that the edge description effect of the virtual character is further improved, and the situation that the edge fracture phenomenon of the virtual character is more obvious is avoided. In addition, after the connection processing is carried out on the broken line positions of the broken line types of the body outline, the edge drawing is carried out on the role edges corresponding to the different broken line types by adopting different role edge rendering strategies, the display effects of different parts of the role edges can be more highlighted, the reasonable distinguishing of the drawing effects of the outline of the game role is realized, and the edge drawing effect of the virtual role can be effectively improved.

Drawings

FIG. 1 is a schematic diagram illustrating steps of an edge tracing method for a virtual character according to an embodiment of the present invention;

FIG. 2 is a schematic diagram illustrating the steps of analyzing the type of a broken line at the broken line of the character edge according to an embodiment of the present invention;

FIG. 3 is a schematic diagram illustrating a step of performing a splicing process on a broken wire according to an embodiment of the present invention;

FIG. 4 is a schematic structural diagram of an edge tracing apparatus for a virtual character according to an embodiment of the present invention;

fig. 5 is a schematic structural diagram of an edge-tracing apparatus for a virtual character according to an embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Fig. 1 is a schematic step diagram of an edge tracing method for a virtual character according to an embodiment of the present invention.

It should be noted that the edge description method for the virtual role provided in the embodiment of the present invention may be executed by a terminal device, for example, a computer, a mobile phone, a tablet, a television, and other client devices; the terminal device can be loaded with various application programs including game application programs and used for presenting game pictures. By way of example, the terminal device may include a display screen for presenting a graphical user interface for presenting game screens and interacting with a player; the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

The edge description method of the virtual character can also be executed by a cloud end comprising a server and a client, specifically, the storage and the operation of the edge description method are completed on the server, and the server can be different types of servers such as an IA architecture server and a RISC architecture server; the server side has high-speed CPU computing capacity, long-time reliable operation, strong I/O external data throughput capacity and better expansibility, and can provide response service requests, undertaking services and guaranteeing services of game applications for the user side. The client device is used for receiving and sending data and presenting game pictures.

Specifically, the method for depicting an edge of a virtual character according to the embodiment of the present invention is executed through steps S11 to S14:

and S11, acquiring the role edge of the target virtual role in the current display interface.

Before step S11, the method further includes the steps of: and determining the target virtual role according to the received user instruction. The user instruction is used for determining at least one virtual character to render the character edge in a plurality of virtual characters of the current display interface of the game.

Illustratively, the user instruction may be input by means of a mouse, a keyboard, a touch screen, or the like; the target virtual character may also be automatically determined after the user game is online, which is not limited herein. The target virtual character may be a virtual character controlled by a user, a virtual character corresponding to the user and teammates, a virtual character controlled by an enemy, or all virtual characters in the game, which is not limited herein.

After the target virtual character is determined, the character edge of the target virtual character is positioned and obtained. In step S11, the character edge of the target virtual character may be, for example, a whole character edge or a local character edge, which is not limited herein. When the role edge is a local role edge, the selection of the component display model is provided for the user in a popup window mode by acquiring the component display model of each component of the target virtual role, and the corresponding component role edge is acquired according to the component display model selected by the user.

S12, acquiring the broken line position of the role edge, and analyzing the broken line type of the broken line position of the role edge; wherein the type of line break comprises a body contour line break type and a non-body contour line break type.

It should be noted that, in the original model of the virtual character, there may be a broken line condition at the character edge, where the broken line type includes a body contour broken line type and a non-body contour broken line type, where the broken line belonging to the non-body contour broken line type may be a broken line formed by hair, beard, hair of a ridden animal, etc. of the virtual character, and is a normal broken line condition; the broken line part belonging to the body contour broken line type can be the situation that the joint of the line and the line or the corner of the line is broken when the original model of the virtual character is not rendered properly, and is an abnormal broken line situation.

In the embodiment of the invention, the role edge of the virtual role is identified so as to obtain each broken line of the role edge. For example, the character edge pixels of the virtual character may be obtained, and according to the difference between the character edge pixels and the pixels displaying the background, the character edge pixels may be located at each broken line in combination with the trend of each line segment in the character edge; of course, other identification methods may be adopted to obtain each broken line of the character edge, which is not limited herein.

And then, analyzing the type of the broken line at each broken line, and judging whether each broken line belongs to the type of the broken line of the body contour or the type of the broken line of the non-body contour. For example, the position information of the broken line of the non-body contour, such as the broken line of hair, beard, etc., on the virtual character may be determined in advance according to the original model design of the virtual character, and then, after each broken line is identified, the position information of the broken line is acquired to determine whether it is the non-body contour broken line type, and if not, it is determined as the body contour broken line type. Of course, other analysis methods may be used to analyze the type of the broken line at each broken line, which is not limited herein.

And S13, performing splicing processing on the broken line part which is of the body contour broken line type.

After the line break type of each line break is determined, carrying out smooth connection processing on the line break part belonging to the body contour line break type according to a preset smoothing algorithm, so that the line break part which is in an abnormal line break condition in the role edge of the virtual role is repaired, the model rendering effect of the virtual role is improved, and the edge description effect of the virtual role is further improved.

S14, rendering the role edge of the target virtual role according to a preset role edge rendering strategy corresponding to the line break type of the line break position of the role edge.

It should be noted that the edge line segment, such as hair, where the broken line of the non-body contour of the virtual character is located is obviously different from the design and display effect of the body contour, and if the edge line segment and the body contour are drawn by the same method, the display effect of the hair may not be highlighted, or even the display effect of the hair may be masked.

Therefore, in the embodiment of the invention, different role edge rendering strategies are set for different disconnection types in advance. For example, one role edge rendering strategy is set for the non-body contour broken line type, another role edge rendering strategy is set for the body contour broken line type, and a mapping relation between the broken line type and the role edge rendering strategy is formed. And then calling a corresponding role edge rendering strategy according to the type of the broken line at the broken line position of the role edge and the mapping relation, and rendering the role edge of the target virtual role.

For example, the mapping relationship may be pre-stored locally, directly called when needed, or stored in the cloud, and downloaded from the cloud through a wireless network or a wired network when needed, which is not limited herein.

The embodiment of the invention provides an edge description method of a virtual character, which comprises the steps of obtaining a broken line part of a character edge of a target virtual character, analyzing whether the broken line type of the broken line part of the character edge is a body contour broken line type or a non-body contour broken line type, carrying out connection processing on the broken line part which is the body contour broken line type, and finally, rendering the character edge of the target virtual character according to a preset character edge rendering strategy corresponding to the broken line type of the character edge. The original model rendering effect of the virtual character can be improved by performing connection processing on the broken line part of the body contour broken line type, so that the edge description effect of the virtual character is further improved, and the situation that the edge fracture phenomenon of the virtual character is more obvious is avoided. In addition, after the connection processing is carried out on the broken line positions of the broken line types of the body outline, the edge drawing is carried out on the role edges corresponding to the different broken line types by adopting different role edge rendering strategies, the display effects of different parts of the role edges can be more highlighted, the reasonable distinguishing of the drawing effects of the outline of the game role is realized, and the edge drawing effect of the virtual role can be effectively improved.

As a preferred implementation manner, refer to fig. 2, which is a schematic diagram illustrating a step of analyzing a type of a broken line at a broken line of a character edge according to an embodiment of the present invention. On the basis of the above steps S11 to S14, the step S12 is specifically executed by steps S121 to S125:

and S121, obtaining a broken line point of an edge line segment where each broken line of the role edge in the display interface is located.

And S122, extending the preset length of the broken line part in the line breaking direction of the broken line part by taking the broken line point as a starting point.

And S123, judging whether each broken line is extended and then is intersected with other extended broken lines.

And S124, if so, judging the line breaking type at the line breaking position as the body contour line breaking type.

And S125, if not, judging the line breaking type at the line breaking position as a non-body contour line breaking type.

In the embodiment of the invention, each broken line position of the role edge in the display interface is obtained, the broken line point of the edge line segment where each broken line position is located is obtained, the broken line position is extended by a preset length in the broken line direction of the broken line position by taking the broken line point as a starting point, if any two extension lines have an intersection point, the broken line type of the broken line position is judged as the body contour broken line type, and if not, the broken line type is the non-body contour broken line type.

Specifically, the wire breaking direction at the wire breaking position is determined by the following way: after each broken line position of the role edge is determined, a point which is close to the broken line point of the edge line segment where the broken line position is located on the edge line segment is obtained, the point is used as a starting point, the broken line point of the edge line segment is used as an end point, and finally the broken line direction of the broken line position is determined according to the connection trend of the two points.

It can be understood that the point close to the broken line may be determined by setting a length threshold, for example, obtaining a point on the edge line segment where the broken line is located and whose distance from the broken line is less than the preset length threshold, so as to implement the extension processing on the broken line, and the like, without affecting the beneficial effects obtained by the present invention.

It is to be understood that the preset length may be set according to a model size of the virtual character, and is not specifically limited herein. It should be noted that the preset length cannot be set too large, so as to prevent the broken line which is originally in a normal broken line condition from intersecting with extended lines at other broken line positions after being extended, and thus the broken line is judged as a body contour broken line type by mistake; and at the same time, the size of the broken line cannot be set too small so as to avoid missing the broken line part which is supposed to be the type of the broken line of the body contour.

For example, by making a tangent to the edge where each broken line is located, whether the tangent at each broken line is intersected with the tangents at other broken lines is determined, if yes, the broken line type at the broken line is determined as a body contour broken line type, and if not, the broken line type at the broken line is determined as a non-body contour broken line type. And is not particularly limited herein.

By adopting the technical means of the embodiment of the invention, the broken line type of each broken line position of the role edge can be effectively judged, so that different edge description operations can be performed on the broken line positions of different broken line types in the follow-up process.

As a preferred embodiment, refer to fig. 3, which is a schematic diagram of a step of performing a splicing process on a broken line in an embodiment of the present invention. Step S13 is specifically executed by steps S131 to S134:

s131, obtaining coordinate information of two broken lines with intersection points after the preset length is prolonged.

S132, determining the shortest distance between the two broken lines according to the coordinate information of the two broken lines.

And S133, acquiring a corresponding arc line segment with a preset radian according to the shortest distance between the two broken line positions.

And S134, carrying out connection processing on the two broken line positions according to the arc line segment.

In the embodiment of the invention, after the type of the broken line at each broken line is determined, for the broken line of the type of the broken line of the body contour, the two broken lines with the intersection point after the preset length is prolonged are jointed. And calculating to obtain the shortest distance between the two broken line positions by obtaining the coordinate information of the two broken line positions, thereby obtaining the arc line section corresponding to the shortest distance for connection.

For example, a mapping relationship between the distance value and the arc segment is preset, and the mapping relationship may be stored locally in advance, may be called directly when needed, may also be stored in the cloud, and may be downloaded from the cloud through a wireless network or a wired network when needed, which is not limited herein.

The preset radian of the arc segment may be specifically set according to actual conditions, for example, the shortest distance between two broken line positions may be used as a diameter to make a semicircular arc, the two broken line positions may be directly used as end points to make a straight line segment, or the arc segment formed by extending extension lines of the two broken line positions to an intersection point, which is not specifically limited herein.

Certainly, a design method corresponding to different arc line segments can be determined according to a distance interval to which the shortest distance between the two broken lines belongs, for example, when the shortest distance is smaller than a first distance threshold, the two broken lines are taken as end points to be connected in a straight line segment mode; when the shortest distance is greater than the first distance threshold, the two broken lines are used as diameters to make a semicircular arc for connection processing, and no specific limitation is made here.

By adopting the technical means of the embodiment of the invention, the connection processing of the broken line part in the type of body contour broken line can be effectively realized, so that the rendering display effect of the role edge of the virtual role is effectively improved, and the rendering effect of the subsequent edge rendering processing of the virtual role is improved.

As a preferred embodiment, the preset character edge rendering strategies include a first character edge rendering strategy corresponding to a non-body contour broken line type and a second character edge rendering strategy corresponding to a body contour broken line type.

It should be noted that the first role edge rendering policy is used to render an edge line segment where a broken line of a non-body-contour broken line type is located, and the second role edge rendering policy is used to render a role edge line segment formed after the broken line of the body-contour broken line type is subjected to joining processing.

Then, step S14 specifically executes through steps S141 to S142:

s141, rendering the first type of edge line segment of the target virtual character according to the first character edge rendering strategy; the first type of edge line segment is an edge line segment where a broken line of a non-body contour broken line type is located in the role edge.

S142, rendering a second type of edge line segment of the target virtual role according to the second role edge rendering strategy; the second type of edge line segment is an edge line segment except the first type of edge line segment in the role edge.

Preferably, the edge line segment where the broken line of the character edge which is a non-body contour broken line type is located comprises a hair line segment of the target virtual character.

As a preferred embodiment, the role edge rendering policy includes: setting parameters of the display color of the role edge, setting parameters of the display light effect of the role edge and setting parameters of the display dynamic effect of the role edge.

Wherein the setting parameters of the display color comprise: the display color type and the single display time length of the display color type in each preset time interval; the setting parameters for displaying the light effect comprise: displaying a light effect type; the setting parameters for displaying the dynamic effect comprise: the dynamic effect type is displayed.

By way of example, after the user determines the target virtual character, for an edge line segment where the broken line of the non-body contour broken line type is located, for example, a hair line segment, the setting parameters of the display color are as follows: the display color type is blue, and the single display time length within the preset time interval of 1 second is 1 second; the setting parameters for displaying the light effect are as follows: displaying the light effect type as flashing light; the setting parameters for displaying the dynamic effect are as follows: the display dynamic effect type is fluttering. And setting parameters of the display colors of the edge line segments except the first type edge line segment in the diagonal color edges are as follows: the display color type is blue, and the single display time length within the preset time interval of 1 second is 1 second; the setting parameters for displaying the light effect are as follows: displaying the light effect type as flashing light; the setting parameters for displaying the dynamic effect are as follows: the display dynamic effect type is dithering.

It is to be understood that the above scenarios are only examples and do not constitute specific limitations of the present solution.

By adopting the technical means of the embodiment of the invention, different role edge rendering strategies including edge display colors, edge display lighting effects and edge dynamic effects are set for different role edge parts, and the rendering of edge pixels of the virtual role can be set from different layers, so that the stereoscopic impression of the virtual role is further improved, and the reality sense of the game is improved.

In a preferred embodiment, the edge rendering policy further includes a rendering priority for each type of setting parameter.

Specifically, the rendering priority of each type of setting parameter is set according to the respective rendering effect, rendering is performed preferentially when the priority is high, and rendering is limited or cancelled when the priority is low.

As an example, during game development, the background of the virtual character is set to be a black background to reduce errors caused when the background performs priority setting on each type of setting parameter, and the same number of play frames per second and play time are set. Then, for each type of rendering picture with parameters, recording the brightness value of each pixel in each frame of picture, then summing the brightness values of each pixel in each frame of rendering picture, and dividing the sum by the number of the pixels to obtain the average brightness value of the frame of rendering picture. And then, summing the average brightness values of the rendered pictures of each frame, and dividing the sum by the total frame number to calculate the brightness average value of the type setting parameter. Finally, comparing the brightness average value of each type of setting parameter with respective preset threshold values to obtain rendering priority, namely, the priority greater than the preset threshold value is high, and the priority lower than the preset threshold value is low; or directly comparing the brightness average values of all the strategies and sorting the brightness average values according to the priority, namely, the brightness average value is high in priority and the brightness average value is low in priority.

Further, the edge rendering policy further includes an edge rendering level.

Specifically, the edge rendering level may be defined by a user, and the edge rendering level further has a correspondence relationship with the rendering priority of each type of setting parameter.

As an example, the edge rendering level includes: a high quality rendering level, a normal quality rendering level and a low quality rendering level, the rendering priorities obtained in the previous steps being: the setting parameter priority for displaying light effects is highest, the setting parameter priority for displaying colors is high, and the setting parameter priority for displaying dynamic effects is low. Rendering the setting parameters of the edge display light effect, the setting parameters of the display color and the setting parameters of the display dynamic effect at the same time under the high-image quality rendering level; under the common image quality rendering level, only rendering the setting parameter of the display light effect with the highest rendering priority and the setting parameter of the display color with the high rendering priority, and not rendering the setting parameter of the display dynamic effect with the low rendering priority; and under the low image quality rendering level, only the setting parameter of the display light effect with the highest rendering priority is rendered, and the setting parameter of the display color with the high rendering priority and the setting parameter of the display dynamic effect with the low rendering priority are not rendered.

By adopting the technical means of the embodiment of the invention, the rendering strategy can be processed in a grading way by setting the rendering priority and the rendering level, and the edge rendering of different equipment configurations can be ensured.

As a preferred implementation manner, in a preferred embodiment, the pixel brightness values of the target virtual character and the display background of the current display interface are preset to different values, and step S11 specifically includes:

s111: acquiring a display model of a target virtual character;

s112: acquiring brightness values of all role pixels of a display model of a target virtual role, and acquiring brightness values of all background pixels of a display background of a current display interface;

s113: and determining the role edge of the target virtual role in the current display interface according to the brightness value of each role pixel and the brightness value of each background pixel.

Preferably, the luminance value of the character pixel is greater than the luminance value of the background pixel.

Specifically, since the luminance value of each character pixel and the luminance value of each background pixel are not equal in value, the present embodiment can distinguish the target virtual character from the display background by the luminance value. When the character edge is obtained, the target virtual character and the display background may be rendered into the same texture map, and the edge pixel of the virtual character is determined by the difference between the brightness value of each pixel in the texture map and the brightness values of the pixels around the pixel.

As an example, after rendering the virtual character and the display background to the same texture map, comparing the brightness difference between each pixel and its front, back, left, and right four pixels (or adding the front left, front right, back left, back right, or more pixels) in the texture map, since the first model brightness values of the virtual character are all the same value, the difference between the brightness values of its internal pixels is 0, and the difference between the brightness values of its edge pixels and the display background is not 0, so that the edge pixels can be selected by traversing the pixels, and after all the edge pixels are selected, the edge pixels of the virtual character can be determined.

As another example, after rendering the virtual character and the display background to the same texture map, comparing the brightness gradient values of each pixel in the texture map with the front, back, left, and right four pixels (or adding the front, back, and back left pixels, or more pixels), since the brightness values of the first model of the virtual character are all the same value, the gradient value between the brightness values of the internal pixels is 0, and the gradient value between the brightness value of the edge pixel and the brightness value of the display background is not 0, the edge pixel can be selected by traversing the pixels, and after all the edge pixels are selected, the edge pixel of the virtual character can be determined.

By adopting the technical means of the embodiment of the invention, the edge pixels of the target virtual character are determined based on the difference of the brightness values between the target virtual character and the display background, the calculation method is simple, the calculation amount is small, and the character edge can be quickly determined.

In another preferred embodiment, the pixel transparency values of the target virtual character and the display background of the current display interface are preset to different values, and step S11 specifically includes:

s111': acquiring a display model of a target virtual character;

s112': the method comprises the steps of obtaining transparency values of all role pixels of a display model of a target virtual role, and obtaining transparency values of all background pixels of a display background of a current display interface;

s113': and determining the role edge of the target virtual role in the current display interface according to the transparency value of each role pixel and the transparency value of each background pixel.

Preferably, the transparency value of the character pixel is smaller than the transparency value of the background pixel.

Specifically, since the transparency values of the character pixels and the transparency values of the background pixels are not equal in value, the present embodiment can distinguish the target virtual character from the display background by the transparency values. When the character edge is obtained, the target virtual character and the display background may be rendered into the same texture map, and the character edge of the target virtual character is determined by the difference between the transparency value of each pixel in the texture map and the transparency values of the pixels around the pixel.

As an example, after the target avatar and the display background are rendered into the same texture map, transparency differences between each pixel and its front, back, left, and right four pixels (or a left front, a right front, a left back, a right back, or more pixels may be added) in the texture map are compared, since transparency values of the first model of the avatar are the same values, a difference between transparency values of its internal pixels is 0, and a difference between transparency values of its edge pixels and the display background is not 0, edge pixels can be selected by traversing pixels, and after all edge pixels are selected, edge pixels of the avatar can be determined.

As another example, after rendering the virtual character and the display background to the same texture map, comparing transparency gradient values of each pixel in the texture map with four pixels before, after, left, and right (or four pixels before, after, and after, or more pixels) in the texture map, since the transparency values of the first model of the virtual character are all the same values, the gradient value between transparency values of its internal pixels is 0, and the gradient value between the edge pixel and the transparency value of the pixel of the display background is not 0, so that the edge pixel can be selected by traversing the pixels, and after all the edge pixels are selected, the edge pixel of the virtual character can be determined.

By adopting the technical means of the embodiment of the invention, the edge pixels of the virtual character are determined based on the difference of the transparency values between the virtual character and the display background, the calculation method is simple, the calculation amount is small, and the edge pixels can be quickly determined.

Fig. 4 is a schematic structural diagram of an edge tracing apparatus for a virtual character according to an embodiment of the present invention. An embodiment of the present invention provides an edge tracing apparatus 20 for a virtual character, including: a character edge obtaining module 21, a broken line type analyzing module 22, a broken line connection processing module 23 and a character edge rendering module 24, wherein,

the role edge obtaining module 21 is configured to obtain a role edge of the target virtual role in the current display interface;

the broken line type analysis module 22 is configured to obtain a broken line position of the role edge, and analyze a broken line type of the broken line position of the role edge; wherein the type of line break comprises a body contour line break type and a non-body contour line break type;

the broken line connection processing module 23 is configured to perform connection processing on the broken line part which is a type of body contour broken line;

the role edge rendering module 24 is configured to render the role edge of the target virtual role according to a role edge rendering policy that is preset and corresponds to a line break type at a line break point of the role edge.

The embodiment of the invention provides an edge description device of a virtual character, which is characterized in that a character edge of a target virtual character in a current display interface is obtained through a character edge obtaining module, a broken line type analyzing module obtains a broken line part of the character edge and analyzes whether the broken line type of the broken line part of the character edge is a body contour broken line type or a non-body contour broken line type, then a broken line connection processing module carries out connection processing on the broken line part of the body contour broken line type, and finally, a character edge rendering module renders the character edge of the target virtual character according to a preset character edge rendering strategy corresponding to the broken line type of the broken line part of the character edge. The original model rendering effect of the virtual character can be improved by performing connection processing on the broken line part of the body contour broken line type, so that the edge description effect of the virtual character is further improved, and the situation that the edge fracture phenomenon of the virtual character is more obvious is avoided. In addition, the present invention is applicable to various fields. After the connection processing is carried out on the broken line positions of the broken line types of the body outline, the edge drawing is carried out on the role edges corresponding to the different broken line types by adopting different role edge rendering strategies, the display effects of different parts of the role edges can be more highlighted, the reasonable distinguishing of the drawing effects of the outline of the game role is realized, and the edge drawing effect of the virtual role can be effectively improved.

As a preferred embodiment, the disconnection type analyzing module 22 specifically includes:

the first acquisition unit is used for acquiring the broken line point of the edge line segment where each broken line of the role edge is located in the display interface;

the extension processing unit is used for extending the preset length of the broken line part in the line breaking direction of the broken line part by taking the broken line point as a starting point;

the intersection point judging unit is used for judging whether each broken line part is extended and then has an intersection point with other extended broken lines;

the broken line type judging unit is used for judging the broken line type at the broken line position as the body contour broken line type if the broken line position is extended and an intersection point exists between the extended broken line position and other extended broken line positions; and if the broken line part is not crossed with other extended broken line parts after being extended, judging the broken line type at the broken line part as a non-body contour broken line type.

By adopting the technical means of the embodiment of the invention, the broken line type of each broken line position of the role edge can be effectively judged, so that different edge description operations can be performed on the broken line positions of different broken line types in the follow-up process.

As a preferred embodiment, the disconnection-connection processing module 23 specifically includes:

the coordinate information acquisition unit is used for acquiring coordinate information of two broken lines with intersection points after the preset length is prolonged;

the shortest distance determining unit is used for determining the shortest distance between the two broken lines according to the coordinate information of the two broken lines;

the arc segment acquisition unit is used for acquiring a corresponding arc segment with a preset radian according to the shortest distance between the two broken line positions;

and the connection processing unit is used for connecting the two broken line positions according to the arc line segment.

By adopting the technical means of the embodiment of the invention, the connection processing of the broken line part in the type of body contour broken line can be effectively realized, so that the rendering display effect of the role edge of the virtual role is effectively improved, and the rendering effect of the subsequent edge rendering processing of the virtual role is improved.

As a preferred embodiment, the preset character edge rendering strategies include a first character edge rendering strategy corresponding to a non-body contour broken line type and a second character edge rendering strategy corresponding to a body contour broken line type;

then, the character edge rendering module 24 specifically includes:

the first rendering unit is used for rendering a first type of edge line segment of the target virtual character according to the first character edge rendering strategy; the first type of edge line segment is an edge line segment where a broken line of a non-body contour broken line type is located in the role edge;

the second rendering unit is used for rendering a second type of edge line segment of the target virtual character according to the second character edge rendering strategy; the second type of edge line segment is an edge line segment except the first type of edge line segment in the role edge.

In a preferred embodiment, the edge line segment where the broken line of the character edge is of the non-body contour broken line type includes a hair line segment of the target virtual character.

As a preferred embodiment, the role edge rendering policy includes: setting parameters of the display color of the role edge, setting parameters of the display light effect of the role edge and setting parameters of the display dynamic effect of the role edge.

Specifically, the setting parameters of the display color include: the display color type and the single display time length of the display color type in each preset time interval;

the setting parameters for displaying the light effect comprise: displaying a light effect type;

the setting parameters for displaying the dynamic effect comprise: the dynamic effect type is displayed.

By adopting the technical means of the embodiment of the invention, different role edge rendering strategies including edge display colors, edge display lighting effects and edge dynamic effects are set for different role edge parts, and the rendering of edge pixels of the virtual role can be set from different layers, so that the stereoscopic impression of the virtual role is further improved, and the reality sense of the game is improved.

In a preferred embodiment, the brightness values of the pixels of the target virtual character and the display background of the display interface are preset to different values;

then, the character edge obtaining module 21 includes:

a display model acquisition unit for acquiring a display model of a target virtual character;

the brightness value acquisition unit is used for acquiring the brightness value of each role pixel of the display model of the target virtual role and acquiring the brightness value of each background pixel of the display background of the current display interface;

and the role edge determining unit is used for determining the role edge of the target virtual role in the current display interface according to the brightness value of each role pixel and the brightness value of each background pixel.

By adopting the technical means of the embodiment of the invention, the edge pixels of the target virtual character are determined based on the difference of the brightness values between the target virtual character and the display background, the calculation method is simple, the calculation amount is small, and the character edge can be quickly determined.

It should be noted that, the edge tracing apparatus for a virtual character according to the embodiment of the present invention is configured to execute all the process steps of the edge tracing method for a virtual character according to the embodiment, and working principles and beneficial effects of the two are in one-to-one correspondence, and thus are not described again.

Fig. 5 is a schematic structural diagram of an edge tracing apparatus for a virtual character according to an embodiment of the present invention. The third embodiment of the present invention provides an edge tracing apparatus 30 for a virtual character, which includes a processor 31, a memory 32, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the processor implements the edge tracing method for the virtual character according to the above embodiment.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.

While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种信息推荐方法、装置、计算机设备及存储介质

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!

技术分类