Rendering method and device and computer program product

By obtaining streaming texture images with known streaming rendering parameters and transparency, combining the triangle segmentation and texture coordinate calculation of trajectory data, dynamically compute the rendering color, the problem of high design time and cost of streaming texture images in the existing technology is solved, and the problem of high design time and cost of streaming texture images is realized. Efficient streaming effect rendering.

CN119478084APending Publication Date: 2025-02-18BEIJING AUTONAVI YUNMAP TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411391033.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

When the prior art realizes the streaming effect of trajectory data, designers are required to design streaming texture images with fixed color matching for each color, resulting in high design time and cost, and the large number of streaming texture images occupies equipment resources, affecting rendering efficiency.

Method used

By obtaining streaming rendering parameters (such as streaming start color and streaming tail color) and streaming texture images with known transparency, triangle segmentation is performed based on trajectory data, correlating trajectory distance and vertices, calculating texture coordinates and color offset weights, and dynamically compute Render the color to achieve rendering of streamer effects.

Benefits of technology

It reduces the design time and cost of streaming texture images, reduces the use of equipment resources, improves rendering efficiency, and can achieve streaming effects of different colors without the need to design streaming texture images with fixed color matching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478084A_ABST
    Figure CN119478084A_ABST
Patent Text Reader

Abstract

The invention provides a rendering method and device and a computer program product, and the method comprises the steps: at least taking a streamer starting point color and a streamer tail point color as streamer rendering parameters for independent configuration, enabling a streamer texture image not to be provided with a fixed color, and only setting the transparency value of a pixel point. The method comprises the following steps: for vertexes of a triangle obtained by performing triangle subdivision based on track points included in to-be-rendered track data, obtaining texture coordinates of the corresponding vertexes of the triangle through a streamer rendering parameter, a track distance associated with the vertexes of the triangle and a rendering time parameter; sampling on a streamer texture image with a known transparency value based on texture coordinates of vertexes of the triangle to obtain color shift weights of the corresponding vertexes of the triangle, and obtaining rendering colors of the corresponding vertexes of the triangle by using the color shift weights, a streamer starting point color and a streamer tail point color; even if the streamer texture image has no fixed color matching, the rendering color of the corresponding vertex of the triangle can be calculated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of rendering technology, and in particular to a rendering method, device and computer program product. Background Art

[0002] As applications provide more and more services for people's lives, applications have begun to show users their historical use of the application in various forms to strengthen the connection between users and applications. For example, music applications provide users with a playlist of songs listened to in the year, and travel applications provide users with historical travel data.

[0003] Taking historical travel data as an example, if the historical travel data is trajectory data, in order to make the visual effect of the trajectory data more attractive, the existing technology displays the trajectory line corresponding to the trajectory data with a streamer effect. However, the inventor of the present application found that when the existing technology realizes the streamer effect, the RGB color value of each pixel point of the streamer texture image used is known and determined, that is, the streamer texture image itself has color. For example, for a blue streamer effect, the designer needs to design a blue streamer texture image, and for a green streamer effect, the designer needs to design a green streamer texture image. If the color of the streamer effect gradually changes from yellow to green, the designer needs to design a streamer texture image that gradually changes from yellow to green, etc.

[0004] When there are many pieces of trajectory data, that is, when there are many trajectory lines drawn, in order to avoid the problem of overlapping and indistinguishable trajectory lines, it is usually necessary to design streamer texture images of different colors for the trajectory lines. According to the existing technology, each streamer texture image needs to be designed separately by the designer, which will take a lot of time. In addition, the more streamer texture images there are, the more device resources are occupied, which affects the rendering efficiency. Therefore, it is necessary to provide a new rendering technology solution that can achieve the streamer effect at low cost and high efficiency. Summary of the invention

[0005] The embodiments of the present application provide a rendering method, device and computer program product, which can realize the streamer effect at low cost and high efficiency. The technical solution is as follows.

[0006] In a first aspect, a rendering method is provided, the method comprising:

[0007] Obtain streamer rendering parameters and a streamer texture image, wherein the streamer rendering parameters at least include a streamer starting point color and a streamer tail point color, and the transparency value of the pixel point of the streamer texture image is known;

[0008] Obtaining the trajectory distance of the trajectory point included in the trajectory data to be rendered;

[0009] Performing triangulation based on the trajectory points included in the trajectory data to be rendered to obtain vertices of triangles corresponding to the trajectory points;

[0010] Associating the trajectory distance of the trajectory point with the vertex of the triangle corresponding to the trajectory point;

[0011] Based on the streamer rendering parameters, the trajectory distance associated with the vertices of the triangle, and the rendering time parameters, texture coordinates of the corresponding vertices of the triangle are obtained;

[0012] Based on the texture coordinates of the corresponding vertices of the triangle, obtaining a transparency value from the streamer texture image as a color shift weight of the corresponding vertices of the triangle;

[0013] Obtaining a rendering color of a corresponding vertex of the triangle based on the color of the streamer starting point, the color of the streamer tail point, and a color shift weight of a corresponding vertex of the triangle;

[0014] Based on the rendering colors of the trajectory points and the corresponding vertices of the triangles included in the trajectory data to be rendered, a trajectory line with a streamer effect is rendered.

[0015] In some embodiments, the streamer rendering parameters further include: streamer duration, and based on the streamer rendering parameters, the trajectory distance associated with the vertices of the triangle, and the rendering time parameters, the texture coordinates of the vertices of the triangle are obtained, including:

[0016] Obtaining a streamer flow speed based at least on a maximum value of the trajectory distances associated with the vertices of the triangle and a duration of the streamer;

[0017] The texture coordinates of the corresponding vertices of the triangle are obtained based at least on the streamer flow speed, the trajectory distance associated with the vertices of the triangle and the rendering time parameter.

[0018] In some embodiments, the streamer rendering parameters further include: the number of streamers, the streamer flow speed is obtained based on at least the maximum value of the trajectory distances associated with the vertices of the triangle and the duration of the streamer, specifically:

