Object shielding relation determination method and device, equipment, medium and product

By obtaining the contour points of the projected area occupied by game objects in a two-dimensional game scene, the problem of low efficiency and low accuracy in determining the occlusion relationship of objects in a two-dimensional game scene is solved, and automatic and accurate occlusion relationship determination is achieved, reducing manpower consumption.

CN120689418APending Publication Date: 2025-09-23NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510962102.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In a two-dimensional game scene, due to the lack of depth information, existing technologies cannot accurately determine the occlusion relationship between scene objects, resulting in low efficiency and low accuracy.

Method used

By obtaining the contour point connection lines of the projected areas occupied by the game objects, these connection lines are used to determine the occlusion relationship of the game objects in the game scene, including obtaining the contour point connection lines corresponding to the projected areas occupied by the first game object and the second game object, and determining the occlusion relationship based on the coordinate data of these connection lines.

Benefits of technology

It realizes the automatic and accurate determination of object occlusion relationships in two-dimensional game scenes, reduces manpower consumption, and improves calculation efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120689418A_ABST
    Figure CN120689418A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a method, device and equipment for determining an object shielding relation, a medium and a product, and relates to the technical field of games. The method comprises the following steps: acquiring a contour point connecting line corresponding to an occupied projection area of a first game object and a contour point connecting line corresponding to an occupied projection area of a second game object; wherein the occupied projection area is a projection area of the bottom surface of the corresponding object on the ground when the corresponding object is placed in the game scene, and the contour point connecting line is a connecting line between two points on the contour line of the corresponding occupied projection area; according to the contour point connecting line corresponding to the occupied projection area of the first game object and the contour point connecting line corresponding to the occupied projection area of the second game object, the shielding relation of the first game object and the second game object in the game scene is determined. According to the embodiment, the shielding relation of the two game objects is automatically determined, and manpower consumption is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of game technology, and in particular to a method, apparatus, device, medium, and product for determining an occlusion relationship between objects. Background Art

[0002] Currently, during the game development process, it is necessary to determine the occlusion relationship between multiple scene objects that are close to each other in the game scene, such as buildings, so as to prepare data for the front-end screen rendering.

[0003] In a three-dimensional (3D) game scene, the occlusion relationship between scene objects can be determined based on the depth information of the scene objects. However, in a two-dimensional (2D) game scene, due to the lack of depth information of each object, the occlusion relationship between scene objects cannot be determined based on the depth information. Instead, the occlusion relationship between scene objects can only be determined manually, which has problems such as low efficiency and low accuracy. Therefore, a solution is urgently needed that can automatically and accurately determine the occlusion relationship between scene objects in the absence of depth information. Summary of the Invention

[0004] Embodiments of the present invention provide a method, apparatus, device, medium, and product for determining an occlusion relationship between objects, so as to automatically and accurately determine the occlusion relationship between two game objects in a game scene and reduce manpower consumption.

[0005] According to one aspect of the present invention, a method for determining an occlusion relationship of an object is provided, the method comprising:

[0006] Obtaining a line connecting the contour points corresponding to the projected area of ​​the first game object and a line connecting the contour points corresponding to the projected area of ​​the second game object; wherein the projected area is the projection area of ​​the bottom surface of the corresponding object on the ground when the corresponding object is placed in the game scene, and the line connecting the contour points is a line connecting two points on the contour line of the corresponding projected area;

[0007] The occlusion relationship between the first game object and the second game object in the game scene is determined based on the contour point connection line corresponding to the projected area occupied by the first game object and the contour point connection line corresponding to the projected area occupied by the second game object.

[0008] According to another aspect of the present invention, a device for determining an occlusion relationship of an object is provided, the device comprising:

[0009] An acquisition module, configured to acquire a line connecting contour points corresponding to a projected area occupied by a first game object, and a line connecting contour points corresponding to a projected area occupied by a second game object; wherein the projected area is the projection area of ​​the bottom surface of the corresponding object on the ground when the corresponding object is placed in the game scene, and the line connecting contour points is a line connecting two points on the contour line of the corresponding projected area;

[0010] The determination module is used to determine the occlusion relationship between the first game object and the second game object in the game scene based on the contour point connection line corresponding to the projection area occupied by the first game object and the contour point connection line corresponding to the projection area occupied by the second game object.

[0011] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0012] at least one processor; and

[0013] a memory communicatively connected to at least one processor; wherein,

[0014] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the method for determining the object occlusion relationship of any embodiment of the present invention.

