Shielding elimination method and device, terminal and storage medium

By calculating layer coverage in the CPU to determine and avoid drawing occluded layers, the problem of low occlusion culling efficiency in the extended reality device compositor is solved, improving layer drawing efficiency and reducing power consumption.

CN118780994APending Publication Date: 2024-10-15BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410745463.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing occlusion culling techniques cannot be effectively applied to compositors of extended reality devices, resulting in inefficient layer drawing and increased power consumption.

Method used

In the compositor of extended reality devices, occluded target maps are not drawn in the compositor by calculating the coverage of the layers in the CPU and determining whether layers other than the layer closest to the human eye position are occluded. Layers to reduce unnecessary layer drawing.

Benefits of technology

It improves the layer drawing efficiency of extended reality devices, reduces power consumption, reduces repeatedly drawn layers, and improves display performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118780994A_ABST
    Figure CN118780994A_ABST
Patent Text Reader

Abstract

The invention provides a shielding elimination method and device, a terminal and a storage medium. The shielding elimination method is applied to a synthesizer of an augmented reality device and comprises the steps that the coverage range of layers in the augmented reality device is determined, and the augmented reality device is provided with at least two to-be-drawn layers; responding to the situation that a target layer is located in the coverage range of any previous layer, and not drawing the target layer in the synthesizer; wherein the target image layer is the image layer, except the image layer closest to the human eye position, in the at least two image layers, and the previous image layer is the image layer closer to the human eye position than the target image layer. The embodiment of the invention is suitable for the synthesizer of the augmented reality equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of extended reality technology, and in particular to an occlusion culling method, device, terminal and storage medium. Background Art

[0002] In graphics, occlusion culling is often used to reduce the amount of drawing and increase the drawing speed. That is, one layer may occlude another layer, and the occluded part of the other layer does not need to be drawn. In some technologies, occlusion culling is performed in the engine, but the occlusion culling performed in the engine cannot be applied to the compositor (XRcomposositor) of the extended reality device. Summary of the invention

[0003] The present disclosure provides an occlusion culling method, device, terminal and storage medium.

[0004] The present disclosure adopts the following technical solutions.

[0005] In some embodiments, the present disclosure provides an occlusion culling method, which is applied to a synthesizer of an extended reality device, comprising:

[0006] Determining a coverage range of a layer in the extended reality device, wherein the extended reality device has at least two layers to be drawn;

[0007] In response to the target layer being within the coverage of any preceding layer, not drawing the target layer in the compositor;

[0008] The target layer is a layer other than the layer closest to the human eye position among the at least two layers, and the previous layer is a layer closer to the human eye position than the target layer.

[0009] In some embodiments, the present disclosure provides an occlusion culling device, which is applied to a synthesizer of an extended reality device, including:

[0010] A calculation unit, used to determine the coverage of the layer in the extended reality device, wherein the extended reality device has at least two layers to be drawn;

[0011] A control unit, configured to not draw the target layer in the synthesizer in response to the target layer being located within the coverage of any preceding layer;

[0012] The target layer is a layer other than the layer closest to the human eye position among the at least two layers, and the previous layer is a layer closer to the human eye position than the target layer.

[0013] In some embodiments, the present disclosure provides a terminal, comprising: at least one memory and at least one processor;

[0014] The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to execute the above method.

[0015] In some embodiments, the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and when the program code is executed by a computer, the computer is prompted to perform any of the above methods.

[0016] The occlusion culling method provided by the embodiment of the present disclosure is applied to the synthesizer of the extended reality device, including: determining the coverage of the layers in the extended reality device, wherein the extended reality device has at least two layers to be drawn; in response to the target layer being within the coverage of any preceding layer, not drawing the target layer in the synthesizer; wherein the target layer is a layer other than the layer closest to the human eye position among the at least two layers, and the preceding layer is a layer closer to the human eye position than the target layer. The embodiment of the present disclosure is applicable to the synthesizer of the extended reality device. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0018] Figure 1 It is a flow chart of an occlusion culling method according to an embodiment of the present disclosure.

[0019] Figure 2 is a schematic diagram of a light beam according to an embodiment of the present disclosure.

[0020] Figure 3 Schematic diagram of screens and layers of an embodiment of the present disclosure.

[0021] Figure 4 Schematic diagram of a cylinder and curved side surfaces of an embodiment of the present disclosure.

[0022] Figure 5 is a top view of the curved side surface of an embodiment of the present disclosure.

[0023] Figure 6 Schematic diagram of the maximum inscribed rectangle of the embodiment of the present disclosure.

[0024] Figure 7 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0026] It should be understood that the various steps described in the method embodiments of the present disclosure can be performed in sequence and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0027] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0028] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0029] It should be noted that the modification of “one” mentioned in the present disclosure is illustrative rather than restrictive, and those skilled in the art should understand that it should be understood as “one or more” unless otherwise clearly indicated in the context.

[0030] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0031] The solution provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0032] In graphics, occlusion culling is often used to reduce the drawing of occluded layers, thereby reducing the drawing of layers and improving response speed. In related technologies, culling is performed in the engine according to the vertex position of the model. However, in the compositor of the extended reality device, all layers use the same vertices regardless of distance, because the vertices in the compositor do not represent physical positions, but distortions. The vertex positions in the compositor can only be obtained after the vertex shader is executed and the reprojection calculation is performed in the fragment shader, which is too late. In other related technologies, pixel-level occlusion relationship judgment is performed in the fragment shader to prevent screen abnormalities, but this judgment will cause performance degradation and will not reduce repeated drawing. The GPU hardware cannot optimize the occlusion culling in the fragment shader, which increases the amount of calculation. GPU hardware has culling schemes such as EARLY-Z and LRZ, but they are not applicable to the compositor of the extended reality device. In some embodiments proposed in the present disclosure, a calculation is performed once in the CPU and no calculation is performed in the GPU, and the increased amount of calculation is very small.