[0019] The maximum value of the trajectory distances associated with the vertices of the triangle is divided by the duration of the streamer and the number of streamers to obtain the streamer flow speed.

[0020] In some embodiments, the rendering time parameters include: a streamer start time and a streamer rendering time, and obtaining the texture coordinates of the corresponding vertices of the triangle based at least on the streamer flow speed, the trajectory distance associated with the vertices of the triangle and the rendering time parameters includes:

[0021] The moving distance of the streamer is obtained by multiplying the flow speed of the streamer by the difference between the streamer rendering time and the streamer start time;

[0022] Based on the streamer moving distance and the trajectory distance associated with the vertices of the triangle, obtaining the streamer distance of the corresponding vertex of the triangle;

[0023] The streamer distance is normalized to a value between 0 and 1 as the texture coordinates of the corresponding vertices of the triangle at the streamer rendering time.

[0024] In some implementations, the streamer distance is normalized to a value between 0 and 1, specifically:

[0025] Dividing the streamer distance by the maximum value of the trajectory distances associated with the vertices of the triangle to normalize the streamer distance to a value between 0 and 1;

[0026] or,

[0027] The streamer distance is divided by the maximum value of the track distances associated with the vertices of the triangle and then multiplied by the streamer number, so as to normalize the streamer distance to a value between 0 and 1.

[0028] In some implementations, obtaining the rendering color of the corresponding vertex of the triangle based on the streamer starting point color, the streamer tail point color, and the color offset weight of the corresponding vertex of the triangle specifically includes:

[0029] Calculate the color difference between the color of the starting point of the streamer and the color of the ending point of the streamer;

[0030] Obtaining disturbed color values ​​of corresponding vertices of the triangle using the color difference and color shift weights of corresponding vertices of the triangle;

[0031] The color value of the rendering color of the corresponding vertex of the triangle is obtained by using the color of the starting point of the streamer or the color of the tail point of the streamer and the disturbed color value of the corresponding vertex of the triangle.

[0032] In some embodiments, the method further comprises:

[0033] Convert the color value of the rendered color of the triangle's vertices to a grayscale value;

[0034] When the grayscale value is greater than a preset target threshold, setting the floodlight color value of the vertex of the triangle;

[0035] Based on the rendering colors of the trajectory points and the corresponding vertices of the triangles included in the trajectory data to be rendered, a trajectory line with a streamer effect is rendered, specifically:

[0036] Based on the trajectory points included in the trajectory data to be rendered, the color values ​​of the rendering colors of the corresponding vertices of the triangles and the floodlight color values, a trajectory line with streamer effects and floodlight effects is rendered.

[0037] In some embodiments, the method further comprises:

[0038] In response to a display request for the trajectory data to be rendered, the current time of the system is obtained as the streamer start time.

[0039] In a second aspect, a rendering device is provided, the device comprising:

[0040] A first acquisition unit is used to acquire streamer rendering parameters and a streamer texture image, wherein the streamer rendering parameters at least include a streamer starting point color and a streamer tail point color, and the transparency value of the pixel point of the streamer texture image is known;

[0041] A second acquisition unit, used to acquire the trajectory distance of the trajectory point included in the trajectory data to be rendered;

[0042] A triangulation unit, configured to perform triangulation based on the trajectory points included in the trajectory data to be rendered, and obtain vertices of triangles corresponding to the trajectory points;

[0043] an associating unit, configured to associate the trajectory distance of the trajectory point with the vertex of the triangle corresponding to the trajectory point;

[0044] A first calculation unit, configured to obtain texture coordinates of corresponding vertices of the triangle based on the streamer rendering parameters, trajectory distances associated with the vertices of the triangle, and rendering time parameters;

[0045] A third acquisition unit, configured to acquire, from the streamer texture image, a transparency value as a color shift weight of a corresponding vertex of the triangle based on the texture coordinates of the vertices of the triangle;

[0046] A second calculation unit, configured to obtain a rendering color of a corresponding vertex of the triangle based on a color of a starting point of the streamer, a color of a tail point of the streamer, and a color shift weight of a corresponding vertex of the triangle;

[0047] The rendering unit is used to render a trajectory line with a streamer effect based on the rendering colors of the trajectory points and the vertices of the triangles included in the trajectory data to be rendered.

[0048] According to a third aspect, a computer program product is provided, which includes one or more computer program instructions. When the computer program instructions are loaded and executed by a computer, the computer executes the method provided by the first aspect or any optional manner of the first aspect.

[0049] It can be seen that the embodiments of the present application have the following beneficial effects:

[0050] Since the embodiment of the present application configures at least the starting color of the streamer and the tail color of the streamer as streamer rendering parameters separately, the streamer texture image no longer needs to have a fixed color scheme, but only needs to set the transparency value of the pixel point. At the same time, for the vertices of the triangle obtained by triangulating the trajectory points included in the trajectory data to be rendered, the present application obtains the texture coordinates of the corresponding vertices of the triangle through the streamer rendering parameters, the trajectory distance associated with the vertices of the triangle, and the rendering time parameters. The texture coordinates of the vertices of the triangle are sampled on the streamer texture image with a known transparency value to obtain the color offset weight of the corresponding vertices of the triangle, and then the color offset weight, the starting color of the streamer and the tail color of the streamer are used to obtain the rendering color of the corresponding vertices of the triangle. Even if the streamer texture image does not have a fixed color scheme, the rendering color of the corresponding vertices of the triangle can be calculated. Therefore, for scenes that render streamer effects of different colors, it is only necessary to configure these colors as streamer rendering parameters, and there is no need for designers to design a streamer texture image with a corresponding fixed color scheme for each color, which reduces the design time of the streamer texture image and reduces the design cost. At the same time, due to the reduction in the number of streamer texture images, the occupation of device resources by the streamer texture image is also reduced, thereby improving the rendering efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is a flowchart of a rendering method provided in an embodiment of the present application;

[0052] Figure 2 is a triangulation principle diagram provided in an embodiment of the present application;

