Scene resource visibility processing methods, devices, electronic devices and storage media
By acquiring a list of bounding spheres and occlusion models, the visibility of virtual models in a game scene is automatically checked based on a ray detection algorithm, solving the problem of low efficiency in manual inspection and improving inspection efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2025-01-03
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, the visibility inspection of scene resources in game scenes mainly relies on manual inspection, which leads to low efficiency, especially in large-scale scenes where the workload is huge.
By acquiring the bounding sphere and occlusion model list in the target 3D scene, sampling is performed based on the bounding sphere to determine the sampling points on the virtual model. The visibility of the virtual model is automatically checked based on the sampling points and the occlusion model list. The visible sampling points are filtered using a ray detection algorithm, and the visibility ratio is statistically analyzed.
It enables automated inspection of occlusion of virtual models in 3D scenes, improving inspection efficiency and accuracy, and facilitating timely adjustments to scene content by artists.
Smart Images

Figure CN119941933B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, electronic device and storage medium for scene resource visibility processing. Background Technology
[0002] Game scenes are one of the main components of a game. In the production of larger scenes, complex scene editing by multiple people is often involved. As the development process iterates, some scene resources are often obscured and cannot be seen.
[0003] In existing technologies, the visibility of various objects in a game scene is mainly checked manually by selecting each object one by one.
[0004] It can be seen that the existing inspection methods mainly rely on manual inspection, which results in low inspection efficiency. Summary of the Invention
[0005] The purpose of this application is to address the shortcomings of the prior art by providing a method, apparatus, electronic device, and storage medium for processing scene resource visibility, which can automatically check the occlusion of virtual models in a 3D scene and improve the inspection effect.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0007] In a first aspect, the present invention provides a method for processing scene resource visibility, the method comprising:
[0008] Obtain the bounding sphere corresponding to the target virtual model in the target 3D scene and the occlusion model list corresponding to the target virtual model. The occlusion model list includes the model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model.
[0009] Based on the bounding sphere, the target virtual model is sampled to determine multiple first-type sampling points located on the target virtual model;
[0010] Based on a plurality of first-type sampling points and the occlusion model list, the number of visible first-type sampling points is determined from the plurality of first-type sampling points, and the visibility of the target virtual model is determined based on the number.
[0011] In a second aspect, the present invention provides a scene resource visibility processing apparatus, comprising:
[0012] The acquisition module is used to acquire the bounding sphere corresponding to the target virtual model in the target 3D scene and the occlusion model list corresponding to the target virtual model. The occlusion model list includes the model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model.
[0013] The determination module is used to sample the target virtual model based on the bounding sphere and determine a plurality of first-type sampling points located on the target virtual model;
[0014] The filtering module is used to determine the number of visible first-type sampling points from the plurality of first-type sampling points and the occlusion model list, and to determine the visibility of the target virtual model based on the number of visible first-type sampling points.
[0015] Thirdly, the present invention provides an electronic device, comprising: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform steps for the visibility of various objects in any of the scenarios described in the foregoing embodiments.
[0016] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs steps related to the visibility of various objects in any of the scenarios described in the foregoing embodiments.
[0017] The beneficial effects of this application are:
[0018] The scene resource visibility processing method, apparatus, electronic device, and storage medium provided in this application embodiment obtain a bounding sphere corresponding to a target virtual model in a target 3D scene and a list of occlusion models corresponding to the target virtual model. The list of occlusion models includes a model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model. Based on the bounding sphere, the target virtual model is sampled to determine multiple first-type sampling points located on the target virtual model. According to the multiple first-type sampling points and the list of occlusion models, the number of visible first-type sampling points is determined from the multiple first-type sampling points, and the visibility of the target virtual model is determined according to the number. This realizes automated inspection of the occlusion of the target virtual model in a 3D scene, improving inspection efficiency. In addition, since the inspection is performed on multiple first-type sampling points uniformly sampled from the target virtual model based on the bounding sphere, the accuracy of the inspection results can be improved. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating a scene resource visibility processing method provided in an embodiment of this application;
[0021] Figure 2 A flowchart illustrating another scenario resource visibility processing method provided in an embodiment of this application;
[0022] Figure 3 A flowchart illustrating another scenario resource visibility processing method provided in an embodiment of this application;
[0023] Figure 4 A flowchart illustrating another scenario resource visibility processing method provided in an embodiment of this application;
[0024] Figure 5 A flowchart illustrating another scenario resource visibility processing method provided in an embodiment of this application;
[0025] Figure 6 A flowchart illustrating another scenario resource visibility processing method provided in an embodiment of this application;
[0026] Figure 7 This is a schematic diagram of the functional modules of a scene resource visibility processing device provided in an embodiment of this application;
[0027] Figure 8 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0029] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0030] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0031] Game scenes are a major component of games, and as development iterates, some scene resources often become obscured and invisible. Current technology primarily involves manually checking the visibility of various objects in a game scene by clicking through each one. However, in large-scale scenes (such as open worlds), there are often tens of thousands of objects, making manual checking extremely labor-intensive. Therefore, existing methods suffer from low efficiency.
[0032] In view of this, embodiments of this application provide a method for processing the visibility of scene resources. This method can automatically check the visibility of each virtual model in the scene, thereby facilitating artists to adjust the scene content in a timely manner and maintain the simplicity of the scene content.
[0033] Figure 1 This is a flowchart illustrating a scene resource visibility processing method provided in an embodiment of this application. The execution subject of this method can be an electronic device capable of processing scene resources in a 3D scene, such as a computer, server, or processor, and is not limited thereto. Optionally, the method provided in this embodiment can be embedded in 3D software during processing, and is not limited thereto.
[0034] Optionally, taking a game scene as an example, the method of this application can be applied to the following processing scenarios: For instance, after iterating scene resources, newly added scene resources may obscure older scene resources, preventing players from seeing the older resources during actual gameplay. In this case, the visibility of scene resources in the game scene should be analyzed to remove old, redundant scene resources. Alternatively, during the collaborative development of scene resources by multiple developers, the editing process by different artists may result in mutually obscuring scene resources. In this case, the visibility of scene resources can be analyzed to remove obscuring scene resources. It should be noted that the application scenarios of this method are not limited to game scenes, nor are they limited to specific processing scenarios.
[0035] like Figure 1 As shown, the method includes:
[0036] Step 101: Obtain the bounding sphere corresponding to the target virtual model in the target 3D scene and the list of occlusion models corresponding to the target virtual model.
[0037] The occlusion model list includes the model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model. The target 3D scene includes: the target virtual model and at least one other virtual model.
[0038] The target virtual model can be a virtual 3D model corresponding to any virtual object in the target 3D scene. Optionally, the target virtual object can be a virtual character, virtual building, virtual tree, virtual vehicle, virtual weapon, etc., which is not limited here.
[0039] The bounding sphere corresponding to the target virtual model is the sphere used to enclose the target virtual model. Optionally, the bounding sphere can be determined based on the farthest point algorithm, the centroid algorithm, etc., without limitation here. It can be flexibly selected according to the actual application scenario.
[0040] The list of occlusion models corresponding to the target virtual model can be determined by calculating the positional relationship between the target virtual model and other virtual models. This list of occlusion models may include the model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model. It should be noted that this application does not limit the occlusion percentage; it can be 1%, 20%, 98%, etc., and is not limited thereto. Of course, this application does not limit the number of occlusion virtual models; it may include one or more depending on the actual application scenario.
[0041] Step 102: Sample the target virtual model based on the bounding sphere to determine multiple first-class sampling points located on the target virtual model.
[0042] The bounding sphere corresponding to the target virtual model serves as a sphere used to enclose the target virtual model. Optionally, sampling of the target virtual model can be based on the bounding sphere to obtain multiple first-type sampling points located on the target virtual model.
[0043] Of course, this application does not limit the number of first-type sampling points. Optionally, the first-type sampling points may include thousands, for example, one thousand, without limitation.
[0044] It is understandable that, due to the uniform distribution of the bounding spheres, uniform sampling can be achieved when sampling the target virtual model based on the bounding spheres, thereby improving the accuracy of determining the visibility of the target virtual model.
[0045] Step 103: Based on the multiple first-class sampling points and the occlusion model list, determine the number of visible first-class sampling points from the multiple first-class sampling points, and determine the visibility of the target virtual model based on the number.
[0046] Among them, occluded sampling points are sampling points in the target virtual model that are not visible to the user. In contrast, visible sampling points are sampling points in the target virtual model that are visible to the user. It can be understood that if the target virtual model is occluded by other virtual models, the first type of sampling points at the occluded position will be invisible.
[0047] Optionally, based on the determined multiple first-class sampling points, the relationship between each first-class sampling point and each occlusion model indicated by the occlusion model list can be determined using a ray detection algorithm, thereby determining the number of visible first-class sampling points; and based on this number, the visibility of the target virtual model can be determined.
[0048] The visibility of the target virtual model indicates the proportion of the target virtual model that is visible. Understandably, a higher proportion indicates that less of the target virtual model is occluded, while a lower proportion indicates that more of the target virtual model is occluded.
[0049] In summary, this application provides a method for processing scene resource visibility. The method includes: obtaining a bounding sphere corresponding to a target virtual model in a target 3D scene and a list of occlusion models corresponding to the target virtual model, the occlusion model list including a model identifier corresponding to at least one occlusion virtual model occluding the target virtual model; sampling the target virtual model based on the bounding sphere to determine multiple first-type sampling points located on the target virtual model; determining the number of visible first-type sampling points from the multiple first-type sampling points according to the multiple first-type sampling points and the occlusion model list, and determining the visibility of the target virtual model based on the number. This achieves automated inspection of the occlusion status of the target virtual model in a 3D scene, improving inspection efficiency. Furthermore, since the inspection is performed on multiple first-type sampling points uniformly sampled from the target virtual model based on the bounding sphere, the accuracy of the inspection results can be improved.
[0050] In an optional implementation, determining the number of visible first-type sampling points from the plurality of first-type sampling points based on the plurality of first-type sampling points and the occlusion model list includes: determining the number of visible first-type sampling points from the plurality of first-type sampling points based on the first normal direction corresponding to each first-type sampling point and the first triangular face corresponding to each occlusion virtual model indicated by the occlusion model list.
[0051] The occlusion model list may include: model identifiers corresponding to one or more occlusion virtual models, and the number of occlusion virtual models is not limited here.
[0052] Optionally, when performing the screening, rays can be emitted along the first normal direction corresponding to the second triangular face of the target virtual model where each first-type sampling point is located; based on the collision between the emitted rays and the first triangular face corresponding to each occluded virtual model, visible sampling points can be determined, and the number of visible first-type sampling points can be counted.
[0053] Figure 2 This is a flowchart illustrating another scenario resource visibility processing method provided in an embodiment of this application. In optional implementations, such as... Figure 2As shown, the above method of determining the number of visible first-class sampling points from multiple first-class sampling points based on the first normal direction corresponding to each first-class sampling point and the first triangular face corresponding to each occlusion virtual model indicated by the occlusion model list includes:
[0054] Step 201: Select and identify suspected visible sampling points from the first type of sampling points.
[0055] Among them, the suspected visible sampling points are sampling points in the target virtual model that are suspected to be visible to the user. Optionally, the determination of suspected visible sampling points can be based on a ray detection algorithm, according to the intersection of the rays emitted by the first type of sampling points with the ground components in the target 3D scene.
[0056] Step 202: For each suspected visible sampling point, emit a first ray along the first normal direction of the front face of the second triangular face of the target virtual model where the suspected visible sampling point is located, and determine whether the first ray intersects with the back face of each first triangular face corresponding to each occluded virtual model.
[0057] In this context, the back faces of each of the first triangular faces are opposite to the user, meaning they are invisible to the user, and the length of the first ray is determined by the radius of the enclosing sphere corresponding to the target virtual model.
[0058] It is understandable that each virtual model in the target 3D scene can be obtained by combining multiple triangular faces. In addition, in order to avoid the first ray intersecting with other non-occluded virtual models and affecting the judgment result, the length of the first ray can be set according to the radius of the bounding sphere corresponding to the target virtual model. For example, if the radius of the bounding sphere corresponding to the target virtual model is R and the length of the first ray is L, then L = R × A, where A is a preset constant, and its value can be determined based on empirical values, such as 8, 10, etc., which are not limited here.
[0059] Based on the above explanation, it can be understood that the emission direction of the first ray corresponding to each suspected visible sampling point is parallel to the first normal direction of the front face of the second triangular face of the target virtual model. Here, the first normal direction is also the normal direction of the front face of the back face of each first triangular face.
[0060] Optionally, the following method can be used to determine whether each first ray intersects with the back face of each first triangular face corresponding to each occlusion virtual model:
[0061] For example, for the j-th suspected visible sampling point VP j N1 j Indicates VP j Along the direction of the first normal to the front face of the second triangular face of the target virtual model, N2 j_mThis represents the face normal corresponding to the back face of the k-th first triangle face of the m-th occlusion virtual model in the occlusion model list. If N1 j ·N2 j_m_k If >0, it means VP j The first ray corresponding to the m-th occlusion virtual model intersects with the back face of the k-th first triangle; otherwise, no intersection occurs. It should be noted that the specific judgment method is not limited to this.
[0062] Step 203: If none exist, determine each suspected visible sampling point as a visible first-class sampling point, and count the number of visible first-class sampling points.
[0063] If the first ray corresponding to a suspected visible sampling point intersects with the back face of each first triangular face corresponding to each occlusion virtual model (i.e., hits the back face), then the suspected visible sampling point is an occlusion sampling point; otherwise, the suspected visible sampling point is a visible first-class sampling point. By counting the visible sampling points, the number of visible first-class sampling points can be obtained.
[0064] To illustrate with the above calculation formula, optionally, if the suspected visible sampling point VP... j If the first ray intersects with the back face of any triangle corresponding to the m-th occlusion virtual model, then the VP is determined. j To occlude sampling points; otherwise, the VP j These are the visible sampling points.
[0065] Figure 3 This is a flowchart illustrating another scenario resource visibility processing method provided in an embodiment of this application. In optional implementations, such as... Figure 3 As shown, the above-mentioned screening of suspected visible sampling points from the first type of sampling points includes:
[0066] Step 301: Using the first type of sampling point as the emission starting point, emit the second ray along the positive direction of the third coordinate axis in the enclosing spherical coordinate system.
[0067] The origin of the bounding sphere coordinate system is located at the center of the bounding sphere, and the third coordinate axis is perpendicular to the virtual ground in the target 3D scene.
[0068] Furthermore, it should be noted that the bounding spherical coordinate system consists of a first coordinate axis, a second coordinate axis, and a third coordinate axis that are perpendicular to each other, and it can be set based on a left-handed coordinate system. Optionally, the plane enclosed by the first and second coordinate axes is parallel to the virtual ground in the target 3D scene; the third coordinate axis is perpendicular to the virtual ground in the target 3D scene.
[0069] Optionally, for each first-class sampling point, the starting point of the second ray can be the first-class sampling point, and it is emitted along the positive direction of the third coordinate axis (that is, parallel to the third coordinate axis in the enclosing spherical coordinate system).
[0070] Step 302: If the second ray does not intersect with the ground components in the target 3D scene, then mark the first type of sampling point as a suspected visible sampling point.
[0071] In this context, the ground component in the target 3D scene is used to manage scene resources within its coverage area (i.e., the area visible and interactive to the player). When a second ray is emitted along the positive direction of the third coordinate axis (i.e., towards the virtual sky) and hits the ground component (i.e., there is an intersection with the ground component), it indicates that the position of the first type of sampling point corresponding to the second ray is below the ground level, that is, the first type of sampling point is below the virtual ground and is an occluded sampling point. If there is no intersection, it indicates that the position of the first type of sampling point corresponding to the second ray is above the ground level, that is, the first type of sampling point is on the virtual ground and is a suspected visible sampling point.
[0072] It is understood that by applying the embodiments of this application, the first type of sampling points located under the virtual ground in the target 3D scene can be initially filtered out by emitting a second ray, thereby improving the accuracy when determining the visibility of the target virtual model.
[0073] In an optional implementation, obtaining the bounding sphere corresponding to the target virtual model in the target 3D scene includes:
[0074] Based on the target bounding box corresponding to the target virtual model, calculate the bounding sphere with the same center as the target bounding box. The radius of the bounding sphere is determined based on the coordinate positions of each vertex in the target bounding box.
[0075] Optionally, the target bounding box can be an axis-aligned rectangle used to enclose the target virtual model, and the axis of the target bounding box is always aligned with the world coordinate axis regardless of how the target virtual model is rotated.
[0076] After determining the target bounding box, the center of the target bounding box can be used as the center of the bounding sphere, and the radius of the bounding sphere can be determined according to the coordinate positions of each vertex in the target bounding box.
[0077] In some embodiments, the radius of the enclosing sphere can be determined according to the following method:
[0078] Calculate the maximum (e.g., Xmax, Ymax, Zmax) and minimum (e.g., Xmin, Ymin, Zmin) values of each vertex in the target bounding box along each coordinate axis; based on the maximum and minimum values of each vertex along each coordinate axis, calculate the span of the target bounding box along each coordinate axis (denoted as ΔX, ΔY, ΔZ); based on the span of the target bounding box along each coordinate axis, calculate the radius of the bounding sphere. Optionally, the radius of the bounding sphere can be calculated using the following formula: R = sqrt(ΔX × ΔX + ΔY × ΔY + ΔZ × ΔZ).
[0079] Optionally, the above sampling of the target virtual model based on the bounding sphere to determine multiple first-type sampling points located on the target virtual model includes:
[0080] Based on the preset number of sampling points, the bounding sphere is sampled to determine multiple second-type sampling points located on the bounding sphere; based on the multiple second-type sampling points, multiple first-type sampling points located on the target virtual model are determined.
[0081] Based on their location, the sampling points can be divided into first-class sampling points and second-class sampling points. Second-class sampling points, which are sampling points located on the bounding sphere, can be obtained by sampling the bounding sphere. First-class sampling points, which are sampling points located on the target virtual model, can be determined based on multiple second-class sampling points. Specifically, they can be determined based on the second-class sampling points by emitting rays into the target virtual model.
[0082] Optionally, the number of the first type of sampling points may be less than or equal to the number of the second type of sampling points. Of course, this application does not limit the number of the second type of sampling points. Optionally, the second type of sampling points may include thousands, for example, one thousand, and this is not limited here.
[0083] It is understandable that, due to the uniform distribution of the bounding sphere, uniform sampling can be achieved when multiple second-type sampling points are obtained based on the bounding sphere. Furthermore, when multiple first-type sampling points are determined on the target virtual model based on these multiple second-type sampling points, uniform sampling of the target virtual model can be achieved. Consequently, the accuracy can be improved when determining the visibility of the target virtual model based on this.
[0084] Accordingly, the above-mentioned determination of the visibility of the target virtual model based on quantity includes: determining the visibility of the target virtual model based on the proportion of quantity in the total number of sampling points corresponding to multiple second-type sampling points.
[0085] Optionally, after determining the number of visible first-class sampling points from multiple first-class sampling points, the proportion of this number to the total number of sampling points corresponding to multiple second-class sampling points can be calculated to determine the visibility of the target virtual model.
[0086] The calculated percentage can be any value between 0 and 1. It can be understood that if the percentage is higher, it means that the target virtual model is less occluded and has higher visibility. If the percentage is lower, it means that the target virtual model is more occluded and has lower visibility.
[0087] Figure 4 This is a flowchart illustrating another scenario resource visibility processing method provided in an embodiment of this application. In optional implementations, such as... Figure 4 As shown, the above sampling of the target virtual model based on the bounding sphere determines multiple first-type sampling points located on the target virtual model, including:
[0088] Step 401: Determine the coordinate position of each second type of sampling point in the bounding spherical coordinate system according to the preset number of sampling points.
[0089] The number of second-type sampling points is equal to the preset number of sampling points. Optionally, the position of each second-type sampling point on the bounding sphere can be randomly determined, or determined using a preset algorithm; this is not limited here.
[0090] The bounding sphere coordinate system consists of a first coordinate axis, a second coordinate axis, and a third coordinate axis that are perpendicular to each other. Optionally, the origin of the bounding sphere coordinate system can be set at the center of the bounding sphere. Then, the coordinate position of each second type of sampling point in the bounding sphere coordinate system can be determined based on the position of each second type of sampling point on the bounding sphere.
[0091] Step 402: Determine the third ray corresponding to each second-type sampling point based on the coordinate position of each second-type sampling point in the bounding spherical coordinate system.
[0092] Among them, the third ray corresponding to each second type of sampling point passes through the center of the enclosing sphere and each second type of sampling point.
[0093] Step 403: Starting from each second-type sampling point, emit each third ray. Based on the intersection of each third ray with the target virtual model, determine each first-type sampling point corresponding to each second-type sampling point.
[0094] After obtaining each second-type sampling point located on the bounding sphere, each second-type sampling point can be used as the starting point for the emission of the third ray. The third ray is emitted through the center of the bounding sphere, and the intersection of the third ray with the triangular face of the target virtual model surface is taken as the first-type sampling point corresponding to each second-type sampling point.
[0095] It is understandable that the number of the first type of sampling points can be less than or equal to the number of the second type of sampling points.
[0096] It should be noted that, in the actual implementation, the third ray equation corresponding to each third ray can also be constructed based on the center of the enclosing sphere and each second type of sampling point, and the intersection point between each third device and the target virtual model can be determined through each third ray equation.
[0097] Figure 5 This is a flowchart illustrating another scene resource visibility processing method provided in an embodiment of this application. In an optional implementation, the bounding spherical coordinate system consists of a first coordinate axis, a second coordinate axis, and a third coordinate axis that are perpendicular to each other.
[0098] In alternative implementations, such as Figure 5 As shown, the above determination of the coordinate position of each second type of sampling point in the bounding spherical coordinate system based on the preset number of sampling points includes:
[0099] Step 501: Determine the value of each second type of sampling point on the first coordinate axis according to the preset number of sampling points.
[0100] Step 502: Based on the values of each second-type sampling point on the first coordinate axis and the radius of the enclosing sphere, determine the values of each second-type sampling point on the second coordinate axis and the third coordinate axis respectively.
[0101] Optionally, when determining the specific sampling points, let n be the preset number of sampling points and i be the sampling sequence number. Then, the coordinate position of the i-th second-type sampling point (xi, yi, zi) in the bounding spherical coordinate system can be calculated using the following method:
[0102] Z i = 1 - (1 / (i-1)) × 2
[0103] X i =cos(Phi×i)×sqrt(1-Z×Z)
[0104] Y i = sin(Phi×i)×sqrt(1-Z×Z)
[0105] Among them, Z i X represents the normalized value of the i-th second-class sampling point (xi, yi, zi) along the third coordinate axis in the bounding spherical coordinate system. i Y represents the normalized value of the i-th second-type sampling point (xi, yi, zi) along the first coordinate axis in the bounding spherical coordinate system. i denoted as the normalized value of the i-th second-class sampling point (xi, yi, zi) in the direction of the second coordinate axis in the bounding spherical coordinate system; Phi represents the constant representing the golden angle, Phi = Pi × (3 - sqrt(5)), sqrt() represents the square root function, Pi represents the constant of π, cos() represents the cosine function, and sin represents the sine function.
[0106] It should be noted that if the radius of the enclosing sphere is R, then xi = X i ×R, yi=Y i ×R, zi=Z i ×R. It should be noted, of course, that the method for determining the coordinate positions of each second-type sampling point in the enclosing spherical coordinate system is not limited to this. Furthermore, it can be understood that the more preset sampling points there are, the higher the corresponding calculation accuracy and the more accurate the inspection results. Optionally, the preset number of sampling points can be flexibly set according to the actual application scenario.
[0107] Figure 6 This is a flowchart illustrating another scenario resource visibility processing method provided in an embodiment of this application. In optional implementations, such as... Figure 6 As shown, the list of occlusion models corresponding to the target virtual model in the target 3D scene obtained above includes:
[0108] Step 601: Calculate the bounding box corresponding to each virtual model in the target 3D scene.
[0109] Step 602: Determine the list of occlusion models corresponding to the target virtual model based on the positional relationship between the bounding boxes of the target virtual model and the other virtual models.
[0110] The determination of the bounding box corresponding to each virtual model can be found in the aforementioned process for determining the bounding box corresponding to each virtual model, and will not be repeated here.
[0111] After calculating the bounding boxes corresponding to each virtual model in the target 3D scene, for the target virtual model, the list of occlusion models corresponding to the target virtual model can be determined based on the intersection of the target bounding box with the bounding boxes corresponding to other virtual models.
[0112] It is understandable that if the bounding box of another virtual model intersects with the target bounding box, the model identifier of that other virtual model is added to the occlusion model list.
[0113] Figure 7 This is a functional module diagram of a scene resource visibility processing device provided in an embodiment of this application. The basic principle and technical effects of this device are the same as those of the corresponding method embodiments described above. For the sake of brevity, parts not mentioned in this embodiment can be referred to the corresponding content in the method embodiments.
[0114] like Figure 7 As shown, the scene resource visibility processing device 100 includes:
[0115] The acquisition module 110 is used to acquire the bounding sphere corresponding to the target virtual model in the target 3D scene and the occlusion model list corresponding to the target virtual model. The occlusion model list includes the model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model.
[0116] The determining module 120 is used to sample the target virtual model based on the bounding sphere and determine a plurality of first-type sampling points located on the target virtual model;
[0117] The filtering module 130 is used to determine the number of visible first-type sampling points from the plurality of first-type sampling points and the occlusion model list, and to determine the visibility of the target virtual model based on the number of visible first-type sampling points.
[0118] In an optional implementation, the filtering module 130 is specifically used to determine the number of visible first-type sampling points from the plurality of first-type sampling points based on the first normal direction corresponding to each of the first-type sampling points and the first triangular face corresponding to each of the occlusion virtual models indicated by the occlusion model list.
[0119] In an optional implementation, the filtering module 130 is specifically used to filter suspected visible sampling points from the first type of sampling points;
[0120] For each of the suspected visible sampling points, a first ray is emitted along the first normal direction of the front face of the second triangular face of the target virtual model where the suspected visible sampling point is located. It is determined whether the first ray intersects with the back face of each of the first triangular faces corresponding to each of the occluded virtual models. The back face of each of the first triangular faces is not visible. The length of the first ray is determined according to the radius of the bounding sphere corresponding to the target virtual model.
[0121] If none exist, then each of the suspected visible sampling points is determined to be a visible first-class sampling point, and the number of visible first-class sampling points is counted.
[0122] In an optional implementation, the filtering module 130 is specifically used to take the first type of sampling point as the emission starting point and emit a second ray along the positive direction of the third coordinate axis in the bounding sphere coordinate system, wherein the origin of the bounding sphere coordinate system is located at the center of the bounding sphere, and the third coordinate axis is perpendicular to the virtual ground in the target three-dimensional scene;
[0123] If the second ray does not intersect with the ground components in the target 3D scene, then the first type of sampling point is marked as a suspected visible sampling point.
[0124] In an optional implementation, the acquisition module 110 is specifically used to calculate a bounding sphere with the same center as the target bounding box based on the target bounding box corresponding to the target virtual model, wherein the radius of the bounding sphere is determined based on the coordinate positions of each vertex in the target bounding box.
[0125] In an optional implementation, the determining module 120 is specifically used to sample the enclosing sphere according to a preset number of sampling points to determine a plurality of second-type sampling points located on the enclosing sphere;
[0126] Based on the multiple second-type sampling points, determine multiple first-type sampling points located on the target virtual model;
[0127] The filtering module 130 is specifically used to include:
[0128] The visibility of the target virtual model is determined based on the proportion of the quantity in the total number of sampling points corresponding to multiple second-type sampling points.
[0129] In an optional implementation, the determining module 120 is specifically used to determine the coordinate position of each second type of sampling point in the enclosing spherical coordinate system according to a preset number of sampling points;
[0130] Based on the coordinate positions of each second type of sampling point in the bounding sphere coordinate system, the third ray corresponding to each second type of sampling point is determined, wherein the third ray corresponding to each second type of sampling point passes through the center of the bounding sphere and each second type of sampling point;
[0131] Starting from each of the second type of sampling points, each of the third rays is emitted, and the first type of sampling points corresponding to each of the second type of sampling points are determined based on the intersection of each of the third rays with the target virtual model.
[0132] In an optional implementation, the bounding spherical coordinate system is composed of a first coordinate axis, a second coordinate axis, and a third coordinate axis that are perpendicular to each other. The determining module 120 is specifically used to determine the value of each second type of sampling point on the first coordinate axis according to a preset number of sampling points.
[0133] Based on the values of each second-type sampling point on the first coordinate axis and the radius of the enclosing sphere, the values of each second-type sampling point on the second coordinate axis and the third coordinate axis are determined respectively.
[0134] In an optional implementation, the acquisition module 110 is specifically used to calculate the bounding box corresponding to each virtual model in the target 3D scene;
[0135] Based on the positional relationship between the target virtual model and the bounding boxes corresponding to other virtual models, a list of occlusion models corresponding to the target virtual model is determined.
[0136] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.
[0137] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).
[0138] Figure 8 This is a schematic diagram of an electronic device provided in an embodiment of this application. This electronic device can be integrated into the aforementioned scene resource visibility processing device. For example... Figure 8 As shown, the electronic device may include a processor 210, a storage medium 220, and a bus 230. The storage medium 220 stores machine-readable instructions executable by the processor 210. When the electronic device is running, the processor 210 communicates with the storage medium 220 via the bus 230. The processor 210 executes the machine-readable instructions to perform the steps of the following method embodiment:
[0139] Obtain the bounding sphere corresponding to the target virtual model in the target 3D scene and the occlusion model list corresponding to the target virtual model. The occlusion model list includes the model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model.
[0140] Based on the bounding sphere, the target virtual model is sampled to determine multiple first-type sampling points located on the target virtual model;
[0141] Based on a plurality of first-type sampling points and the occlusion model list, the number of visible first-type sampling points is determined from the plurality of first-type sampling points, and the visibility of the target virtual model is determined based on the number.
[0142] In an optional implementation, determining the number of visible first-type sampling points from the plurality of first-type sampling points based on the plurality of first-type sampling points and the occlusion model list includes:
[0143] Based on the first normal direction corresponding to each of the first type of sampling points and the first triangular face corresponding to each of the occlusion virtual models indicated by the occlusion model list, the number of visible first type of sampling points is determined from the plurality of first type of sampling points.
[0144] In an optional implementation, determining the number of visible first-type sampling points from the plurality of first-type sampling points based on the first normal direction corresponding to each of the first-type sampling points and the first triangular face corresponding to each of the occlusion virtual models indicated by the occlusion model list includes:
[0145] Select potentially visible sampling points from the first type of sampling points;
[0146] For each of the suspected visible sampling points, a first ray is emitted along the first normal direction of the front face of the second triangular face of the target virtual model where the suspected visible sampling point is located. It is determined whether the first ray intersects with the back face of each of the first triangular faces corresponding to each of the occluded virtual models. The back face of each of the first triangular faces is not visible. The length of the first ray is determined according to the radius of the bounding sphere corresponding to the target virtual model.
[0147] If none exist, then each of the suspected visible sampling points is determined to be a visible first-class sampling point, and the number of visible first-class sampling points is counted.
[0148] In an optional implementation, the step of filtering suspected visible sampling points from the first type of sampling points includes:
[0149] Using the first type of sampling point as the emission starting point, a second ray is emitted along the positive direction of the third coordinate axis in the bounding sphere coordinate system, wherein the origin of the bounding sphere coordinate system is located at the center of the bounding sphere, and the third coordinate axis is perpendicular to the virtual ground in the target three-dimensional scene;
[0150] If the second ray does not intersect with the ground components in the target 3D scene, then the first type of sampling point is marked as a suspected visible sampling point.
[0151] In an optional implementation, obtaining the bounding sphere corresponding to the target virtual model in the target 3D scene includes:
[0152] Based on the target bounding box corresponding to the target virtual model, calculate a bounding sphere with the same center as the target bounding box, wherein the radius of the bounding sphere is determined according to the coordinate positions of each vertex in the target bounding box.
[0153] In an optional implementation, the step of sampling the target virtual model based on the bounding sphere to determine a plurality of first-type sampling points located on the target virtual model includes:
[0154] Based on a preset number of sampling points, the bounding sphere is sampled to determine multiple second-type sampling points located on the bounding sphere;
[0155] Based on the multiple second-type sampling points, determine multiple first-type sampling points located on the target virtual model;
[0156] Determining the visibility of the target virtual model based on the quantity includes:
[0157] The visibility of the target virtual model is determined based on the proportion of the quantity in the total number of sampling points corresponding to multiple second-type sampling points.
[0158] In an optional implementation, the step of sampling the target virtual model based on the bounding sphere to determine a plurality of first-type sampling points located on the target virtual model includes:
[0159] Based on the preset number of sampling points, determine the coordinate position of each second type of sampling point in the bounding spherical coordinate system;
[0160] Based on the coordinate positions of each second type of sampling point in the bounding sphere coordinate system, the third ray corresponding to each second type of sampling point is determined, wherein the third ray corresponding to each second type of sampling point passes through the center of the bounding sphere and each second type of sampling point;
[0161] Starting from each of the second type of sampling points, each of the third rays is emitted, and the first type of sampling points corresponding to each of the second type of sampling points are determined based on the intersection of each of the third rays with the target virtual model.
[0162] In an optional implementation, the bounding spherical coordinate system is composed of a first coordinate axis, a second coordinate axis, and a third coordinate axis that are perpendicular to each other. The step of determining the coordinate position of each second type of sampling point in the bounding spherical coordinate system according to a preset number of sampling points includes:
[0163] Based on the preset number of sampling points, determine the value of each second type of sampling point on the first coordinate axis;
[0164] Based on the values of each second-type sampling point on the first coordinate axis and the radius of the enclosing sphere, the values of each second-type sampling point on the second coordinate axis and the third coordinate axis are determined respectively.
[0165] In an optional implementation, obtaining the list of occlusion models corresponding to the target virtual model in the target 3D scene includes:
[0166] Calculate the bounding box corresponding to each virtual model in the target 3D scene;
[0167] Based on the positional relationship between the target virtual model and the bounding boxes corresponding to other virtual models, a list of occlusion models corresponding to the target virtual model is determined.
[0168] The specific implementation methods and technical effects of the above-described method embodiments are similar to those described above, and will not be repeated here.
[0169] Optionally, this application also provides a storage medium storing a computer program, which, when run by a processor, executes the steps of the following method embodiments:
[0170] Obtain the bounding sphere corresponding to the target virtual model in the target 3D scene and the occlusion model list corresponding to the target virtual model. The occlusion model list includes the model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model.
[0171] Based on the bounding sphere, the target virtual model is sampled to determine multiple first-type sampling points located on the target virtual model;
[0172] Based on a plurality of first-type sampling points and the occlusion model list, the number of visible first-type sampling points is determined from the plurality of first-type sampling points, and the visibility of the target virtual model is determined based on the number.
[0173] In an optional implementation, determining the number of visible first-type sampling points from the plurality of first-type sampling points based on the plurality of first-type sampling points and the occlusion model list includes:
[0174] Based on the first normal direction corresponding to each of the first type of sampling points and the first triangular face corresponding to each of the occlusion virtual models indicated by the occlusion model list, the number of visible first type of sampling points is determined from the plurality of first type of sampling points.
[0175] In an optional implementation, determining the number of visible first-type sampling points from the plurality of first-type sampling points based on the first normal direction corresponding to each of the first-type sampling points and the first triangular face corresponding to each of the occlusion virtual models indicated by the occlusion model list includes:
[0176] Select potentially visible sampling points from the first type of sampling points;
[0177] For each of the suspected visible sampling points, a first ray is emitted along the first normal direction of the front face of the second triangular face of the target virtual model where the suspected visible sampling point is located. It is determined whether the first ray intersects with the back face of each of the first triangular faces corresponding to each of the occluded virtual models. The back face of each of the first triangular faces is not visible. The length of the first ray is determined according to the radius of the bounding sphere corresponding to the target virtual model.
[0178] If none exist, then each of the suspected visible sampling points is determined to be a visible first-class sampling point, and the number of visible first-class sampling points is counted.
[0179] In an optional implementation, the step of filtering suspected visible sampling points from the first type of sampling points includes:
[0180] Using the first type of sampling point as the emission starting point, a second ray is emitted along the positive direction of the third coordinate axis in the bounding sphere coordinate system, wherein the origin of the bounding sphere coordinate system is located at the center of the bounding sphere, and the third coordinate axis is perpendicular to the virtual ground in the target three-dimensional scene;
[0181] If the second ray does not intersect with the ground components in the target 3D scene, then the first type of sampling point is marked as a suspected visible sampling point.
[0182] In an optional implementation, obtaining the bounding sphere corresponding to the target virtual model in the target 3D scene includes:
[0183] Based on the target bounding box corresponding to the target virtual model, calculate a bounding sphere with the same center as the target bounding box, wherein the radius of the bounding sphere is determined according to the coordinate positions of each vertex in the target bounding box.
[0184] In an optional implementation, the step of sampling the target virtual model based on the bounding sphere to determine a plurality of first-type sampling points located on the target virtual model includes:
[0185] Based on a preset number of sampling points, the bounding sphere is sampled to determine multiple second-type sampling points located on the bounding sphere;
[0186] Based on the multiple second-type sampling points, determine multiple first-type sampling points located on the target virtual model;
[0187] Determining the visibility of the target virtual model based on the quantity includes:
[0188] The visibility of the target virtual model is determined based on the proportion of the quantity in the total number of sampling points corresponding to multiple second-type sampling points.
[0189] In an optional implementation, the step of sampling the target virtual model based on the bounding sphere to determine a plurality of first-type sampling points located on the target virtual model includes:
[0190] Based on the preset number of sampling points, determine the coordinate position of each second type of sampling point in the bounding spherical coordinate system;
[0191] Based on the coordinate positions of each second type of sampling point in the bounding sphere coordinate system, the third ray corresponding to each second type of sampling point is determined, wherein the third ray corresponding to each second type of sampling point passes through the center of the bounding sphere and each second type of sampling point;
[0192] Starting from each of the second type of sampling points, each of the third rays is emitted, and the first type of sampling points corresponding to each of the second type of sampling points are determined based on the intersection of each of the third rays with the target virtual model.
[0193] In an optional implementation, the bounding spherical coordinate system is composed of a first coordinate axis, a second coordinate axis, and a third coordinate axis that are perpendicular to each other. The step of determining the coordinate position of each second type of sampling point in the bounding spherical coordinate system according to a preset number of sampling points includes:
[0194] Based on the preset number of sampling points, determine the value of each second type of sampling point on the first coordinate axis;
[0195] Based on the values of each second-type sampling point on the first coordinate axis and the radius of the enclosing sphere, the values of each second-type sampling point on the second coordinate axis and the third coordinate axis are determined respectively.
[0196] In an optional implementation, obtaining the list of occlusion models corresponding to the target virtual model in the target 3D scene includes:
[0197] Calculate the bounding box corresponding to each virtual model in the target 3D scene;
[0198] Based on the positional relationship between the target virtual model and the bounding boxes corresponding to other virtual models, a list of occlusion models corresponding to the target virtual model is determined.
[0199] The specific implementation methods and technical effects of the above-described method embodiments are similar to those described above, and will not be repeated here.
[0200] Optionally, this application also provides a computer program product, which includes instructions that, when executed on an electronic device, cause the electronic device to perform the steps of the above-described method embodiments.
[0201] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0202] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0203] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.
[0204] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0205] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0206] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need further definition and explanation in subsequent figures. The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for handling scene resource visibility, characterized in that, The method includes: Obtain the bounding sphere corresponding to the target virtual model in the target 3D scene and the occlusion model list corresponding to the target virtual model. The occlusion model list includes the model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model. Based on the bounding sphere, the target virtual model is sampled to determine multiple first-type sampling points located on the target virtual model; Based on a plurality of first-type sampling points and the occlusion model list, the number of visible first-type sampling points is determined from the plurality of first-type sampling points, and the visibility of the target virtual model is determined based on the number; The step of sampling the target virtual model based on the bounding sphere to determine multiple first-type sampling points located on the target virtual model includes: Based on a preset number of sampling points, the bounding sphere is sampled to determine multiple second-type sampling points located on the bounding sphere; Based on the multiple second-type sampling points, determine multiple first-type sampling points located on the target virtual model; The step of determining multiple first-type sampling points located on the target virtual model based on multiple second-type sampling points includes: Starting from each of the second type of sampling points, a corresponding third ray is emitted. Based on the intersection of each third ray with the target virtual model, each of the first type of sampling points corresponding to each of the second type of sampling points is determined. The third ray corresponding to each of the second type of sampling points passes through the center of the enclosing sphere and each of the second type of sampling points.
2. The method according to claim 1, characterized in that, The step of determining the number of visible first-type sampling points from the plurality of first-type sampling points based on the plurality of first-type sampling points and the occlusion model list includes: Based on the first normal direction corresponding to each of the first type of sampling points and the first triangular face corresponding to each of the occlusion virtual models indicated by the occlusion model list, the number of visible first type of sampling points is determined from the plurality of first type of sampling points.
3. The method according to claim 2, characterized in that, The step of determining the number of visible first-type sampling points from the plurality of first-type sampling points based on the first normal direction corresponding to each of the first-type sampling points and the first triangular face corresponding to each of the occlusion virtual models indicated by the occlusion model list includes: Select potentially visible sampling points from the first type of sampling points; For each of the suspected visible sampling points, a first ray is emitted along the first normal direction of the front face of the second triangular face of the target virtual model where the suspected visible sampling point is located. It is determined whether the first ray intersects with the back face of each of the first triangular faces corresponding to each of the occluded virtual models. The back face of each of the first triangular faces is not visible. The length of the first ray is determined according to the radius of the bounding sphere corresponding to the target virtual model. If none exist, then each of the suspected visible sampling points is determined to be a visible first-class sampling point, and the number of visible first-class sampling points is counted.
4. The method according to claim 3, characterized in that, The step of filtering suspected visible sampling points from the first type of sampling points includes: Using the first type of sampling point as the emission starting point, a second ray is emitted along the positive direction of the third coordinate axis in the bounding sphere coordinate system, wherein the origin of the bounding sphere coordinate system is located at the center of the bounding sphere, and the third coordinate axis is perpendicular to the virtual ground in the target three-dimensional scene; If the second ray does not intersect with the ground components in the target 3D scene, then the first type of sampling point is marked as a suspected visible sampling point.
5. The method according to claim 1, characterized in that, The step of obtaining the bounding sphere corresponding to the target virtual model in the target 3D scene includes: Based on the target bounding box corresponding to the target virtual model, calculate a bounding sphere with the same center as the target bounding box, wherein the radius of the bounding sphere is determined according to the coordinate positions of each vertex in the target bounding box.
6. The method according to claim 1, characterized in that, Determining the visibility of the target virtual model based on the quantity includes: The visibility of the target virtual model is determined based on the proportion of the quantity in the total number of sampling points corresponding to multiple second-type sampling points.
7. The method according to claim 4, characterized in that, The method further includes: Based on the preset number of sampling points, determine the coordinate position of each second type of sampling point in the bounding spherical coordinate system; Based on the coordinate positions of each second type of sampling point in the bounding spherical coordinate system, determine the third ray corresponding to each second type of sampling point.
8. The method according to claim 7, characterized in that, The bounding spherical coordinate system is composed of a first coordinate axis, a second coordinate axis, and a third coordinate axis that are perpendicular to each other. Determining the coordinate position of each second-type sampling point in the bounding spherical coordinate system according to a preset number of sampling points includes: Based on the preset number of sampling points, determine the value of each second type of sampling point on the first coordinate axis; Based on the values of each second-type sampling point on the first coordinate axis and the radius of the enclosing sphere, the values of each second-type sampling point on the second coordinate axis and the third coordinate axis are determined respectively.
9. The method according to claim 2, characterized in that, The process of obtaining the list of occlusion models corresponding to the target virtual model in the target 3D scene includes: Calculate the bounding box corresponding to each virtual model in the target 3D scene; Based on the positional relationship between the target virtual model and the bounding boxes corresponding to other virtual models, a list of occlusion models corresponding to the target virtual model is determined.
10. A scene resource visibility processing device, characterized in that, include: The acquisition module is used to acquire the bounding sphere corresponding to the target virtual model in the target 3D scene and the occlusion model list corresponding to the target virtual model. The occlusion model list includes the model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model. The determination module is used to sample the target virtual model based on the bounding sphere and determine a plurality of first-type sampling points located on the target virtual model; A filtering module is used to determine the number of visible first-type sampling points from the plurality of first-type sampling points and the occlusion model list, and to determine the visibility of the target virtual model based on the number of visible first-type sampling points. The determining module is specifically used to sample the bounding sphere according to a preset number of sampling points to determine a plurality of second-type sampling points located on the bounding sphere; and to determine a plurality of first-type sampling points located on the target virtual model based on the plurality of second-type sampling points. The step of determining multiple first-type sampling points located on the target virtual model based on multiple second-type sampling points includes: emitting a corresponding third ray starting from each second-type sampling point; determining each first-type sampling point corresponding to each second-type sampling point based on the intersection of each third ray with the target virtual model; and the third ray corresponding to each second-type sampling point passing through the center of the enclosing sphere and each second-type sampling point.
11. An electronic device, characterized in that, include: A processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform steps related to the visibility of various objects in any of the scenarios described in claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs steps related to the visibility of various objects in any of the scenarios described in claims 1-9.