[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions for enabling a processor to implement the method for determining an object occlusion relationship according to any embodiment of the present invention when the computer instructions are executed.

[0016] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, it implements the method for determining the object occlusion relationship of any embodiment of the present invention.

[0017] The embodiments of the above invention have the following advantages or beneficial effects:

[0018] In the solution provided by an embodiment of the present invention, the occlusion relationship between the first game object and the second game object in the game scene is determined based on the line connecting the contour points corresponding to the projected area of ​​the first game object and the line connecting the contour points corresponding to the projected area of ​​the second game object. Because the line connecting the contour points of the projected areas of the two game objects can represent the relative positions of the two game objects to a certain extent, the occlusion relationship between the two game objects can be determined more accurately based on the line connecting the contour points of the projected areas of the two game objects. This solves the current problems of low efficiency and low accuracy caused by manual judgment of the occlusion relationship of each game object, and realizes the automatic and accurate determination of the occlusion relationship between the two game objects, reducing manpower consumption.

[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 A schematic flow chart of a method for determining an occlusion relationship of an object provided in an embodiment of the present invention;

[0022] Figure 2 Another schematic flow chart of a method for determining an object occlusion relationship according to an embodiment of the present invention;

[0023] Figure 3 An example diagram of connecting contour points corresponding to the projected area provided by an embodiment of the present invention;

[0024] Figure 4 An example diagram of a process for determining the contour point connection lines corresponding to the projected area occupied by any game object provided by an embodiment of the present invention;

[0025] Figure 5 An example diagram of a scene for determining a set of shadow points provided by an embodiment of the present invention;

[0026] Figure 6 An example diagram of the projected area provided by an embodiment of the present invention;

[0027] Figure 7 A schematic structural diagram of an apparatus for determining an occlusion relationship of an object provided by an embodiment of the present invention;

[0028] Figure 8 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] Figure 1 This is a flow chart of a method for determining object occlusion relationships provided by an embodiment of the present invention. This embodiment is applicable to the case of automatically determining the occlusion relationships of multiple game objects in a game scene. The method can be executed by an object occlusion relationship determination device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device. In this embodiment, the electronic device can be a computer or server used in game development. Figure 1 As shown, the method includes:

[0032] S101: Obtain a line of contour points corresponding to a projection area occupied by a first game object and a line of contour points corresponding to a projection area occupied by a second game object.

[0033] The first and second game objects are both scene objects during the game development process. Scene objects may include objects with fixed positions within the game scene, such as buildings. In this embodiment, the first and second game objects are two different objects that may overlap. The projected area is the area of ​​the ground where the bottom surface of the corresponding object is projected when placed in the game scene. The contour line is the line connecting two points on the contour line of the corresponding projected area.

[0034] Specifically, when determining the occlusion relationship between a first game object and a second game object, the projected area of ​​the first game object and the projected area of ​​the second game object can be determined separately. For example, if the game objects are regular geometric shapes, the projected area can be determined using axis-aligned bounding box projection or oriented bounding box projection, both of which are basic geometric projection methods. If the game objects are irregular geometric shapes, such as complex model game objects, the projected area can be determined using methods such as triangular mesh projection calculation or height map projection.

[0035] Specifically, after determining the projected area of ​​the first game object and the projected area of ​​the second game object according to the above method, two points can be found on the contour line of the projected area of ​​the first game object and connected to obtain a line of contour points corresponding to the projected area of ​​the first game object; and two points can be found on the contour line of the projected area of ​​the second game object and connected to obtain a line of contour points corresponding to the projected area of ​​the second game object. Optionally, in this embodiment, the two points found on the contour line can be two extreme points, such as a left extreme point and a right extreme point, where the left extreme point is the point on the contour line with the smallest horizontal axis coordinate value and the right extreme point is the point on the contour line with the largest horizontal axis coordinate value. Alternatively, the two points found on the contour line can be a point adjacent to the left extreme point and a point adjacent to the right extreme point, where a point adjacent to the left extreme point means a point whose horizontal axis coordinate value differs from the horizontal axis coordinate value of the left extreme point by less than a preset threshold, and a point adjacent to the right extreme point means a point whose horizontal axis coordinate value differs from the horizontal axis coordinate value of the right extreme point by less than a preset threshold.

[0036] In this embodiment, separately obtaining the projected areas of the first and second game objects provides a common dimensional basis for subsequently determining the occlusion relationship between the first and second game objects. Furthermore, determining the connecting line of contour points corresponding to the projected area of ​​the first game object and the projected area of ​​the second game object simplifies the comparison of the projected areas. By extracting key feature boundaries, this provides a more critical feature basis for subsequently determining the occlusion relationship.

[0037] S102: Determine an occlusion relationship between the first game object and the second game object in the game scene based on a line connecting contour points corresponding to the projected area of ​​the first game object and a line connecting contour points corresponding to the projected area of ​​the second game object.

[0038] The occlusion relationship between the first and second game objects in the game scene can be the occlusion relationship between the first and second game objects in a 2D game scene or a 3D game scene. Since 3D game objects must be baked into 2D masks before being placed in a 2D game scene, the occlusion relationship between the first and second game objects in the 2D game scene can also be referred to as the occlusion relationship between the first game object's mask and the second game object's mask in the 2D game scene.

[0039] Specifically, if the first game object and the second game object have an occlusion relationship in the game scene, it means that in the two-dimensional coordinate system, the contour point connection line corresponding to the projected area occupied by the first game object (hereinafter referred to as the first connection line) and the contour point connection line corresponding to the projected area occupied by the second game object (hereinafter referred to as the second connection line) have a common line segment in the horizontal axis direction, and the points on the common line segment of the game object that is usually occluded are located higher than the corresponding points on the common line segment of the other game object. Therefore, as long as the common line segment of the first connection line and the second connection line in the horizontal axis direction is found and the vertical axis coordinate values ​​of the corresponding points on the two common line segments (i.e., the points with the same horizontal axis coordinate values) are compared, the occlusion relationship between the first game object and the second game object in the game scene can be determined.

[0040] In this embodiment, the occlusion relationship between the first game object and the second game object is determined based on the contour point connection line corresponding to the projected area occupied by the first game object and the contour point connection line corresponding to the projected area occupied by the second game object. This solves the problems of low efficiency and low accuracy caused by manual judgment of the occlusion relationship between objects, realizes the automatic determination of the occlusion relationship between the two game objects, and reduces manpower consumption.

[0041] Figure 2 This is another flowchart of a method for determining an occlusion relationship of objects provided in an embodiment of the present invention. Based on the above embodiments and other examples, this embodiment mainly elaborates on the steps before obtaining the contour point connection line corresponding to the occupied projection area of ​​the first game object and the contour point connection line corresponding to the occupied projection area of ​​the second game object, the steps of determining the occlusion relationship between the first game object and the second game object in the game scene based on the contour point connection line corresponding to the occupied projection area of ​​the first game object and the contour point connection line corresponding to the occupied projection area of ​​the second game object, and the steps after determining the occlusion relationship between the first game object and the second game object in the game scene. Figure 2 As shown, the method includes:

[0042] S201. Determine whether the first game object and the second game object overlap based on the coordinate data of the first game object and the coordinate data of the second game object.

[0043] The coordinate data may be three-dimensional coordinate data of each game object in a three-dimensional game scene, or may be two-dimensional coordinate data in a two-dimensional game scene.

[0044] Exemplarily, determining whether the first game object and the second game object overlap based on the coordinate data of the first game object and the coordinate data of the second game object includes:

[0045] (1) Determine a first bounding box of the first game object based on the coordinate data of the first game object, and determine a second bounding box of the second game object based on the coordinate data of the second game object.

[0046] The bounding box is the smallest geometric shape that encloses the target object, and can be specifically an axis-aligned bounding box (AABB).

[0047] Specifically, in one implementation, if the coordinate data is three-dimensional coordinate data, the center coordinates, half-length value, half-width value, and half-height value of the first game object can be determined, and the maximum and minimum coordinate values ​​of the first game object can be determined accordingly. The maximum coordinate value includes the maximum x-axis coordinate value, the maximum y-axis coordinate value, and the maximum z-axis coordinate value. The minimum coordinate value includes the minimum x-axis coordinate value, the minimum y-axis coordinate value, and the minimum z-axis coordinate value. Subsequently, the point corresponding to the maximum coordinate value of the first game object can be connected with the point corresponding to the minimum coordinate value on each coordinate axis according to actual conditions to obtain the first bounding box of the first game object. The second bounding box of the second game object can be obtained similarly. In another implementation, if the coordinate data is two-dimensional coordinate data, compared to the three-dimensional coordinate data, only the "z-axis" coordinate is missing. Therefore, the first bounding box of the first game object and the second bounding box of the second game object can also be obtained by referring to the above method.

[0048] (2) Determine whether the first game object and the second game object overlap based on the first bounding box and the second bounding box.

[0049] Specifically, after obtaining the first and second bounding boxes, collision detection can be used to determine whether the first and second game objects collide, i.e., overlap. For example, methods such as the coordinate range overlap method, the separating axis theorem, and the vector difference method can be used to determine whether the first and second game objects overlap based on the first and second bounding boxes.

[0050] For example, if the coordinate data is three-dimensional coordinate data in a three-dimensional game scene, the three-dimensional center coordinates of the first game object are (x a ,y a , z a ), half length w a , half-width h a and half-height d a , the three-dimensional center coordinates of the second game object are (x b ,y b , z b ), half length w b 、half width h b and half-height d bAt this point, the maximum coordinate of the first game object can be determined to be (x a +w a ,y a +h a , z a +d a ), the minimum coordinate is (x a -w a ,y a -h a , z a -d a ). And determine the maximum coordinate of the second game object as (x b +w b ,y b +h b , z b +d b ), the minimum coordinate is (x b -w b ,y b -h b , z b -d b ). After that, determine whether: x a +w a ≥x b -w b And x b +w b ≥x a -w a , and y a +h a ≥y b -h b And y b +h b ≥y a -h a , and z a +d a ≥z b -d b And z b +d b ≥z a -d a That is, if it is determined that all the above formulas are satisfied at the same time, it is determined that the first game object and the second game object overlap. For example, if the coordinate data is two-dimensional coordinate data in a two-dimensional game scene, the two-dimensional coordinates of the first game object are (x a ,y a ), half length w a and half-width h a , the two-dimensional coordinates of the second game object are (x b ,y b ), half length w b and half-width hb ; Determine the maximum coordinates (x a +w a ,y a +h a ), minimum coordinate (x a -w a ,y a -h a ), determine the maximum coordinates (x b +w b ,y b +h b ), minimum coordinate (x b -w b ,y b -h b ). After that, determine whether: x a -w a ≤x b +w b And x a +w a ≥x b -w b , and y a -h a ≤x b +w b And y a +h a ≥y b -h b That is, if it is determined that all the above formulas are satisfied at the same time, it is determined that the first game object and the second game object overlap.

[0051] S202: If the first game object and the second game object overlap, obtain a line of contour points corresponding to the projected area occupied by the first game object and a line of contour points corresponding to the projected area occupied by the second game object.

[0052] Specifically, if it is determined that the first game object and the second game object overlap, it means that the occlusion relationship between the first game object and the second game object needs to be determined. Therefore, it can trigger the execution of the operation of obtaining the contour point connection line corresponding to the occupied projection area of ​​the first game object and the contour point connection line corresponding to the occupied projection area of ​​the second game object.

[0053] For example, for the projected area of ​​the first game object, the left and right extreme points of the projected area can be selected and connected to form the contour line corresponding to the projected area of ​​the first game object. Similarly, the contour line corresponding to the projected area of ​​the second game object can also be derived based on this.

[0054] It's worth noting that if the first and second game objects don't overlap, there's no need to obtain a line connecting the contour points corresponding to the projected areas of the two game objects, because there's no occlusion relationship between the first and second game objects. Therefore, there's no need to execute the method of this embodiment. This embodiment focuses on resolving situations where the first and second game objects overlap, i.e., where there's an occlusion relationship between the first and second game objects.

[0055] S203: Determine a first common line segment in the horizontal direction between the line connecting the contour points corresponding to the projected area of ​​the first game object and the line connecting the contour points corresponding to the projected area of ​​the second game object, and a second common line segment in the horizontal direction between the line connecting the contour points corresponding to the projected area of ​​the second game object and the line connecting the contour points corresponding to the projected area of ​​the first game object.

[0056] Specifically, the first common line segment and the second common line segment can be determined based on the coordinate data of the two endpoints of the first line, which is a line connecting the contour points corresponding to the projected area of ​​the first game object, and the coordinate data of the two endpoints of the second line, which is a line connecting the contour points corresponding to the projected area of ​​the second game object. For example, assuming that the left endpoint of the first line is L1(x L1 ,y L1 ), the right endpoint is R1(x R1 ,y R1 ), the left endpoint of the second line is L2(x L2 ,y L2 ), the right endpoint is R2(x R2 ,y R2 ), if x L2 <x R1 <x R2 , then the first common line segment is the line whose horizontal coordinate value on the first connecting line falls on [x L2 , x R1 ], the second common line segment is composed of points in the range of [x L2 , x R1 ]The line segment formed by the points within the range; if x L2 <x L1 <x R2 , then the first common line segment is the line whose horizontal coordinate value on the first connecting line falls on [x L1 , x R1 ] range of points, the second common line segment is composed of points whose horizontal axis coordinates on the second line fall within [x L1 , x R1 ] is a line segment formed by points within the range.

[0057] For example, Figure 3This is an example diagram of the lines connecting the contour points corresponding to the projected area provided by the embodiment of the present invention. Figure 3 As shown, the first game object 91 (the red house-shaped object on the left) and the second game object 92 (the red house-shaped object on the right) are both on the plane 90 (i.e., the ground in the game scene). According to the above method, the occupied projection area 901 (indicated by the red dotted line on the left) corresponding to the first game object 91 and the occupied projection area 902 (indicated by the red dotted line on the right, part of which is not shown due to being blocked) corresponding to the second game object 92 can be obtained. At this time, since the occupied projection area is the projection of a three-dimensional object onto the two-dimensional ground, the occupied projection area is the area under the two-dimensional coordinate system. Therefore, the left endpoint L1 and the right endpoint R1 of the occupied projection area 901 can be determined, and connected with a dotted line, then the first connecting line 911 corresponding to the occupied projection area 901 of the first game object 91 can be obtained; and the left endpoint L2 and the right endpoint R2 of the occupied projection area 902 can be determined, and connected with a dotted line, then the second connecting line 912 corresponding to the occupied projection area 902 of the second game object 92 can be obtained. At this time, it can be obtained from Figure 3 From the diagram, we know that the common portion between first line 911 and second line 912 is the line segment from L2 to R1. That is, according to the above method, the first common line segment can be determined as Q1R1, and the second common line segment as L2Q2. For example, Q1 is the intersection of L2 along the downward dashed line with first line 911, and Q2 is the intersection of R1 along the upward dashed line with second line 912.

[0058] In this embodiment, by determining the first common line segment and the second common line segment, feature extraction of the overlapping area of ​​the first game object and the second game object is achieved, providing an accurate and simple basis for subsequently determining the occlusion relationship between the first game object and the second game object based on the feature.

[0059] S204: Determine an occlusion relationship between the first game object and the second game object in the game scene based on coordinate data of points on the first common line segment and the second common line segment.

[0060] The coordinate data of the points on the first common line segment and the second common line segment are the coordinate values ​​corresponding to the points, including the horizontal axis coordinate value and the vertical axis coordinate value.

[0061] Specifically, you can first select corresponding points on the first common line segment and the second common line segment, where corresponding points refer to points with the same horizontal axis coordinate values; for example, corresponding points include but are not limited to midpoints; then, based on the size relationship of the vertical axis coordinate values ​​of the selected corresponding points, determine the occlusion relationship between the first game object and the second game object in the game scene.

[0062] For example, first determine the line segment expression of the contour point connection line. Figure 3 Take the first line 911 in as an example. Since the two ends of the first line 911 are L1 and R1 respectively, and the coordinate values ​​of L1 and R1 are known, for the first line 911, the line segment expression of the first line 911 can be determined according to the coordinate values ​​of the two points L1 and R1. Similarly, the line segment expression of the second line 912 can also be determined according to the coordinate values ​​of the points L2 and R2. After that, after determining the line segment expressions corresponding to the two contour point lines, the horizontal axis coordinate values ​​of the midpoints on the first common line segment and the second common line segment can be substituted into the line segment expressions corresponding to the two contour point lines respectively to obtain the vertical axis coordinate values ​​of the two midpoints. For example, taking the first line 911 as an example, let the line segment expression of the first line 911 be: y=A*x+B. Among them, y is the vertical axis coordinate value, x is the horizontal axis coordinate value, A is the line segment slope, and B is the line segment intercept. After determining L1(x L1 ,y L1 ) and R1(x R1 ,y R1 ), we can get two equations: L1 =A*x L1 +B and y R1 =A*x R1 + B. Therefore, the two equations can be combined to obtain the values ​​of A and B, and determine the line segment expression of the first line 911. The same method can be used to obtain the line segment expression of the second line 912. For example, since the minimum and maximum values ​​of the horizontal coordinates of all points on the first common line segment and the second common line segment are the same, the horizontal coordinate range of the first common line segment and the second common line segment can be determined accordingly. For example, Figure 3 The first common line segment and the second common line segment, their horizontal coordinates are both from x L2 to x R1 . Further, any one horizontal coordinate value can be selected from the horizontal coordinate range of the first common line segment and the second common line segment as the reference coordinate value, and substituted into the line segment expressions corresponding to the two line segments respectively to obtain the vertical coordinate value 1 corresponding to the horizontal coordinate value in the first common line segment, and the vertical coordinate value 2 corresponding to the horizontal coordinate value in the second common line segment, and the occlusion relationship between the first game object and the second game object in the game scene can be determined according to the numerical values ​​of the vertical coordinate value 1 and the vertical coordinate value 2. Among them, any one point with the same horizontal coordinate on the first common line segment and the second common line segment can be a quarter point, a midpoint, a two-thirds point or an arbitrary point starting from the direction with the smaller horizontal coordinate.

[0063] Optionally, determining the occlusion relationship between the first game object and the second game object in the game scene according to coordinate data of points on the first common line segment and the second common line segment includes:

[0064] The occlusion relationship between the first game object and the second game object in the game scene is determined according to the magnitude relationship between the longitudinal axis coordinate value of the midpoint on the first common line segment and the longitudinal axis coordinate value of the midpoint on the second common line segment.

[0065] Specifically, first, the horizontal axis coordinate value of the midpoint between the first common line segment and the second common line segment can be determined. Figure 3 , according to the known horizontal coordinate x of L2 and R1 L2 and x R1 , the horizontal axis coordinate value x at the midpoint of the first common line segment and the second common line segment can be calculated c =(x L2 +x R1 ) / 2. Then, the horizontal axis coordinate value x at the midpoint of the first common line segment and the second common line segment can be calculated. c , respectively, into the segment expression of the first connecting line 911 corresponding to the first common segment and the segment expression of the second connecting line 912 corresponding to the second common segment, to obtain the vertical axis coordinate value 1 of the midpoint of the first common segment and the vertical axis coordinate value 2 of the midpoint of the second common segment. Finally, directly compare the values ​​of the vertical axis coordinate value 1 and the vertical axis coordinate value 2, for example Figure 3 , if the vertical axis coordinate value 1 is smaller than the vertical axis coordinate value 2, it means that the first game object blocks the second game object.

[0066] It is worth noting that the occlusion relationship between the first game object and the second game object in the game scene is determined based on the magnitude relationship between the vertical axis coordinate value of the midpoint on the first common line segment and the vertical axis coordinate value of the midpoint on the second common line segment, which needs to be determined specifically according to the vertical axis direction. Figure 3 For example, if the positive direction of the vertical axis is upward, if the vertical axis coordinate value of the midpoint on the first common line segment is greater than the vertical axis coordinate value of the midpoint on the second common line segment, the second game object blocks the first game object; if the vertical axis coordinate value of the midpoint on the first common line segment is less than the vertical axis coordinate value of the midpoint on the second common line segment, the first game object blocks the second game object, that is, the smaller the vertical axis coordinate value, the closer the object is to the front. Conversely, if the positive direction of the vertical axis is downward, if the vertical axis coordinate value of the midpoint on the first common line segment is greater than the vertical axis coordinate value of the midpoint on the second common line segment, the first game object blocks the second game object; if the vertical axis coordinate value of the midpoint on the first common line segment is less than the vertical axis coordinate value of the midpoint on the second common line segment, the second game object blocks the first game object, that is, the larger the vertical axis coordinate value, the closer the object is to the front.

[0067] In this embodiment, the occlusion relationship between the first and second game objects in the game scene is determined based on the coordinate data of points on the first and second common line segments. This solves the current problem of inefficiency and low accuracy caused by manual determination of the occlusion relationship between objects. It automatically determines the occlusion relationship between the two game objects, reducing manpower consumption. Furthermore, by determining the occlusion relationship between the two game objects using only the coordinate data of the points on the common line segments that represent the overlapping portions of the two game objects, it reduces computational complexity, reduces computing power, and improves computational speed and efficiency.

[0068] S205 , saving the relationship data representing the occlusion relationship; and sending the relationship data to the game client, so that the game client renders the dynamic elements running between the first game object and the second game object in the game scene according to the relationship data.

[0069] Dynamic elements refer to content or objects in a game whose state or behavior changes over time, based on player actions, or due to game logic. Rendering is the process of converting in-game 3D models, textures, lighting, and other data into 2D screen images.

[0070] Specifically, after determining the occlusion relationship between the first game object and the second game object, relationship data representing the occlusion relationship between the first game object and the second game object can be generated and stored on the server. After any game client is installed or started, the stored relationship data can be sent to the game client so that when the game client displays a game scene containing the first game object and the second game object, dynamic elements running between the first game object and the second game object in the game scene can be rendered according to the relationship data, so that the dynamic elements are rendered correctly.

[0071] In this embodiment, the relationship data representing the occlusion relationship is saved and sent to the game client. When the game scene of the game client runs to the first game object and the second game object, the dynamic elements between the first game object and the second game object are rendered according to the relationship data, thereby ensuring the correctness of the element rendering and the user experience in the game process.

[0072] Figure 4 This is an example diagram of the process of determining the contour point connection lines corresponding to the projected area of ​​any game object provided by the embodiment of the present invention. Based on the above embodiments and other examples, this embodiment mainly explains the process of determining the contour point connection lines corresponding to the projected area of ​​any game object. Figure 4 As shown, the process includes:

[0073] S401: Determine the intersection of two different shadows of any game object, and determine the shadowed area occupied by any game object based on the intersection.

[0074] In this embodiment, any game object includes a first game object and a second game object. A shadow is an area that is not illuminated by a light source.

[0075] Specifically, one implementation method directly determines the geometric projections of any game object in two directions, treats the two geometric projections as two different shadows, and determines the area where the two different shadows intersect, i.e., the intersection. Furthermore, the intersection area is used as the projected area occupied by any game object. Another implementation method determines the optical projections of any game object in two directions, treats the two optical projections as two different shadows, obtains the intersection area, and uses the intersection area as the projected area occupied by any game object.

[0076] S402: Determine the line connecting the two extreme points of the projected area of ​​any game object as the line connecting the contour points corresponding to the projected area of ​​any game object.

[0077] Among them, the two extreme points can specifically be the left extreme point and the right extreme point of the projected area occupied by any game object. The left extreme point is the point with the smallest horizontal axis coordinate value on the contour line of the projected area occupied by any game object, and the right extreme point is the point with the largest horizontal axis coordinate value on the contour line.

[0078] Specifically, after obtaining the projected area of ​​the first and second game objects using the above method, for each game object's projected area, the point on the contour line of the projected area with the smallest horizontal coordinate value in the two-dimensional coordinate system, i.e., the left extreme point, can be determined; as well as the point on the contour line of the projected area with the largest horizontal coordinate value in the two-dimensional coordinate system, i.e., the right extreme point. Furthermore, by connecting the left extreme point and the right extreme point, a line connecting the contour points corresponding to the projected area can be obtained. Based on this, the maximum horizontal coverage of the game object corresponding to the projected area can be determined.

[0079] For example, continue to refer to Figure 3 After determining the projected area 901 of the first game object 91 and the projected area 902 of the second game object 92, the left endpoint L1 and the right endpoint R1 of the projected area 901 can be connected to form a first line 911, and the left endpoint L2 and the right endpoint R2 of the projected area 902 can be connected to form a second line 912. The left endpoint shown in this embodiment is an example of a left extreme point, and the right endpoint is an example of a right extreme point.

[0080] In this embodiment, after determining the projected area occupied by the first game object and the projected area occupied by the second game object, the contour point connection line corresponding to each projected area can be determined based on the extreme points on the horizontal coordinates of each projected area, namely the left extreme point and the right extreme point. In this way, the projected area can be further simplified, providing an accurate and precise comparison item for subsequently determining the occlusion relationship between the two game objects. At the same time, since the contour point connection line is the line between the left extreme point and the right extreme point of the projected area, the characteristics of the range covered by the projected area are maximized, and the contour point connection line based on the projected area is used instead of the projected area to more accurately represent the maximum coverage of the object in the horizontal direction, thereby reducing the amount of calculation for determining the subsequent occlusion relationship between the two game objects. At the same time, it can also ensure the accuracy of the calculation while improving the calculation speed and efficiency.

[0081] Furthermore, the intersection of two different shadows of any game object is determined, and the shadowed area of ​​any game object is determined based on the intersection, specifically including:

[0082] S4011. Obtain a first depth map obtained by photographing any game object with a camera set at a first light source position, determine a first target point on the ground that meets a first preset condition, and form a first shadow point set.

[0083] Among them, the first light source position is the position where the first light source is located. In this embodiment, the first light source is used to form a projection of any game object on the ground. In this embodiment, the camera can be a camera that obtains the depth of the scene, such as an orthogonal camera, which can present the object in the form of parallel projection to ensure that the size and proportion of the object remain unchanged at any distance. The first depth map is used to represent the scene depth obtained by the camera when the light source at the first light source position illuminates the surface of any game object. The first preset condition includes: the depth value corresponding to the mapping point of the first target point in the first depth map is less than the distance value between the first target point and the first light source plane. The first shadow point set includes at least one determined first target point on the ground that meets the first preset condition.

[0084] Specifically, Figure 5 This is an example diagram of a scene when determining a set of shadow points provided by an embodiment of the present invention. Figure 5As shown, the camera 10 set at the first light source position shoots any game object 20 in the direction of the arrow to obtain a first depth map. The first depth map can be divided into an orthogonal two-dimensional coordinate system, which is shown as the "u, v" coordinate system in the figure. At this time, for any plane 30 where any game object 20 is located, a shadow 40 will be formed on the plane 30 through the illumination of the light source at the camera 10. That is, within the range of the plane 30, other areas except the shadow 40 can be illuminated by the light source. Therefore, the shadow 40 is the first shadow point set. Then, the first target point in the first shadow point set can be accurately determined based on the imaged first depth map.

[0085] For example, suppose there is a point P in the plane 30 and it is necessary to determine whether it is in the shadow 40. First, since the light source is parallel light, the coordinates of P in the 3D coordinate system and the plane corresponding to the light source can be determined as follows: Figure 3 The plane position of camera 10 in the image is used to determine the distance from P to the plane, which is recorded as pd. Then, based on the first depth map, the uv coordinates of P in the uv coordinate system of the first depth map can be obtained. Specifically, the position of camera 10 and the shooting direction (light source direction) can be used to obtain a coordinate system "X, Y, Z" with the light source (camera 10) as the origin and perpendicular to the light source direction. Among them, the Z axis is the direction parallel to the light source direction, and the plane formed by X and Y is the uv plane of the first depth map. Furthermore, the coordinate points in the coordinate system "X, Y, Z" in the 3D scene can be converted into coordinate points in the uv coordinate system of the first depth map through a coordinate system conversion method. For example, based on the camera's shooting width and height, that is, the pixel resolution in the first depth map, the coordinates are normalized to between (0, 1). That is, the coordinate system conversion is achieved through matrix transformation and scaling normalization of the coordinate system conversion. At this time, since the 3D coordinates of point P are known, point P' of P in the uv coordinate system can be determined based on the above coordinate system conversion. Among them, point P' is the mapping point of P in the coordinate system of the first depth map. Next, the depth value dt corresponding to point P' can be obtained by using the method of texture sampling and depth buffering. After obtaining dt, it can be determined based on the first preset condition whether point P is a point in the shadow, that is, whether it is the first target point in the first shadow point set. At this time, the depth value corresponding to the mapping point of the point in the first depth map is dt, and the distance value between the point and the first light source plane is pd. Therefore, if dt<pd, it means that the light source does not illuminate this point P, then point P is the first target point in the first shadow point set; if dt=pd, it means that the light source illuminates this point P, and point P is not in the first shadow point set. Among them, since it is impossible for the camera to not capture a closer point, the situation of dt>pd will not occur.

[0086] In this embodiment, an orthogonal camera is used to obtain a depth map. Based on the depth information in the depth map, the shadow area that the camera cannot illuminate when illuminating any game object is determined, providing a basis for subsequently determining the shadow area occupied by any game object.

[0087] S4012: Obtain a second depth map obtained by photographing any game object with a camera set at a second light source position, determine a second target point on the ground that meets a second preset condition, and form a second shadow point set.

[0088] Among them, the second light source position is different from the first light source position. In this embodiment, optionally, the shooting direction (projection direction) of the camera set at the second light source position is perpendicular to the shooting direction (projection direction) of the camera set at the first light source position. That is, the camera set at the first light source position and the camera set at the second light source position are placed opposite each other. The second preset condition includes: the depth value corresponding to the mapping point of the second target point in the second depth map is less than the distance value between the second target point and the second light source plane. The second shadow point set includes at least one determined second target point on the ground that meets the second preset condition.

[0089] Specifically, similar to determining the first shadow point set, a camera is placed at the second light source position and the object is photographed to obtain a second depth map. Then, based on the above method and the second preset condition, the second shadow point set can be determined.

[0090] S4013. Determine the area formed by the target points in the intersection of the first shadow point set and the second shadow point set as the projected area occupied by any game object.

[0091] Specifically, based on the principle of orthogonal projection of parallel light, it can be known that by shooting the same object from different light source positions using two orthogonal cameras with perpendicular projection directions, the object's projection area can be determined. In other words, the area formed by the target points in the intersection of the first shadow point set and the second shadow point set is the projection area of ​​any game object. For example, Figure 6 This is an example diagram of the projected area provided by the embodiment of the present invention. Figure 6 As shown, in Figure 6 , the ground 70, the first shadow point set 50, the second shadow point set 60, and the occupied projection area 80 are shown. That is, the area formed by the target points in the intersection of the first shadow point set 50 and the second shadow point set 60 is the occupied projection area 80.

[0092] In this embodiment, the principle of orthogonal projection of parallel light is utilized to capture a depth map of any game object from cameras set at different light source positions. Two sets of shadow points are determined according to preset conditions, and then the occupied projection area is determined based on the area formed by the target points in the intersection of the two sets of shadow points. This allows the accurate determination of the occupied projection area of ​​the game object, providing an accurate dimensional basis for the subsequent determination of the occlusion relationship between the game objects. At the same time, determining the two-dimensional occupied projection area of ​​the game object achieves dimensionality reduction and simplification, that is, by extracting two-dimensional features that can reflect the key contours of the three-dimensional object, it provides a basis for the subsequent rapid and accurate determination of the occlusion relationship of the game object. Optionally, if the camera set at the first light source position and the camera set at the second light source position are placed opposite each other, the occupied projection area obtained based on this can provide a more accurate judgment basis for the subsequent determination of the occlusion relationship between the first game object and the second game object.

[0093] Figure 7 A schematic diagram of a structure of a device for determining an occlusion relationship of an object provided in an embodiment of the present invention, wherein the device is suitable for executing a method for determining an occlusion relationship of an object provided in an embodiment of the present invention, such as Figure 7 As shown, the device may specifically include:

[0094] Acquisition module 701 is configured to acquire a line connecting contour points corresponding to a projected area occupied by a first game object and a line connecting contour points corresponding to a projected area occupied by a second game object; wherein the projected area is the projection area of ​​the bottom surface of the corresponding object on the ground when the corresponding object is placed in the game scene, and the line connecting contour points is a line connecting two points on the contour line of the corresponding projected area;

[0095] The determination module 702 is used to determine the occlusion relationship between the first game object and the second game object in the game scene based on the contour point connection line corresponding to the projected area of ​​the first game object and the contour point connection line corresponding to the projected area of ​​the second game object.

[0096] In one embodiment, the method by which the acquisition module 701 determines the contour point connection line corresponding to the projected area occupied by any game object includes:

[0097] Determine the intersection of two different shadows of any game object, and determine the projected area of ​​any game object based on the intersection; determine the line between the two extreme points of the projected area of ​​any game object as the contour point line corresponding to the projected area of ​​any game object.

[0098] In one embodiment, the acquisition module 701 determines the intersection of two different shadows of any game object, and determines the shadowed area of ​​any game object based on the intersection, including:

[0099] Obtain a first depth map obtained by photographing any game object with a camera set at a first light source position in the game scene, determine a first target point on the ground that meets a first preset condition, and form a first shadow point set; the first preset condition includes: a depth value corresponding to a mapping point of the first target point in the first depth map is less than a distance value between the point and the first light source plane; obtain a second depth map obtained by photographing any game object with a camera set at a second light source position in the game scene, determine a second target point on the ground that meets a second preset condition, and form a second shadow point set; the second preset condition includes: a depth value corresponding to a mapping point of the second target point in the second depth map is less than a distance value between the point and the second light source plane; determine an area formed by target points in the intersection of the first shadow point set and the second shadow point set as the projection area occupied by any game object.

[0100] In one embodiment, the device further includes a determination module, which, before obtaining the contour point connection line corresponding to the projected area occupied by the first game object and the contour point connection line corresponding to the projected area occupied by the second game object, is configured to:

[0101] Based on the coordinate data of the first game object and the coordinate data of the second game object, determine whether the first game object and the second game object overlap; if the first game object and the second game object overlap, trigger the execution of the operation of obtaining the contour point connection line corresponding to the projected area occupied by the first game object and the contour point connection line corresponding to the projected area occupied by the second game object.

[0102] In one embodiment, the determination module determines whether the first game object and the second game object overlap based on the coordinate data of the first game object and the coordinate data of the second game object, including:

[0103] Determine a first bounding box of the first game object according to the coordinate data of the first game object, and determine a second bounding box of the second game object according to the coordinate data of the second game object; and determine whether the first game object and the second game object overlap based on the first bounding box and the second bounding box.

[0104] In one embodiment, the determination module 702 is specifically configured to:

[0105] Determine a first common line segment in the horizontal direction on a line connecting contour points corresponding to the projected area of ​​the first game object and a line connecting contour points corresponding to the projected area of ​​the second game object, and a second common line segment in the horizontal direction on a line connecting contour points corresponding to the projected area of ​​the second game object and a line connecting contour points corresponding to the projected area of ​​the first game object; determine an occlusion relationship between the first game object and the second game object in the game scene based on coordinate data of points on the first common line segment and on the second common line segment.

[0106] In one embodiment, the determining module 702 determines the occlusion relationship between the first game object and the second game object in the game scene based on the coordinate data of the points on the first common line segment and the second common line segment, including:

[0107] The occlusion relationship between the first game object and the second game object in the game scene is determined according to the magnitude relationship between the longitudinal axis coordinate value of the midpoint on the first common line segment and the longitudinal axis coordinate value of the midpoint on the second common line segment.

[0108] In one embodiment, the device further includes an interaction module, which, after determining the occlusion relationship between the first game object and the second game object in the game scene, is configured to:

[0109] Saving the relationship data representing the occlusion relationship; and sending the relationship data to the game client, so that the game client renders the dynamic elements running between the first game object and the second game object in the game scene according to the relationship data.

[0110] The device for determining object occlusion relationships provided in an embodiment of the present invention can execute the method for determining object occlusion relationships provided in any embodiment of the present invention, and has corresponding functional modules and beneficial effects of the execution method.

[0111] Figure 8 Schematic diagram of the structure of an electronic device provided for an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0112] like Figure 8As shown, the electronic device 8 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 and a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 8. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0113] Multiple components in electronic device 8 are connected to I / O interface 15, including: an input unit 16, such as a keyboard and mouse; an output unit 17, such as various types of displays and speakers; a storage unit 18, such as a magnetic disk and optical disk; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. Communication unit 19 allows electronic device 8 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunications networks. Processor 11 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 executes the various methods and processes described above, such as the method for determining object occlusion relationships. In some embodiments, the method for determining object occlusion relationships can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 8 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for determining object occlusion relationships described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the method for determining object occlusion relationships in any other appropriate manner (e.g., via firmware).