[0053] Figure 3 is a schematic diagram of a streamer texture image provided by an embodiment of the present application;

[0054] Figure 4 This is a schematic diagram of the streamer rendering effect provided by an embodiment of the present application;

[0055] Figure 5 This is another schematic diagram of streamer rendering effect provided by an embodiment of the present application;

[0056] Figure 6 This is another schematic diagram of streamer rendering effect provided by an embodiment of the present application;

[0057] Figure 7 is a schematic diagram of the structure of a rendering device provided in an embodiment of the present application;

[0058] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0060] The following is an explanation of some terminology concepts involved in the embodiments of the present application.

[0061] (1) Streamer

[0062] Streamer is a visual effect of UV animation, which includes the effects of light flow, flickering, change, jump, etc. Streamer can be used to simulate animation scenes such as dynamic flowing water, burning flames, and magma flow.

[0063] (2) Bloom

[0064] Bloom is streaks of light extending outward from the boundaries of bright areas of an image, creating a halo effect in bright areas of an image.

[0065] (3) Shader

[0066] A shader is a program that runs on the graphics processing unit (GPU) of a computer. Shaders include vertex shaders and pixel shaders. Vertex shaders are responsible for processing vertex data of primitives (such as triangles, points, lines, etc.), and pixel shaders are responsible for processing pixel data of primitives.

[0067] The details of the embodiments of the present disclosure are described in detail below through specific examples.

[0068] Attached Figure 1 : is a flowchart of a rendering method provided in an embodiment of the present application, the method is used to render a streamer effect on trajectory data, and includes the following steps:

[0069] Step S101, obtaining streamer rendering parameters and a streamer texture image, wherein the streamer rendering parameters at least include a streamer starting point color and a streamer tail point color, and the transparency value of the pixel points of the streamer texture image is known.

[0070] In an embodiment of the present application, the streamer rendering parameters and the streamer texture image are two independent data, wherein the streamer rendering parameters include the RGB value of the streamer starting point color and the RGB value of the streamer tail point color, which can be pre-set by a technician, or can be set by the user according to actual needs when using the technical solution provided in the embodiment of the present application to render the streamer effect. Regardless of the setting method, it will not affect the implementation of the embodiment of the present application.

[0071] In the embodiment of the present application, the transparency value of the streamer texture image is known. It can be understood that in computer graphics, an image is composed of pixels, and each pixel includes information of four channels, RGBA, where RGBA represents red, green, blue and transparency, respectively. The transparency value of the streamer texture image in the present application is known, which means that the value of the A channel of the streamer texture image is determined / fixed and can be directly read from the streamer texture image, while the value of RGB is not fixed and needs to be calculated. Since the streamer texture image in the embodiment of the present application does not have a fixed RGB value, there is no need for designers to specially design a streamer texture image with RGB values, which greatly reduces the design cost of the streamer texture image. Compared with the existing technology that requires designing a streamer texture image for each color, it also greatly reduces the number of streamer texture images.

[0072] Step S102, obtaining the trajectory distance of the trajectory point included in the trajectory data to be rendered.

[0073] The technical solution provided in the embodiment of the present application can be used to render trajectory data with a streamer effect. The trajectory data is a collection of a series of trajectory points with timestamp marks formed by the object during the movement. The trajectory points can also be called position points, and the coordinates of the position points are longitude and latitude coordinates. The trajectory data of the embodiment of the present application can be trajectory data formed outdoors or indoors in various travel modes such as driving, cycling, walking (including running). If there are more than two trajectory data that need to be rendered at the same time, when implementing the technical solution provided by the present application, the steps after step S201 can be executed in parallel for different trajectory data.

[0074] The streaming light effect achieved by the embodiment of the present application for trajectory data is specifically the flow of light on the trajectory line formed by trajectory points. Since the light needs to flow on the trajectory line, it is necessary to determine the parameters for achieving the streaming light effect during the execution of this solution, including: the streaming light flow speed, etc. For this purpose, the embodiment of the present application needs to obtain the trajectory distance of the trajectory points included in the trajectory data to be rendered, and the streaming light flow speed can be obtained through the trajectory distance and the rendering time parameter of the streamer.

[0075] As mentioned above, the trajectory points are marked with timestamps. Usually, the trajectory points included in the trajectory data are sorted by timestamps. Taking sorting from early to late as an example, the trajectory distance of a trajectory point is equal to the distance between the trajectory point and a trajectory point sorted before it, plus the trajectory distance from a trajectory point sorted before it to the first trajectory point. That is, the trajectory distance of a trajectory point is the distance from the trajectory point sorted before it to the first trajectory point sorted. For example, the trajectory data to be rendered includes 4 trajectory points, the trajectory distance of the first trajectory point is 0, the trajectory distance of the second trajectory point is the distance from the second trajectory point to the first trajectory point; the trajectory distance of the third trajectory point is the distance from the third trajectory point to the second trajectory point plus the trajectory distance of the second trajectory point, the trajectory distance of the fourth trajectory point is the distance from the fourth trajectory point to the third trajectory point, plus the trajectory distance of the third trajectory point, and so on.

[0076] Step S103 , performing triangulation (triangulation) based on the trajectory points included in the trajectory data to be rendered, and obtaining vertices of triangles corresponding to the trajectory points.

[0077] Since the trajectory data needs to be rendered as a trajectory line with a certain width, it is necessary to triangulate the trajectory points included in the rendered trajectory data to obtain the vertices of the triangle, and then render based on the vertices of the triangle to obtain a trajectory line with a certain width. The embodiment of the present application adopts the existing triangulation technology, which will not be described in detail here.

[0078] Step S104, associating the trajectory distance of the trajectory point with the vertex of the triangle corresponding to the trajectory point.

[0079] In some embodiments, considering that the trajectory data to be rendered includes multiple trajectory points, after the multiple trajectory points are triangulated to obtain the triangle corresponding to each trajectory point, the trajectory distance of the trajectory point and the vertex of the triangle corresponding to the trajectory point can be associated, and then the texture coordinates of the vertex of the triangle can be obtained according to the trajectory distance of the trajectory point associated with the vertex of the triangle.

