CN115774536A - Method, device and equipment for displaying mark points and storage medium - Google Patents

Method, device and equipment for displaying mark points and storage medium Download PDF

Info

Publication number
CN115774536A
CN115774536A CN202211627131.3A CN202211627131A CN115774536A CN 115774536 A CN115774536 A CN 115774536A CN 202211627131 A CN202211627131 A CN 202211627131A CN 115774536 A CN115774536 A CN 115774536A
Authority
CN
China
Prior art keywords
fragment
color
primitive
radius
display
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211627131.3A
Other languages
Chinese (zh)
Inventor
曹张悦
赵晓波
李仁举
陈锦明
李洲强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shining 3D Technology Co Ltd
Original Assignee
Shining 3D Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shining 3D Technology Co Ltd filed Critical Shining 3D Technology Co Ltd
Priority to CN202211627131.3A priority Critical patent/CN115774536A/en
Publication of CN115774536A publication Critical patent/CN115774536A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Generation (AREA)

Abstract

The application provides a display method and device of a mark point, electronic equipment and a computer readable storage medium. The method comprises the following steps: acquiring geometric shape information and color information of the mark points; the color information indicates colors of different display portions in the marker point; processing the geometric shape information of the mark point by using a vertex shader to obtain a first primitive; processing the first primitive by using a geometry shader to obtain a second primitive; for a plurality of fragments obtained by rasterizing the second primitive, determining a display part to which each fragment belongs according to the geometric shape information by a fragment shader, and determining the color of each fragment based on the display part to which each fragment belongs and the color information; and displaying the mark points according to the color of each of the plurality of fragments. The displayed mark points are clear and smooth in edge.

Description