[0114] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0115] Computer programs for implementing the object occlusion relationship determination method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0116] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0117] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0118] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or front-end components. The components of the system can be interconnected via 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), a blockchain network, and the Internet. A computing system can include clients and servers. The clients and servers are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and establishing a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within a cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and virtual private server (VPS) services.

[0119] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit them here. The above specific implementation methods do not constitute limitations on the scope of protection of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for determining object occlusion relationships, characterized in that: The method comprises: Obtaining a line connecting contour points corresponding to the projected area occupied by the first game object and a line connecting contour points corresponding to the projected area occupied by the second game object; wherein the projected area is the projection area of ​​the bottom surface of the corresponding object on the ground when the corresponding object is placed in the game scene, and the line connecting contour points is a line connecting two points on the contour line of the corresponding projected area; The occlusion relationship between the first game object and the second game object in the game scene is determined based on the contour point connection line corresponding to the projected area occupied by the first game object and the contour point connection line corresponding to the projected area occupied by the second game object.

2. The method according to claim 1, characterized in that The method for determining the contour point connection line corresponding to the projected area occupied by any game object includes: Determine the intersection of two different shadows of any game object, and determine the shadowed area occupied by any game object based on the intersection; The line connecting the two extreme points of the projected area occupied by any game object is determined as the line connecting the contour points corresponding to the projected area occupied by any game object.