[0080] refer to Figure 2 As shown, Figure 2 The triangulation principle adopted in the embodiment of the present application is illustrated. Figure 2 The green point in the middle represents the trajectory point. The line connecting the green trajectory points is used as the midline of the rectangle. Two lines passing through the trajectory points and perpendicular to the midline are generated, and two lines parallel to the midline are generated. The distance from the line parallel to the midline to the midline can be a preset value. These four lines form a closed rectangle, which can be divided into two triangles along any diagonal line. Figure 2 As shown, the vertex of the triangle corresponding to trajectory point 1 is Figure 2Vertex 1 and vertex 2 are shown, therefore, the trajectory distance of trajectory point 1 will be associated with vertex 1 and vertex 2.

[0081] Step S105, obtaining texture coordinates of corresponding vertices of the triangle based on streamer rendering parameters, trajectory distances associated with vertices of the triangle, and rendering time parameters.

[0082] Texture coordinates can also be called uv coordinates, u is the horizontal coordinate, v is the vertical coordinate, and the value range of u and v is 0 to 1; the process of using texture coordinates to obtain the color attributes of pixels from a texture image is called sampling, and sampling can be implemented by obtaining the color attributes of pixels corresponding to the texture coordinates calculated in step S205 in the streamer texture image. Since the streamer effect achieved by the trajectory data of the present application is the flow of light on the trajectory line, this means that as time changes, it is necessary to continuously sample in the streamer texture image to obtain the rendering color of the vertices of the triangle at the corresponding time. Therefore, the streamer rendering parameters of the present application also need to include: the duration of the streamer, the duration of the streamer can be used to calculate the streamer flow speed, which is also equivalent to the texture change speed. Therefore, the texture change distance can be calculated using the streamer flow speed, and then the texture coordinates of the vertices of the triangle at the corresponding time can be obtained.

[0083] Specifically, when the streamer rendering parameters further include: streamer duration, step S105 may be implemented as follows:

[0084] The flow velocity of the streamer is calculated based on at least the maximum value of the trajectory distances associated with the vertices of the triangle and the duration of the streamer;

[0085] The texture coordinates of the corresponding vertices of the triangle are obtained based at least on the streamer flow speed, the trajectory distance associated with the vertices of the triangle, and the rendering time parameter.

[0086] It can be understood that the maximum value of the trajectory distance associated with the vertices of the triangle is the trajectory distance between the two trajectory points sorted at both ends in the trajectory data. Referring to the example in which the aforementioned trajectory data includes 4 trajectory points, the maximum value of the trajectory distance is the trajectory distance from the 4th trajectory point to the 1st trajectory point.

[0087] In some embodiments, more than one flowing light needs to be rendered simultaneously for the trajectory data. To support the rendering effect, the streamer rendering parameters may further include the streamer number n, where n is a positive integer greater than or equal to 1. Since the streamer number affects the streamer flow speed, and thus affects the texture coordinates of the vertices of the triangle, when more than one flowing light needs to be rendered simultaneously for the trajectory data, the present application obtains the streamer flow speed based on at least the maximum value of the trajectory distances associated with the vertices of the triangle and the streamer duration, and the preferred embodiments provided are as follows:

[0088] The maximum value of the trajectory distances associated with the triangle vertices is divided by the streamer duration and the number of streamers to obtain the streamer flow speed.

[0089] Exemplarily, assuming that the maximum value of the trajectory distances associated with the vertices of a triangle is maxDistance, the streamer duration is Dur, and the number of streamers is n, the streamer flow speed is equal to the maximum value of the trajectory distances associated with the vertices of the triangle divided by the streamer duration and the number of streamers, that is, the streamer flow speed is equal to maxDistance / (Dur×n).

[0090] When specifically calculating the texture coordinates of the vertices of the triangle, in order to achieve a uniform rendering effect, the texture coordinates of the vertices of the triangle may be normalized to a value between 0 and 1. Specifically, the aforementioned obtaining the texture coordinates of the corresponding vertices of the triangle based at least on the streamer flow speed, the trajectory distance associated with the vertices of the triangle and the rendering time parameter may specifically include:

[0091] The moving distance of the streamer is obtained by multiplying the flow speed of the streamer by the difference between the streamer rendering time and the streamer start time.

[0092] Based on the streamer moving distance and the trajectory distance associated with the vertices of the triangle, the streamer distance of the corresponding vertex of the triangle is obtained;

[0093] Normalize the streamer distance to a value between 0 and 1, which is used as the texture coordinate of the corresponding vertex of the triangle at the streamer rendering time.

[0094] In a specific implementation, the streamer distance is normalized to a value between 0 and 1 as the texture coordinate of the corresponding vertex of the triangle at the streamer rendering time. This can be achieved by dividing the streamer distance by the maximum value of the trajectory distances associated with the vertices of the triangle.

[0095] The following is an introduction to the process of determining texture coordinates provided by the present application with reference to specific examples.

[0096] Exemplarily, the trajectory distance associated with the vertices of the triangle is ptDistance, the maximum value of the trajectory distance ptDistance associated with the vertices of the triangle is maxDistance, the duration of the streamer is Dur, the start time of the streamer is T0, and the streamer rendering time is t. Then the streamer flow speed is equal to maxDistance / Dur, the streamer moving distance is s1, s1=(maxDistance / Dur)×(t-T0), the streamer distance of the corresponding vertex of the triangle is equal to s1+ptDistance, and the texture coordinates of the vertex of the triangle at time t are (u0, v1). Figure 3 As shown, the transparency value of the streamer texture image changes with the change of the v coordinate. Therefore, for the vertex of the triangle, the u coordinate in the texture coordinate of the vertex can be a fixed value, v1 = (s1 + ptDistance) / maxDistance. Conversely, if the transparency value of the streamer texture image changes with the change of the u coordinate, the v coordinate can be a fixed value, u0 = (s1 + ptDistance) / maxDistance.

