CN114119828A - Semitransparent object rendering sorting method, device, equipment and storage medium - Google Patents

Semitransparent object rendering sorting method, device, equipment and storage medium Download PDF

Info

Publication number
CN114119828A
CN114119828A CN202111391134.7A CN202111391134A CN114119828A CN 114119828 A CN114119828 A CN 114119828A CN 202111391134 A CN202111391134 A CN 202111391134A CN 114119828 A CN114119828 A CN 114119828A
Authority
CN
China
Prior art keywords
semi
current
transparent object
transparent
data
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
CN202111391134.7A
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.)
Suzhou Qinyou Network Technology Co ltd
Original Assignee
Suzhou Qinyou Network 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 Suzhou Qinyou Network Technology Co ltd filed Critical Suzhou Qinyou Network Technology Co ltd
Priority to CN202111391134.7A priority Critical patent/CN114119828A/en
Publication of CN114119828A publication Critical patent/CN114119828A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/62Semi-transparency

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

The embodiment of the invention discloses a method, a device and equipment for rendering and sequencing semitransparent objects and a storage medium. The semitransparent object rendering and sorting method comprises the following steps: acquiring the shielding rate data of the semitransparent object graphs in the semitransparent object graph set; determining a single-layer semi-transparent object distribution subset of the semi-transparent object and inter-subset sequencing data of the single-layer semi-transparent object distribution subset according to the shielding rate data of the semi-transparent object graph; and performing sequencing rendering on the semi-transparent object graphs in the semi-transparent object graph set according to the inter-subset sequencing data of the single-layer semi-transparent object distribution subset. According to the technical scheme of the embodiment of the invention, the sequencing efficiency of the semitransparent rendering can be improved on the premise of ensuring the semitransparent rendering effect.

Description