3. The method according to claim 2, characterized in that Determining the intersection of two different shadows of any game object, and determining the shadowed area of ​​any game object based on the intersection, includes: Obtain a first depth map obtained by capturing any game object using a camera positioned at a first light source position, and determine a first target point on the ground that satisfies a first preset condition to form a first shadow point set; the first preset condition includes: a depth value corresponding to a mapping point of the first target point in the first depth map is less than a distance between the first target point and the first light source plane; Obtaining a second depth map obtained by photographing the game object with a camera positioned at a second light source position, and determining a second target point on the ground that meets a second preset condition to form a second shadow point set; the second preset condition including: a depth value corresponding to a mapping point of the second target point in the second depth map is less than a distance between the second target point and the second light source plane; The area formed by the target points in the intersection of the first shadow point set and the second shadow point set is determined as the occupied projection area of ​​any game object.

4. The method according to claim 3, characterized in that The camera arranged at the first light source position and the camera arranged at the second light source position are arranged opposite to each other.

5. The method according to claim 2, characterized in that The two extreme points are the left extreme point and the right extreme point of the projected area occupied by any game object, the left extreme point is the point on the contour line of the projected area occupied by any game object with the smallest horizontal axis coordinate value, and the right extreme point is the point on the contour line with the largest horizontal axis coordinate value.