[0097] As mentioned above, in actual applications, there are situations where more than one streamer is rendered. Therefore, the streamer rendering parameters may also include the number of streamers. At this time, the maximum value of the trajectory distances associated with the vertices of the triangle can be divided by the number of streamers to obtain the maximum average value, and then the maximum average value can be used to normalize the streamer distance to a value between 0 and 1. That is, the streamer distance is divided by the maximum value of the trajectory distances associated with the vertices of the triangle and then multiplied by the number of streamers to normalize the streamer distance to a value between 0 and 1.

[0098] Exemplarily, the trajectory distance associated with the vertices of the triangle is ptDistance, the maximum value of the trajectory distance ptDistance associated with the vertices of the triangle is maxDistance, the duration of the streamer is Dur, the number of streamers is n, then the streamer flow speed is equal to maxDistance / (Dur×n), the streamer start time is T0, the streamer rendering time is t, then the streamer moving distance is s1, then s1=(maxDistance / (Dur×n))×(t-T0), the streamer distance is equal to s1+ptDistance, the texture coordinates of the vertices of the triangle at t are (u0, v1), if the streamer texture image is as follows Figure 3 As shown, u0 is a fixed value, and v1 in the texture coordinates can be calculated using the following formula:

[0099] v1 = (s1 + ptDistance) × n / maxDistance or v1 = (s1 + ptDistance) / (maxDistance / n)

[0100] On the contrary, if the transparency of the streamer texture image changes with the u coordinate, v1 is a fixed value, and u0 in the texture coordinate can be calculated using the following formula:

[0101] u0=(s1+ptDistance)×n / maxDistance or u0=(s1+ptDistance) / (maxDistance / n).

[0102] In one embodiment, the light streamer start time may be the time point when the light streamer function is turned on, such as the time when the user enters the light streamer effect rendering page or the time when the user clicks the light streamer effect rendering control. The light streamer rendering time is the time for rendering an image of a trajectory line containing a light streamer effect.

[0103] As an example, in response to a user's request to display the trajectory data to be rendered, the current system time can be obtained as the streamer start time. The aforementioned display request can be triggered by an event in which the user enters the streamer effect rendering page or a user clicks on the streamer effect rendering control.

[0104] Step S106, based on the texture coordinates of the corresponding vertices of the triangle, a transparency value is obtained from the streamer texture image as a color shift weight of the corresponding vertices of the triangle.

[0105] Since this application obtains the transparency value from the streamer texture image as the color offset weight of the corresponding vertex of the triangle, Figure 3 As shown, the transparency value of the streamer texture image changes with the change of texture coordinates. Therefore, when the texture coordinates of the vertices of the triangle change with the rendering time, the color shift weight obtained for the vertex also changes, and the change of the color shift weight will affect the rendering color obtained by using the color shift weight and calculation, that is, the rendering color of each vertex of the triangle at different rendering times is different. When the rendering colors of all vertices of the triangle change with the rendering time, the streamer effect of the trajectory data to be rendered can be achieved.

[0106] Step S107, obtaining the rendering color of the corresponding vertex of the triangle based on the color of the starting point of the streamer, the color of the tail point of the streamer and the color offset weight of the corresponding vertex of the triangle.

[0107] like Figure 3As shown, the transparency of the streamer texture image decreases from top to bottom, which means that the rendering color of the vertices of the triangle will change from dark to light. At this time, the rendering color of the corresponding vertices of the triangle calculated using the streamer starting color, the streamer tail color and the color offset weight will change with the change of rendering time, and the streamer effect can be achieved by changing the depth of the color. In other words, the rendering color of the corresponding vertices of the triangle of the present application is calculated based on the color offset weight obtained by sampling on the streamer texture image combined with the streamer starting color and the streamer tail color. There is no need for technicians to configure the color for the streamer texture image. Therefore, if you want to change the color of the streamer effect of the trajectory data, you only need to change the streamer starting color and the streamer tail color, and the streamer texture image can be reused, which can greatly reduce the design cost of the streamer texture image and improve the implementation efficiency.

[0108] In a specific implementation, the rendering color of the corresponding vertices of the triangle can be implemented in the following manner, including:

[0109] Calculate the color difference between the starting point color of the streamer and the ending point color of the streamer, that is, calculate the difference in color value between the starting point color of the streamer and the ending point color of the streamer;

[0110] The perturbed color value of the corresponding vertex of the triangle is calculated using the color value difference and the color shift weight of the corresponding vertex of the triangle;

[0111] The color value of the rendering color of the corresponding vertex of the triangle is calculated by using the color of the starting point of the streamer or the color of the tail point of the streamer combined with the disturbance color value.

[0112] The following is an introduction to the process of obtaining rendering colors with specific examples.

[0113] For example, the color value of the streamer start point color is A, A = (r1, g1, b1), the color value of the streamer tail point color is B, B = (r2, g2, b2), the color offset weight of the vertex is w, the disturbance color value is C, C = w × (r1-r2, g1-g2, b1-b2), and the color value of the rendering color is FinalColor.

[0114] In one embodiment, FinalColor=AC=(r1, g1, b1)-w×(r1-r2, g1-g2, b1-b2);

[0115] or,

[0116] In another embodiment, FinalColor=B+C=(r2, g2, b2)+w×(r1-r2, g1-g2, b1-b2).

[0117] Step S108 , rendering a trajectory line with a streamer effect based on the trajectory points and the rendering colors of the corresponding vertices of the triangles included in the trajectory data to be rendered.

[0118] When rendering a trajectory line with a streamer effect, it is necessary to render the line shape of the trajectory line based on the trajectory points, and at the same time, utilize the changes in the rendering colors of the corresponding vertices of the triangle to achieve the streamer effect on the trajectory line.

[0119] In some implementations, the streamer rendering parameters may further include the number of streamer playbacks. The number of streamer playbacks may generally be set to loop playback, so that a trajectory line that always has a streamer effect can be drawn.