Semitransparent object rendering sorting method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of image processing, in particular to a method, a device, equipment and a storage medium for rendering and sequencing semitransparent objects.
Background
In order to show the character display effect better, in the field of image processing, the character is usually required to be subjected to semitransparent processing, so that the character is vivid, and the user experience is improved.
In the prior art, sequencing processing of semi-transparent rendering is generally avoided, or a manual sequencing mode is adopted to render semi-transparent parts, so that rendering results of non-processed semi-transparent parts in the prior art are poor, and the problem of time and labor waste of manual sequencing of semi-transparent parts exists.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for rendering and sorting semitransparent objects, which can improve the rendering and sorting efficiency of the semitransparent objects on the premise of ensuring the rendering effect of the semitransparent objects.
In a first aspect, an embodiment of the present invention provides a method for rendering and sorting semi-transparent objects, including:
acquiring the shielding rate data of the semitransparent object graphs in the semitransparent object graph set;
determining a single-layer semi-transparent object distribution subset of the semi-transparent object and inter-subset sequencing data of the single-layer semi-transparent object distribution subset according to the shielding rate data of the semi-transparent object graph;
and performing sequencing rendering on the semi-transparent object graphs in the semi-transparent object graph set according to the inter-subset sequencing data of the single-layer semi-transparent object distribution subset.
In a second aspect, an embodiment of the present invention further provides a device for rendering and sorting semi-transparent objects, including:
the shielding rate data acquisition module is used for acquiring shielding rate data of the semitransparent object graphs in the semitransparent object graph set;
the data processing module is used for determining a single-layer semi-transparent object distribution subset of the semi-transparent object and the inter-subset sequencing data of the single-layer semi-transparent object distribution subset according to the shielding rate data of the semi-transparent object graph;
and the sequencing rendering module is used for sequencing and rendering the semitransparent object graphs in the semitransparent object graph set according to the sequencing data among the subsets of the single-layer semitransparent object distribution subset.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method for semi-transparent object rendering ordering provided by any embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for rendering and sorting semi-transparent objects according to any embodiment of the present invention.
According to the technical scheme of the embodiment, the single-layer semi-transparent object distribution subset of the semi-transparent object and the inter-subset sequencing data of the single-layer semi-transparent object distribution subset are determined according to the shielding rate data of the semi-transparent object graphs in the semi-transparent object graph set, so that the semi-transparent object graphs in the semi-transparent object graph set are sequenced and rendered according to the inter-subset sequencing data of the single-layer semi-transparent object distribution subset. The semi-transparent object graph set can be divided based on the levels by determining the single-layer semi-transparent object distribution subsets through the shielding rate data, semi-transparent object graphs in the semi-transparent object graph set are sorted and rendered according to the inter-set sorting data, the semi-transparent object graph set for realizing the level division can be automatically sorted and rendered according to the inter-set sorting data without manual intervention, a better rendering effect can be ensured, the problems that the rendering result is poor due to the fact that the semi-transparent part is not processed in the prior art, time and labor are wasted due to the fact that the semi-transparent part is manually sorted are solved, and the rendering and sorting efficiency of the semi-transparent objects can be improved on the premise that the rendering effect of the semi-transparent objects is ensured.
Drawings
FIG. 1 is a flowchart of a method for sorting rendering of semi-transparent objects according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for sorting rendering of semi-transparent objects according to a second embodiment of the present invention;
FIG. 3 is a schematic view of a hair bundle after color marking according to a second embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating an unordered rendering effect according to a second embodiment of the present invention;
fig. 5 is a schematic diagram illustrating a sequenced rendering effect according to a second embodiment of the present invention;
FIG. 6 is a schematic diagram of a second embodiment of the present invention for dividing the mesh of a hair model into hair bundles;
FIG. 7 is a schematic diagram of another embodiment of the present invention for dividing the mesh of a hair model into hair bundles;
FIG. 8 is a schematic diagram of a hair model without intra-layer ordering according to a second embodiment of the present invention;
FIG. 9 is a comparison of an unordered hair model and an intra-layer ordered hair model according to a second embodiment of the present invention;
FIG. 10 is a comparison of another unordered hair model and an intra-layer ordered hair model provided in accordance with example two of the present invention;
fig. 11 is a schematic diagram of a semitransparent object rendering sorting apparatus according to a third embodiment of the present invention;
fig. 12 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a method for sorting and rendering semi-transparent objects according to an embodiment of the present invention, where the embodiment is applicable to a case where semi-transparent objects are efficiently sorted and rendered, and the method may be executed by a semi-transparent object rendering sorting apparatus, which may be implemented by software and/or hardware, and may be generally integrated in an electronic device. Accordingly, as shown in fig. 1, the method comprises the following operations:
and S110, acquiring the occlusion rate data of the semi-transparent object graphs in the semi-transparent object graph set.
Wherein the semi-transparent object graphics set may be a graphics set that requires rendering of ordered semi-transparent objects. The semi-transparent object graphic may be a graphic of a semi-transparent object in the set of semi-transparent object graphics. The set of translucent object graphics may include at least one translucent object graphic. Illustratively, the translucent object graphic may include, but is not limited to, a translucent hair graphic, a translucent clothing graphic, a translucent five-sense organ graphic, a translucent hair ornament graphic, a translucent character graphic, and the like. When the translucent object graphic is a translucent hair graphic, the translucent object graphic set may be a graphic set including a plurality of translucent hair graphics. The occlusion rate data may be used to characterize the degree of occlusion of the object.
In the embodiment of the invention, the semi-transparent object graph set can be obtained first, and then the semi-transparent object graphs included in the semi-transparent object graph set are determined, so that the shielding rate data of each semi-transparent object graph is calculated.
S120, determining a single-layer semi-transparent object distribution subset of the semi-transparent objects and inter-subset ordering data of the single-layer semi-transparent object distribution subset according to the occlusion rate data of the semi-transparent object graph.
Wherein the semi-transparent object can be a semi-transparent object requiring rendering sequencing. The single-layer semi-transparent object distribution subset may be a set of semi-transparent object graphics belonging to a certain level in the set of semi-transparent object graphics. For example, when the translucent object is a hair model, the translucent object graphic may be a bundle of hair and the single-layered translucent object distribution subset may be a bundle of hair at a level in the hair model. The inter-subset ordering data may be data characterizing a rendering order of the single-layer semi-transparent object distribution subsets.
In the embodiment of the invention, the semi-transparent object graphs in the semi-transparent object graph set can be divided according to the shielding rate data of the semi-transparent object graphs to obtain the single-layer semi-transparent object distribution subset of the semi-transparent objects, so that the semi-transparent object graphs in the single-layer semi-transparent object distribution subset belong to the same layer, and the inter-subset sequencing data of the single-layer semi-transparent object distribution subset is further determined according to the sequence of dividing the single-layer semi-transparent object distribution subset.
S130, conducting sequencing rendering on the semi-transparent object graphs in the semi-transparent object graph set according to the inter-subset sequencing data of the single-layer semi-transparent object distribution subset.
In the embodiment of the invention, the rendering sequence of the single-layer semi-transparent object distribution subset can be determined according to the inter-subset sorting data of the single-layer semi-transparent object distribution subset, and then the semi-transparent object graphics in the semi-transparent object graphics set are sorted and rendered according to the rendering sequence of the single-layer semi-transparent object distribution subset.
According to the technical scheme of the embodiment, the single-layer semi-transparent object distribution subset of the semi-transparent object and the inter-subset sequencing data of the single-layer semi-transparent object distribution subset are determined according to the shielding rate data of the semi-transparent object graphs in the semi-transparent object graph set, so that the semi-transparent object graphs in the semi-transparent object graph set are sequenced and rendered according to the inter-subset sequencing data of the single-layer semi-transparent object distribution subset. The semi-transparent object graph set can be divided based on the levels by determining the single-layer semi-transparent object distribution subsets through the shielding rate data, semi-transparent object graphs in the semi-transparent object graph set are sorted and rendered according to the inter-set sorting data, the semi-transparent object graph set for realizing the level division can be automatically sorted and rendered according to the inter-set sorting data without manual intervention, a better rendering effect can be ensured, the problems that the rendering result is poor due to the fact that the semi-transparent part is not processed in the prior art, time and labor are wasted due to the fact that the semi-transparent part is manually sorted are solved, and the rendering and sorting efficiency of the semi-transparent objects can be improved on the premise that the rendering effect of the semi-transparent objects is ensured.
Example two
Fig. 2 is a flowchart of a method for rendering and sorting semi-transparent objects according to a second embodiment of the present invention, which is embodied on the basis of the second embodiment, and in this embodiment, a specific optional implementation manner of obtaining occlusion rate data of semi-transparent object graphics in a semi-transparent object graphics set and performing internal sorting on a single-layer semi-transparent object distribution subset is given. Accordingly, as shown in fig. 2, the method includes the following operations:
s210, determining the current semi-transparent object to be processed according to the semi-transparent object graph set.
The current to-be-processed semitransparent object can be a semitransparent object graph of which the occlusion rate data needs to be calculated currently.
In the embodiment of the invention, the current to-be-processed semitransparent object of which the occlusion rate data needs to be calculated currently can be determined from the semitransparent object graph set.
In an optional embodiment of the present invention, before acquiring the occlusion rate data of the semi-transparent object graphics in the semi-transparent object graphics set, the method may further include: acquiring vertex associated data of a semi-transparent object unit in the semi-transparent object; a set of semi-transparent object graphics is determined from the vertex association data for the semi-transparent object cells.
The semi-transparent object unit may be a minimum component unit of the semi-transparent object, that is, the semi-transparent object unit cannot be subdivided. For example, when the semi-transparent object is a 3D model, the semi-transparent object cells are triangles that make up the 3D model. The vertex association data may be data associated with vertices of the translucent object cells. The vertex association data may include data such as a vertex identification for identifying a vertex number and a translucent object unit to which the vertex belongs.
In the embodiment of the invention, the semi-transparent objects needing to be rendered and sequenced can be firstly obtained, so that the semi-transparent object units forming the semi-transparent objects are determined, the vertex association data of each semi-transparent object unit is further determined, so that the semi-transparent object units sharing the vertices are determined according to the vertex association data, and further the semi-transparent object graph set is determined according to the semi-transparent object units sharing the vertices.
Illustratively, when the translucent object is a hair model, the set of translucent object graphics may be determined by inputting vertex association data to a hairlines. Create () function is a function that divides hair bundles. The embodiment of the invention does not limit the function adopted for determining the semi-transparent object graph set.
For example, the semi-transparent object cells in the semi-transparent object may be traversed first, and if none of the vertices of the semi-transparent object cells are assigned a semi-transparent object graphical identifier, a new semi-transparent object graphical identifier may be assigned to the vertices of the semi-transparent object cells whose none of the vertices are assigned a semi-transparent object graphical identifier. If a portion of the vertices of a semi-transparent object cell are assigned semi-transparent object graphical identifiers, the semi-transparent object graphical identifiers are configured to the vertices of the semi-transparent object cell to which the semi-transparent object graphical identifiers are not assigned. If different vertexes of a semi-transparent object unit have different semi-transparent object graphic identifications, selecting one semi-transparent object graphic identification from the different semi-transparent object graphic identifications of the different vertexes of the semi-transparent object unit to be uniformly configured to all vertexes of the semi-transparent object unit, and configuring the vertexes of the semi-transparent object units having the same semi-transparent object graphic identifications as the semi-transparent object units before the vertexes which are not uniformly configured to be the same as the semi-transparent object unit vertexes after the vertexes which are uniformly configured. Wherein, the semitransparent object graph mark can be a mark for representing the semitransparent object graph so as to count the semitransparent object units belonging to the same semitransparent object graph. For example, the translucent object graphic identification of the translucent object graphic A may be the ID1, and the translucent object graphic identification of the translucent object graphic B may be the ID 2.
Illustratively, assuming that the translucent object is a hair model, the translucent object units are triangles 1, 2, 3, 4, and 5 constituting the hair model. The vertices of triangle 1 are vertex 1, vertex 2, and vertex 3. The vertices of triangle 2 are vertex 2, vertex 3, and vertex 4. The vertices of triangle 3 are vertex 5, vertex 6, and vertex 7. The vertices of triangle 4 are vertex 4, vertex 5, and vertex 6. The vertices of triangle 5 are vertex 8, vertex 9, and vertex 10. Assuming that the hair bundle identifier (translucent hair pattern identifier) assigned to the vertex of triangle 1 is ID1, since triangles 1 and 2 share vertices 2 and 3, it is possible to divide triangles 1 and 2 into one hair bundle, that is, one translucent hair pattern, and assign hair bundle identifiers ID1 to the vertices of triangles 1 and 2, triangle 3 does not share vertices with triangles 2 and 1, and further divide triangle 3 into one hair bundle, and assign hair bundle identifier ID2 to the vertex of triangle 3. Since triangle 4 shares apex 4 with triangle 2 and apex 5 and apex 6 with triangle 3, triangle 4 may be scored into the hair strand of strand ID1, or triangle 4 may be scored into the hair strand of strand ID2, with the apex of triangle 4 presenting a different strand ID, strand ID1 may be uniformly assigned to the apex of triangle 4, and strand ID1 may be assigned to the apex of triangle 3, with triangle 1, triangle 2, triangle 3, and triangle 4 being divided into one strand, with the apex of the triangle within the strand having a uniform strand ID 1. Since the vertex of triangle 5 is not assigned a hair strand identification and does not share vertices with triangles 1, 2, 3, and 4, the vertex of triangle 5 may be assigned a hair strand identification ID 2.
And S220, calculating current normal direction data of the current semitransparent object to be processed.
Wherein the current normal direction data may be used to characterize the normal direction of the translucent object figure for which the normal direction currently needs to be determined.
Specifically, if the current to-be-processed translucent object is a plane graph, the current normal direction data of the current to-be-processed translucent object may be calculated according to a calculation manner of a plane normal. If the current to-be-processed semitransparent object is a curved surface graph, current normal direction data of the current to-be-processed semitransparent object can be calculated according to a calculation mode of a curved surface normal.
For example, if the current to-be-processed translucent object is a curved graphic, the translucent object units constituting the current to-be-processed translucent object may be determined first, further taking the product of the normal vector of the semi-transparent object unit and the area of the semi-transparent object unit as the normal direction data of the semi-transparent object unit, further taking the average value of the normal direction data of all the semi-transparent object units of the current semi-transparent object to be processed as the current normal direction data of the current semi-transparent object to be processed, and also performing weighting processing on the vertex normal vector of the semi-transparent object unit and taking the weighting result as the normal direction data of the semi-transparent object unit, and then taking the average value of the normal direction data of all the semi-transparent object units of the current semi-transparent object to be processed as the current normal direction data of the current semi-transparent object to be processed.
And S230, determining the related semitransparent object of the current semitransparent object to be processed according to the current normal direction data.
Wherein the associated translucent object may be a translucent object graphic that occludes the translucent object currently to be processed. The associated translucent object may include one, or more translucent object graphics.
In the embodiment of the present invention, it may be determined according to the normal direction data that when the current to-be-processed translucent object is drawn, an associated translucent object that is occluded from the current to-be-processed translucent object is formed.
In an optional embodiment of the present invention, determining an associated translucent object of the current translucent object to be processed according to the current normal direction data may comprise: determining current orthogonal camera parameters matched with the current semitransparent object to be processed according to the current normal direction data; and determining the related semitransparent object of the current semitransparent object to be processed according to the current orthogonal camera parameter matched with the current semitransparent object to be processed and the image depth data of the non-current semitransparent object image.
The current orthogonal camera parameters may be data that the orthogonal camera that shoots the current semitransparent object to be processed needs to be configured. The non-current translucent object graphic may be a translucent object graphic other than the current translucent object to be processed captured by the orthogonal camera. The graphics depth data may be data characterizing the depth of pixels of the graphics. Pixel depth may refer to the number of bits used to store each pixel and also is used to measure the resolution of the image.
In the embodiment of the present invention, a direction opposite to the vector direction of the current normal direction data may be determined, and then the orthogonal camera may be placed according to the direction opposite to the vector direction of the current normal direction data, and then the current orthogonal camera parameter matched with the current translucent object to be processed may be determined according to the maximum diagonal of the bounding box of the current translucent object to be processed. After obtaining the current orthogonal camera parameters matched with the current semi-transparent object to be processed, the orthogonal camera can be configured according to the current orthogonal camera parameters, so that the shooting range of the orthogonal camera at least comprises the whole current semi-transparent object to be processed, the shot image depth at least comprises the whole semi-transparent object graph set, then a non-current semi-transparent object graph is determined from the graphs shot by the orthogonal camera, and graph depth data of the non-current semi-transparent object graph is analyzed, so that the non-current semi-transparent object graph closer to the orthogonal camera than the current semi-transparent object to be processed is determined according to the graph depth data of the non-current semi-transparent object graph, and then the non-current semi-transparent object graph closer to the orthogonal camera than the current semi-transparent object to be processed is used as the associated semi-transparent object of the current semi-transparent object to be processed.
S240, determining the occlusion area of the associated semitransparent object to the current semitransparent object to be processed.
The occlusion area can represent the occlusion range and can be used for representing the occluded area in the current to-be-processed semitransparent object.
In the embodiment of the present invention, the image area of the associated translucent object and the image area of the current to-be-processed translucent object may be determined first, and then the occlusion area of the associated translucent object on the current to-be-processed translucent object may be determined according to the image area of the associated translucent object and the image area of the current to-be-processed translucent object.
In an optional embodiment of the present invention, determining an occlusion area of the associated translucent object for the current translucent object to be processed may include: acquiring an object depth value of a current semi-transparent object to be processed and an object depth value of an associated semi-transparent object according to current orthogonal camera parameters; determining the global graph area of the current to-be-processed semitransparent object according to the object depth value of the current to-be-processed semitransparent object; determining the area of the shielding graph of the current semitransparent object to be processed according to the object depth value of the associated semitransparent object; and determining the shielding area of the associated semitransparent object to the current semitransparent object to be processed according to the shielding graph area and the global graph area.
Wherein the object depth value may be an average value of pixel depths of the graphic. The global graphics area may be the graphics area of the currently pending translucent object. The occlusion graphical area may be an area of the associated translucent object that forms an occlusion for the currently pending translucent object.
In the embodiment of the present invention, the shot image of the current orthogonal camera may be determined according to the current orthogonal camera parameter, and then the object depth value of the current to-be-processed translucent object and the object depth value of the associated translucent object are calculated according to the shot image of the current orthogonal camera, and then according to the object depth value of the current to-be-processed translucent object, the global graphic area of the current to-be-processed translucent object corresponding to the object depth value of the current to-be-processed translucent object is determined, and the blocked graphic area of the current to-be-processed translucent object corresponding to the object depth value of the associated translucent object is determined according to the object depth value of the associated translucent object, and then the area of the overlapping area of the blocked graphic area and the global graphic area is used as the blocked area of the associated translucent object on the current to-be-processed translucent object.
And S250, calculating the shielding rate data of the semi-transparent object graph according to the shielding area of the semi-transparent object to be processed currently.
In the embodiment of the invention, the occlusion rate data of the semi-transparent object graph can be calculated according to the occlusion area of the current semi-transparent object to be processed and the graph area of the current semi-transparent object to be processed.
Optionally, the occlusion rate data of the current to-be-processed semitransparent object may be calculated according to the occlusion area of the current to-be-processed semitransparent object and the graph area of the current to-be-processed semitransparent object, so that the current to-be-processed semitransparent object is removed from the graph set of semitransparent objects to update the graph set of semitransparent objects, and the step S210 is executed until the graph set of semitransparent objects is an empty set. The algorithm for calculating the occlusion rate data may be implemented on a Central Processing Unit (CPU) or a Graphics Processing Unit (GPU).
For example, a sum value C of the occlusion area a of the current to-be-processed translucent object and the graph area B of the current to-be-processed translucent object may be calculated first, and then a ratio of the occlusion area a of the current to-be-processed translucent object to the sum value C may be used as the occlusion rate data of the translucent object graph.
For example, the depth writing may be turned off (at this time, data in the depth buffer is not rewritten when other hair bundles are drawn, and only the depth value of the current hair bundle is in the depth buffer), the depth test may be further turned on (only when other hair bundles are closer to the orthogonal camera, the other hair bundles are discarded when the other hair bundles are farther from the orthogonal camera, and the discarded hair bundle does not obscure the current hair bundle), and the obscured area of the hair bundle obscuring the current hair bundle may be rendered into the color b, and after the color rendering of the current hair bundle is completed, the rendering effect may be as shown in fig. 3. After the rendering area of the color a and the rendering area of the color b are obtained, the number of pixels of the color a may be further counted according to the rendering area of the color a, and the number of pixels of the color b may be counted according to the rendering area of the color b, so as to calculate a sum of the number of pixels of the color a and the number of pixels of the color b, and a ratio of the number of pixels of the color b to the sum may be used as the shielding rate data of the semi-transparent object image. When the ratio is 0, it represents that the current hair bundle is not blocked, and when the ratio is 1, it represents that the current hair bundle is completely blocked.
For example, the GPU may encode all the operation instructions of the issue into a command buffer (programming concept of command buffer) in batch, and then render the global graphics area and the occlusion graphics area of the current issue based on the rendering pipeline, and further calculate the occlusion rate data based on the renderer, which is faster than the CPU in data processing speed of the GPU. When rendering the current hair bundle, the current hair bundle may be set as a rendering target with a side of 256 pixels, and the depth buffer of the full map is flushed to the nearest value (e.g., 0) that can be represented.
S260, determining a single-layer semi-transparent object distribution subset of the semi-transparent objects and inter-subset ordering data of the single-layer semi-transparent object distribution subset according to the occlusion rate data of the semi-transparent object graph.
In an optional embodiment of the present invention, after determining the single-layer translucent object distribution subset of translucent objects according to the occlusion rate data of the translucent object graph, the method may further comprise: determining a current single-layer semitransparent object to be sorted; acquiring current normal direction data of a current single-layer semitransparent object to be sorted; determining target normal direction data according to current normal direction data of the current single-layer semitransparent object to be sorted and normal direction data of the non-current single-layer semitransparent object to be sorted in the single-layer semitransparent object distribution subset; updating the current normal direction data according to the target normal direction data; and performing subset internal sorting on the single-layer semitransparent objects to be sorted currently according to the current normal direction data.
The single-layer semi-transparent object to be sorted currently can be a semi-transparent object graph with the arrangement order in the layers determined in the distribution subset of the layered semi-transparent objects. The first determined current single-layer semi-transparent object to be sorted comprises a semi-transparent object graph, and the subsequently determined current single-layer semi-transparent object to be sorted is a combination of a plurality of semi-transparent object graphs. The non-current single-layer semi-transparent object to be sorted may be a semi-transparent object to be processed in the single-layer semi-transparent object distribution subset except the current single-layer semi-transparent object to be sorted, and the non-current single-layer semi-transparent object to be sorted and the current single-layer semi-transparent object to be sorted belong to the same single-layer semi-transparent object distribution subset. The target normal direction data may be data calculated from current normal direction data of the single-layer translucent object to be sorted currently and normal direction data of the single-layer translucent object to be sorted not currently in the single-layer translucent object distribution subset, and used to update the current normal direction data.
In the embodiment of the present invention, a current single-layer translucent object to be sorted may be determined from the single-layer translucent object distribution subset, current normal direction data of the current single-layer translucent object to be sorted is further calculated, thereby determining a non-current single-layer translucent object to be sorted within the single-layer translucent object distribution subset whose normal direction opposite to the current normal direction corresponding to the current single-layer translucent object to be sorted is closest, and determining normal direction data of the non-current single-layer translucent object to be sorted. After obtaining the current normal direction data of the current single-layer semitransparent object to be sorted and the normal direction data of the non-current single-layer semitransparent object to be sorted in the single-layer semitransparent object distribution subset with the reverse direction of the normal direction closest to the current normal direction data, calculating target normal direction data according to the current normal direction data of the current single-layer semitransparent object to be sorted and the normal direction data of the non-current single-layer semitransparent object to be sorted in the single-layer semitransparent object distribution subset, taking the target normal direction data as new current normal direction data, adding the non-current single-layer semitransparent object to be sorted with the calculated target normal direction data into the current single-layer semitransparent object to be sorted, and returning to execute the operation of determining the current single-layer semitransparent object to be sorted until the current single-layer semitransparent object to be sorted comprises all semitransparent object graphs of the single-layer semitransparent object distribution subset, and then, according to the subset internal sorting of the current single-layer semitransparent objects to be sorted, performing sorting rendering on the current single-layer semitransparent objects to be sorted according to the subset internal sorting of the current single-layer semitransparent objects to be sorted.
In an optional embodiment of the invention, updating the current normal direction data according to the target normal direction data may comprise: acquiring a sum of the target normal direction data and the current normal direction data; and updating the current normal direction data according to the sum of the target normal direction data and the current normal direction data.
In the embodiment of the present invention, the sum of the target normal direction data and the current normal direction data may be calculated, and then the sum of the target normal direction data and the current normal direction data is used as new current normal direction data, and then the non-current to-be-sorted single-layer semitransparent object corresponding to the target normal direction data is added to the current to-be-sorted single-layer semitransparent object, and the operation of determining the current to-be-sorted single-layer semitransparent object is returned until the current to-be-sorted single-layer semitransparent object includes all previous to-be-processed semitransparent objects in the single-layer semitransparent object distribution subset, and the update of the current normal direction data is ended.
For example, assume that the single-layer translucent object distribution subset is determined to include translucent object graphic a, translucent object graphic B, and translucent object graphic C. Under the condition that the current single-layer semi-transparent object to be sorted is empty, a semi-transparent object image, such as a semi-transparent object graph A, can be randomly selected from a single-layer semi-transparent object distribution subset, the selected semi-transparent object graph A is further added to the current single-layer semi-transparent object to be sorted, the current normal direction data of the current single-layer semi-transparent object to be sorted is the current normal direction data of the semi-transparent object graph A, the semi-transparent object graph B and the semi-transparent object graph C are further taken as non-current single-layer semi-transparent objects to be sorted, the semi-transparent object graph B which is closest to the reverse direction of the vector corresponding to the current normal direction data of the semi-transparent object graph A is further determined from the non-current single-layer semi-transparent object to be sorted, and the sum of the normal direction data of the semi-transparent object graph B and the current normal direction data of the semi-transparent object graph A is taken as the target normal direction data, and updating the current normal direction data into target normal direction data, and adding the semitransparent object graph B into the current single-layer semitransparent object to be sorted.
After adding the semi-transparent object graph B to the current single-layer semi-transparent object to be sorted, the current single-layer semi-transparent object to be sorted comprises a semi-transparent object graph A and a semi-transparent object graph B, the non-current single-layer semi-transparent object to be sorted is a semi-transparent object graph C, the current normal direction data of the current single-layer semi-transparent object to be sorted is the sum of the normal direction data of the semi-transparent object graph B and the normal direction data of the semi-transparent object graph A, the semi-transparent object graph C which is closest to the reverse direction of the vector corresponding to the current normal direction data of the current single-layer semi-transparent object to be sorted is determined according to the current normal direction data of the current single-layer semi-transparent object to be sorted, and the sum of the normal direction data of the semi-transparent object graph C, the normal direction data of the semi-transparent object graph B and the normal direction data of the semi-transparent object graph A is used as target normal direction data, and adding the semi-transparent object graph C to the current single-layer semi-transparent object to be sorted, finishing the operation of determining the current single-layer semi-transparent object to be sorted as the current single-layer semi-transparent object to be sorted comprises all the semi-transparent object graphs of the single-layer semi-transparent object distribution subset, and taking the sequence of the semi-transparent objects (the semi-transparent object graph A, the semi-transparent object graph B and the semi-transparent object graph C) added to the current single-layer semi-transparent object to be sorted as the subset internal sorting according to the updating process of the current normal direction data.
In an optional embodiment of the present invention, determining the single-layer semi-transparent object distribution subset of the semi-transparent objects and the inter-subset ordering data of the single-layer semi-transparent object distribution subset according to the occlusion rate data of the semi-transparent object graph may include: determining a current occlusion rate threshold; dividing the semitransparent object graph with the shielding rate data less than or equal to the current shielding rate threshold value into a single-layer semitransparent object distribution subset; and determining inter-subset ordering data of the single-layer semi-transparent object distribution subsets according to the determined sequence of the single-layer semi-transparent object distribution subsets.
The current occlusion rate threshold may be a preset occlusion rate threshold according to the rendering effect. For example, the current occlusion rate threshold may be set to 0.2, and the occlusion rate thresholds for each single-layer semi-transparent object distribution subset may be determined to be the same or different.
In the embodiment of the invention, the current occlusion rate threshold value can be determined according to the required rendering effect, the empty set is initialized to be used as the single-layer semi-transparent object distribution subset, the semi-transparent object graph with the occlusion rate data smaller than or equal to the current occlusion rate threshold value is divided into the single-layer semi-transparent object distribution subset, and the inter-subset sequencing data of the single-layer semi-transparent object distribution subset is determined according to the determination sequence of each single-layer semi-transparent object distribution subset.
For example, assuming that the single-layer semi-transparent object distribution subset 1 is determined first, the single-layer semi-transparent object distribution subset 2 is determined, and the single-layer semi-transparent object distribution subset 3 is determined last, the inter-subset ordering data is the single-layer semi-transparent object distribution subset 1, the single-layer semi-transparent object distribution subset 2, and the single-layer semi-transparent object distribution subset 3.
S270, conducting sequencing rendering on the semi-transparent object graphs in the semi-transparent object graph set according to the inter-subset sequencing data of the single-layer semi-transparent object distribution subset.
In an optional embodiment of the present invention, performing an ordered rendering on the semi-transparent object graphics in the semi-transparent object graphics set according to the inter-subset ordering data of the single-layer semi-transparent object distribution subset may include: performing reverse order processing on the sorting data among the subsets of the single-layer semitransparent object distribution subset to obtain reverse order sorting data among the subsets; and performing sequencing rendering on the semi-transparent object graphs in the semi-transparent object graph set according to the reverse sequencing data among the subsets.
Wherein, the reverse order processing can be used for reversely rearranging the data in the array. For example, the original array is 123, and the reverse-order rearranged array that can perform reverse-order processing on the original array is 321. The inter-subset sort data may be a result of a reverse process of the inter-subset sort data of the single-layer semi-transparent object distribution subset.
In the embodiment of the invention, the inter-subset sorting data of the single-layer semi-transparent object distribution subset can be subjected to reverse order processing to obtain a reverse order sorting result of the inter-subset sorting data, namely the inter-subset reverse order sorting data, and then the semi-transparent object graphics in the semi-transparent object graphics set are subjected to sorting rendering by utilizing the inter-subset reverse order sorting data and the inter-subset sorting data of the single-layer semi-transparent object distribution subset.
For example, it is assumed that the inter-subset ordering data is a single-layer semi-transparent object distribution subset 1, a single-layer semi-transparent object distribution subset 2, and a single-layer semi-transparent object distribution subset 3, a single-layer semi-transparent object distribution subset 2, and a single-layer semi-transparent object distribution subset 1, and then the single-layer semi-transparent object distribution subset 3 in the semi-transparent object graphic set is rendered first, then the single-layer semi-transparent object distribution subset 2 in the semi-transparent object graphic set is rendered, and finally the single-layer semi-transparent object distribution subset 1 in the semi-transparent object graphic set is rendered.
In one specific example, when drawing a hair model of a virtual character, translucency is introduced to make the hair edge look more natural for better hair display. The semitransparent rendering can draw a graph from far to near by using a painter algorithm, a triangle behind the head in a hair model is drawn firstly, then a temple is drawn, drawing from near to far occurs, however, the sequence of the triangles of the single renderer can not be processed, grids which are not sequenced after semitransparent is introduced can encounter obvious errors, some triangles which need to be shielded are drawn, the triangle which needs to be shielded originally is not shielded as shown in figure 4, and the circled part is the condition that the triangle which needs to be shielded originally is not shielded. According to the scheme, the in-layer sequencing (subset internal sequencing) is carried out on the hair bundle layers (equivalent to single-layer semitransparent object distribution subsets), the hair bundle layers are sequenced and rendered according to the hair bundle layer stripping reverse sequence (equivalent to subset reverse sequencing data) of different hair bundle layers, the sequencing of the triangle rendering sequence can be realized, the problem that the rendering effect is poor due to the fact that a single renderer cannot sequence the triangles per se is solved, and after the hair bundle layers are sequenced according to the scheme, the final sequencing rendering effect is shown in fig. 5.
The hair bundle ordering of the hair model can refer to the following steps, step 1, dividing the triangle of the hair model into hair bundles; step 2, calculating the shielding rate of the hair bundle to be determined (the hair bundle which is not layered and sequenced is equivalent to a plurality of semitransparent objects to be processed); step 3, dividing the hair bundle with the shielding rate data smaller than or equal to the current shielding rate threshold value into hair bundle layers Li in the hair bundles to be determined, wherein Li represents the ith layer of hair bundle; step 4, carrying out in-layer sequencing on the hair strands of one hair strand layer; step 5, removing the hair bundle Li from the hair bundle to be determined, enabling i to be i +1, and returning to execute the step 2 to the step 5 until the hair bundle to be determined is empty, and dividing all the hair bundles into a certain layer; and 6, rendering the hair strands in the sequence of the Ln … L1 and L2 in the reverse peeling sequence according to the hair strand layers L1, L2 and … Ln obtained in the peeling sequence. Where L1 represents a first layer of hair strands, L2 represents a second layer of hair strands, and so on, and Ln represents an nth layer of hair strands. The larger n represents that the hair bundle layer is more inside, the hair bundles more inside are drawn preferentially, the correct mixing from inside to outside is ensured, and finally, an off-line (occurring in the editing stage, but not in the game running stage) ordered grid is obtained, and the grid can obtain a good display effect when being directly used in the game.
Specifically, step 2 may include: step 2.1, calculating the current normal direction data of the current hair bundle; step 2.2, arranging an orthogonal camera along the direction opposite to the normal direction corresponding to the current normal direction data; step 2.3, drawing the current hair bundle according to the image shot by the orthogonal camera, writing the pixel depth value into a depth buffer area, and marking the current hair bundle as color a; step 2.4, closing the depth writing, starting the depth test, and rendering the shielding area of the hair bundle shielding the current hair bundle as a color b; and 2.5, taking the pixel number of the color b/(the pixel number of the color b + the pixel number of the color a) as the shielding rate data of the current hair bundle.
Step 4 may include: step 4.1.1, determining unordered hair bundles in the layer, wherein the initial value is all the hair bundles in the layer; step 4.1.2, normal direction data of unordered hair bundles in the layer are calculated; step 4.1.3, determining a current hair bundle from the unordered hair bundles in the layer (which is equivalent to determining the current single-layer semitransparent object to be ordered, and only one semitransparent object graph is included in the current single-layer semitransparent object to be ordered at the moment), and taking the normal direction data N of the current hair bundle as the current normal direction data; step 4.2, determining the nearest direction of the current hair bundle from the current layerA near hair bundle as the next hair bundle to be treated and marking the next hair bundle to be treated as Sn(ii) a Step 4.3, with SnThe sum of the normal direction data N and the current normal direction data N is set as target normal direction data Nn which is Sn+ N, and updating the current normal direction data by using a formula N ═ Nn; step 4.4, delete S from intra-layer unsorted bundlenWill SnAdding to the sorted list; and 4.5, returning to execute the steps 4.2 to 4.4 until the unordered hair bundles in the layers are emptied, wherein the adding sequence of the hair bundles in the sequence list is the in-layer sequencing sequence of the hair bundles in the layers.
Fig. 6 is a schematic diagram of dividing a mesh of a hair model into hair strands according to a second embodiment of the present invention, and as shown in fig. 6, a triangle as the mesh is divided into a plurality of hair strands in a three-dimensional coordinate system. For a more visual presentation of the hair bundle, a schematic representation of the hair bundle of another hair model is given in a three-dimensional coordinate system, see fig. 7. Each lock of hair is shown as a bundle in fig. 7 and 6.
Fig. 8 is a schematic diagram of a hair model without in-layer sorting according to the second embodiment of the present invention, and as shown in fig. 8, if no in-layer sorting is performed, a situation may occur in which one side of the hair model is observed substantially correctly, and the other side of the hair model is observed substantially incorrectly. When viewed from right to left, the hair model renders substantially correct, while when viewed from left to right, the hair model is substantially incorrect, i.e., still a large portion of the right hairstyle can be seen, only a small portion of the left hairstyle can be seen.
Fig. 9 is a comparison diagram of a hair model without in-layer sorting and a hair model with in-layer sorting according to a second embodiment of the present invention, and fig. 10 is a comparison diagram of another hair model without in-layer sorting and a hair model with in-layer sorting according to a second embodiment of the present invention, as shown in fig. 9, when the hair model is viewed from the right side, if the strand layer completes the in-layer sorting, the rendered graphic can be partially correct and partially incorrect when viewed from the right side (the color of the correct portion in the hair model is lighter than that of the incorrect portion). If the hair strand layers are not internally ordered, the rendered graphic is viewed as substantially correct on the right. As shown in FIG. 10, when the hair model is viewed from the left, if the strand layers complete the intra-layer ordering, the rendered graphic may be partially erroneous for the right portion when viewed from the left. If the hair strand layers are not internally ordered, the rendered graphic is viewed as a basic error on the left. When the transparency of the semitransparent hair bundle is moderate or low, if the hair model is correctly and wrongly interpenetrated, the wrong part is not easy to be found, so that the scheme can improve the visual effect by carrying out in-layer sequencing on the hair bundle layer.
After the hair bundles are sequenced, intermediate results in the calculation process can be checked through a debugging tool, and then an error link can be checked, wherein the error link can include calculation problems and/or art resource problems. The error link can be quickly positioned through the debugging tool, and the position needing to be corrected is accurately judged. For example, test cases may be written in a debug tool as test units that do not destroy the correctness of the hair strand sorted rendering when modifying code. The test tool can also display the in-layer sequencing sequence of the hair bundle layer and the sequencing sequence of the hair bundle layer in a visual mode so as to conveniently check the sequencing result and the correctness of hair bundle division, and can also output the current hair bundle and pictures of other hair bundles shielding the current hair bundle when calculating the shielding rate data of the current hair bundle so as to conveniently check the correctness of the orthogonal camera and the shielding rate data.
The technical scheme of the embodiment determines the current semitransparent object to be processed according to the semitransparent object graph set so as to calculate the current normal direction data of the current semitransparent object to be processed, further determining the associated semitransparent object of the current semitransparent object to be processed according to the current normal direction data, further determining the shielding area of the associated semitransparent object to the current semitransparent object to be processed, calculating the occlusion rate data of the semi-transparent object graph according to the occlusion area of the current semi-transparent object to be processed, thereby determining a single-layered semi-transparent object distribution subset of the semi-transparent objects and inter-subset ordering data of the single-layered semi-transparent object distribution subset from the occlusion rate data of the semi-transparent object pattern, and then, performing sequencing rendering on the semi-transparent object graphs in the semi-transparent object graph set according to the inter-subset sequencing data of the single-layer semi-transparent object distribution subset. The semi-transparent object graph set can be divided based on the levels by determining the single-layer semi-transparent object distribution subsets through the shielding rate data, semi-transparent object graphs in the semi-transparent object graph set are sorted and rendered according to the inter-set sorting data, the semi-transparent object graph set for realizing the level division can be automatically sorted and rendered according to the inter-set sorting data without manual intervention, a better rendering effect can be ensured, the problems that the rendering result is poor due to the fact that the semi-transparent part is not processed in the prior art, time and labor are wasted due to the fact that the semi-transparent part is manually sorted are solved, and the rendering and sorting efficiency of the semi-transparent objects can be improved on the premise that the rendering effect of the semi-transparent objects is ensured.
It should be noted that any permutation and combination between the technical features in the above embodiments also belong to the scope of the present invention.
EXAMPLE III
Fig. 11 is a schematic diagram of a semitransparent object rendering sorting apparatus according to a third embodiment of the present invention, and as shown in fig. 11, the apparatus includes: an occlusion rate data obtaining module 310, a data processing module 320, and a sorting rendering module 330, wherein:
an occlusion rate data obtaining module 310, configured to obtain occlusion rate data of a semi-transparent object graph in a semi-transparent object graph set;
a data processing module 320, configured to determine a single-layer semi-transparent object distribution subset of semi-transparent objects and inter-subset ordering data of the single-layer semi-transparent object distribution subset according to the occlusion rate data of the semi-transparent object graph;
and the sorting rendering module 330 is configured to perform sorting rendering on the semi-transparent object graphics in the semi-transparent object graphics set according to the inter-subset sorting data of the single-layer semi-transparent object distribution subset.
According to the technical scheme of the embodiment, the single-layer semi-transparent object distribution subset of the semi-transparent object and the inter-subset sequencing data of the single-layer semi-transparent object distribution subset are determined according to the shielding rate data of the semi-transparent object graphs in the semi-transparent object graph set, so that the semi-transparent object graphs in the semi-transparent object graph set are sequenced and rendered according to the inter-subset sequencing data of the single-layer semi-transparent object distribution subset. The semi-transparent object graph set can be divided based on the levels by determining the single-layer semi-transparent object distribution subsets through the shielding rate data, semi-transparent object graphs in the semi-transparent object graph set are sorted and rendered according to the inter-set sorting data, the semi-transparent object graph set for realizing the level division can be automatically sorted and rendered according to the inter-set sorting data without manual intervention, a better rendering effect can be ensured, the problems that the rendering result is poor due to the fact that the semi-transparent part is not processed in the prior art, time and labor are wasted due to the fact that the semi-transparent part is manually sorted are solved, and the rendering and sorting efficiency of the semi-transparent objects can be improved on the premise that the rendering effect of the semi-transparent objects is ensured.
Optionally, the occlusion rate data obtaining module 310 is specifically configured to: determining a current semitransparent object to be processed according to the semitransparent object graph set; calculating current normal direction data of the current semitransparent object to be processed; determining an associated semitransparent object of the current semitransparent object to be processed according to the current normal direction data; determining the shielding area of the associated semitransparent object to the current semitransparent object to be processed; and calculating the shielding rate data of the semi-transparent object graph according to the shielding area of the current semi-transparent object to be processed.
Optionally, the occlusion rate data obtaining module 310 is specifically configured to: determining current orthogonal camera parameters matched with the current semitransparent object to be processed according to the current normal direction data; and determining the related semitransparent object of the current semitransparent object to be processed according to the current orthogonal camera parameter matched with the current semitransparent object to be processed and the image depth data of the non-current semitransparent object image.
Optionally, the occlusion rate data obtaining module 310 is specifically configured to: acquiring an object depth value of the current semi-transparent object to be processed and an object depth value of the associated semi-transparent object according to the current orthogonal camera parameter; determining the global graph area of the current to-be-processed semitransparent object according to the object depth value of the current to-be-processed semitransparent object; determining the area of an occlusion graph of the current semi-transparent object to be processed according to the object depth value of the associated semi-transparent object; and determining the shielding area of the associated semitransparent object to the current semitransparent object to be processed according to the shielding graph area and the global graph area.
Optionally, the data processing module 320 is specifically configured to: determining a current occlusion rate threshold; dividing the semi-transparent object graph with the occlusion rate data less than or equal to the current occlusion rate threshold value into the single-layer semi-transparent object distribution subset; determining inter-subset ordering data for each of the single-layer semi-transparent object distribution subsets according to the determined order of the single-layer semi-transparent object distribution subsets.
Optionally, the device for rendering and sorting semi-transparent objects further includes a subset internal sorting module, configured to determine a single-layer semi-transparent object to be currently sorted; acquiring current normal direction data of the current single-layer semitransparent objects to be sorted; determining target normal direction data according to the current normal direction data of the current single-layer semitransparent object to be sorted and the normal direction data of the non-current single-layer semitransparent object to be sorted in the single-layer semitransparent object distribution subset; updating the current normal direction data according to the target normal direction data; and performing subset internal sorting on the current single-layer semitransparent objects to be sorted according to the current normal direction data.
Optionally, the subset internal sorting module is specifically configured to: acquiring a sum of the target normal direction data and the current normal direction data; and updating the current normal direction data according to the sum of the target normal direction data and the current normal direction data.
Optionally, the sorting rendering module 330 is specifically configured to: performing reverse order processing on the sorting data among the subsets of the single-layer semi-transparent object distribution subset to obtain reverse order sorting data among the subsets; and performing sequencing rendering on the semi-transparent object graphics in the semi-transparent object graphics set according to the reverse sequencing data among the subsets.
Optionally, the apparatus for rendering and sorting semi-transparent objects further includes a semi-transparent object graphics set determining module, configured to obtain vertex association data of a semi-transparent object unit in the semi-transparent object; and determining the semi-transparent object graph set according to the vertex association data of the semi-transparent object unit.
The semitransparent object rendering sorting device can execute the semitransparent object rendering sorting device method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. For details of the technology that are not described in detail in this embodiment, reference may be made to the method for a semitransparent object rendering and sorting apparatus according to any embodiment of the present invention.
Since the above-described semitransparent object rendering sorting device is a device capable of executing the method of the semitransparent object rendering sorting device in the embodiment of the present invention, based on the method of the semitransparent object rendering sorting device in the embodiment of the present invention, a person skilled in the art can understand a specific implementation manner of the semitransparent object rendering sorting device in the embodiment and various variations thereof, and therefore, how the semitransparent object rendering sorting device implements the method of the semitransparent object rendering sorting device in the embodiment of the present invention is not described in detail herein. As long as those skilled in the art implement the apparatus adopted by the method for rendering and sorting the semitransparent objects in the embodiment of the present invention, the apparatus falls within the scope of the present application.
Example four
Fig. 12 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 12 illustrates a block diagram of an electronic device 412 that is suitable for use in implementing embodiments of the present invention. The electronic device 412 shown in fig. 12 is only an example and should not bring any limitations to the function and the scope of use of the embodiments of the present invention. The electronic device 412 may be, for example, a computer device or a server device, etc.
As shown in fig. 12, the electronic device 412 is in the form of a general purpose computing device. The components of the electronic device 412 may include, but are not limited to: one or more processors 416, a storage device 428, and a bus 418 that couples the various system components including the storage device 428 and the processors 416.
Bus 418 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Electronic device 412 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
Storage 428 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 430 and/or cache Memory 432. The electronic device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 434 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 12, commonly referred to as a "hard drive"). Although not shown in FIG. 12, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 418 by one or more data media interfaces. Storage 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
Program 436 having a set (at least one) of program modules 426 may be stored, for example, in storage 428, such program modules 426 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination may comprise an implementation of a network environment. Program modules 426 generally perform the functions and/or methodologies of embodiments of the invention as described herein.
The electronic device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, camera, display 424, etc.), with one or more devices that enable a user to interact with the electronic device 412, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 412 to communicate with one or more other computing devices. Such communication may be through an Input/Output (I/O) interface 422. Also, the electronic device 412 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network, such as the internet) via the Network adapter 420. As shown, network adapter 420 communicates with the other modules of electronic device 412 over bus 418. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 412, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.
The processor 416 executes various functional applications and data processing by executing programs stored in the storage device 428, for example, implementing the method for rendering and sorting semi-transparent objects according to the above embodiment of the present invention: acquiring the shielding rate data of the semitransparent object graphs in the semitransparent object graph set; determining a single-layer semi-transparent object distribution subset of the semi-transparent object and inter-subset sequencing data of the single-layer semi-transparent object distribution subset according to the shielding rate data of the semi-transparent object graph; and performing sequencing rendering on the semi-transparent object graphics in the semi-transparent object graphics set according to the inter-subset sequencing data of the single-layer semi-transparent object distribution subset.
According to the technical scheme of the embodiment, the single-layer semi-transparent object distribution subset of the semi-transparent object and the inter-subset sequencing data of the single-layer semi-transparent object distribution subset are determined according to the shielding rate data of the semi-transparent object graphs in the semi-transparent object graph set, so that the semi-transparent object graphs in the semi-transparent object graph set are sequenced and rendered according to the inter-subset sequencing data of the single-layer semi-transparent object distribution subset. The semi-transparent object graph set can be divided based on the levels by determining the single-layer semi-transparent object distribution subsets through the shielding rate data, semi-transparent object graphs in the semi-transparent object graph set are sorted and rendered according to the inter-set sorting data, the semi-transparent object graph set for realizing the level division can be automatically sorted and rendered according to the inter-set sorting data without manual intervention, a better rendering effect can be ensured, the problems that the rendering result is poor due to the fact that the semi-transparent part is not processed in the prior art, time and labor are wasted due to the fact that the semi-transparent part is manually sorted are solved, and the rendering and sorting efficiency of the semi-transparent objects can be improved on the premise that the rendering effect of the semi-transparent objects is ensured.
EXAMPLE five
An embodiment of the present invention further provides a computer storage medium storing a computer program, where the computer program is executed by a computer processor to perform the method for rendering and sorting translucent objects according to any one of the above embodiments of the present invention: acquiring the shielding rate data of the semitransparent object graphs in the semitransparent object graph set; determining a single-layer semi-transparent object distribution subset of the semi-transparent object and inter-subset sequencing data of the single-layer semi-transparent object distribution subset according to the shielding rate data of the semi-transparent object graph; and performing sequencing rendering on the semi-transparent object graphics in the semi-transparent object graphics set according to the inter-subset sequencing data of the single-layer semi-transparent object distribution subset.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: 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 disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments illustrated herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (12)