6. The method according to claim 1, characterized in that Before obtaining the contour point connection line corresponding to the projected area occupied by the first game object and the contour point connection line corresponding to the projected area occupied by the second game object, the method further includes: determining whether the first game object and the second game object overlap based on the coordinate data of the first game object and the coordinate data of the second game object; If the first game object and the second game object overlap, an operation of obtaining a line of contour points corresponding to the projected area occupied by the first game object and a line of contour points corresponding to the projected area occupied by the second game object is triggered.

7. The method according to claim 6, characterized in that The determining, based on the coordinate data of the first game object and the coordinate data of the second game object, whether the first game object and the second game object overlap includes: Determine a first bounding box of the first game object according to the coordinate data of the first game object, and determine a second bounding box of the second game object according to the coordinate data of the second game object; It is determined whether the first game object and the second game object overlap based on the first bounding box and the second bounding box.

8. The method according to claim 1, characterized in that The determining, based on a line connecting contour points corresponding to the projected area occupied by the first game object and a line connecting contour points corresponding to the projected area occupied by the second game object, an occlusion relationship between the first game object and the second game object in the game scene includes: Determining a first common line segment in the horizontal direction between a line connecting contour points corresponding to the projected area of ​​the first game object and a line connecting contour points corresponding to the projected area of ​​the second game object, and a second common line segment in the horizontal direction between a line connecting contour points corresponding to the projected area of ​​the second game object and a line connecting contour points corresponding to the projected area of ​​the first game object; The occlusion relationship between the first game object and the second game object in the game scene is determined based on the coordinate data of the points on the first common line segment and the second common line segment.