[0120] As attached Figure 4 As shown in the figure, the streamer rendering parameters are that the streamer starting point color is green, the streamer tail point color is gray, the number of streamers is 1, the streamer duration is the preset duration, and the streamer playback number is loop playback. Figure 4 In the image, you can see a stream of light that gradually changes from green to gray, always flowing along the trajectory line.

[0121] As attached Figure 5 As shown in the figure, the streamer rendering parameters are that the streamer start point color is green, the streamer end point color is gray, the number of streamers is 3, the streamer duration is the preset duration, and the streamer playback times are loop playback. Figure 4 and attached Figure 5 It can be seen that changing the number of streamers will significantly change the streamer effect. Figure 5 The trajectory line in the figure also includes three streamers that gradually change from green to gray and flow along the trajectory line.

[0122] In some embodiments, the process of determining the texture coordinates of the vertices of the triangle can be performed by a vertex shader, the process of obtaining the rendering colors of the vertices of the triangle can be performed by a pixel shader, and the vertices of the triangle can be rendered according to the rendering colors of the vertices of the triangle.

[0123] In some embodiments, in addition to rendering a streaming effect on the trajectory line, a floodlight effect can also be rendered on the trajectory line. To this end, after calculating the color value of the rendering color of the vertices of the triangle, the color value of the rendering color can be converted into a grayscale value to obtain the grayscale value of the rendering color. When the grayscale value is greater than the target threshold, it means that the brightness of the vertices of the triangle is relatively high, and a floodlight effect can be formed. The floodlight color value of the vertices of the triangle can be set, and then the vertices of the triangle are jointly rendered according to the color value of the rendering color and the floodlight color value, so that the streaming effect and the floodlight effect of the trajectory line can be achieved at the same time, that is, based on the trajectory points to be rendered, the color value of the rendering color of the vertices of the triangle, and the floodlight color value of the vertices of the triangle, a trajectory line with a streaming effect and a floodlight effect is rendered.

[0124] Reference Figure 6 As shown, attached Figure 6 The streamer rendering parameters in the example are: the streamer start color is green, the streamer end color is gray, the number of streamers is 3, the streamer duration is the preset duration, the streamer playback times is loop playback, and the Figure 6 The streamer effect and the bloom effect are rendered at the same time.

[0125] To summarize the above embodiments, in some embodiments of the present application, the starting point color and the tail point color of the streamer are separately configured as streamer rendering parameters, so that the streamer texture image no longer needs to have a fixed color scheme, but only the transparency value of the pixel point needs to be set. At the same time, for the vertices of the triangle obtained by triangulating the trajectory points included in the trajectory data to be rendered, the present application obtains the texture coordinates of the corresponding vertices of the triangle through the streamer rendering parameters, the trajectory distance associated with the vertices of the triangle, and the rendering time parameters, and samples the texture coordinates of the vertices of the triangle on the streamer texture image with a known transparency value to obtain the corresponding vertices of the triangle. The color offset weight is then used, and the color offset weight, the streamer starting point color and the streamer tail point color are used to obtain the rendering color of the corresponding vertices of the triangle. Even if the streamer texture image does not have a fixed color scheme, the rendering color of the corresponding vertices of the triangle can be calculated. Therefore, for scenes that render streamer effects of different colors, it is only necessary to configure these colors as streamer rendering parameters, without the need for designers to design a streamer texture image with a corresponding fixed color scheme for each color, which reduces the design time and cost of the streamer texture image. At the same time, the number of streamer texture images is reduced, which reduces the occupation of device resources by the streamer texture image and improves rendering efficiency.

[0126] Figure 7 It is a structural schematic diagram of a rendering device 700 provided in an embodiment of the present application. The device 700 includes a first acquisition unit 710, a second acquisition unit 720, a segmentation unit 730, an association unit 740, a first calculation unit 750, a third acquisition unit 760, a second calculation unit 770 and a rendering unit 780.

[0127] A first acquisition unit 710 is used to acquire streamer rendering parameters and a streamer texture image, wherein the streamer rendering parameters at least include a streamer starting point color and a streamer tail point color, and the transparency value of the pixel point of the streamer texture image is known;

[0128] A second acquisition unit 720 is used to acquire the trajectory distance of the trajectory point included in the trajectory data to be rendered;

[0129] A triangulation unit 730 is configured to perform triangulation based on the trajectory points included in the trajectory data to be rendered, and obtain vertices of triangles corresponding to the trajectory points;

[0130] An associating unit 740, configured to associate the trajectory distance of the trajectory point with the vertex of the triangle corresponding to the trajectory point;

[0131] A first calculation unit 750 is used to obtain texture coordinates of corresponding vertices of the triangle based on the streamer rendering parameters, the trajectory distance associated with the vertices of the triangle, and the rendering time parameter;

[0132] A third acquisition unit 760 is used to acquire a transparency value as a color shift weight of a corresponding vertex of the triangle from the streamer texture image based on the texture coordinates of the vertices of the triangle;

[0133] A second calculation unit 770 is used to obtain the rendering color of the corresponding vertex of the triangle based on the color of the starting point of the streamer, the color of the tail point of the streamer and the color shift weight of the corresponding vertex of the triangle;

[0134] The rendering unit 780 is used to render a trajectory line with a streamer effect based on the rendering colors of the trajectory points and the vertices of the triangles included in the trajectory data to be rendered.

[0135] In some implementations, the streamer rendering parameters further include: streamer duration, the first calculation unit 750 is used to:

[0136] Obtaining a streamer flow speed based at least on a maximum value of the trajectory distances associated with the vertices of the triangle and a duration of the streamer;

[0137] The texture coordinates of the corresponding vertices of the triangle are obtained based at least on the streamer flow speed, the trajectory distance associated with the vertices of the triangle and the rendering time parameter.

[0138] In some implementations, the streamer rendering parameters further include: the number of streamers, the first calculation unit 750, configured to:

[0139] The maximum value of the trajectory distances associated with the vertices of the triangle is divided by the duration of the streamer and the number of streamers to obtain the streamer flow speed.