[0033] There are mainly two types of occlusion culling in related technologies. One is occlusion culling similar to Unity, which occurs before the drawing task starts. Each object has its own bounding box generated by the engine, which is a cuboid. No matter how many vertices the object has or how complex it is, it is within this bounding box. If a cuboid is completely behind another cuboid, the rendering and drawing task of the object in this cuboid will be completely discarded. This cannot be applied in the solution of the present disclosure because the layers are 2D and overlap with each other, and this occlusion culling directly discards the rendering task, and there is no engine to generate this cuboid in the present disclosure. The other is GPU hardware culling in the drawing task, that is, when rendering starts, occlusion culling occurs in the vertex shader, after primitives are generated according to the vertices, that is, a triangle primitive is generated for every three vertices. If a primitive is completely blocked by another, then this primitive will be culled. However, in the XR compositor (the compositor of the extended reality device), the vertex does not represent the actual position, but the direction of the light. The vertex is full-screen and represents the distortion value of each position on the screen. This is related to the XR lens, that is, for an XR device, no matter how far or how big or small its drawing layer is, its vertices are fixed and only related to the lens of the device. The XR compositor reprojects according to the light in the fragment shader and calculates the color of the point sample. Normally, a layer in the middle of the screen is drawn to generate the surrounding vertices of this layer. The vertices of the XR compositor are always fixed, but when the fragment is reprojected, the blank area outside the layer cannot be reprojected and is discarded. The solution in some embodiments of the present disclosure is to calculate the direction of the light projected to the upper left and lower right vertices of this layer before rendering, and then associate it with the distortion value of the vertex, and actively delete the vertices that do not meet the requirements in the vertex shader.

[0034] like Figure 1 As shown, Figure 1 This is a flowchart of an occlusion culling method according to an embodiment of the present disclosure, which is applied to a synthesizer of an extended reality device, specifically before rendering, and includes the following steps.

[0035] S11. Determine the coverage of the layer in the extended reality device.

[0036] In some embodiments, the extended reality device has at least two layers to be drawn.

[0037] S12, in response to the target layer being located within the coverage of any preceding layer, not drawing the target layer in the compositor;

[0038] In some embodiments, the target layer is a layer other than the layer closest to the human eye position among at least two layers, and the previous layer is a layer closer to the human eye position than the target layer. The human eye position is the position of the human eye of the user using the extended reality device in the extended reality world. In an extended reality device (such as a virtual reality device, an augmented reality device, and a mixed reality device), different layers are drawn on the screen by a synthesizer according to the distance from the user's human eye position, and the layers are used to display images. The layer close to the human eye will block the layer far from the human eye. If the blocked invisible image is still drawn, it will cause repeated drawing to increase power consumption. In some embodiments, there are at least two layers with different positions, and the coverage range of each layer is calculated by the CPU in the synthesizer (the layer farthest from the human eye position will not block other layers, so the coverage range of the layer can be ignored), and the target layer can be any layer other than the layer closest to the human eye position. If the coverage area of ​​any previous layer between the target layer and the human eye position covers the target layer, there is no need to draw the target layer to reduce power consumption.

[0039] In some embodiments of the present disclosure, in order to address the problem that existing occlusion culling is not suitable for the synthesizer of an extended reality device, a method for occlusion culling suitable for the synthesizer of an extended reality device is proposed. The method is executed before rendering, thereby reducing the drawing of occluded layers, improving display efficiency, and reducing power consumption.

[0040] In some embodiments of the present disclosure, determining the coverage of a layer in an extended reality device includes: determining, in the local coordinate system of the layer, the pitch angle range and the horizontal angle range of the layer relative to the position of a human eye; if the pitch angle range and the horizontal angle range of the target layer are within the pitch angle range and the horizontal angle range of any previous layer, then the target layer is within the coverage of the previous layer of the target layer.

[0041] In some embodiments, when calculating the coverage range of any layer, it is necessary to calculate in the local coordinate system of the calculated layer. In the extended reality space displayed by the extended reality device, if the pitch angle range and the horizontal angle range are determined by the screen coordinate system or the world coordinate system, because the shape of the layer will produce a certain deformation as the position of the user's eyes changes, therefore, the calculation of the pitch angle range and the horizontal angle range is actually inaccurate, so in this embodiment, it is necessary to determine it in the local coordinate system of the layer (also commonly referred to as the Local coordinate system). The local coordinate systems of different layers are different. When calculating the pitch angle range and the horizontal angle range of a layer, the local coordinate system of the layer is used, and the local coordinate systems of other layers are not used. For any layer, in the local coordinate system of the layer, the maximum angle range that the human eye needs to rotate in the vertical and horizontal directions to observe the layer at the human eye position is simulated, that is, the pitch angle range and the horizontal angle range of the layer. It should be noted that the vertical direction and the horizontal direction in this embodiment are based on the local coordinate system of the layer in the extended real world, which may be different from the vertical direction and the horizontal direction in the real world. The vertical direction and the horizontal direction in this embodiment are usually parallel to two different coordinate axes of the local coordinate system, for example, the vertical direction is usually parallel to the y-axis in the local coordinate system, and the horizontal direction is parallel to the x-axis. Therefore, the pitch angle range usually depends on the projection angle of the angle formed by the line connecting the highest point and the lowest point of the layer in the vertical direction and the position of the human eye in the vertical direction, and the horizontal angle range usually depends on the projection angle of the angle formed by the line connecting the leftmost point and the rightmost point of the layer in the horizontal direction and the position of the human eye in the horizontal direction. In this embodiment, the coverage of the layer is determined by the pitch angle range and the horizontal angle range, rather than calculating the range covered by the overall boundary of the layer, which is conducive to reducing the amount of calculation and improving the calculation speed.

[0042] In some embodiments of the present disclosure, in the local coordinate system of the layer, the pitch angle range and the horizontal angle range of the layer relative to the human eye position are determined, including: obtaining the coordinates of at least two vertices of the boundary of the layer and the coordinates of the human eye position in the local coordinate system of the layer; and determining the pitch angle range and the horizontal angle range of the layer according to the coordinates of at least two vertices of the layer and the coordinates of the human eye position in the local coordinate system of the layer.