9. The method according to claim 8, characterized in that The determining, based on the coordinate data of the points on the first common line segment and the second common line segment, the occlusion relationship between the first game object and the second game object in the game scene includes: The occlusion relationship between the first game object and the second game object in the game scene is determined based on the magnitude relationship between the longitudinal axis coordinate value of the midpoint on the first common line segment and the longitudinal axis coordinate value of the midpoint on the second common line segment.

10. The method according to any one of claims 1 to 9, characterized in that After determining the occlusion relationship between the first game object and the second game object in the game scene, the method further includes: Saving the relationship data representing the occlusion relationship; and The relationship data is sent to a game client, so that the game client renders the dynamic elements running between the first game object and the second game object in the game scene according to the relationship data.

11. A device for determining an occlusion relationship of an object, characterized in that: The device comprises: An acquisition module, configured to acquire a line connecting contour points corresponding to a projected area occupied by a first game object, and a line connecting contour points corresponding to a projected area occupied by a second game object; wherein the projected area is the projection area of ​​the bottom surface of the corresponding object on the ground when the corresponding object is placed in the game scene, and the line connecting contour points is a line connecting two points on the contour line of the corresponding projected area; A determination module is used to determine the occlusion relationship between the first game object and the second game object in the game scene based on the contour point connection line corresponding to the projected area occupied by the first game object and the contour point connection line corresponding to the projected area occupied by the second game object.

12. An electronic device, characterized in that: The electronic device comprises: one or more processors; a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining the object occlusion relationship according to any one of claims 1 to 10.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for determining the object occlusion relationship according to any one of claims 1 to 10 is implemented.

14. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the method for determining an occlusion relationship of an object according to any one of claims 1 to 10.

Citation Information

Cited By

  • Special effect positioning display method and device, equipment and medium

    CN121266115A