[0140] In some implementations, the rendering time parameters include: streamer start time and streamer rendering time. The first calculation unit 750 is used to:

[0141] The moving distance of the streamer is obtained by multiplying the flow speed of the streamer by the difference between the streamer rendering time and the streamer start time;

[0142] Based on the streamer moving distance and the trajectory distance associated with the vertices of the triangle, obtaining the streamer distance of the corresponding vertex of the triangle;

[0143] The streamer distance is normalized to a value between 0 and 1 as the texture coordinates of the corresponding vertices of the triangle at the streamer rendering time.

[0144] In some implementations, the first computing unit 750 is configured to:

[0145] Dividing the streamer distance by the maximum value of the trajectory distances associated with the vertices of the triangle to normalize the streamer distance to a value between 0 and 1;

[0146] or,

[0147] The streamer distance is divided by the maximum value of the track distances associated with the vertices of the triangle and then multiplied by the streamer number, so as to normalize the streamer distance to a value between 0 and 1.

[0148] In some implementations, the second computing unit 770 is configured to:

[0149] Calculate the color difference between the color of the starting point of the streamer and the color of the ending point of the streamer;

[0150] Obtaining disturbed color values ​​of corresponding vertices of the triangle using the color difference and color shift weights of corresponding vertices of the triangle;

[0151] The color value of the rendering color of the corresponding vertex of the triangle is obtained by using the color of the starting point of the streamer or the color of the tail point of the streamer and the disturbed color value of the corresponding vertex of the triangle.

[0152] In some embodiments, the device further comprises a setting unit, the setting unit being configured to:

[0153] Convert the color value of the rendered color of the triangle's vertices to a grayscale value;

[0154] When the grayscale value is greater than a preset target threshold, setting the floodlight color value of the vertex of the triangle;

[0155] The rendering unit 780 is used for:

[0156] Based on the trajectory points included in the trajectory data to be rendered, the color values ​​of the rendering colors of the corresponding vertices of the triangles and the floodlight color values, a trajectory line with streamer effects and floodlight effects is rendered.

[0157] In some embodiments, the device further comprises a fourth acquisition unit, the fourth acquisition unit being configured to:

[0158] In response to a display request for the trajectory data to be rendered, the current time of the system is obtained as the streamer start time.

[0159] Attached Figure 7The device embodiments described are merely illustrative. For example, the division of the above units is only a logical functional division. There may be other division methods in actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. The functional units in the various embodiments of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0160] Attached Figure 8 is a schematic diagram of the structure of an electronic device 800 provided in an embodiment of the present application. Figure 8 The electronic device 800 shown may be provided as a server or a client.

[0161] The electronic device 800 includes at least one processor 801 , a memory 802 , and at least one network interface 803 .

[0162] The processor 801 is, for example, a general-purpose central processing unit (CPU), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of the present application. For example, the processor 801 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0163] The memory 802 is, for example, a read-only memory (ROM) or other static storage device that can store static information and instructions, a random access memory (RAM) or other dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. Optionally, the memory 802 exists independently and is connected to the processor 801 through the internal connection 804. Alternatively, the memory 802 and the processor 801 are optionally integrated together.

[0164] The network interface 803 uses any transceiver-like device for communicating with other devices or communication networks. The network interface 803 includes, for example, at least one of a wired network interface or a wireless network interface. The wired network interface is, for example, an Ethernet interface. The Ethernet interface is, for example, an optical interface, an electrical interface, or a combination thereof. The wireless network interface is, for example, a wireless local area network (WLAN) interface, a cellular network interface, or a combination thereof.

[0165] In some embodiments, the processor 801 includes one or more CPUs, such as Figure 8 CPU0 and CPU1 are shown in the figure.

[0166] In some embodiments, the electronic device 800 optionally includes multiple processors, such as the attached Figure 8 801 and processor 805 are shown in FIG. Each of these processors is, for example, a single-core processor (single-CPU), or a multi-core processor (multi-CPU). The processor here optionally refers to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0167] In some embodiments, the electronic device 800 further includes an internal connection 804. The processor 801, the memory 802, and the at least one network interface 803 are connected via the internal connection 804. The internal connection 804 includes a path to transmit information between the above components. Optionally, the internal connection 804 is a single board or a bus. Optionally, the internal connection 804 is divided into an address bus, a data bus, a control bus, etc.

[0168] Optionally, the processor 801 implements the method in the above embodiment by reading the program code stored in the memory 802, or the processor 801 implements the method in the above embodiment by the program code stored internally. In the case where the processor 801 implements the method in the above embodiment by reading the program code stored in the memory 802, the memory 802 stores the program code 810 that implements the method provided in the embodiment of the present application.

[0169] For more details on how the processor 801 implements the above functions, please refer to the descriptions in the previous method embodiments, which will not be repeated here.

[0170] The embodiment of the present application also provides a computer-readable medium for storing program code, where the program code is used to execute any one of the methods of the aforementioned embodiments.

[0171] It should be noted that the computer-readable medium mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0172] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0173] The present application also provides a computer program product. When the computer program product is run on a computer device, the computer device executes any one of the methods of the foregoing embodiments.

[0174] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of the embodiment of the present application are executed.

[0175] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0176] A refers to B, which means that A is the same as B or A is a simple variant of B.

[0177] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of objects, and cannot be understood as indicating or implying relative importance. For example, the first road segment and the second road segment are used to distinguish different road segments, rather than to describe a specific order of road segments, and cannot be understood as meaning that the first road segment is more important than the second road segment.

[0178] The information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the road information involved in this application is obtained with full authorization.

[0179] In the embodiments of the present application, unless otherwise specified, "at least one" means one or more, and "a plurality" means two or more. For example, a plurality of road segments means two or more road segments.

[0180] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in accordance with the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidState Disk (SSD)), etc.