Method, device and equipment for displaying mark points and storage medium
Technical Field
The present application relates to the field of graphic display technologies, and in particular, to a method and an apparatus for displaying a mark point, an electronic device, and a computer-readable storage medium.
Background
The mark points are widely applied in a plurality of fields; for example, the mark points can carry coded information, and the mark points carrying the coded information can be called coded mark points, which are indispensable parts in the fields of photogrammetry, industrial scanning and the like and have important application value in image recognition; also for example, the marker points can be used as visual markers in the field of localization.
In the related art, there are generally the following two ways for displaying the mark point:
the first is drawn in the form of a triangle composition: for the circular part or the arc-shaped part in the mark point, in order to realize the effect of the circle or the arc, the circle or the arc needs to be subdivided into a plurality of triangles, and the edge of the circle is formed by one side of the triangles, so that the circular or arc-shaped display effect is presented.
The second is a texture map of a frame plus corresponding shape: using a bounding box shape that encloses the mark points and then attaching a texture map in the shape of the mark points. The shape and the corresponding color of the mark points on the texture mapping, the part of the color values needing to be drawn are normal, and the transparency of the part of the color values not needing to be drawn is 0. And sampling the texture mapping when the equipment renders the external frame type, and drawing.
In both of the above display modes, the edge of the mark point after enlargement is not smooth, or the data amount of the mark point is too large to occupy too much storage space in order to improve the smoothing effect.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for displaying a mark point, an electronic device, and a computer-readable storage medium.
Specifically, the method is realized through the following technical scheme:
according to a first aspect of embodiments of the present application, there is provided a method for displaying a landmark point, including:
acquiring geometric shape information and color information of the mark points; the color information indicates colors of different display portions in the marker point;
processing the geometric shape information of the mark point by using a vertex shader to obtain a first primitive; processing the first primitive by using a geometry shader to obtain a second primitive;
for a plurality of fragments obtained by rasterizing the second primitive, determining a display part to which each fragment belongs according to the geometric shape information by a fragment shader, and determining the color of each fragment based on the display part to which each fragment belongs and the color information;
and displaying the mark points according to the color of each of the plurality of fragments.
Optionally, different display portions of the mark point comprise at least two circles with different radii, the centers of the at least two circles are overlapped, and the display level of the circle with the smaller radius is higher than the display level of the circle with the larger radius; the geometric shape information includes radii of at least two of the circles;
the determining the display part to which each fragment belongs according to the geometric shape information comprises:
for each of the plurality of fragments, determining a target distance from the fragment to a center of a landmark;
and determining the display part to which the fragment belongs according to the difference between the target distance and the radius of at least two circles respectively.
Optionally, different ones of the marker points comprise a central circle and at least one annular band; the geometric shape information comprises the radius of a central circle and the radius of each annular band;
the determining the display part to which each fragment belongs according to the geometric shape information comprises:
for each of the plurality of fragments, determining a target distance from the fragment to a center of a landmark;
and determining the display part to which the fragment belongs according to the difference between the target distance and the radius of the central circle and the difference between the target distance and the radius of each annular band.
Optionally, if the target distance is smaller than or equal to the radius of the central circle, the display portion to which the fragment belongs is the central circle;
if the target distance is greater than the radius of the central circle and less than or equal to the radius of the annular band, the display part to which the fragment belongs is the annular band;
in the case that the index point includes at least two annular bands, if the target distance is between the radius of the central circle and the radius of the annular band closest to the central circle, the display portion to which the slice belongs is the annular band closest to the central circle; and if the target distance is between the radiuses of the two annular bands, determining that the display part to which the fragment belongs is the larger radius of the two annular bands.
Optionally, the annular band can be divided into at least two arcuate regions; the geometric shape information further comprises an angle range of each arc-shaped area;
the determining the display part to which each fragment belongs according to the geometric shape information comprises:
for a fragment belonging to an annular band, determining an arc-shaped region to which the fragment belongs according to the angle information of the fragment and the difference between the angle ranges of different arc-shaped regions in the annular band to which the fragment belongs;
the method further comprises the following steps:
in a fragment shader, determining the display shape of each arc-shaped area by using the angle range of each arc-shaped area;
the displaying the mark point according to the color of each of the plurality of fragments includes:
and displaying the mark points according to the color of each fragment in the plurality of fragments and the display shape of each arc-shaped area.
Optionally, the method further comprises:
and if the fragment does not belong to any display part in the mark points according to the geometric shape information, discarding the fragment or setting the color of the fragment to be transparent.
Optionally, the first primitive is drawn in a point manner by the vertex shader.
Optionally, the geometric shape information includes normal information and a radius of the landmark point;
processing the first primitive by using a geometry shader to obtain a second primitive, wherein the processing comprises:
drawing an outer frame shape of the first graphic element according to the normal information and the radius of the mark point;
outputting the second graphic element according to the external frame type; wherein the second primitive comprises two triangle primitives.
According to a second aspect of embodiments of the present application, there is provided a display device of a mark point, including:
the information acquisition module is used for acquiring the geometric shape information and the color information of the mark points; the color information indicates colors of different display portions in the marker point;
the pixel obtaining module is used for drawing the geometric shape information of the mark point by using a vertex shader to obtain a first pixel; processing the first primitive by using a geometry shader to obtain a second primitive;
a color determining module, configured to determine, by a fragment shader, a display portion to which each fragment belongs according to the geometric shape information for a plurality of fragments obtained by rasterizing the second primitive, and determine a color of each fragment based on the display portion to which each fragment belongs and the color information;
and the display module is used for displaying the mark points according to the color of each of the plurality of fragments.
According to a third aspect of embodiments of the present application, there is provided an electronic device comprising a memory, a processor, and executable instructions stored on the memory and executable on the processor;
wherein the processor, when executing the executable instructions, performs the steps of the method of any of the first aspects.
According to a fourth aspect of embodiments herein, there is provided a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method of any one of the first aspect.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in the embodiment of the disclosure, the display part to which each fragment belongs is determined according to the geometric shape information in the fragment shader, and the color of each fragment is accurately determined based on the display part to which each fragment belongs and the color information, so that the effect that the circular or arc-shaped edge part of the mark point can be smoothly and clearly displayed no matter how the circular or arc-shaped edge part is magnified and observed is achieved; and the data amount of the mark point only relates to the graphic element information and the related parameter information (such as geometric shape information and color information), the data amount of the mark point is less, and the required storage space is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1A and 1B are schematic diagrams of marker points plotted in the form of a triangle composition in the related art.
Fig. 1C is a partially enlarged view of fig. 1B.
Fig. 2 is a partially enlarged view of a mark point drawn by a frame shape and a texture map of a corresponding shape in the related art.
Fig. 3 is a flowchart illustrating a method for displaying a mark point according to an exemplary embodiment of the present application.
Fig. 4A is a schematic diagram of a landmark obtained by the display method of a landmark according to the present application according to an exemplary embodiment of the present application.
Fig. 4B and 4C are partial enlarged views of fig. 4A.
Fig. 5 is an exemplary schematic diagram of an electronic device shown in an exemplary embodiment of the present application.
FIG. 6 is a schematic diagram of another marker point shown in an exemplary embodiment of the present application.
Fig. 7 is another exemplary schematic diagram of an electronic device shown in an exemplary embodiment of the present application.
Fig. 8 is a schematic structural diagram of a display device for a mark point according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if," as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination," depending on the context.
A first display mode of a mark point in the related art is drawn in a form of a triangle, and when the mark point is drawn in the form of a triangle, please refer to fig. 1A (where gray is a background, the mark point is formed by an outer black circle and an inner white circle), if the triangle is subdivided too little, it can be seen that an edge of a circle is formed by a line segment, and each line segment corresponds to one side of a subdivided triangle, so that at the edge of the circle, the circle is not a true circle, the edge of the circle is not smooth enough, and the display effect is not good; if there are too many subdivided triangles, see fig. 1B, although it may look very round after being slightly enlarged, if fig. 1B is continuously enlarged, see fig. 1C, there are line segments, and too many triangles may cause the data amount of the mark point to increase, and occupy a lot of storage space.
A second display mode of the mark points in the related art is to draw a frame shape and a texture map with a corresponding shape, please refer to fig. 2, if the mark points displayed by the drawing mode are observed after being enlarged, it can be found that the edge of the circular part has insufficient resolution of the texture map due to enlargement, thereby causing a situation of display blur and unsmooth; if the mark point is made to look sharp by using a higher resolution texture map, the amount of data of the mark point increases, and much memory space is occupied.
For the problems in the related art, the embodiments of the present application provide a method for displaying a mark point, where OpenGL is used for drawing, and after obtaining geometric shape information and color information of the mark point, a vertex shader may be used to process the geometric shape information of the mark point to obtain a first primitive; processing the first primitive by using a geometry shader to obtain a second primitive; further, for a plurality of fragments obtained by rasterizing the second primitive, a fragment shader can determine a display part to which each fragment belongs according to the geometric shape information, and determine the color of each fragment based on the display part to which each fragment belongs and the color information; and finally, displaying the mark points according to the color of each of the plurality of fragments. In this embodiment, the display portion to which each fragment belongs is determined in the fragment shader, so that each fragment can display a corresponding color, and an effect that the circular or arc-shaped edge portion of the mark point can be smoothly and clearly displayed regardless of how enlarged and observed is achieved; and the data amount of the mark point only relates to the graphic element information and the related parameter information (such as geometric shape information and color information), the data amount of the mark point is less, and the required storage space is reduced.
The method for displaying a landmark provided in the embodiments of the present application may be performed by an electronic device with a graphics processing function, including but not limited to a smart phone/mobile phone, a tablet computer, a Personal Digital Assistant (PDA), a laptop computer, a desktop computer, a media content player, a video game station/system, a virtual reality system, an augmented reality system, a wearable device (e.g., a watch, glasses, gloves, headwear (e.g., a hat, a helmet, a virtual reality headset, an augmented reality headset, a Head Mounted Device (HMD), a headband), a pendant, an armband, a leg ring, a shoe, a vest), a remote controller, or any other device with a graphics processing function.
Illustratively, the electronic device includes a processor and a memory, where the memory stores executable instructions executable on the processor, and the processor executes the executable instructions to implement the method for displaying the landmark provided by the embodiment of the present application. Illustratively, the processor may be a Graphics Processing Unit (GPU).
Illustratively, the electronic device integrates a computer program product, and the electronic device implements the method for displaying the landmark provided by the embodiments of the present application when executing the computer program product.
Referring to fig. 3, fig. 3 is a schematic diagram of a method for displaying a mark point according to an embodiment of the present application, where the method may be executed by an electronic device, and the method includes:
in S101, geometric shape information and color information of a marker point are acquired; the color information indicates colors of different display portions in the marker point.
In S102, processing the geometric shape information of the mark point by using a vertex shader to obtain a first primitive; and processing the first primitive by using a geometry shader to obtain a second primitive.
In S103, for a plurality of fragments obtained by rasterizing the second primitive, a fragment shader determines a display portion to which each fragment belongs according to the geometry information, and determines a color of each fragment based on the display portion to which each fragment belongs and the color information.
In S104, the mark point is displayed according to the color of each of the plurality of fragments.
In this embodiment, the display portion to which each fragment belongs is determined in the fragment shader, so that each fragment can display a corresponding color, and an effect that the circular or arc-shaped edge portion of the mark point can be smoothly and clearly displayed regardless of how enlarged and observed is achieved; and the data amount of the mark point only relates to the graphic element information and the related parameter information (such as geometric shape information and color information), the data amount of the mark point is less, and the required storage space is reduced.
In one example, referring to fig. 4A, fig. 4A shows a mark point obtained by the mark point display method of the present application (the mark point is a black portion and a white portion in fig. 4A). Referring to fig. 4B and 4C, fig. 4B and 4C are enlarged views of fig. 4A, and it can be seen that when the mark point obtained by the mark point display method of the present application is enlarged, the circular edge portion of the mark point can still be smoothly and clearly displayed.
In an exemplary embodiment, the electronic device includes a Central Processing Unit (CPU) and a Graphics Processing Unit (GPU). Referring to fig. 5, the central processor may transmit geometric shape information and color information of the mark points to be displayed to the graphic processor. After the graphic processor acquires the geometric shape information and the color information of the mark point, a vertex shader in the graphic processor processes the geometric shape information of the mark point to obtain a first primitive; then processing the first primitive by a geometry shader to obtain a second primitive; after rasterizing the second primitive to obtain a plurality of fragments, determining a display part to which each fragment belongs according to the geometric shape information by a fragment shader, and determining the color of each fragment based on the display part to which each fragment belongs and the color information; it should be noted that, if it is determined that there is a fragment that does not belong to any display portion in the mark point according to the geometric shape information, the fragment may be discarded or the color of the fragment may be set to be transparent, so that other fragments belonging to the mark point form the shape of the mark point; and finally, displaying the mark points according to the colors of the fragments belonging to different display parts in the plurality of fragments.
A vertex shader is a set of instruction code that is executed when a vertex is rendered. A vertex shader is a shader that performs a series of operations on vertices. Vertices may contain many other attributes besides the most basic position attribute, such as texture, normal, etc. Through the vertex shader, the graphics processor knows where the vertex should be drawn.
In some embodiments, the vertex shader may draw the first primitive in a point manner according to the geometry information of the landmark points, and then output the first primitive to the geometry shader.
The geometry shader is a shader between a vertex shader and a fragment shader, the input of the geometry shader is a group of vertexes of a primitive, the output of the geometry shader is a group of vertexes of another primitive, the purpose of transforming one primitive into another completely different primitive is achieved, and more vertexes than the original are generated.
In some embodiments, the geometry information includes normal information and a radius of a mark point, and a geometry shader may draw a circumscribed frame shape of the first primitive according to the normal information and the radius of the mark point, and then output the second primitive according to the circumscribed frame shape, so that a shape of the mark point may be determined from the second primitive in the following; in one example, the outer frame shape is a rectangle consisting of two triangles, and the second primitive comprises two triangle primitives.
In some embodiments, the different display portions of the mark point include at least two circles with different radii, the centers of the at least two circles overlap, and the display level of the circle with the smaller radius is higher than the display level of the circle with the larger radius, please refer to fig. 4A, the mark point can be displayed by overlapping the centers of the white circle and the black circle, and the display level of the white circle is higher than the display level of the black circle. The geometry information includes radii of at least two circles. The geometry shader is specifically configured to draw an outline frame of the first primitive according to the normal information and a maximum radius of the at least two circles, and then output the second primitive according to the outline frame.
After the second primitive is obtained, rasterization processing may be performed on the second primitive to obtain a plurality of fragments. After obtaining the plurality of fragments rasterized by the second primitive, a fragment shader may be invoked to perform a fragment-by-fragment operation to determine a color of each fragment. For each of the number of fragments, a fragment shader may be invoked to determine a target distance of the fragment to a landmark center, for example; determining a display part to which the fragment belongs according to the difference between the target distance and the radius of at least two circles respectively, and further determining the color of the fragment based on the display part to which the fragment belongs and the color of the display part indicated by the color information; the fragment shader can discard or set the fragments which do not belong to the central circle or each annular band to be transparent. In this embodiment, in the fragment shader, the display portion to which each fragment belongs is accurately determined according to the target distance from each fragment to the center of the mark point and the geometric shape information, so that each fragment can display an accurate color, and the effect that the circular edge of the mark point can be smoothly and clearly displayed no matter how the circular edge of the mark point is enlarged and observed is achieved.
In one example, taking the example that different display portions of the landmark points include circles with different radii, if the target distance is less than or equal to the smaller of the radii of the two circles, the display portion to which the fragment belongs is the smaller of the radii of the two circles; if the target distance is greater than the smaller of the two circles and less than or equal to the larger of the two circles, the display portion to which the slice belongs is the larger of the two circles.
Further, the circular shape can also be divided into at least two arc-shaped regions; for example, referring to fig. 6, the circle of the outermost circle of the mark point is divided into 8 arc regions, wherein 4 arc regions display white, and the other 4 arc regions have a transparency of 0, i.e., do not display color. The geometric shape information of the landmark point includes the angular ranges of the respective arc-shaped areas into which any one of the circles is divided, in addition to the radii of the at least two circles. After determining the circle to which each fragment belongs, the fragment shader determines the arc-shaped area to which the fragment belongs according to the difference between the angle information of the fragment and the angle range of different arc-shaped areas in the circle to which the fragment belongs, for the circle divided into the arc-shaped areas; and determining the color of the fragment based on the arc-shaped area to which the fragment belongs and the color of the arc-shaped area indicated by the color information. In the fragment shader, the display shape of each arc-shaped area is determined by utilizing the angle range of each arc-shaped area; and the mark point can be displayed according to the color of each of the plurality of fragments and the display shape of each arc-shaped area. In this embodiment, the fragment shader determines to which circle each fragment belongs, and further determines to which arc-shaped area of the circles the fragment belonging to the circle divided into the arc-shaped areas belongs, so that the display portion to which each fragment belongs is accurately determined, and each fragment can display an accurate color, thereby achieving an effect that the circular edge of the mark point can be smoothly and clearly displayed regardless of how the circular edge is enlarged and observed.
In other embodiments, the different display portions of the landmark points include a central circle and at least one annular band; for example, the mark point shown in fig. 4A may be composed of a white central circle and a black annular band. The geometric shape information comprises the radius of a central circle and the radius of each annular band; the radius of the annular band refers to the radius of the circle in which the annular band is located, for example, the radius of the annular band in fig. 4A is the sum of the radius of the white central circle and the width of the black annular band. And the geometry shader is specifically configured to draw an outline frame of the first primitive according to the normal information and the radius of the annular band of the outermost circle of the mark point, and then output the second primitive according to the outline frame.
After the second primitive is obtained, rasterization processing may be performed on the second primitive to obtain a plurality of fragments. The core of the rasterization algorithm is to obtain the pixels covered by the projection of the second primitive onto the screen, and this part of pixels is called a fragment. Each fragment carries a pixel coordinate besides the attribute contained in the vertex to indicate which pixel in the corresponding image space; the attributes are obtained by vertex attribute interpolation in a rasterization algorithm; a fragment can be said to be a discretized point within the original primitive (i.e., the second primitive). After obtaining the number of fragments for which the second primitive is rasterized, a fragment shader may be invoked to perform a fragment-by-fragment operation to determine a color of each fragment.
For each of the plurality of fragments, a fragment shader may be invoked to determine a target distance from the fragment to a center of a landmark, and then determine a display portion to which the fragment belongs according to a difference between the target distance and a radius of the central circle and a difference between the target distance and a radius of each annular band, and further determine a color of the fragment based on the display portion to which the fragment belongs and the color of the display portion indicated by the color information; the fragment shader can discard or set the fragments which do not belong to the central circle or each annular band to be transparent. In this embodiment, in the fragment shader, the display portion to which each fragment belongs is accurately determined according to the target distance from each fragment to the center of the mark point and the geometric shape information, so that each fragment can display an accurate color, and the effect that the circular edge of the mark point can be smoothly and clearly displayed no matter how the circular edge of the mark point is enlarged and observed is achieved.
In one example, if the target distance is smaller than or equal to the radius of the central circle, it may be determined that the display portion to which the fragment belongs is the central circle. In the case that the mark point includes an annular band, if the target distance is greater than the radius of the central circle and less than or equal to the radius of the annular band, it may be determined that the display portion to which the fragment belongs is the annular band; and then can abandon the piece that does not belong to center circle or annular area to reduce the data bulk of mark point, reduce memory space.
In the case where the index point includes at least two annular bands, if the target distance is greater than the radius of the center circle, there are two cases: (1) If the target distance is between the radius of the central circle and the radius of the annular band closest to the central circle, it may be determined that the display portion to which the slice belongs is the annular band closest to the central circle. (2) If the target distance is between the radii of the two annular bands, it may be determined that the display portion to which the fragment belongs is the larger of the radii of the two annular bands. And then for the fragment that does not belong to the centre circle or arbitrary a ring band, can abandon or set as transparent color to guarantee the accurate demonstration of code point shape.
Further, the annular band in the index point can also be divided into at least two arc-shaped areas; for example, referring to fig. 6, the annular band at the outermost circle of the mark point is divided into 8 arc regions, wherein 4 arc regions display white, and the other 4 arc regions have a transparency of 0, i.e., do not display color. The geometric shape information of the marker point includes the angular ranges of the respective arc-shaped areas in the annular band in addition to the radius of the central circle and the radius of each annular band. After determining whether each fragment belongs to a central circle or an annular band, a fragment shader determines an arc-shaped area to which the fragment belongs according to the difference between the angle information of the fragment and the angle ranges of different arc-shaped areas in the annular band to which the fragment belongs, for the fragment belonging to the annular band; and determining the color of the fragment based on the arc-shaped area to which the fragment belongs and the color of the arc-shaped area indicated by the color information. In this embodiment, the fragment shader determines whether each fragment belongs to the central circle or the annular band, and further determines which arc region the fragment belonging to the annular band belongs to, so as to accurately determine the display portion to which each fragment belongs, so that each fragment can display an accurate color, and achieve the effect that the circular edge of the mark point can be smoothly and clearly displayed no matter how the circular edge is enlarged.
In the fragment shader, the display shape of each arc-shaped area is determined by utilizing the angle range of each arc-shaped area; after determining the color corresponding to each fragment and the display shape of each arc-shaped area, the electronic device may display the mark point according to the color of each fragment in the plurality of fragments and the display shape of each arc-shaped area. For example, the electronic device may write information such as a color of each of the several fragments and a display shape of each arc region into the graphics processor cache, so as to perform visual expression according to the information in the graphics processor cache. And when the mark point is stored subsequently, only the primitive information and the related parameter information (such as geometric shape information and color information) need to be stored, and the data volume of the mark point is less, so that the required storage space is reduced.
It should be understood that the solutions described in the above embodiments may be combined without conflict, and are not exemplified in the embodiments of the present disclosure.
FIG. 7 is a schematic block diagram of an apparatus provided in an exemplary embodiment. Referring to fig. 7, at the hardware level, the apparatus includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile storage 710, but may also include hardware required for other services. One or more embodiments of the present description can be implemented in software, such as by the processor 702 reading corresponding computer programs from the non-volatile storage 710 into the memory 708 and then executing. Of course, besides software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 8, the display device of the mark point can be applied to the apparatus shown in fig. 7 to implement the technical solution of the present specification. Wherein the display device of the mark point may include:
an information obtaining module 201, configured to obtain geometric shape information and color information of the mark point; the color information indicates colors of different display portions in the marker point.
A primitive obtaining module 202, configured to draw the geometric shape information of the mark point by using a vertex shader, to obtain a first primitive; and processing the first primitive by using a geometry shader to obtain a second primitive.
And a color determining module 203, configured to determine, by the fragment shader, a display portion to which each fragment belongs according to the geometry information for the plurality of fragments obtained by rasterizing the second primitive, and determine a color of each fragment based on the display portion to which each fragment belongs and the color information.
A display module 204, configured to display the mark point according to a color of each of the plurality of fragments.
In some embodiments, the different display portions of the landmark points comprise at least two circles of different radii, the centers of the at least two circles overlap, and the display level of the circle with the smaller radius is higher than the display level of the circle with the larger radius; the geometry information includes radii of at least two of the circles. The color determination module 203 is specifically configured to: for each of the plurality of fragments, determining a target distance from the fragment to a center of a landmark; and determining the display part to which the fragment belongs according to the difference between the target distance and the radius of at least two circles respectively.
In some embodiments, the different display portions of the landmark points include a central circle and at least one annular band; the geometry information includes a radius of the central circle and a radius of each of the annular bands. The color determination module 203 is specifically configured to: for each of the plurality of fragments, determining a target distance from the fragment to a center of a landmark; and determining the display part to which the fragment belongs according to the difference between the target distance and the radius of the central circle and the difference between the target distance and the radius of each annular band.
In some embodiments, if the target distance is smaller than or equal to the radius of the central circle, the display portion to which the fragment belongs is the central circle; if the target distance is greater than the radius of the central circle and less than or equal to the radius of the annular band, the display part to which the fragment belongs is the annular band; in the case that the index point includes at least two annular bands, if the target distance is between the radius of the central circle and the radius of the annular band closest to the central circle, the display part to which the slice belongs is the annular band closest to the central circle; and if the target distance is between the radiuses of the two annular bands, determining that the display part to which the fragment belongs is the larger radius of the two annular bands.
In some embodiments, the endless belt can be divided into at least two arcuate regions; the geometric shape information further comprises an angle range of each arc-shaped area; the color determination module 203 is specifically configured to: and for the fragment belonging to the annular belt, determining the arc-shaped area to which the fragment belongs according to the angle information of the fragment and the difference between the angle ranges of different arc-shaped areas in the annular belt to which the fragment belongs. The device further comprises a shape determining module, which is used for determining the display shape of each arc-shaped area by using the angle range of each arc-shaped area in the fragment shader. The display module 204 is specifically configured to display the mark point according to the color of each of the plurality of fragments and the display shape of each arc-shaped area.
In some embodiments, the method further comprises discarding the fragment or setting the color of the fragment to transparent if it is determined from the geometry information that the fragment does not belong to any of the display portions in the landmark points.
In some embodiments, the first primitive is drawn in points by the vertex shader.
In some embodiments, the geometry information includes normal information and a radius of a landmark point; the primitive obtaining module 202 is specifically configured to draw an outer frame shape of the first primitive according to the normal information and the radius of the mark point; outputting the second graphic element according to the external frame type; wherein the second primitive comprises two triangle primitives.
The implementation process of the functions and actions of each module in the above device is detailed in the implementation process of the corresponding steps in the above method, and is not described herein again.
Correspondingly, the embodiment of the application also provides an electronic device, which comprises a memory, a processor and executable instructions stored on the memory and capable of running on the processor;
wherein the processor implements the steps of the above method when executing the executable instructions.
By way of example, the Processor includes, but is not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), or an off-the-shelf Programmable Gate Array (FPGA), etc.
Illustratively, the memory may include at least one type of storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like.
Accordingly, an embodiment of the present application further provides a computer program product, which includes a computer program, and the computer program is used for implementing the above method when being executed by a processor.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as a memory comprising instructions, executable by a processor of an apparatus to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium, instructions in the storage medium, when executed by a processor of a terminal, enable the terminal to perform the above-described method.
Embodiments of the subject matter and the functional operations described in this specification can be implemented in: digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or a combination of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions, encoded on a tangible, non-transitory program carrier for execution by, or to control the operation of, data processing apparatus. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode and transmit information to suitable receiver apparatus for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
Computers suitable for the execution of a computer program include, for example, general and/or special purpose microprocessors, or any other type of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory and/or a random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer does not necessarily have such a device. Moreover, a computer may be embedded in another device, e.g., a mobile telephone, a Personal Digital Assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device such as a Universal Serial Bus (USB) flash drive, to name a few.
Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., an internal hard disk or a removable disk), magneto-optical disks, and CD ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. In other instances, features described in connection with one embodiment may be implemented as discrete components or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Further, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
The above description is only a preferred embodiment of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for displaying a landmark, comprising:
acquiring geometric shape information and color information of the mark points; the color information indicates colors of different display portions in the marker point;
processing the geometric shape information of the mark point by using a vertex shader to obtain a first primitive; processing the first primitive by using a geometry shader to obtain a second primitive;
for a plurality of fragments obtained by rasterizing the second primitive, determining a display part to which each fragment belongs according to the geometric shape information by a fragment shader, and determining the color of each fragment based on the display part to which each fragment belongs and the color information;
and displaying the mark points according to the color of each of the plurality of fragments.
2. The method according to claim 1, wherein the different display portions of the landmark points comprise at least two circles of different radii, the centers of the at least two circles overlap, and the display level of the circle of smaller radius is higher than the display level of the circle of larger radius; the geometric shape information includes radii of at least two of the circles;
the determining the display part to which each fragment belongs according to the geometric shape information comprises:
for each of the plurality of fragments, determining a target distance from the fragment to a center of a landmark;
and determining the display part to which the fragment belongs according to the difference between the target distance and the radius of at least two circles respectively.
3. The method of claim 1, wherein the different displayed portions of the landmark points include a center circle and at least one annular band; the geometric shape information comprises the radius of a central circle and the radius of each annular band;
the determining the display part to which each fragment belongs according to the geometric shape information comprises:
for each of the plurality of fragments, determining a target distance from the fragment to a center of a landmark;
and determining the display part to which the fragment belongs according to the difference between the target distance and the radius of the central circle and the difference between the target distance and the radius of each annular band.
4. The method of claim 3, wherein if the target distance is smaller than or equal to the radius of the central circle, the display portion to which the fragment belongs is the central circle;
if the target distance is greater than the radius of the central circle and less than or equal to the radius of the annular band, the display part to which the fragment belongs is the annular band;
in the case that the index point includes at least two annular bands, if the target distance is between the radius of the central circle and the radius of the annular band closest to the central circle, the display portion to which the slice belongs is the annular band closest to the central circle; and if the target distance is between the radiuses of the two annular bands, determining that the display part to which the fragment belongs is the larger radius of the two annular bands.
5. The method according to claim 3 or 4, wherein the endless belt can be divided into at least two arc-shaped areas; the geometric shape information further comprises an angle range of each arc-shaped area;
the determining the display part to which each fragment belongs according to the geometric shape information comprises:
for a fragment belonging to an annular band, determining an arc-shaped region to which the fragment belongs according to the difference between the angle information of the fragment and the angle ranges of different arc-shaped regions in the annular band to which the fragment belongs;
the method further comprises the following steps:
in a fragment shader, determining the display shape of each arc-shaped area by using the angle range of each arc-shaped area;
the displaying the mark point according to the color of each of the plurality of fragments includes:
and displaying the mark points according to the color of each fragment in the plurality of fragments and the display shape of each arc-shaped area.
6. The method of claim 1, further comprising: if it is determined that the fragment does not belong to any display part in the mark points according to the geometric shape information, discarding the fragment or setting the color of the fragment to be transparent; and/or the first primitive is rendered point-wise by the vertex shader.
7. The method of claim 1, wherein the geometry information includes normal information and a radius of a landmark point;
processing the first primitive by using a geometry shader to obtain a second primitive, wherein the processing comprises:
drawing an outer frame shape of the first graphic element according to the normal information and the radius of the mark point;
outputting the second graphic element according to the outer frame type; wherein the second primitive comprises two triangle primitives.
8. A display device of a marker point, comprising:
the information acquisition module is used for acquiring the geometric shape information and the color information of the mark points; the color information indicates colors of different display portions in the marker point;
the pixel obtaining module is used for drawing the geometric shape information of the mark point by using a vertex shader to obtain a first pixel; processing the first primitive by using a geometry shader to obtain a second primitive;
a color determining module, configured to determine, by a fragment shader, a display portion to which each fragment belongs according to the geometric shape information for a plurality of fragments obtained by rasterizing the second primitive, and determine a color of each fragment based on the display portion to which each fragment belongs and the color information;
and the display module is used for displaying the mark points according to the color of each of the plurality of fragments.
9. An electronic device comprising a memory, a processor, and executable instructions stored on the memory and executable on the processor;
wherein the processor, when executing the executable instructions, performs the steps of the method of any one of claims 1 to 7.
10. A computer readable storage medium having stored thereon computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1 to 7.
CN202211627131.3A 2022-12-16 2022-12-16 Method, device and equipment for displaying mark points and storage medium Pending CN115774536A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211627131.3A CN115774536A (en) 2022-12-16 2022-12-16 Method, device and equipment for displaying mark points and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211627131.3A CN115774536A (en) 2022-12-16 2022-12-16 Method, device and equipment for displaying mark points and storage medium