1. A method for sorting semitransparent object renderings, comprising:
acquiring the shielding rate data of the semitransparent object graphs in the semitransparent object graph set;
determining a single-layer semi-transparent object distribution subset of semi-transparent objects and inter-subset ordering data of the single-layer semi-transparent object distribution subset according to the occlusion rate data of the semi-transparent object graph;
and performing sequencing rendering on the semi-transparent object graphics in the semi-transparent object graphics set according to the sequencing data of the inter-subset set of the single-layer semi-transparent object distribution subset.
2. The method of claim 1, wherein obtaining occlusion rate data for a semi-transparent object graphic of a set of semi-transparent object graphics comprises:
determining a current semitransparent object to be processed according to the semitransparent object graph set;
calculating current normal direction data of the current semitransparent object to be processed;
determining an associated semitransparent object of the current semitransparent object to be processed according to the current normal direction data;
determining the shielding area of the associated semitransparent object to the current semitransparent object to be processed;
and calculating the shielding rate data of the semi-transparent object graph according to the shielding area of the current semi-transparent object to be processed.
3. The method of claim 2, wherein said determining an associated translucent object of the current translucent object to be processed from the current normal direction data comprises:
determining current orthogonal camera parameters matched with the current semitransparent object to be processed according to the current normal direction data;
and determining the related semitransparent object of the current semitransparent object to be processed according to the current orthogonal camera parameter matched with the current semitransparent object to be processed and the image depth data of the non-current semitransparent object image.
4. The method of claim 3, wherein the determining an occlusion area of the current semi-transparent object to be processed by the associated semi-transparent object comprises:
acquiring an object depth value of the current semi-transparent object to be processed and an object depth value of the associated semi-transparent object according to the current orthogonal camera parameter;
determining the global graph area of the current to-be-processed semitransparent object according to the object depth value of the current to-be-processed semitransparent object;
determining the area of an occlusion graph of the current semi-transparent object to be processed according to the object depth value of the associated semi-transparent object;
and determining the shielding area of the associated semitransparent object to the current semitransparent object to be processed according to the shielding graph area and the global graph area.
5. The method of claim 1, wherein determining a single-layer semi-transparent object distribution subset of semi-transparent objects and inter-subset ordering data for the single-layer semi-transparent object distribution subset from occlusion rate data for the semi-transparent object graph comprises:
determining a current occlusion rate threshold;
dividing the semi-transparent object graph with the occlusion rate data less than or equal to the current occlusion rate threshold value into the single-layer semi-transparent object distribution subset;
determining inter-subset ordering data for each of the single-layer semi-transparent object distribution subsets according to the determined order of the single-layer semi-transparent object distribution subsets.
6. The method of claim 1, further comprising, after said determining a single-layer semi-transparent object distribution subset of semi-transparent objects from occlusion rate data of the semi-transparent object graph:
determining a current single-layer semitransparent object to be sorted;
acquiring current normal direction data of the current single-layer semitransparent objects to be sorted;
determining target normal direction data according to the current normal direction data of the current single-layer semitransparent object to be sorted and the normal direction data of the non-current single-layer semitransparent object to be sorted in the single-layer semitransparent object distribution subset;
updating the current normal direction data according to the target normal direction data;
and performing subset internal sorting on the current single-layer semitransparent objects to be sorted according to the current normal direction data.
7. The method of claim 6, wherein said updating the current normal direction data from the target normal direction data comprises:
acquiring a sum of the target normal direction data and the current normal direction data;
and updating the current normal direction data according to the sum of the target normal direction data and the current normal direction data.
8. The method of claim 1, wherein the ordered rendering of semi-transparent object graphics in the semi-transparent object graphics set according to the inter-subset ordering data of the single-layer semi-transparent object distribution subset comprises:
performing reverse order processing on the sorting data among the subsets of the single-layer semi-transparent object distribution subset to obtain reverse order sorting data among the subsets;
and performing sequencing rendering on the semi-transparent object graphics in the semi-transparent object graphics set according to the reverse sequencing data among the subsets.
9. The method according to claim 1, further comprising, prior to said obtaining occlusion rate data for a semi-transparent object graphic of the set of semi-transparent object graphics:
acquiring vertex associated data of a semi-transparent object unit in the semi-transparent object;
and determining the semi-transparent object graph set according to the vertex association data of the semi-transparent object unit.
10. A semi-transparent object rendering ordering apparatus, comprising:
the shielding rate data acquisition module is used for acquiring shielding rate data of the semitransparent object graphs in the semitransparent object graph set;
the data processing module is used for determining a single-layer semi-transparent object distribution subset of the semi-transparent objects and the inter-subset sequencing data of the single-layer semi-transparent object distribution subset according to the occlusion rate data of the semi-transparent object graph;
and the sequencing rendering module is used for sequencing and rendering the semi-transparent object graphs in the semi-transparent object graph set according to the sequencing data among the subsets of the single-layer semi-transparent object distribution subset.
11. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the translucent object rendering ordering method of any one of claims 1-9.
12. A computer storage medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements the translucent object rendering ordering method according to any one of claims 1-9.
CN202111391134.7A 2021-11-19 2021-11-19 Semitransparent object rendering sorting method, device, equipment and storage medium Pending CN114119828A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111391134.7A CN114119828A (en) 2021-11-19 2021-11-19 Semitransparent object rendering sorting method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111391134.7A CN114119828A (en) 2021-11-19 2021-11-19 Semitransparent object rendering sorting method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114119828A true CN114119828A (en) 2022-03-01

Family

ID=80439604

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111391134.7A Pending CN114119828A (en) 2021-11-19 2021-11-19 Semitransparent object rendering sorting method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114119828A (en)

Similar Documents

Publication Publication Date Title
JP7421585B2 (en) Method for determining differential data for rays of a ray bundle and graphics processing unit
US8665267B2 (en) System and method for generating 3D surface patches from unconstrained 3D curves
US7164420B2 (en) Ray tracing hierarchy
CN112669463B (en) Method for reconstructing curved surface of three-dimensional point cloud, computer device and computer-readable storage medium
US8988433B2 (en) Systems and methods for primitive intersection in ray tracing
CN107464286B (en) Method, device, equipment and readable medium for repairing holes in three-dimensional city model
EP3933779A1 (en) Intersection testing in a ray tracing system
CN111145356B (en) Cutting method based on Unity3D model
CN106251391A (en) Divided method
CN110368694A (en) Data processing method, device, equipment and the readable storage medium storing program for executing of scene of game
CN111583381B (en) Game resource map rendering method and device and electronic equipment
CN109410213A (en) Polygon pel method of cutting out, computer readable storage medium, electronic equipment based on bounding box
TWI769138B (en) Graphics processing method, pipeline circuit and computer program
EP3664037A1 (en) Tiling a primitive in a graphics processing system
KR20130049753A (en) Designing a modeled volume represented by dexels
CN117058384B (en) Method and system for semantic segmentation of three-dimensional point cloud
CN114119828A (en) Semitransparent object rendering sorting method, device, equipment and storage medium
KR101919085B1 (en) Apparatus and method for simplification of 3D mesh data
CN114418829A (en) Static scene occlusion processing method and device, electronic equipment and readable medium
CN110837707B (en) Finite element analysis system, method, computer equipment and storage medium
CN112379692A (en) Method, device and equipment for determining unmanned aerial vehicle air route and storage medium
CN113822961B (en) Method, device, equipment and medium for 2D rendering of 3D model
US10984581B2 (en) UV transfer
CN116778065B (en) Image processing method, device, computer and storage medium
TWI719379B (en) Method and computer program product for ray tracing

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