[0181] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A rendering method, characterized in that: The method comprises: Obtain streamer rendering parameters and a streamer texture image, wherein the streamer rendering parameters at least include a streamer starting point color and a streamer tail point color, and the transparency value of the pixel point of the streamer texture image is known; Obtaining the trajectory distance of the trajectory point included in the trajectory data to be rendered; Performing triangulation based on the trajectory points included in the trajectory data to be rendered to obtain vertices of triangles corresponding to the trajectory points; Associating the trajectory distance of the trajectory point with the vertex of the triangle corresponding to the trajectory point; Based on the streamer rendering parameters, the trajectory distance associated with the vertices of the triangle, and the rendering time parameters, texture coordinates of the corresponding vertices of the triangle are obtained; Based on the texture coordinates of the corresponding vertices of the triangle, obtaining a transparency value from the streamer texture image as a color shift weight of the corresponding vertices of the triangle; Obtaining a rendering color of a corresponding vertex of the triangle based on the color of the streamer starting point, the color of the streamer tail point, and a color shift weight of a corresponding vertex of the triangle; Based on the rendering colors of the trajectory points and the corresponding vertices of the triangles included in the trajectory data to be rendered, a trajectory line with a streamer effect is rendered.

2. The method according to claim 1, characterized in that The streamer rendering parameters also include: streamer duration, based on the streamer rendering parameters, the trajectory distance associated with the vertices of the triangle and the rendering time parameters, the texture coordinates of the vertices of the triangle are obtained, including: Obtaining a streamer flow speed based at least on a maximum value of the trajectory distances associated with the vertices of the triangle and a duration of the streamer; The texture coordinates of the corresponding vertices of the triangle are obtained based at least on the streamer flow speed, the trajectory distance associated with the vertices of the triangle and the rendering time parameter.

3. The method according to claim 2, characterized in that The streamer rendering parameters also include: the number of streamers, the maximum value of the trajectory distance associated with the vertices of the triangle and the duration of the streamer, and the streamer flow speed, which is specifically: The maximum value of the trajectory distances associated with the vertices of the triangle is divided by the duration of the streamer and the number of streamers to obtain the streamer flow speed.

4. The method according to claim 2 or 3, characterized in that: The rendering time parameters include: the streamer start time and the streamer rendering time, and the texture coordinates of the corresponding vertices of the triangle are obtained based at least on the streamer flow speed, the trajectory distance associated with the vertices of the triangle and the rendering time parameters, including: The moving distance of the streamer is obtained by multiplying the flow speed of the streamer by the difference between the streamer rendering time and the streamer start time; Based on the streamer moving distance and the trajectory distance associated with the vertices of the triangle, obtaining the streamer distance of the corresponding vertex of the triangle; The streamer distance is normalized to a value between 0 and 1 as the texture coordinates of the corresponding vertices of the triangle at the streamer rendering time.

5. The method according to claim 4, characterized in that The streamer distance is normalized to a value between 0 and 1, specifically: Dividing the streamer distance by the maximum value of the trajectory distances associated with the vertices of the triangle to normalize the streamer distance to a value between 0 and 1; or, The streamer distance is divided by the maximum value of the track distances associated with the vertices of the triangle and then multiplied by the streamer number, so as to normalize the streamer distance to a value between 0 and 1.

6. The method according to any one of claims 1 to 3, characterized in that: The obtaining, based on the color of the streamer starting point, the color of the streamer tail point and the color offset weight of the corresponding vertex of the triangle, the rendering color of the corresponding vertex of the triangle specifically includes: Calculate the color difference between the color of the starting point of the streamer and the color of the ending point of the streamer; Obtaining disturbed color values ​​of corresponding vertices of the triangle using the color difference and color shift weights of corresponding vertices of the triangle; The color value of the rendering color of the corresponding vertex of the triangle is obtained by using the color of the starting point of the streamer or the color of the tail point of the streamer and the disturbed color value of the corresponding vertex of the triangle.

7. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Convert the color value of the rendered color of the triangle's vertices to a grayscale value; When the grayscale value is greater than a preset target threshold, setting the floodlight color value of the vertex of the triangle; Based on the rendering colors of the trajectory points and the corresponding vertices of the triangles included in the trajectory data to be rendered, a trajectory line with a streamer effect is rendered, specifically: Based on the trajectory points included in the trajectory data to be rendered, the color values ​​of the rendering colors of the corresponding vertices of the triangles and the floodlight color values, a trajectory line with streamer effects and floodlight effects is rendered.

8. The method according to claim 4, characterized in that The method further comprises: In response to a display request for the trajectory data to be rendered, the current time of the system is obtained as the streamer start time.

9. A rendering device, characterized in that: The device comprises: A first acquisition unit is used to acquire streamer rendering parameters and a streamer texture image, wherein the streamer rendering parameters at least include a streamer starting point color and a streamer tail point color, and the transparency value of the pixel point of the streamer texture image is known; A second acquisition unit, used to acquire the trajectory distance of the trajectory point included in the trajectory data to be rendered; A triangulation unit, configured to perform triangulation based on the trajectory points included in the trajectory data to be rendered, and obtain vertices of triangles corresponding to the trajectory points; an associating unit, configured to associate the trajectory distance of the trajectory point with the vertex of the triangle corresponding to the trajectory point; A first calculation unit, configured to obtain texture coordinates of corresponding vertices of the triangle based on the streamer rendering parameters, trajectory distances associated with the vertices of the triangle, and rendering time parameters; A third acquisition unit, configured to acquire, from the streamer texture image, a transparency value as a color shift weight of a corresponding vertex of the triangle based on the texture coordinates of the vertices of the triangle; A second calculation unit, configured to obtain a rendering color of a corresponding vertex of the triangle based on a color of a starting point of the streamer, a color of a tail point of the streamer, and a color shift weight of a corresponding vertex of the triangle; The rendering unit is used to render a trajectory line with a streamer effect based on the rendering colors of the trajectory points and the vertices of the triangles included in the trajectory data to be rendered.

10. A computer program product, characterized in that The computer program product comprises one or more computer program instructions, and when the computer program instructions are loaded and executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Rendering method and apparatus, and computer program product

    WO2026066330A1