Publications (1)

Publication Number Publication Date
CN115774536A true CN115774536A (en) 2023-03-10

Family

ID=85392469

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211627131.3A Pending CN115774536A (en) 2022-12-16 2022-12-16 Method, device and equipment for displaying mark points and storage medium

Country Status (1)

Country Link
CN (1) CN115774536A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116824028A (en) * 2023-08-30 2023-09-29 腾讯科技(深圳)有限公司 Image coloring method, apparatus, electronic device, storage medium, and program product

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116824028A (en) * 2023-08-30 2023-09-29 腾讯科技(深圳)有限公司 Image coloring method, apparatus, electronic device, storage medium, and program product
CN116824028B (en) * 2023-08-30 2023-11-17 腾讯科技(深圳)有限公司 Image coloring method, apparatus, electronic device, storage medium, and program product

Similar Documents

Publication Publication Date Title
US8194071B2 (en) Tile based graphics rendering
EP3121786B1 (en) Graphics pipeline method and apparatus
US8059119B2 (en) Method for detecting border tiles or border pixels of a primitive for tile-based rendering
US8212840B2 (en) 3-D clipping in a graphics processing unit
US9019271B2 (en) Z-culling method, three-dimensional graphics processing method and apparatus threrof
KR20150041057A (en) Gpu-accelerated path rendering
KR20220167323A (en) Augmented reality content creators including 3D data in a messaging system
CN109544658B (en) Map rendering method and device, storage medium and electronic device
CN105550973B (en) Graphics processing unit, graphics processing system and anti-aliasing processing method
US8004522B1 (en) Using coverage information in computer graphics
CN115774536A (en) Method, device and equipment for displaying mark points and storage medium
Prochazka et al. Augmented reality implementation methods in mainstream applications
US8525843B2 (en) Graphic system comprising a fragment graphic module and relative rendering method
WO2023138199A1 (en) Route drawing method and apparatus, computer device, storage medium and program product
CN112132859A (en) Sticker generation method, apparatus, medium, and electronic device
US11989807B2 (en) Rendering scalable raster content
CN111710044A (en) Image processing method, apparatus and computer-readable storage medium
JPH11185054A (en) Image processor
US20150091890A1 (en) Rendering techniques for textured displays
CN118043842A (en) Rendering format selection method and related equipment thereof
CN116958375A (en) Graphics processor, system, apparatus, device, and method
CN110969568B (en) BIM model double-sided display accelerated rendering method, system, product and storage medium
CN112330769A (en) Method and device for generating dotted line texture and electronic equipment
US11776179B2 (en) Rendering scalable multicolored vector content
JPWO2002023484A1 (en) Texture mapping method and rendering device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination