Rendering method and apparatus, and computer program product
By using streaming rendering parameters and triangle subdivision technology, the streaming effect of trajectory data is calculated, solving the problems of long design time and high resource consumption in existing technologies, and achieving efficient rendering of streaming effects.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2026-04-02
Smart Images

Figure CN2025103701_02042026_PF_FP_ABST
Abstract
Description
A rendering method, device and computer program product
[0001] The present disclosure claims priority to the Chinese patent application No. 202411391033.3, filed on September 30, 2024, and entitled "A rendering method, device and computer program product", the entire content of which is incorporated herein by reference. TECHNICAL FIELD
[0002] The present disclosure relates to the technical field of rendering, in particular to a rendering method, device and computer program product. BACKGROUND
[0003] With the increasing services provided by application software for people's life, the application software also begins to show its historical use of the application software to the user in various forms to enhance the link between the user and the application software. For example, the music application software provides the user with the annual song list, the travel application software provides the user with historical travel data, etc.
[0004] Taking the 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 prior art has a light effect on the trajectory line corresponding to the trajectory data, but the present disclosure finds that the RGB (red-green-blue) color value of each pixel point of the light texture image used in the prior art is known and determined, that is, the light texture image itself is colored. For example, the blue light effect needs a designer to design a blue light texture image, the green light effect needs a designer to design a green light texture image, and if the color of the light effect gradually changes from yellow to green, a designer needs to design a light texture image that gradually changes from yellow to green.
[0005] When the number of trajectory data is large, that is, the number of trajectory lines drawn is large, in order to avoid the problem that the trajectory lines overlap and cannot be distinguished, it is usually necessary to design different color light texture images for the trajectory lines, and according to the prior art, each light texture image needs to be designed separately by a designer, which will consume a lot of time, in addition, the more the number of light texture images, the more device resources are occupied, which affects the efficiency of rendering. Therefore, it is necessary to provide a new rendering technical solution that can realize the light effect at low cost and high efficiency. SUMMARY
[0006] The present disclosure provides a rendering method, device and computer program product, which can realize the light effect at low cost and high efficiency. The technical solution is as follows.
[0007] In a first aspect, a rendering method is provided, the method comprising:
[0008] obtaining stream light rendering parameters and a stream light texture image, the stream light rendering parameters comprising at least a stream light start point color and a stream light end point color, and a transparency value of each pixel of the stream light texture image being known;
[0009] obtaining a trajectory distance of a trajectory point included in the trajectory data to be rendered;
[0010] triangulating the trajectory point included in the trajectory data to be rendered to obtain vertices of a triangle corresponding to the trajectory point;
[0011] associating the trajectory distance of the trajectory point with the vertices of the triangle corresponding to the trajectory point;
[0012] obtaining a texture coordinate of each vertex of the triangle based on the stream light rendering parameters, the trajectory distance associated with the vertices of the triangle, and a rendering time parameter;
[0013] obtaining, from the stream light texture image, a transparency value as a color offset weight of each vertex of the triangle based on the texture coordinate of each vertex of the triangle;
[0014] obtaining a rendering color of each vertex of the triangle based on the stream light start point color, the stream light end point color, and the color offset weight of each vertex of the triangle;
[0015] rendering a trajectory line with a stream light effect based on the trajectory point included in the trajectory data to be rendered and the rendering color of each vertex of the triangle.
[0016] In some embodiments, the stream light rendering parameters further comprise a stream light duration, and obtaining the texture coordinate of each vertex of the triangle based on the stream light rendering parameters, the trajectory distance associated with the vertices of the triangle, and the rendering time parameter comprises:
[0017] obtaining a stream light flow speed based at least on a maximum value in the trajectory distance associated with the vertices of the triangle and the stream light duration;
[0018] obtaining the texture coordinate of each vertex of the triangle based at least on the stream light flow speed, the trajectory distance associated with the vertices of the triangle, and the rendering time parameter.
[0019] In some embodiments, the stream light rendering parameters further comprise a stream light number, and obtaining the stream light flow speed based at least on the maximum value in the trajectory distance associated with the vertices of the triangle and the stream light duration specifically comprises:
[0020] Dividing the maximum value in the trajectory distance associated with the vertex of the triangle by the streamer duration and the streamer number, a streamer flow speed is obtained.
[0021] In some embodiments, the rendering time parameter comprises a streamer start time and a streamer rendering time, and the texture coordinates of the corresponding vertex of the triangle are obtained based on at least the streamer flow speed, the trajectory distance associated with the vertex of the triangle, and the rendering time parameter, comprising:
[0022] Multiplying the streamer flow speed by the difference between the streamer rendering time and the streamer start time, a streamer movement distance is obtained.
[0023] Based on the streamer movement distance and the trajectory distance associated with the vertex of the triangle, a streamer distance of the corresponding vertex of the triangle is obtained.
[0024] The streamer distance is normalized to a value between 0 and 1 as the texture coordinates of the corresponding vertex of the triangle at the streamer rendering time.
[0025] In some embodiments, the streamer distance is normalized to a value between 0 and 1, specifically:
[0026] The streamer distance is divided by the maximum value in the trajectory distance associated with the vertex of the triangle to normalize the streamer distance to a value between 0 and 1.
[0027] Or,
[0028] The streamer distance is divided by the maximum value in the trajectory distance associated with the vertex of the triangle and multiplied by the streamer number to normalize the streamer distance to a value between 0 and 1.
[0029] In some embodiments, the rendering color of the corresponding vertex of the triangle is obtained based on the streamer start point color, the streamer tail point color, and the color offset weight of the corresponding vertex of the triangle, specifically comprising:
[0030] The color difference between the streamer start point color and the streamer tail point color is calculated.
[0031] The perturbation color value of the corresponding vertex of the triangle is obtained using the color difference and the color offset weight of the corresponding vertex of the triangle.
[0032] The color value of the rendering color of the corresponding vertex of the triangle is obtained using the streamer start point color or the streamer tail point color and the perturbation color value of the corresponding vertex of the triangle.
[0033] In some embodiments, the method further comprises:
[0034] convert a color value of a rendering color of a vertex of the triangle into a gray value;
[0035] when the gray value is greater than a preset target threshold, set a flood color value of the vertex of the triangle;
[0036] based on a rendering color of a vertex of the triangle and a track point included in the track data to be rendered, render a track line with a flow light effect, specifically:
[0037] based on a rendering color of a vertex of the triangle and a track point included in the track data to be rendered, render a track line with a flow light effect and a flood light effect.
[0038] In some embodiments, the method further comprises:
[0039] in response to a display request for the track data to be rendered, obtaining a current time of the system as a flow light start time.
[0040] In a second aspect, a rendering device is provided, and the device comprises:
[0041] a first obtaining unit, configured to obtain a flow light rendering parameter and a flow light texture image, the flow light rendering parameter at least including a flow light start point color and a flow light tail point color, and a transparency value of a pixel point of the flow light texture image being known;
[0042] a second obtaining unit, configured to obtain a track distance of a track point included in the track data to be rendered;
[0043] a splitting unit, configured to perform triangle splitting based on the track point included in the track data to be rendered, to obtain a vertex of a triangle corresponding to the track point;
[0044] an associating unit, configured to associate the track distance of the track point with the vertex of the triangle corresponding to the track point;
[0045] a first calculating unit, configured to obtain a texture coordinate of a vertex of the triangle based on the flow light rendering parameter, the track distance associated with the vertex of the triangle, and a rendering time parameter;
[0046] a third obtaining unit, configured to obtain a transparency value as a color offset weight of the vertex of the triangle from the flow light texture image based on the texture coordinate of the vertex of the triangle;
[0047] a second calculating unit, configured to obtain a rendering color of the vertex of the triangle based on the flow light start point color, the flow light tail point color, and the color offset weight of the vertex of the triangle;
[0048] The rendering unit is configured to render the trajectory line with the light effect based on the rendering color of the vertex of the triangle and the trajectory point included in the trajectory data to be rendered.
[0049] In a third aspect, a computer program product is provided, which includes one or more computer program instructions, when loaded and executed by a computer, causing the computer to perform the method provided in the first aspect or any optional manner of the first aspect.
[0050] In a fourth aspect, an electronic device is provided, which includes at least one processor, and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to cause the electronic device to perform the method provided in the first aspect or any optional manner of the first aspect.
[0051] In a fifth aspect, a computer-readable storage medium is provided, which stores computer execution instructions, when a processor executes the computer execution instructions, the method provided in the first aspect or any optional manner of the first aspect is implemented.
[0052] Therefore, the embodiments of the present disclosure have the following beneficial effects:
[0053] Since the embodiments of the present disclosure at least separately configure the light effect start point color and the light effect tail point color as the light effect rendering parameters, the light effect texture image no longer needs to have a fixed color matching, but only needs to set the transparency value of the pixel point. Meanwhile, for the vertex of the triangle obtained by triangulation based on the trajectory point included in the trajectory data to be rendered, the present disclosure obtains the texture coordinates of the corresponding vertex of the triangle through the light effect rendering parameters, the trajectory distance associated with the vertex of the triangle, and the rendering time parameter. The color offset weight of the corresponding vertex of the triangle is obtained by sampling on the light effect texture image with the known transparency value based on the texture coordinates of the vertex of the triangle. The rendering color of the corresponding vertex of the triangle is obtained by using the color offset weight, the light effect start point color, and the light effect tail point color. Therefore, even if the light effect texture image does not have a fixed color matching, the rendering color of the corresponding vertex of the triangle can also be calculated. Therefore, for a scene of rendering a light effect of different colors, only these colors need to be configured as the light effect rendering parameters, and designers do not need to design a light effect texture image with a corresponding fixed color matching for each color, thereby reducing the design time of the light effect texture image and reducing the design cost. Meanwhile, since the number of light effect texture images is reduced, the occupation of the device resources by the light effect texture image is also reduced, and the rendering efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0054] FIG. 1 is a flowchart of a rendering method provided by the embodiments of the present disclosure;
[0055] Fig. 2 is a schematic diagram of a triangulation principle provided by an embodiment of the present disclosure;
[0056] Fig. 3 is a schematic diagram of a flow light texture image provided by an embodiment of the present disclosure;
[0057] Fig. 4 is a schematic diagram of a flow light rendering effect provided by an embodiment of the present disclosure;
[0058] Fig. 5 is a schematic diagram of another flow light rendering effect provided by an embodiment of the present disclosure;
[0059] Fig. 6 is a schematic diagram of still another flow light rendering effect provided by an embodiment of the present disclosure;
[0060] Fig. 7 is a schematic diagram of a structure of a rendering device provided by an embodiment of the present disclosure;
[0061] Fig. 8 is a schematic diagram of a structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the following will further describe the embodiments of the present disclosure in detail with reference to the drawings.
[0063] The following explains and describes some terms and concepts related to the embodiments of the present disclosure.
[0064] (1) Flow light
[0065] Flow light is a visual effect of UV animation, and the flow light includes effects such as light flow, flicker, change and jumping. The flow light can be used to simulate dynamic flowing water, burning flame, flowing magma and other animation scenes.
[0066] (2) Bloom
[0067] Bloom is a light stripe extending outward from the boundary of a bright area of an image, which can produce a halo effect for the bright area of the image.
[0068] (3) Shader
[0069] A shader is a program running on a graphics processing unit (GPU) of a computer, and the shader includes a vertex shader and a pixel shader, etc., wherein the vertex shader is responsible for processing vertex data of a primitive (such as a triangle, a point, a line, etc.), and the pixel shader is responsible for processing pixel data of the primitive.
[0070] The following describes the details of the embodiments of the present disclosure in detail through specific embodiments.
[0071] FIG. 1 is a flowchart of a rendering method provided by an embodiment of the present disclosure, which is used to render a flow light effect on trajectory data, and includes the following steps:
[0072] In step S101, flow light rendering parameters and a flow light texture image are obtained, wherein the flow light rendering parameters at least include a flow light start point color and a flow light end point color, and the transparency value of a pixel point of the flow light texture image is known.
[0073] In the embodiment of the present disclosure, the flow light rendering parameters and the flow light texture image are two independent data, wherein the RGB values of the flow light start point color and the flow light end point color included in the flow light rendering parameters can be pre-set by a technician or set by a user according to actual needs when the flow light effect is rendered by using the technical solution provided by the embodiment of the present disclosure, and no matter which setting method is used, it does not affect the implementation of the embodiment of the present disclosure.
[0074] In the embodiment of the present disclosure, the transparency value of the flow light texture image is known. It can be understood that in computer graphics, an image is composed of pixel points, each pixel point includes information of four channels of RGBA (red-green-blue-alpha), and RGBA respectively represents red, green, blue and transparency. The transparency value of the flow light texture image in the present disclosure is known, which means that the value of the A channel of the flow light texture image is determined / fixed and can be directly read from the flow light texture image, while the value of RGB is not fixed and needs to be calculated. Since the flow light texture image of the embodiment of the present disclosure does not have a fixed RGB value, it is not necessary for a designer to specially design a flow light texture image with an RGB value, which greatly reduces the design cost of the flow light texture image. Compared with the prior art which needs to design a flow light texture image for each color, the number of flow light texture images is also greatly reduced.
[0075] In step S102, the trajectory distance of a trajectory point included in the to-be-rendered trajectory data is obtained.
[0076] The technical solution provided by the embodiment of the present disclosure can be used to render trajectory data with a flow light effect. The trajectory data is a collection of a series of trajectory points with timestamp markers formed by an object in a traveling process. The trajectory point can also be called a position point, and the coordinate of the position point is a latitude and longitude coordinate. The trajectory data of the embodiment of the present disclosure can be trajectory data formed in various traveling modes such as driving, cycling, walking (including running), outdoors or indoors. If there are more than two pieces of trajectory data that need to be rendered at the same time, the steps after step S201 can be executed in parallel for different trajectory data when the technical solution provided by the present disclosure is implemented.
[0077] The flow light effect realized by the trajectory data according to the embodiments of the present disclosure is specifically that the light flows on the trajectory line formed by the trajectory points. Since the light needs to flow on the trajectory line, the parameters for realizing the flow light effect need to be determined in the process of implementing the present solution, including the flow speed of the flow light and the like. To this end, the embodiments of the present disclosure need to obtain the trajectory distance of the trajectory points included in the trajectory data to be rendered, and the flow speed of the flow light can be obtained through the trajectory distance and the rendering time parameter of the flow light.
[0078] As mentioned above, the trajectory points are marked with time stamps. In general, the trajectory points included in the trajectory data are sorted according to the time stamps. For example, the trajectory points are sorted from early to late according to time. The trajectory distance of a trajectory point is equal to the distance between the trajectory point and a trajectory point sorted before the trajectory point, plus the trajectory distance between the trajectory point sorted before the trajectory point and the first trajectory point. That is, the trajectory distance of a trajectory point is the distance between the trajectory point and the first trajectory point through the trajectory points sorted before the trajectory point. For example, the trajectory data to be rendered includes four trajectory points. The trajectory distance of the first trajectory point is 0, the trajectory distance of the second trajectory point is the distance between the second trajectory point and the first trajectory point, the trajectory distance of the third trajectory point is the distance between the third trajectory point and the second trajectory point plus the trajectory distance of the second trajectory point, and the trajectory distance of the fourth trajectory point is the distance between the fourth trajectory point and the third trajectory point plus the trajectory distance of the third trajectory point. The same applies to the rest.
[0079] In step S103, the trajectory points included in the trajectory data to be rendered are triangulated to obtain the vertices of the triangles corresponding to the trajectory points.
[0080] Since the trajectory data needs to be rendered into a trajectory line with a certain width, the trajectory points included in the trajectory data to be rendered need to be triangulated to obtain the vertices of the triangles, and subsequent rendering based on the vertices of the triangles can obtain the trajectory line with a certain width. The embodiments of the present disclosure use existing triangulation technology, which will not be described in detail here.
[0081] In step S104, the trajectory distance of the trajectory point is associated with the vertices of the triangle corresponding to the trajectory point.
[0082] 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 triangles corresponding to each trajectory point, the trajectory distance of the trajectory point can be associated with the vertices of the triangle corresponding to the trajectory point. Subsequently, the texture coordinates of the vertices of the triangle can be obtained according to the trajectory distance of the trajectory point associated with the vertices of the triangle.
[0083] Referring to FIG. 2, FIG. 2 shows a schematic diagram of the triangulation principle provided by the embodiment of the present disclosure. In FIG. 2, the green dots represent the trajectory points. The connecting line of the green trajectory points is taken as the center line of the rectangle. Two lines passing through the trajectory points and perpendicular to the center line are generated, and two lines parallel to the center line are generated. The distance from the line parallel to the center line to the center line can be a preset value. The four lines form a closed rectangle. The rectangle can be divided into two triangles along any diagonal. As shown in FIG. 2, the vertices of the triangle corresponding to the trajectory point 1 are vertex 1 and vertex 2 shown in FIG. 2. Therefore, the trajectory distance of the trajectory point 1 will be associated with vertex 1 and vertex 2.
[0084] In step S105, the texture coordinates of the corresponding vertices of the triangle are obtained based on the flow light rendering parameter, the trajectory distance associated with the vertices of the triangle, and the rendering time parameter.
[0085] The texture coordinates can also be referred to as uv coordinates. u is the horizontal coordinate, and v is the vertical coordinate. The value range of u and v is 0 to 1. The process of using the texture coordinates to obtain the color attribute of the pixel point from the texture image is called sampling. The implementation manner of sampling can be that the color attribute of the pixel point corresponding to the texture coordinates calculated in step S105 is obtained in the flow light texture image. Since the flow light effect realized by the trajectory data of the present disclosure is that the light flows on the trajectory line, it means that sampling needs to be performed in the flow light texture image continuously to obtain the rendering color of the vertices of the triangle at the corresponding time as the time changes. Therefore, the flow light rendering parameter of the present disclosure also needs to include the flow light duration. The flow light duration can be used to calculate the flow light flow speed. The flow light flow speed is equivalent to the texture change speed. Therefore, the texture change distance can be calculated by using the flow light flow speed, and then the texture coordinates of the vertices of the triangle at the corresponding time can be obtained.
[0086] Specifically, when the flow light rendering parameter further includes the flow light duration, step S105 can adopt the following implementation manner:
[0087] The flow light flow speed is calculated based on at least the maximum value in the trajectory distance associated with the vertices of the triangle and the flow light duration;
[0088] The texture coordinates of the corresponding vertices of the triangle are obtained based on at least the flow light flow speed, the trajectory distance associated with the vertices of the triangle, and the rendering time parameter.
[0089] It can be understood that the maximum value in the trajectory distance associated with the vertices of the triangle is the trajectory distance between the two trajectory points arranged at the two ends in the trajectory data. Referring to the aforementioned example in which the trajectory data includes four trajectory points, the maximum value in the trajectory distance is the trajectory distance from the fourth trajectory point to the first trajectory point.
[0090] In some embodiments, more than one flowing light needs to be rendered simultaneously for the trajectory data, to support the rendering effect, the flowing light rendering parameter can further include the number of flowing lights n, n is a positive integer greater than or equal to 1, since the number of flowing lights affects the flowing speed of the flowing light, and further affects the texture coordinates of the vertices of the triangle, therefore, when more than one flowing light needs to be rendered simultaneously for the trajectory data, the preferred embodiments provided by the present disclosure are based on at least the maximum value in the trajectory distance associated with the vertices of the triangle and the duration of the flowing light, to obtain the flowing speed of the flowing light, as follows:
[0091] Divide the maximum value in the trajectory distance associated with the vertices of the triangle by the duration of the flowing light and the number of flowing lights to obtain the flowing speed of the flowing light.
[0092] Exemplarily, assuming that the maximum value in the trajectory distance associated with the vertices of the triangle is maxDistance, the duration of the flowing light is Dur, and the number of flowing lights is n, then the flowing speed of the flowing light is equal to the maximum value in the trajectory distance associated with the vertices of the triangle divided by the duration of the flowing light and the number of flowing lights, i.e., the flowing speed of the flowing light is equal to maxDistance / (Dur x n).
[0093] In the specific calculation of the texture coordinates of the vertices of the triangle, to achieve a unified rendering effect, the texture coordinates of the vertices of the triangle can be normalized to a value between 0 and 1. Specifically, the aforementioned obtaining of the texture coordinates of the corresponding vertices of the triangle based on at least the flowing speed of the flowing light, the trajectory distance associated with the vertices of the triangle, and the rendering time parameter can specifically include:
[0094] Obtaining the flowing distance of the corresponding vertices of the triangle based on the flowing distance of the flowing light and the trajectory distance associated with the vertices of the triangle.
[0095]
[0096] Normalizing the flowing distance to a value between 0 and 1 as the texture coordinates of the corresponding vertices of the triangle at the flowing rendering time.
[0097] In the specific implementation, the flowing distance can be normalized to a value between 0 and 1 as the texture coordinates of the corresponding vertices of the triangle at the flowing rendering time, which can be achieved by dividing the flowing distance by the maximum value in the trajectory distance associated with the vertices of the triangle.
[0098] The process of determining the texture coordinates provided by the present disclosure is introduced below in combination with specific examples.
[0099] Exemplarily, the trajectory distance associated with the vertex of the triangle is ptDistance, the maximum value in the trajectory distance ptDistance associated with the vertex of the triangle is maxDistance, the duration of the streamer is Dur, the starting time of the streamer is T0, the rendering time of the streamer is t, 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 s1+ptDistance, the texture coordinate of the vertex of the triangle at t is (u0, v1), and the transparency value of the streamer texture image changes with the change of the v coordinate as shown in FIG. 3. Therefore, for the vertex of the triangle, the u coordinate in the texture coordinate of the vertex can take a fixed value, and 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 take a fixed value, and u0=(s1+ptDistance) / maxDistance.
[0100] As described above, in actual applications, there are cases of rendering more than one streamer, therefore, the streamer rendering parameter can also include the number of streamers. At this time, the maximum average value can be obtained by dividing the maximum value in the trajectory distance associated with the vertex of the triangle by the number of streamers, and then the streamer distance is normalized to a value between 0 and 1 by using the maximum average value, that is, the streamer distance is divided by the maximum value in the trajectory distance associated with the vertex of the triangle and multiplied by the number of streamers to normalize the streamer distance to a value between 0 and 1.
[0101] Exemplarily, the trajectory distance associated with the vertex of the triangle is ptDistance, the maximum value in the trajectory distance ptDistance associated with the vertex of the triangle is maxDistance, the duration of the streamer is Dur, the number of streamers is n, the streamer flow speed is equal to maxDistance / (Dur×n), the starting time of the streamer is T0, the rendering time of the streamer is t, the streamer moving distance is s1, s1=(maxDistance / (Dur×n))×(t-T0), the streamer distance is equal to s1+ptDistance, the texture coordinate of the vertex of the triangle at t is (u0, v1), and if the streamer texture image is as shown in FIG. 3, u0 is a fixed value, and v1 in the texture coordinate can be calculated by the following formula:
[0102] v1=(s1+ptDistance)×n / maxDistance, or v1=(s1+ptDistance) / (maxDistance / n)
[0103] Conversely, if the transparency of the flow light texture image varies with the u coordinate varying, v1 is a fixed value, u0 in the texture coordinate can be calculated as follows:
[0104] u0 = (s1 + ptDistance) x n / maxDistance or u0 = (s1 + ptDistance) / (maxDistance / n).
[0105] In an embodiment, the flow light starting time can be a time point when the flow light function is turned on, such as a time when a user enters a flow light effect rendering page or a time when the user clicks a flow light effect rendering control. The flow light rendering time is a time when an image containing a track line with a flow light effect is rendered.
[0106] As an example, the system current time can be obtained as the flow light starting time in response to a user's request for display of track data to be rendered. The aforementioned request for display can be triggered by an event of the user entering a flow light effect rendering page or an event of the user clicking a flow light effect rendering control.
[0107] In step S106, based on the texture coordinates of the respective vertices of the triangle, the transparency value is obtained from the flow light texture image as the color offset weight of the respective vertices of the triangle.
[0108] Since the transparency value of the flow light texture image varies with the change of the texture coordinates, as shown in FIG. 3, the color offset weight obtained for the vertex of the triangle is also changed when the texture coordinates of the vertex of the triangle change with the rendering time, and the change of the color offset weight affects the rendering color calculated by using the color offset weight, that is, the rendering color of each vertex of the triangle at different rendering times is different, and when the rendering colors of all vertices of the triangle change with the rendering time, the flow light effect of the track data to be rendered can be realized.
[0109] In step S107, based on the flow light starting point color, the flow light tail point color and the color offset weight of the respective vertices of the triangle, the rendering color of the respective vertices of the triangle is obtained.
[0110] FIG. 3 is a schematic diagram of a flow light texture image according to an embodiment of the present disclosure. As shown in FIG. 3, the transparency of the flow light texture image decreases from top to bottom, which means that the rendering color of the vertex of the triangle will change from dark to light, and the rendering color of the vertex of the triangle calculated by using the flow light start point color, the flow light end point color and the color offset weight will change with the rendering time, and the light and dark change of the color can achieve the flow light effect. That is, the rendering color of the vertex of the triangle according to the present disclosure is calculated by using the color offset weight obtained by sampling on the flow light texture image, the flow light start point color and the flow light end point color, and the color of the flow light texture image does not need to be configured by the technician, so if the color of the flow light effect of the track data is to be changed, only the flow light start point color and the flow light end point color need to be changed, and the flow light texture image can be reused, which can greatly reduce the design cost of the flow light texture image and improve the implementation efficiency.
[0111] In a specific implementation, the rendering color of the vertex of the triangle can be implemented in the following manner, which comprises:
[0112] calculating the color difference between the flow light start point color and the flow light end point color, i.e. calculating the difference between the color values of the flow light start point color and the flow light end point color;
[0113] calculating the perturbation color value of the vertex of the triangle by using the difference between the color values and the color offset weight of the vertex of the triangle;
[0114] calculating the color value of the rendering color of the vertex of the triangle by using the flow light start point color or the flow light end point color in combination with the perturbation color value.
[0115] The process of obtaining the rendering color will be introduced below in combination with a specific example.
[0116] For example, the color value of the flow light start point color is A, A=(r1, g1, b1), the color value of the flow light end point color is B, B=(r2, g2, b2), the color offset weight of the vertex is w, the perturbation color value is C, C=w×(r1-r2, g1-g2, b1-b2), and the color value of the rendering color is FinalColor.
[0117] In one embodiment, FinalColor=A-C=(r1, g1, b1)-w×(r1-r2, g1-g2, b1-b2);
[0118] or,
[0119] In another embodiment, FinalColor=B+C=(r2, g2, b2)+w×(r1-r2, g1-g2, b1-b2).
[0120] Step S108, rendering the trajectory line with the light effect based on the rendering color of the trajectory point included in the trajectory data to be rendered and the corresponding vertex of the triangle.
[0121] In the rendering of the trajectory line with the light effect, the line shape of the trajectory line needs to be rendered based on the trajectory point, and the light effect on the trajectory line is realized by using the change of the rendering color of the corresponding vertex of the triangle.
[0122] In some embodiments, the light rendering parameter can further include the number of light plays, and the number of light plays can be usually set as a loop play, so that the trajectory line with the light effect can be drawn.
[0123] FIG. 4 is a schematic diagram of a light rendering effect according to an embodiment of the present disclosure. As shown in FIG. 4, the light rendering parameter is that the light start point color is green, the light end point color is gray, the number of lights is 1, the light duration is a preset duration, and the number of light plays is a loop play. Therefore, the user can see a trajectory line with a light effect in which a green light gradually changes to gray and flows along the trajectory line in FIG. 4.
[0124] FIG. 5 is another schematic diagram of a light rendering effect according to an embodiment of the present disclosure. As shown in FIG. 5, the light rendering parameter is that the light start point color is green, the light end point color is gray, the number of lights is 3, the light duration is a preset duration, and the number of light plays is a loop play. Comparing FIG. 4 and FIG. 5, it can be seen that the number of lights is changed, and the light effect is greatly changed. The trajectory line in FIG. 5 includes three trajectory lines with a light effect in which a green light gradually changes to gray and flows along the trajectory line.
[0125] 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 color of the vertices of the triangle can be performed by a pixel shader, and the vertices of the triangle are rendered according to the rendering color of the vertices of the triangle.
[0126] In some embodiments, in addition to rendering the light effect on the trajectory line, a floodlight effect can also be rendered on the trajectory line. To this end, after the color value of the rendering color of the vertices of the triangle is obtained, the color value of the rendering color can be converted to a gray value, so as to obtain the gray value of the rendering color. When the gray value is greater than a target threshold value, it means that the brightness of the vertex of the triangle is high, and the floodlight effect can be formed. The floodlight color value of the vertex of the triangle can be set. Then, the vertices of the triangle are jointly rendered according to the color value of the rendering color and the floodlight color value of the vertex of the triangle. Thus, the light effect and the floodlight effect of the trajectory line can be realized at the same time, that is, the trajectory line with the light effect and the floodlight effect is rendered based on the trajectory point included in the trajectory data to be rendered, the color value of the rendering color of the vertex of the triangle, and the floodlight color value of the vertex of the triangle.
[0127] FIG. 6 is a schematic diagram of another stream light rendering effect according to an embodiment of the present disclosure. Referring to FIG. 6, the stream light rendering parameters in FIG. 6 are that the stream light start color is green, the stream light end color is gray, the number of stream lights is 3, the stream light duration is a preset time length, and the stream light play frequency is a loop. FIG. 6 simultaneously renders the stream light effect and the flood light effect.
[0128] In summary of the above various embodiments, in some embodiments of the present disclosure, the stream light start color and the stream light end color are configured as stream light rendering parameters separately, so that the stream light texture image no longer needs to have a fixed color matching, but only needs to set the transparency value of the pixel point. Meanwhile, for the vertices of the triangle obtained by triangulation based on the track points included in the track data to be rendered, the present disclosure obtains the texture coordinates of the corresponding vertices of the triangle by using the stream light rendering parameters, the track distance associated with the vertices of the triangle, and the rendering time parameter. The color offset weight of the corresponding vertices of the triangle is obtained by sampling on the stream light texture image with known transparency value based on the texture coordinates of the vertices of the triangle. The rendering color of the corresponding vertices of the triangle is obtained by using the color offset weight, the stream light start color, and the stream light end color. Therefore, even if the stream light texture image does not have a fixed color matching, the rendering color of the corresponding vertices of the triangle can still be calculated. Therefore, for a scene in which different colors of stream light effects are rendered, only these colors need to be configured as stream light rendering parameters, without the need for designers to design a stream light texture image with a corresponding fixed color matching for each color, thereby reducing the design time of the stream light texture image and reducing the design cost. Meanwhile, the number of stream light texture images is reduced, the occupation of the stream light texture image on the device resources is reduced, and the rendering efficiency is improved.
[0129] FIG. 7 is a schematic diagram of a structure of a rendering device according to an embodiment of the present disclosure. The rendering device 700 includes a first obtaining unit 710, a second obtaining unit 720, a triangulation unit 730, an association unit 740, a first calculation unit 750, a third obtaining unit 760, a second calculation unit 770, and a rendering unit 780.
[0130] The first obtaining unit 710 is configured to obtain stream light rendering parameters and a stream light texture image. The stream light rendering parameters at least include a stream light start color and a stream light end color. The transparency value of the pixel point of the stream light texture image is known.
[0131] The second obtaining unit 720 is configured to obtain the track distance of the track points included in the track data to be rendered.
[0132] The triangulation unit 730 is configured to perform triangulation based on the track points included in the track data to be rendered, to obtain the vertices of the triangle corresponding to the track points.
[0133] The association unit 740 is configured to associate the trajectory distance of the trajectory point with the vertex of the triangle corresponding to the trajectory point.
[0134] The first calculation unit 750 is configured to obtain the texture coordinate of the vertex of the triangle based on the flow light rendering parameter, the trajectory distance associated with the vertex of the triangle, and the rendering time parameter.
[0135] The third acquisition unit 760 is configured to acquire, as the color offset weight of the vertex of the triangle, the transparency value from the flow light texture image based on the texture coordinate of the vertex of the triangle.
[0136] The second calculation unit 770 is configured to obtain the rendering color of the vertex of the triangle based on the flow light start point color, the flow light tail point color, and the color offset weight of the vertex of the triangle.
[0137] The rendering unit 780 is configured to render the trajectory line with the flow light effect based on the trajectory point included in the trajectory data to be rendered and the rendering color of the vertex of the triangle.
[0138] In some embodiments, the flow light rendering parameter further includes a flow light duration, and the first calculation unit 750 is configured to:
[0139] obtain the flow light flow speed based on at least the maximum value in the trajectory distance associated with the vertex of the triangle and the flow light duration.
[0140] obtain the texture coordinate of the vertex of the triangle based on at least the flow light flow speed, the trajectory distance associated with the vertex of the triangle, and the rendering time parameter.
[0141] In some embodiments, the flow light rendering parameter further includes a flow light number, and the first calculation unit 750 is configured to:
[0142] obtain the flow light flow speed by dividing the maximum value in the trajectory distance associated with the vertex of the triangle by the flow light duration and the flow light number.
[0143] In some embodiments, the rendering time parameter includes a flow light start time and a flow light rendering time, and the first calculation unit 750 is configured to:
[0144] obtain the flow light movement distance by multiplying the flow light flow speed by the difference between the flow light rendering time and the flow light start time.
[0145] obtain the flow light distance of the vertex of the triangle based on the flow light movement distance and the trajectory distance associated with the vertex of the triangle.
[0146] normalizing the stream light distance into a value between 0 and 1 as the texture coordinate of the corresponding vertex of the triangle at the stream light rendering time.
[0147] In some embodiments, the first calculating unit 750 is configured to:
[0148] divide the stream light distance by the maximum value in the track distance associated with the vertex of the triangle to normalize the stream light distance into a value between 0 and 1;
[0149] or,
[0150] divide the stream light distance by the maximum value in the track distance associated with the vertex of the triangle and multiply the stream light number to normalize the stream light distance into a value between 0 and 1.
[0151] In some embodiments, the second calculating unit 770 is configured to:
[0152] calculate the color difference between the stream light start point color and the stream light end point color;
[0153] obtain the perturbed color value of the corresponding vertex of the triangle by using the color difference and the color offset weight of the corresponding vertex of the triangle;
[0154] obtain the color value of the rendering color of the corresponding vertex of the triangle by using the stream light start point color or the stream light end point color and the perturbed color value of the corresponding vertex of the triangle.
[0155] In some embodiments, the apparatus further comprises a setting unit configured to:
[0156] convert the color value of the rendering color of the vertex of the triangle into a gray value;
[0157] set the flood light color value of the vertex of the triangle when the gray value is greater than a preset target threshold value;
[0158] The rendering unit 780 is configured to:
[0159] render the track line with the stream light effect and the flood light effect based on the track point included in the to-be-rendered track data, the color value of the rendering color of the corresponding vertex of the triangle, and the flood light color value.
[0160] In some embodiments, the apparatus further comprises a fourth obtaining unit configured to:
[0161] obtain the current time of the system as the stream light start time in response to a display request for the to-be-rendered track data.
[0162] The apparatus embodiment described in FIG. 7 is merely illustrative, for example, the division of the above units is merely logical function division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The function units in various embodiments of the present disclosure can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0163] FIG. 8 is a structural schematic diagram of an electronic device according to an embodiment of the present disclosure. The electronic device 800 shown in FIG. 8 can be provided as a server or a client.
[0164] The electronic device 800 includes at least one processor 801, a memory 802, and at least one network interface 803.
[0165] The processor 801 is, for example, a general 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 solutions of the present disclosure. 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.
[0166] The memory 802 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions; a random access memory (RAM), or other type of dynamic storage device that can store information and instructions; a programmable read-only memory (EPROM), electrically programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM), or other optical disk storage, including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray, and the like; a magnetic disk storage medium; a solid state hard drive; or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to. The memory 802 can optionally exist independently of the processor 801 and be connected to the processor 801 via an internal connection 804. Alternatively, the memory 802 and the processor 801 can be integrated together.
[0167] The network interface 803 uses any suitable transceiver-type 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 networks (WLAN) interface, a cellular network interface, or a combination thereof.
[0168] In some embodiments, the processor 801 includes one or more CPUs, such as CPU0 and CPU1 as shown in FIG. 8.
[0169] In some embodiments, the electronic device 800 optionally includes multiple processors, such as the processor 801 and the processor 805 as shown in FIG. 8. Each of these processors is, for example, a single-CPU; alternatively, a multi-CPU. A processor here can optionally refer to one or more devices, circuits, and / or processing cores for processing data, such as computer program instructions.
[0170] 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 through the internal connection 804. The internal connection 804 includes a channel to transmit information between the above-mentioned 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.
[0171] Optionally, the processor 801 implements the method in the above-mentioned embodiments by reading the program code stored in the memory 802, or the processor 801 implements the method in the above-mentioned embodiments by the program code stored internally. In the case that the processor 801 implements the method in the above-mentioned embodiments by reading the program code stored in the memory 802, the memory 802 stores the program code 810 for implementing the method provided by the embodiments of the present disclosure.
[0172] For more details of the processor 801 implementing the above-mentioned functions, please refer to the description in the above-mentioned method embodiments, which will not be repeated here.
[0173] The embodiments of the present disclosure further provide a computer readable medium for storing program code for executing any one of the methods in the above-mentioned embodiments.
[0174] It should be noted that the computer readable medium described above in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination thereof. The computer readable storage medium may, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, 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 thereof. In the present disclosure, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present disclosure, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus. The program code contained in the computer readable medium can be transmitted by any suitable medium, including but not limited to a wire, a cable, a RF (radio frequency), etc., or any suitable combination thereof.
[0175] The computer readable medium described above can be contained in the electronic device described above; or can exist separately and not be assembled into the electronic device.
[0176] The embodiments of the present disclosure also provide a computer program product, which, when running on a computer device, causes the computer device to execute any one of the methods of the aforementioned embodiments.
[0177] In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program comprising program code for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by 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 methods of the embodiments of the present disclosure are executed.
[0178] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the difference from other embodiments.
[0179] A refers to B, which means that A is the same as B or a simple transformation of B.
[0180] The terms "first" and "second" and the like in the specification and claims of the embodiments of the present disclosure are used to distinguish different objects, and are not used to describe a specific order of the objects, nor can they 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, and are not used to describe a specific order of the road segments, nor can the first road segment be understood as more important than the second road segment.
[0181] The information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of the present disclosure are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions. For example, the road information involved in the present disclosure is obtained under sufficient authorization.
[0182] Unless otherwise specified, the meaning of "at least one" in the embodiments of the present disclosure is one or more, and the meaning of "multiple" is two or more. For example, multiple road segments refer to two or more road segments.
[0183] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, the embodiments 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 processes or functions described in the embodiments of the present disclosure are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can 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 can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media sets. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD (digital versatile disc)), or a semiconductor medium (for example, a solid state disk (SSD)), etc.
[0184] The above embodiments are only used to illustrate the technical solutions of the present disclosure, but not limit the present disclosure; although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalent ones; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present disclosure.
Claims
A rendering method, wherein, The method comprises: acquiring stream light rendering parameters and a stream light texture image, the stream light rendering parameters at least including a stream light starting point color and a stream light tail point color, and transparency values of pixel points of the stream light texture image being known; acquiring a track distance of a track point included in to-be-rendered track data; performing triangle division based on the track point included in the to-be-rendered track data to obtain vertices of a triangle corresponding to the track point; associating the track distance of the track point with the vertices of the triangle corresponding to the track point; obtaining texture coordinates of corresponding vertices of the triangle based on the stream light rendering parameters, the track distance associated with the vertices of the triangle, and a rendering time parameter; obtaining, from the stream light texture image, a transparency value as a color offset weight of the corresponding vertices of the triangle based on the texture coordinates of the corresponding vertices of the triangle; obtaining a rendering color of the corresponding vertices of the triangle based on the stream light starting point color, the stream light tail point color, and the color offset weight of the corresponding vertices of the triangle; rendering a track line with a stream light effect based on the track point included in the to-be-rendered track data and the rendering color of the corresponding vertices of the triangle. The method of claim 1, wherein, The stream light rendering parameters further include a stream light duration, and the obtaining of the texture coordinates of the corresponding vertices of the triangle based on the stream light rendering parameters, the track distance associated with the vertices of the triangle, and the rendering time parameter comprises: obtaining a stream light flow speed based at least on a maximum value in the track distance associated with the vertices of the triangle and the stream light duration; obtaining the texture coordinates of the corresponding vertices of the triangle based at least on the stream light flow speed, the track distance associated with the vertices of the triangle, and the rendering time parameter. The method of claim 2, wherein, The stream light rendering parameters further include a stream light number, and the obtaining of the stream light flow speed based at least on the maximum value in the track distance associated with the vertices of the triangle and the stream light duration specifically comprises: dividing the maximum value in the track distance associated with the vertices of the triangle by the stream light duration and the stream light number to obtain the stream light flow speed. The method according to claim 2 or 3, wherein The rendering time parameter includes a stream light starting time and a stream light rendering time, and the obtaining of the texture coordinates of the corresponding vertices of the triangle based at least on the stream light flow speed, the track distance associated with the vertices of the triangle, and the rendering time parameter comprises: multiplying the stream light flow speed by a difference between the stream light rendering time and the stream light starting time to obtain a stream light moving distance; obtaining a stream light distance of the corresponding vertices of the triangle based on the stream light moving distance and the track distance associated with the vertices of the triangle; normalizing the stream light distance to a value between 0 and 1 as a texture coordinate of the corresponding vertices of the triangle at the stream light rendering time. The method of claim 4, wherein, The normalizing of the stream light distance to a value between 0 and 1 specifically comprises: dividing the stream light distance by the maximum value in the track distance associated with the vertices of the triangle to normalize the stream light distance to a value between 0 and 1; or dividing the stream light distance by the maximum value in the track distance associated with the vertices of the triangle and multiplying the stream light distance by the stream light number to normalize the stream light distance to a value between 0 and 1. The method according to any one of claims 1 to 5, wherein The color offset weight of the corresponding vertex of the triangle is obtained based on the stream light start point color, the stream light tail point color, and the color of the corresponding vertex of the triangle, and includes: calculating the color difference between the stream light start point color and the stream light tail point color; using the color difference and the color offset weight of the corresponding vertex of the triangle to obtain the perturbed color value of the corresponding vertex of the triangle; using the stream light start point color or the stream light tail point color and the perturbed color value of the corresponding vertex of the triangle to obtain the color value of the rendering color of the corresponding vertex of the triangle. The method according to any one of claims 1 to 6, wherein The method further includes: converting the color value of the rendering color of the vertex of the triangle into a gray value; when the gray value is greater than a preset target threshold, setting the floodlight color value of the vertex of the triangle; The method further includes: based on the rendering color of the corresponding vertex of the triangle, the rendering color of the corresponding vertex of the triangle, and the floodlight color value, rendering the trajectory line with stream light effect and floodlight effect. The method according to claim 4 or 5, wherein The method further includes: in response to a display request for the to-be-rendered trajectory data, obtaining the current time of the system as the stream light start time. A rendering device, wherein, The device includes: a first obtaining unit configured to obtain stream light rendering parameters and a stream light texture image, the stream light rendering parameters including at least a stream light start point color and a stream light tail point color, and the transparency value of a pixel point of the stream light texture image being known; a second obtaining unit configured to obtain the trajectory distance of a trajectory point included in to-be-rendered trajectory data; a splitting unit configured to perform triangle splitting based on the trajectory point included in the to-be-rendered trajectory data to obtain the vertex of a triangle corresponding to the trajectory point; an association unit configured to associate the trajectory distance of the trajectory point with the vertex of the triangle corresponding to the trajectory point; a first calculating unit configured to obtain the texture coordinate of the corresponding vertex of the triangle based on the stream light rendering parameters, the trajectory distance associated with the vertex of the triangle, and a rendering time parameter; a third obtaining unit configured to obtain the transparency value as the color offset weight of the corresponding vertex of the triangle from the stream light texture image based on the texture coordinate of the vertex of the triangle; a second calculating unit configured to obtain the rendering color of the corresponding vertex of the triangle based on the stream light start point color, the stream light tail point color, and the color offset weight of the corresponding vertex of the triangle; a rendering unit configured to render the trajectory line with stream light effect based on the trajectory point included in the to-be-rendered trajectory data and the rendering color of the vertex of the triangle. An electronic device, wherein includes: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores program code executable by the at least one processor, and the program code is executed by the at least one processor to cause the electronic device to perform the method of any one of claims 1-8. A computer program product, wherein, The computer program product comprises one or more computer program instructions which, when loaded and run by a computer, cause the computer to perform the method of any one of claims 1-8. A computer-readable storage medium, wherein, The computer readable storage medium stores program codes, and when the processor executes the program codes, the method of any one of claims 1-8 is implemented.
Citation Information
Patent Citations
Image rendering processing method and device and electronic equipment
CN114463478A
Map rendering method and device, electronic equipment and storage medium
CN115984418A
Streaming effect rendering method and device and electronic equipment
CN116740259A
Rendering method and device and computer program product
CN119478084A
Anti-aliasing of straight lines within a map image
US8730258B1