[0043] In some embodiments, at least two vertices are points where the layer has maximum or minimum values ​​in the vertical direction or horizontal direction, because the pitch angle range and horizontal angle range of the layer are only related to the relative position relationship between some key vertices and the human eye position, and have nothing to do with non-vertices on the boundary, therefore, the coordinates of the vertices on the boundary of the layer and the coordinates of the human eye position are obtained to determine the pitch angle range and horizontal angle range of the layer. Avoid calculating all points in the layer. In order to calculate the pitch angle range and the horizontal angle range, at least two vertices are required.

[0044] In some embodiments of the present disclosure, the pitch angle range and the horizontal angle range of the layer are determined based on the coordinates of at least two vertices of the layer and the coordinates of the human eye position in the local coordinate system of the layer, including: calculating the pitch angle tangent value and the horizontal angle tangent value corresponding to the lines from the human eye position to each vertex; obtaining the tangent value range of the pitch angle range and the tangent value range of the horizontal angle range according to the pitch angle tangent value and the horizontal angle tangent value corresponding to each line; wherein the pitch angle range and the horizontal angle range are represented by the tangent value range of the pitch angle range and the tangent value range of the horizontal angle range.

[0045] In some embodiments, the line from the human eye to the vertex describes the boundary of the layer, and the line is represented by coordinates (X, Y, Z) in the local coordinate system of the layer, where the y-axis is assumed to be the numerical direction, the x-axis is the horizontal direction, the z-axis is perpendicular to the direction of the layer, and the layer is parallel to the plane where the x-axis and the y-axis are located. Then, the pitch tangent value of the line is Y / Z, and the horizontal tangent value of the line is X / Z, that is, the pitch tangent value of the line is the ratio of the length of the line in the vertical direction to the length in the direction perpendicular to the layer, and the horizontal tangent value of the line is the ratio of the length of the line in the horizontal direction to the length in the direction perpendicular to the layer. The pitch tangent value of each line defines the maximum and minimum values ​​of the tangent value of the pitch angle range, and the range between the two is the tangent value range of the pitch angle range. The horizontal tangent value of each line defines the maximum and minimum values ​​of the tangent value of the horizontal angle range, and the range between the two is the tangent value range of the horizontal angle range.

[0046] In some embodiments of the present disclosure, the tangent value of the pitch angle and the tangent value of the horizontal angle corresponding to the line from the human eye position to any vertex are calculated in the following manner: a first direction vector in the screen coordinate system is obtained, the first direction vector is the direction vector of the light, the light is a mapping point from the human eye position to the screen, the mapping point is a point on the screen mapped from a target point, the target point is any vertex of at least two vertices in the layer, and the human eye position is located at the origin of the screen coordinate system: the first direction vector is subjected to an anti-distortion process to obtain a second direction vector; the second direction vector is converted into a local coordinate system of the layer by an inverse transformation to obtain a third direction vector; in the local coordinate system of the layer, the sum of the coordinates of the human eye position in the local coordinate system of the layer plus the product of the third direction vector and the length of the line is used as a light expression representing the light; according to the equation relationship between the light expression and the coordinate value of the target point in the local coordinate system, the tangent value of the pitch angle and the tangent value of the horizontal angle corresponding to the line from the human eye position to the target point are calculated.

[0047] In some embodiments, the target point may be any vertex, which represents the vertex of the tangent value of the pitch angle and the tangent value of the horizontal angle of the line previously calculated with the human eye position, such as Figure 3 As shown, the screen is the curtain of the extended real world. The contents of each layer displayed in the extended real world are stacked on the screen. The points on the layer have corresponding rays in the extended real world. The rays are the positions of the mapping points from the human eye position to the screen. The target point is the coordinate of the point where the ray is projected to the overlay (layer). Please refer to Figure 2 , the light is the light starting from the human eye position, such as Figure 2As shown, endpoint O represents the coordinates of the human eye position, D represents the unit direction vector, and the parameterized equation of the light is expressed as R(t)=O+t*D, t is a scalar representing the length of the light, ranging from zero to infinity, and R is the light in the synthesizer rendering process. The position of the screen in the screen coordinate system is known. Assuming that z=-1 is a plane perpendicular to the z axis, the coordinate value of the mapping point on the screen in the screen coordinate system can be expressed as (x, y, -1). This value is directly provided by the extended reality device and can be obtained directly. The human eye position is the origin, and the first direction vector from the human eye position to the mapping point on the screen is also (x, y, -1). However, the point on the screen is actually not real, but is actually obtained through distortion calculation because the lens has distortion (such as pincushion distortion). Therefore, it is necessary to perform anti-distortion calculation on the x and y coordinate values ​​in (x, y, -1) to obtain tu and tv. In fact, the coordinates of any point on the screen in the screen coordinate system need to be anti-distorted, and all the points after anti-distortion calculation constitute the screen (the screen is a plane). After the anti-distortion calculation, the second direction vector of the light is represented by (tu, tv, -1), which is the representation in the screen coordinate system. To convert it to the local coordinate system of the layer, it is necessary to perform the inverse transformation of the model*view matrix, that is, the third direction vector of the light in the local coordinate system of the layer is represented by D(ax, ay, az) = invert(modelView)*(tu, tv, -1), where D(ax, ay, az) is the vector representation of the third direction vector in the local coordinate system, and invert represents the inverse transformation. At this time, the position of the human eye in the local coordinate system of the layer is O(x0, y0, z0), then the line in the local coordinate system is represented by R(t) = O(x0, y0, z0) + t*D(ax, ay, az), and the coordinate value of the target point in the local coordinate system is calculated, that is, the coordinates of the point projected from the line in O(x0, y0, z0) with a direction of (ax, ay, az) to the plane where the layer is located. If each vertex is calculated for projection judgment, then if there are n layers, each with 50×50 vertices, then it will be calculated n! * 50 * 50 times. In order to save drawing, the pitch angle range and horizontal angle range corresponding to the line connecting the lower left vertex and the upper right vertex (i.e. the first vertex and the second vertex) of the rectangular figure and the human eye position are calculated first. If the pitch angle range and horizontal angle range corresponding to the vertices of other layers are within the range of this layer, it means that this layer will cover the vertices of other layers, and other layers can discard the vertex area of ​​this layer and not draw it.The position of the points in the layer in the local coordinate system of the layer is known, and the position pointed to by the light expression is also the position of the target point in the local coordinate system. The two have an equation relationship. For example, taking the target point as the first vertex (x1, y1, z1), R(t) = O(x0, y0, z0) + t*D(ax, ay, az) = (x1, y1, z1), t takes different values ​​for different vertices according to the specific situation, but t will be eliminated in the process of calculating the tangent value, so it has no effect. For any vertex, because the line connecting the human eye position and the vertex is in the same direction as D, calculating the tangent value of the horizontal angle and the tangent value of the pitch angle of the vertex line is actually calculating ax / az and ay / az.

[0048] In some embodiments of the present disclosure, if the shape of the layer is a rectangle, the coordinates of at least two vertices of the layer include: coordinates of a first vertex and a second vertex; the first vertex and the second vertex are two endpoints on the diagonal line of the rectangle in the local coordinate system; the tangent value range corresponding to the horizontal angle range of the layer is (x1-x0) / (z1-z0) to (x2-x0) / (z2-z0); the tangent value range corresponding to the pitch angle range of the layer is (y1-y0) / (z1-z0) to (y2-y0) / (z2-z0); wherein, in the local coordinate system of the layer, the coordinates of the human eye position are (x0, y0, z0), the coordinates of the first vertex are (x1, y1, z1), and the coordinates of the second vertex of the rectangle are (x2, y2, z2).

[0049] In some embodiments, Figure 3 As shown, Figure 3 The overlay in the diagram is any layer shown schematically. The layer is a rectangle. The layer and the screen can be parallel. The two endpoints on the diagonal line of the rectangle ( Figure 3The coordinates of the lower left point and the upper right point (in the middle, or the lower right point and the upper left point) include the length and width of the rectangle, so only these two endpoints are needed to determine the pitch angle range and horizontal angle range relative to the human eye position, thereby reducing the amount of calculation while ensuring the accuracy of the calculation. For the first vertex, according to R(t)=O(x0,y0,z0)+t*D(ax,ay,az)=(x1,y1,z1), split it to each axis, assuming that t is f. In fact, the value of t does not affect the result. We get x0+ax*f=x1, y0+ay*f=y1, z0+az*f=z1, and the three combined give ax / az=(x1-x0) / (z1-z0), ay / az=(y1-y0) / (z1-z0). Similarly for the second vertex, we get ax / az=(x2-x0) / (z2-z0), ay / az=(y2-y0) / (z2-z0). These four values ​​are the maximum and minimum values ​​of the tangent value range corresponding to the horizontal angle range, as well as the maximum and minimum values ​​of the tangent value range corresponding to the pitch angle range. The tangent value range is obtained through these maximum and minimum values.

[0050] In some embodiments of the present disclosure, the shape of the layer is an arc-shaped side surface of a cylinder, the arc angle of the center of the circle corresponding to the arc-shaped side surface is not greater than 180 degrees and the position of the human eye is located on the side toward which the notch of the arc-shaped side surface is facing; the at least two vertices include: a third vertex and a fourth vertex of the arc-shaped side surface on the end surface of the cylinder, and a fifth vertex and a sixth vertex of the arc-shaped side surface at both ends of the diagonal line of the maximum inscribed rectangle parallel to the height of the cylinder.

[0051] In some embodiments, Figure 4 (A) Schematic showing a cylinder, Figure 4 (B) schematically shows the curved side of a cylinder. The curved side is a part of the side surface of the cylinder, which has two curved sides, upper and lower, and two height sides parallel to the height direction. The arc of the circle corresponding to the curved side is the arc of the center of the circle corresponding to the curved side. Therefore, the curved side is at most half of the side of the cylinder. In this case, the curved side is a semicircle. The human eye is located on the side facing the concave side of the curved side, as shown in FIG. Figure 5 As shown in the figure, it shows a schematic diagram of looking at the arc side from the negative direction of the y axis (assuming that the arc of the center of the circle corresponding to the arc side is 180 degrees). The third vertex and the fourth vertex should be the two points where any arc side of the arc side intersects with the height. When the arc of the center of the circle corresponding to the arc side is 180 degrees, these two points are Figure 4 The two points where the middle arc plate intersects the x-axis define the horizontal angle range required to look at the arc side from the human eye position. Figure 6 The maximum inscribed rectangle of the curved side is shown schematically. Figure 6The vertical direction is the y-axis direction. Because of the height relationship between the curved side and the human eye, what the human eye actually sees when looking at the curved side is not a rectangle. In this case, the maximum inscribed rectangle can be used to simplify the calculation. The maximum inscribed rectangle is used to represent the pitch angle range in the vertical direction. This is the same as the method for calculating the pitch angle range when the layer is a rectangle.

[0052] In some embodiments of the present disclosure, the origin of the local coordinate system of the layer is located at the center of the cylinder, and in the local coordinate system of the layer, the x-axis and the y-axis are parallel to the end face of the cylinder, and the z-axis is parallel to the height of the cylinder; according to the coordinates of at least two vertices of the layer and the coordinates of the human eye position in the local coordinate system of the layer, the pitch angle range and the horizontal angle range of the layer are determined, including: the tangent value range corresponding to the horizontal angle range of the layer is (x3-x0) / (z3-z0) to (x4-x0) / (z4-z0); the tangent value range corresponding to the pitch angle range of the layer is (y5-y0) / (z5-z0) to (y6-y0) / (z6-z0); wherein, in the local coordinate system of the layer, the coordinates of the human eye position are (x0, y0, z0), and the coordinates of the third vertex are (x3, y3 ,z3), the coordinates of the fourth vertex of the rectangle are (x4,y4,z4), the coordinates of the fifth vertex are (x5,y5,z5), and the coordinates of the sixth vertex of the rectangle are (x6,y6,z6), x3=r×ratio1 / sqrt(1+ratio1×ratio1), z3=-x3 / ratio1, x4=r×ratio2 / sqrt(1+ratio2×ratio2), z4=-x4 / ratio2, sprt represents square root calculation, r is the radius of the end face, ratio1 is the tangent value of the angle between the line connecting the third vertex and the center of the end face and the x-axis in the local coordinate system of the layer; ratio2 is the tangent value of the angle between the line connecting the fourth vertex and the center of the end face and the x-axis in the local coordinate system of the layer.

[0053] In some embodiments, Figure 4 As shown, it shows the local coordinate system of the layer. The origin is set at the geometric center of the cylinder, that is, half of the height and on the line connecting the centers of the two end faces. The radius of the cylinder is r, and the y-axis is the height. For any point on the arc edge (px, py, pz), as Figure 5As shown. The tangent value of the angle between the line connecting the point and the center of the circle and the x-axis is expressed as ratio = tanα = px / pz, where α is the angle between the line connecting the point and the center of the circle and the x-axis. Since the point is on the edge of the circle, it satisfies px*px+pz*pz=r*r, so we can solve for px=r*ratio / sqrt(1+ratio*ratio), pz=-px / ratio. If the point is the third vertex (x3, y3, z3), the ratio of the components of the line (light) from the human eye position to the third vertex on the x-axis and z-axis (i.e., the tangent Value) is (x3-x0) / (z3-z0), which is the maximum value of the tangent value corresponding to the horizontal angle range. Similarly, if the point is the fourth vertex (x4,y4,z4), then the ratio of the components of the line (light) from the human eye position to the fourth vertex on the x-axis and z-axis (that is, the tangent value) is (x4-x0) / (z4-z0), which is the minimum value of the tangent value corresponding to the horizontal angle range. The coordinates of the third and fourth vertices in the local coordinate system can be obtained from the application where the layer is located. Combined with the human eye position, the tangent value range corresponding to the horizontal angle range can be obtained.

[0054] For the calculation of the pitch angle range, it is necessary to calculate Figure 4 In the y-axis direction, if you want to calculate the exact range in the y-axis, you must calculate the exact projection, because y is not a line, but an arc, and the range cannot be determined by two points. At this time, each vertex needs to solve the projection point. However, it can be simplified to find the range of a maximum inscribed rectangle, which can greatly reduce the calculation. The specific calculation method is the same as the calculation method when the layer is a rectangle. Select two points on the diagonal. For the fourth vertex, according to R(t)=O(x0,y0,z0)+f*D(ax,ay,az)=(x5,y5,z5), solve (y5-y0) / (z5-z0). For the sixth vertex, according to R(t)=O(x0,y0,z0)+f*D(ax,ay,az)=(x6,y6,z6), the tangent value range corresponding to the pitch angle range of this layer is (y5-y0) / (z5-z0) to (y6-y0) / (z6-z0). Assume that the height of the cylinder is 2 and the radius is r, then Figure 6 The upper left corner point of the maximum inscribed rectangle is (0,1,-r). The light formula in the plane is R(t)=O(x0,y0,z0)+f*D(ax,ay,az)=(0,1,-r), which is split into z and y axes through z0+f*az=-r and y0+f*ay=1.0, Y / Zmax=ay / az=(1.0-y) / (-rz). Similarly, the point of the lower right corner of the maximum inscribed rectangle is calculated, and Y / Zmin=ay / az=(-1.0-y) / (-rz).

[0055] In the order from far to near the position of the human eye, the numbers of the respective layers start from 1 and increase sequentially. After calculating in the above manner the ranges of X / Z (the tangent value of the horizontal angle range) and Y / Z (the tangent value of the pitch angle range) of the covered areas in the layers from 1 to n, then when drawing the k-th layer, if the ratios of X / Z and Y / Z of the vertex are within the ranges of X / Z and Y / Z of the covered area of the m-th layer (k < m <= n), then the layer where this vertex is located can be discarded. The present disclosure can reduce the repeated drawing of the earth city with an arc side shape by 85%, and completely eliminate the repeated drawing of the rectangular layers.

[0056] The present disclosure also proposes an occlusion culling device, applied to the synthesizer of an extended reality device, including:

[0057] A calculation unit, configured to determine the covered range of the layers in the extended reality device, where there are at least two layers to be drawn in the extended reality device;

[0058] A control unit, configured to, in response to the target layer being within the covered range of any of the previous layers, not draw the target layer in the synthesizer;

[0059] wherein the target layer is a layer other than the layer closest to the human eye position among the at least two layers, and the previous layer is a layer closer to the human eye position than the target layer.

[0060] In some embodiments, determining the covered range of the layers in the extended reality device includes: in the local coordinate system of the layer, determining the pitch angle range and the horizontal angle range of the layer relative to the human eye position;

[0061] If the pitch angle range and the horizontal angle range of the target layer are respectively within the pitch angle range and the horizontal angle range of any of the previous layers, then the target layer is within the covered range of the previous layer of the target layer.

[0062] In some embodiments, in the local coordinate system of the layer, determining the pitch angle range and the horizontal angle range of the layer relative to the human eye position includes:

[0063] Obtaining the coordinates of at least two vertices of the boundary of the layer and the coordinates of the human eye position in the local coordinate system of the layer;

[0064] Determining the pitch angle range and the horizontal angle range of the layer according to the coordinates of at least two vertices of the layer and the coordinates of the human eye position in the local coordinate system of the layer.

[0065] In some embodiments, determining the pitch angle range and the horizontal angle range of the layer according to the coordinates of at least two vertices of the layer and the coordinates of the human eye position in the local coordinate system of the layer includes:

[0066] Calculate the pitch angle tangent value and horizontal angle tangent value corresponding to the line connecting the human eye position to each vertex;

[0067] The tangent value range of the pitch angle range and the tangent value range of the horizontal angle range are obtained according to the pitch angle tangent value and the horizontal angle tangent value corresponding to each connecting line;

[0068] The pitch angle range and the horizontal angle range are represented by a tangent value range of the pitch angle range and a tangent value range of the horizontal angle range.

[0069] In some embodiments, the tangent value of the pitch angle and the tangent value of the horizontal angle corresponding to the line from the human eye position to any vertex are calculated in the following manner:

[0070] Get the first direction vector in the screen coordinate system, where the first direction vector is the direction vector of the light, where the light is the mapping point from the human eye position to the screen, where the mapping point is the point on the screen mapped from the target point, where the target point is any vertex of at least two vertices in the layer, and where the human eye position is located at the origin of the screen coordinate system:

[0071] Performing an anti-distortion process on the first direction vector to obtain a second direction vector;

[0072] The second direction vector is converted into the local coordinate system of the layer through inverse transformation to obtain a third direction vector;

[0073] In the local coordinate system of the layer, the sum of the coordinates of the human eye position in the local coordinate system of the layer plus the product of the third direction vector and the length of the connecting line is used as a ray expression representing the ray;

[0074] According to the equation relationship between the light expression and the coordinate value of the target point in the local coordinate system, the tangent value of the pitch angle and the tangent value of the horizontal angle corresponding to the line from the human eye position to the target point are calculated.

[0075] In some embodiments, if the shape of the layer is a rectangle, the coordinates of the at least two vertices of the layer include: coordinates of a first vertex and a second vertex; the first vertex and the second vertex are two endpoints on a diagonal line of the rectangle in the local coordinate system;

[0076] The tangent value range of the horizontal angle range of this layer is (x1-x0) / (z1-z0) to (x2-x0) / (z2-z0);

[0077] The tangent value range of the layer's pitch angle range is (y1-y0) / (z1-z0) to (y2-y0) / (z2-z0);

[0078] Among them, in the local coordinate system of this layer, the coordinates of the human eye position are (x0, y0, z0), the coordinates of the first vertex are (x1, y1, z1), and the coordinates of the second vertex of the rectangle are (x2, y2, z2).

[0079] In some embodiments, the shape of the layer is an arc-shaped side of a cylinder, the arc of the center of the circle corresponding to the arc-shaped side is not greater than 180 degrees, and the human eye position is located on the side toward which the notch of the arc-shaped side faces;

[0080] The at least two vertices include: a third vertex and a fourth vertex of the arc-shaped side surface on the end surface of the cylinder, and a fifth vertex and a sixth vertex of the arc-shaped side surface at both ends of the diagonal line of the largest inscribed rectangle parallel to the height of the cylinder.

[0081] In some embodiments, the origin of the local coordinate system of the layer is located at the center of the cylinder, in which the x-axis and the y-axis are parallel to the end surface of the cylinder, and the z-axis is parallel to the height of the cylinder;

[0082] Determining the pitch angle range and the horizontal angle range of the layer according to the coordinates of at least two vertices of the layer and the coordinates of the human eye position in the local coordinate system of the layer includes:

[0083] The tangent value range of the horizontal angle range of this layer is (x3-x0) / (z3-z0) to (x4-x0) / (z4-z0);

[0084] The tangent value range of the layer's pitch angle range is (y5-y0) / (z5-z0) to (y6-y0) / (z6-z0);

[0085] Among them, in the local coordinate system of the layer, the coordinates of the human eye position are (x0, y0, z0), the coordinates of the third vertex are (x3, y3, z3), the coordinates of the fourth vertex as a rectangle are (x4, y4, z4), the coordinates of the fifth vertex are (x5, y5, z5), and the coordinates of the sixth vertex as a rectangle are (x6, y6, z6), x3=r×ratio1 / sqrt(1+ratio1×ratio1), z3=-x3 / ratio1, x4=r×ratio2 / sqrt(1+ratio2×ratio2), z4=-x4 / ratio2, r is the radius of the end face, ratio1 is the tangent value of the angle between the line connecting the third vertex and the center of the end face and the x-axis in the local coordinate system of the layer; ratio2 is the tangent value of the angle between the line connecting the fourth vertex and the center of the end face and the x-axis in the local coordinate system of the layer.

[0086] For the embodiments of the device, since they basically correspond to the method embodiments, the relevant parts refer to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the modules described as separation modules may or may not be separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present embodiment. Those of ordinary skill in the art can understand and implement without paying creative work.

[0087] The method and device of the present disclosure are described above based on the embodiments and application examples. In addition, the present disclosure also provides a terminal and a storage medium, which are described below.

[0088] Reference below Figure 7 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 800 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in the figure is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present disclosure.

[0089] like Figure 7 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0090] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although the electronic device 800 with various devices is shown in the figure, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.

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

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

[0093] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperTextTransferProtocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an adhoc peer-to-peer network), as well as any currently known or future developed network.

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

[0095] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method of the present disclosure.

[0096] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0097] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0098] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0099] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0100] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0101] According to one or more embodiments of the present disclosure, an occlusion culling method is provided, which is applied to a synthesizer of an extended reality device, including:

[0102] Determining a coverage range of a layer in the extended reality device, wherein the extended reality device has at least two layers to be drawn;

[0103] In response to the target layer being within the coverage of any preceding layer, not drawing the target layer in the compositor;

[0104] The target layer is a layer other than the layer closest to the human eye position among the at least two layers, and the previous layer is a layer closer to the human eye position than the target layer.

[0105] According to one or more embodiments of the present disclosure, an occlusion culling method is provided to determine the coverage of a layer in the extended reality device, including: determining, in a local coordinate system of the layer, a pitch angle range and a horizontal angle range of the layer relative to a human eye position;

[0106] If the pitch angle range and the horizontal angle range of the target layer are respectively within the pitch angle range and the horizontal angle range of any of the preceding layers, then the target layer is within the coverage range of the preceding layer of the target layer.

[0107] According to one or more embodiments of the present disclosure, an occlusion culling method is provided, which determines the pitch angle range and horizontal angle range of the layer relative to the position of a human eye in the local coordinate system of the layer, including:

[0108] Obtaining the coordinates of at least two vertices of the boundary of the layer and the coordinates of the human eye position in the local coordinate system of the layer;

[0109] The pitch angle range and the horizontal angle range of the layer are determined according to the coordinates of at least two vertices of the layer and the coordinates of the human eye position in the local coordinate system of the layer.

[0110] According to one or more embodiments of the present disclosure, an occlusion culling method is provided, which determines the pitch angle range and the horizontal angle range of the layer according to the coordinates of at least two vertices of the layer and the coordinates of the human eye position in the local coordinate system of the layer, including:

[0111] Calculate the pitch angle tangent value and horizontal angle tangent value corresponding to the line connecting the human eye position to each vertex;

[0112] The tangent value range of the pitch angle range and the tangent value range of the horizontal angle range are obtained according to the pitch angle tangent value and the horizontal angle tangent value corresponding to each connecting line;

[0113] The pitch angle range and the horizontal angle range are represented by a tangent value range of the pitch angle range and a tangent value range of the horizontal angle range.

[0114] According to one or more embodiments of the present disclosure, an occlusion culling method is provided, which calculates the tangent value of the pitch angle and the tangent value of the horizontal angle corresponding to the line from the human eye position to any vertex in the following manner:

[0115] Get the first direction vector in the screen coordinate system, where the first direction vector is the direction vector of the light, where the light is the mapping point from the human eye position to the screen, where the mapping point is the point on the screen mapped from the target point, where the target point is any vertex of at least two vertices in the layer, and where the human eye position is located at the origin of the screen coordinate system:

[0116] Performing an anti-distortion process on the first direction vector to obtain a second direction vector;

[0117] The second direction vector is converted into the local coordinate system of the layer through inverse transformation to obtain a third direction vector;

[0118] In the local coordinate system of the layer, the sum of the coordinates of the human eye position in the local coordinate system of the layer plus the product of the third direction vector and the length of the connecting line is used as a ray expression representing the ray;

[0119] According to the equation relationship between the light expression and the coordinate value of the target point in the local coordinate system, the tangent value of the pitch angle and the tangent value of the horizontal angle corresponding to the line from the human eye position to the target point are calculated.

[0120] According to one or more embodiments of the present disclosure, an occlusion culling method is provided, where if the shape of the layer is a rectangle, the coordinates of at least two vertices of the layer include: coordinates of a first vertex and a second vertex; the first vertex and the second vertex are two endpoints on a diagonal line of the rectangle in a local coordinate system;

[0121] The tangent value range of the horizontal angle range of this layer is (x1-x0) / (z1-z0) to (x2-x0) / (z2-z0);

[0122] The tangent value range of the layer's pitch angle range is (y1-y0) / (z1-z0) to (y2-y0) / (z2-z0);

[0123] Among them, in the local coordinate system of this layer, the coordinates of the human eye position are (x0, y0, z0), the coordinates of the first vertex are (x1, y1, z1), and the coordinates of the second vertex of the rectangle are (x2, y2, z2).

[0124] According to one or more embodiments of the present disclosure, an occlusion culling method is provided, wherein the shape of the layer is an arc-shaped side surface of a cylinder, the arc angle of the center of the circle corresponding to the arc-shaped side surface is not greater than 180 degrees, and the human eye position is located on the side toward which the notch of the arc-shaped side surface faces;

[0125] The at least two vertices include: a third vertex and a fourth vertex of the arc-shaped side surface on the end surface of the cylinder, and a fifth vertex and a sixth vertex of the arc-shaped side surface at both ends of the diagonal line of the largest inscribed rectangle parallel to the height of the cylinder.

[0126] According to one or more embodiments of the present disclosure, an occlusion culling method is provided, wherein the origin of the local coordinate system of the layer is located at the center of the cylinder, in which the x-axis and the y-axis are parallel to the end face of the cylinder, and the z-axis is parallel to the height of the cylinder;

[0127] Determining the pitch angle range and the horizontal angle range of the layer according to the coordinates of at least two vertices of the layer and the coordinates of the human eye position in the local coordinate system of the layer includes:

[0128] The tangent value range of the horizontal angle range of this layer is (x3-x0) / (z3-z0) to (x4-x0) / (z4-z0);

[0129] The tangent value range of the layer's pitch angle range is (y5-y0) / (z5-z0) to (y6-y0) / (z6-z0);

[0130] Among them, in the local coordinate system of the layer, the coordinates of the human eye position are (x0, y0, z0), the coordinates of the third vertex are (x3, y3, z3), the coordinates of the fourth vertex as a rectangle are (x4, y4, z4), the coordinates of the fifth vertex are (x5, y5, z5), and the coordinates of the sixth vertex as a rectangle are (x6, y6, z6), x3=r×ratio1 / sqrt(1+ratio1×ratio1), z3=-x3 / ratio1, x4=r×ratio2 / sqrt(1+ratio2×ratio2), z4=-x4 / ratio2, r is the radius of the end face, ratio1 is the tangent value of the angle between the line connecting the third vertex and the center of the end face and the x-axis in the local coordinate system of the layer; ratio2 is the tangent value of the angle between the line connecting the fourth vertex and the center of the end face and the x-axis in the local coordinate system of the layer.

[0131] According to one or more embodiments of the present disclosure, an occlusion culling device is provided, which is applied to a synthesizer of an extended reality device, including:

[0132] A calculation unit, used to determine the coverage of the layer in the extended reality device, wherein the extended reality device has at least two layers to be drawn;

[0133] A control unit, configured to not draw the target layer in the synthesizer in response to the target layer being located within the coverage of any preceding layer;

[0134] The target layer is a layer other than the layer closest to the human eye position among the at least two layers, and the previous layer is a layer closer to the human eye position than the target layer.

[0135] According to one or more embodiments of the present disclosure, there is provided a terminal, including: at least one memory and at least one processor;

[0136] The at least one memory is used to store program codes, and the at least one processor is used to call the program codes stored in the at least one memory to execute any one of the above methods.

[0137] According to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium is used to store program code, and when the program code is executed by a computer, the computer is prompted to execute any one of the above methods.

[0138] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0139] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0140] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. An occlusion culling method, characterized in that: Synthesizers for extended reality devices, including: Determining a coverage range of a layer in the extended reality device, wherein the extended reality device has at least two layers to be drawn; In response to the target layer being within the coverage of any preceding layer, not drawing the target layer in the compositor; The target layer is a layer other than the layer closest to the human eye position among the at least two layers, and the previous layer is a layer closer to the human eye position than the target layer.

2. The method according to claim 1, characterized in that Determining the coverage of the layer in the extended reality device includes: determining the pitch angle range and horizontal angle range of the layer relative to the position of the human eye in the local coordinate system of the layer; If the pitch angle range and the horizontal angle range of the target layer are respectively within the pitch angle range and the horizontal angle range of any of the preceding layers, then the target layer is within the coverage range of the preceding layer of the target layer.

3. The method according to claim 2, characterized in that In the local coordinate system of the layer, determine the pitch angle range and horizontal angle range of the layer relative to the human eye position, including: Obtaining the coordinates of at least two vertices of the boundary of the layer and the coordinates of the human eye position in the local coordinate system of the layer; The pitch angle range and the horizontal angle range of the layer are determined according to the coordinates of at least two vertices of the layer and the coordinates of the human eye position in the local coordinate system of the layer.

4. The method according to claim 3, characterized in that Determining the pitch angle range and the horizontal angle range of the layer according to the coordinates of at least two vertices of the layer and the coordinates of the human eye position in the local coordinate system of the layer includes: Calculate the pitch angle tangent value and horizontal angle tangent value corresponding to the line connecting the human eye position to each vertex; The tangent value range of the pitch angle range and the tangent value range of the horizontal angle range are obtained according to the pitch angle tangent value and the horizontal angle tangent value corresponding to each connecting line; The pitch angle range and the horizontal angle range are represented by a tangent value range of the pitch angle range and a tangent value range of the horizontal angle range.

5. The method according to claim 4, characterized in that The tangent value of the pitch angle and the tangent value of the horizontal angle corresponding to the line from the eye position to any vertex are calculated as follows: Get the first direction vector in the screen coordinate system, where the first direction vector is the direction vector of the light, where the light is the mapping point from the human eye position to the screen, where the mapping point is the point on the screen mapped from the target point, where the target point is any vertex of at least two vertices in the layer, and where the human eye position is located at the origin of the screen coordinate system: Performing an anti-distortion process on the first direction vector to obtain a second direction vector; The second direction vector is converted into the local coordinate system of the layer through inverse transformation to obtain a third direction vector; In the local coordinate system of the layer, the sum of the coordinates of the human eye position in the local coordinate system of the layer plus the product of the third direction vector and the length of the connecting line is used as a ray expression representing the ray; According to the equation relationship between the light expression and the coordinate value of the target point in the local coordinate system, the tangent value of the pitch angle and the tangent value of the horizontal angle corresponding to the line from the human eye position to the target point are calculated.

6. The method according to any one of claims 3 to 5, characterized in that: If the shape of the layer is a rectangle, the coordinates of the at least two vertices of the layer include: coordinates of a first vertex and a second vertex; the first vertex and the second vertex are two endpoints on a diagonal line of the rectangle in the local coordinate system; The tangent value range of the horizontal angle range of this layer is (x1-x0) / (z1-z0) to (x2-x0) / (z2-z0); The tangent value range corresponding to the pitch angle range of this layer is (y1-y0) / (z1-z0) to (y2-y0) / (z2-z0); Among them, in the local coordinate system of this layer, the coordinates of the human eye position are (x0, y0, z0), the coordinates of the first vertex are (x1, y1, z1), and the coordinates of the second vertex of the rectangle are (x2, y2, z2).

7. The method according to any one of claims 3 to 5, characterized in that: The shape of the layer is an arc-shaped side surface of a cylinder, the arc angle of the center of the circle corresponding to the arc-shaped side surface is not greater than 180 degrees, and the human eye position is located on the side toward which the notch of the arc-shaped side surface faces; The at least two vertices include: a third vertex and a fourth vertex of the arc-shaped side surface on the end surface of the cylinder, and a fifth vertex and a sixth vertex of the arc-shaped side surface at both ends of the diagonal line of the largest inscribed rectangle parallel to the height of the cylinder.

8. The method according to claim 7, characterized in that The origin of the local coordinate system of the layer is located at the center of the cylinder. In the local coordinate system of the layer, the x-axis and the y-axis are parallel to the end surface of the cylinder, and the z-axis is parallel to the height of the cylinder. Determining the pitch angle range and the horizontal angle range of the layer according to the coordinates of at least two vertices of the layer and the coordinates of the human eye position in the local coordinate system of the layer includes: The tangent value range of the horizontal angle range of this layer is (x3-x0) / (z3-z0) to (x4-x0) / (z4-z0); The tangent value range of the layer's pitch angle range is (y5-y0) / (z5-z0) to (y6-y0) / (z6-z0); Among them, in the local coordinate system of the layer, the coordinates of the human eye position are (x0, y0, z0), the coordinates of the third vertex are (x3, y3, z3), the coordinates of the fourth vertex as a rectangle are (x4, y4, z4), the coordinates of the fifth vertex are (x5, y5, z5), and the coordinates of the sixth vertex as a rectangle are (x6, y6, z6), x3=r×ratio1 / sqrt(1+ratio1×ratio1), z3=-x3 / ratio1, x4=r×ratio2 / sqrt(1+ratio2×ratio2), z4=-x4 / ratio2, r is the radius of the end face, ratio1 is the tangent value of the angle between the line connecting the third vertex and the center of the end face and the x-axis in the local coordinate system of the layer; ratio2 is the tangent value of the angle between the line connecting the fourth vertex and the center of the end face and the x-axis in the local coordinate system of the layer.

9. An occlusion culling device, characterized in that: Synthesizers for extended reality devices, including: A calculation unit, used to determine the coverage of the layer in the extended reality device, wherein the extended reality device has at least two layers to be drawn; A control unit, configured to not draw the target layer in the synthesizer in response to the target layer being located within the coverage of any preceding layer; The target layer is a layer other than the layer closest to the human eye position among the at least two layers, and the previous layer is a layer closer to the human eye position than the target layer.

10. A terminal, comprising: at least one memory and at least one processor; The at least one memory is used to store program code, and the at least one processor is used to call the program code stored in the at least one memory to execute the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, the computer-readable storage medium being used to store program code, wherein when the program code is executed by a computer, the computer is prompted to execute the method according to any one of claims 1 to 8.