Scene resource visibility processing method and device, electronic equipment and storage medium
By obtaining the list of encircling ball and occlusion models in a three-dimensional scene, sampling determines the number of visible sampling points, solving the problem of low manual inspection efficiency in the prior art, realizing automated inspection and improving accuracy.
Patent Information
- Application Number
- CN202510014058.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-01-03
AI Technical Summary
In the prior art, scene resource visibility checks in game scenes mainly rely on manual selection, resulting in low inspection efficiency.
By obtaining the list of enclosing balls and occlusion models in the target three-dimensional scene, the target virtual model is sampled based on the enclosing balls, and the number of visible sampling points is determined, thereby automatically checking the occlusion status of the virtual model.
It realizes automatic inspection of the occlusion of virtual models in three-dimensional scenarios, improves inspection efficiency, and improves the accuracy of inspection results.
Smart Images

Figure CN119941933A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a scene resource visibility processing method, device, electronic device and storage medium. Background Art
[0002] The game scene is one of the main components of the game. In the production process of larger scenes, complex scene editing by multiple people is often involved. As the research and development process iterates, some scene resources are often obscured and invisible.
[0003] In the prior art, in a game scene, the visibility of various objects in the game scene is mainly checked manually one by one.
[0004] It can be seen that the existing inspection method mainly relies on manual inspection, and therefore has the problem of low inspection efficiency. Summary of the invention
[0005] The purpose of this application is to provide a scene resource visibility processing method, device, electronic device and storage medium to address the deficiencies in the above-mentioned prior art, which can automatically check the occlusion of virtual models in three-dimensional scenes and improve the inspection effect.
[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] In a first aspect, the present invention provides a method for processing visibility of scene resources, the method comprising:
[0008] Acquire a bounding sphere corresponding to a target virtual model in a target three-dimensional scene and a list of occlusion models corresponding to the target virtual model, wherein the list of occlusion models includes a model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model;
[0009] Sampling the target virtual model based on the bounding sphere to determine a plurality of first-category sampling points located on the target virtual model;
[0010] According to the plurality of first-category sampling points and the occlusion model list, the number of visible first-category sampling points is determined from the plurality of first-category sampling points, and the visibility of the target virtual model is determined according to the number.
[0011] In a second aspect, the present invention provides a scene resource visibility processing device, comprising:
[0012] An acquisition module, used to acquire a bounding sphere corresponding to a target virtual model in a target three-dimensional scene and a list of occlusion models corresponding to the target virtual model, wherein the list of occlusion models includes a model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model;
[0013] A determination module, configured 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] A screening module is used to determine the number of visible first-category sampling points from the plurality of first-category sampling points according to the plurality of first-category sampling points and the occlusion model list, and determine the visibility of the target virtual model according to the number.
[0015] In a third aspect, 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 and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of visibility of various objects in the scene as described in any of the aforementioned embodiments.
[0016] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of visibility of various objects in a scene as described in any of the aforementioned embodiments are executed.
[0017] The beneficial effects of this application are:
[0018] In the scene resource visibility processing method, device, electronic device and storage medium provided in the embodiments of the present application, an enclosing sphere corresponding to a target virtual model in a target three-dimensional scene and an occlusion model list corresponding to the target virtual model are obtained, wherein the occlusion model list includes a model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model; the target virtual model is sampled based on the enclosing sphere to determine a plurality of first-class sampling points located on the target virtual model; based on the plurality of first-class sampling points and the occlusion model list, the number of visible first-class sampling points is determined from the plurality of first-class sampling points, and the visibility of the target virtual model is determined based on the number, thereby realizing automatic inspection of the occlusion situation of the target virtual model in the three-dimensional scene and improving the inspection efficiency; in addition, since the plurality of first-class sampling points uniformly sampled from the target virtual model based on the enclosing sphere are inspected, the accuracy of the inspection result can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A flowchart of a scene resource visibility processing method provided in an embodiment of the present application;
[0021] Figure 2 A flowchart of another scene resource visibility processing method provided in an embodiment of the present application;
[0022] Figure 3 A flowchart of another scene resource visibility processing method provided in an embodiment of the present application;
[0023] Figure 4 A flowchart of another scene resource visibility processing method provided in an embodiment of the present application;
[0024] Figure 5 A flowchart of another scene resource visibility processing method provided in an embodiment of the present application;
[0025] Figure 6 A flowchart of another scene resource visibility processing method provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of functional modules of a scene resource visibility processing device provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0029] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0030] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0031] The game scene is one of the main components of the game. As the development process iterates, some scene resources are often blocked and invisible. In the prior art, the visibility of scene resources in the game scene is mainly checked manually by clicking on each object in the game scene. However, in a large-scale scene (such as an open world), there are often tens of thousands of objects in the scene, and the workload of manual inspection is large. Therefore, the existing inspection method has the problem of low inspection efficiency.
[0032] In view of this, an embodiment of the present application provides a scene resource visibility processing method, which can be used to 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 flow chart of a scene resource visibility processing method provided in an embodiment of the present application. The execution subject of the method can be a computer, server, processor, or other electronic device that can process scene resources in a three-dimensional scene, which is not limited here. Optionally, when performing specific processing, the method provided in the embodiment of the present application can be embedded in three-dimensional software, which is not limited here.
[0034] Optionally, taking the game scene as an example, the method of the present application can be applied to the following processing scenarios. For example, after the scene resource iteration, the newly added scene resources block the old scene resources, resulting in the player not seeing the old scene resources in the actual game experience. Therefore, the visibility of the scene resources in the game scene should be analyzed to delete the old and redundant scene resources; or, in the process of multi-person cooperation in developing scene resources, the editing process of each artist may cause scene resources to block each other. In this case, the visibility of the scene resources can be analyzed to delete the blocked scene resources. Of course, it should be noted that the application scenarios of the method of the present application are not limited to game scenes, and the specific processing scenarios are not limited.
[0035] like Figure 1 As shown, the method includes:
[0036] Step 101: Obtain a bounding sphere corresponding to a target virtual model in a target three-dimensional scene and a list of occlusion models corresponding to the target virtual model.
[0037] The occlusion model list includes a model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model, and the target three-dimensional scene includes: the target virtual model and at least one other virtual model.
[0038] Among them, the target virtual model can be a virtual three-dimensional model corresponding to any virtual object in the target three-dimensional scene. Optionally, the target virtual object can be a virtual character, a virtual building, a virtual tree, a virtual vehicle, a virtual weapon, etc., which is not limited here.
[0039] The bounding sphere corresponding to the target virtual model is a sphere used to wrap the target virtual model. Optionally, the bounding sphere can be determined based on the farthest point algorithm, the centroid algorithm, etc., which is not limited here and can be flexibly selected according to the actual application scenario.
[0040] The occlusion model list corresponding to the target virtual model can be determined by calculating the positional relationship between the target virtual model and other virtual models. The occlusion model list may include a model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model. It should be noted that the present application does not limit the occlusion ratio, which may be 1%, 20%, 98%, etc. of the occlusion target virtual model, and is not limited here. Of course, the present application does not limit the number of occlusion virtual models, and may include one or more according to the actual application scenario.
[0041] Step 102: Sampling the target virtual model based on the bounding sphere to determine a plurality of first-category sampling points located on the target virtual model.
[0042] The enclosing sphere corresponding to the target virtual model is used as a sphere for enclosing the target virtual model. Optionally, for sampling the target virtual model, a plurality of first-category sampling points located on the target virtual model may be obtained based on the enclosing sphere.
[0043] Of course, the present application does not limit the number of the first type of sampling points. Optionally, the first type of sampling points may include thousands, for example, may include one thousand, which is not limited here.
[0044] It can be understood that, due to the uniform distribution of the enclosing sphere, uniform sampling can be achieved when sampling the target virtual model based on the enclosing sphere, and the accuracy can be improved when the visibility of the target virtual model is subsequently determined based on this.
[0045] Step 103 : According to the plurality of first-category sampling points and the occlusion model list, the number of visible first-category sampling points is determined from the plurality of first-category sampling points, and the visibility of the target virtual model is determined according to the number.
[0046] Among them, the occluded sampling points are sampling points in the target virtual model that are invisible to the user. In contrast to the occluded sampling points, the visible sampling points are sampling points in the target virtual model that can be seen by 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 not be visible.
[0047] Optionally, based on the determined multiple first-category sampling points, the relationship between each first-category sampling point and each occlusion model indicated by the occlusion model list can be determined based on a ray detection algorithm to determine the number of visible first-category sampling points; based on the number, the visibility of the target virtual model is determined.
[0048] The visibility of the target virtual model is used to indicate the visible proportion of the target virtual model. It is understandable that if the proportion is higher, it means that the target virtual model is less obscured, and if the proportion is lower, it means that the target virtual model is more obscured.
[0049] In summary, an embodiment of the present application provides a scene resource visibility processing method, the method comprising: obtaining a bounding sphere corresponding to a target virtual model in a target three-dimensional scene and an occlusion model list corresponding to the target virtual model, the occlusion model list comprising a model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model; sampling the target virtual model based on the bounding sphere, and determining a plurality of first-class sampling points located on the target virtual model; determining the number of visible first-class sampling points from the plurality of first-class sampling points according to the plurality of first-class sampling points and the occlusion model list, and determining the visibility of the target virtual model according to the number, thereby realizing automated inspection of the occlusion situation of the target virtual model in the three-dimensional scene and improving inspection efficiency; in addition, since the plurality of first-class sampling points that are uniformly sampled from the target virtual model based on the bounding sphere are inspected, the accuracy of the inspection result can be improved.
[0050] In an optional embodiment, the above-mentioned determining the number of visible first-category sampling points from multiple first-category sampling points based on multiple first-category sampling points and the occlusion model list includes: determining the number of visible first-category sampling points from multiple first-category sampling points based on a first normal direction corresponding to each first-category sampling point and a 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 herein.
[0052] Optionally, during the specific screening, rays can be emitted along the first normal direction corresponding to the second triangular face of the target virtual model where each first-class sampling point is located; the visible sampling points are determined based on the collision between the emitted rays and the first triangular face corresponding to each occluding virtual model, and the number of visible first-class sampling points is obtained by counting.
[0053] Figure 2 A flow chart of another scene resource visibility processing method provided in an embodiment of the present application, in an optional implementation manner, as Figure 2As shown, the above-mentioned determining the number of visible first-category sampling points from a plurality of first-category sampling points according to the first normal direction corresponding to each first-category sampling point and the first triangular face corresponding to each occluding virtual model indicated by the occlusion model list includes:
[0054] Step 201: Screen and determine suspected visible sampling points from the first category of sampling points.
[0055] The suspected visible sampling points are sampling points in the target virtual model that are suspected to be visible to the user. Optionally, the suspected visible sampling points can be determined based on a ray detection algorithm according to the intersection of the rays emitted by the first type of sampling points and the ground components in the target three-dimensional scene.
[0056] Step 202: For each suspected visible sampling point, emit a first ray along the first normal direction of the front side of the second triangular face of the target virtual model where the suspected visible sampling point is located, and determine whether the first ray has an intersection with the back side of each first triangular face corresponding to each occluding virtual model.
[0057] The back side of each first triangular face faces away from the user, that is, is invisible to the user, and the length of the first ray is determined according to the radius of the enclosing sphere corresponding to the target virtual model.
[0058] It can be understood that for each virtual model in the target three-dimensional scene, it can be obtained by combining multiple triangular faces; in addition, in order to avoid the intersection of the first ray and other non-occluded virtual models and affect the judgment result, optionally, the length of the first ray can be set according to the radius of the enclosing sphere corresponding to the target virtual model. For example, the radius of the enclosing sphere corresponding to the target virtual model is R, and the length of the first ray is L, then L=R×A, wherein A is a preset constant, and its value can be determined according to empirical values, for example, the value can be 8, 10, etc., which is not limited here.
[0059] Based on the above description, 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 side of the second triangular face of the target virtual model where it is located. The first normal direction is the normal direction of the front side of the back side triangular face of each first triangular face.
[0060] Optionally, when determining whether each first ray has an intersection with the back surface of each first triangular surface corresponding to each occluding virtual model, the following method may be used:
[0061] For example, for the jth suspected visible sampling point VP j , record N1 j Indicates VP j Along the first normal direction of the front face of the second triangle face of the target virtual model, N2 j_mIndicates the face normal corresponding to the back face of the kth first triangle face corresponding to the mth occluding virtual model in the occluding model list. If N1 j N2 j_m_k >0, then VP j The corresponding first ray and the back surface of the kth first triangle surface corresponding to the mth occlusion virtual model have an intersection point, otherwise, it means that there is no intersection point. Of course, it should be noted that the specific determination method is not limited to this.
[0062] Step 203: If not, determine each suspected visible sampling point as a visible first-category sampling point, and obtain the number of visible first-category sampling points by counting.
[0063] Among them, if the first ray corresponding to a suspected visible sampling point intersects with the back side of each first triangular face corresponding to each occluding virtual model (that is, it hits the back side), then it means that the suspected visible sampling point is an occluding sampling point; otherwise, it means that 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] Combined with the above calculation formula, optionally, if the suspected visible sampling point VP j If the corresponding first ray intersects with the back side of any triangle face corresponding to the mth occluded virtual model, then the VP j is the occluded sampling point; otherwise, the VP j is a visible sampling point.
[0065] Figure 3 A flow chart of another scene resource visibility processing method provided in an embodiment of the present application, in an optional implementation manner, as Figure 3 As shown, the above screening of suspected visible sampling points from the first type of sampling points includes:
[0066] Step 301: 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 enclosing spherical coordinate system.
[0067] The origin of the enclosing sphere coordinate system is located at the center of the enclosing sphere, and the third coordinate axis is perpendicular to the virtual ground in the target three-dimensional scene.
[0068] In addition, it should be noted that the bounding sphere coordinate system is composed of a first coordinate axis, a second coordinate axis, and a third coordinate axis that are perpendicular to each other, and can be set based on a left-handed system. Optionally, the plane enclosed by the first coordinate axis and the second coordinate axis is parallel to the virtual ground in the target three-dimensional scene; the third coordinate axis is perpendicular to the virtual ground in the target three-dimensional scene.
[0069] Optionally, for each first-type sampling point, the starting point of the second ray may be the first-type sampling point, and emitted along the positive direction of the third coordinate axis (ie, parallel to the third coordinate axis in the enclosing spherical coordinate system).
[0070] Step 302: If there is no intersection between the second ray and the ground component in the target three-dimensional scene, the first type of sampling point is marked as a suspected visible sampling point.
[0071] Among them, the ground component in the target three-dimensional scene is used to manage the scene resources within its coverage range (i.e., the player's visible and interactive area), wherein, when the second ray is emitted along the positive direction of the third coordinate axis (i.e., the direction toward the virtual sky) and hits the ground component (i.e., there is an intersection with the ground component), it means that the position of the first-class sampling point corresponding to the second ray is lower than the ground horizontal plane, that is, the first-class sampling point is under the virtual ground, and the first-class sampling point is an occluded sampling point; if there is no intersection, it means that the position of the first-class sampling point corresponding to the second ray is higher than the ground horizontal plane, that is, the first-class sampling point is on the virtual ground, and the first-class sampling point is a suspected visible sampling point.
[0072] It can be understood that, by applying the embodiments of the present application, the first type of sampling points located under the virtual ground in the target three-dimensional scene can be initially filtered out by emitting the second ray, thereby improving the accuracy when subsequently determining the visibility of the target virtual model.
[0073] In an optional implementation manner, the step of obtaining a bounding sphere corresponding to the target virtual model in the target three-dimensional scene includes:
[0074] According to the target bounding box corresponding to the target virtual model, a bounding sphere having the same center as the target bounding box is calculated, wherein the radius of the bounding sphere is determined according to the coordinate position of each vertex in the target bounding box.
[0075] Optionally, the target bounding box may be an axis-aligned rectangular frame, which is used to wrap the target virtual model, and no matter how the target virtual model is rotated, the axis of the target bounding box is always aligned with the world coordinate axis.
[0076] After the target bounding box is determined, the center of the target bounding box may be used as the center of the bounding sphere, and the radius of the bounding sphere may be determined according to the coordinate positions of each vertex in the target bounding box.
[0077] In some embodiments, the radius of the bounding sphere may be determined according to the following method:
[0078] Calculate the maximum value (e.g., Xmax, Ymax, Zmax) and minimum value (e.g., Xmin, Ymin, Zmin) of each vertex in the target bounding box on each coordinate axis; calculate the span of the target bounding box in each coordinate axis direction (recorded as ΔX, ΔY, ΔZ) according to the maximum value and minimum value of each vertex on each coordinate axis; calculate the radius of the bounding sphere according to the span of the target bounding box in each coordinate axis direction. 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 sampling of the target virtual model based on the enclosing sphere to determine a plurality of first-category sampling points located on the target virtual model includes:
[0080] According to the preset number of sampling points, the enclosing sphere is sampled to determine a plurality of second-category sampling points located on the enclosing sphere; and according to the plurality of second-category sampling points, a plurality of first-category sampling points located on the target virtual model are determined.
[0081] Among them, according to the location of the sampling points, the sampling points can be divided into first-category sampling points and second-category sampling points; the second-category sampling points, that is, the sampling points located on the enclosing sphere, can be obtained by sampling the enclosing sphere; the first-category sampling points, that is, the sampling points located on the target virtual model, can be determined based on multiple second-category sampling points, specifically, can be determined based on the second-category sampling points and by emitting rays to 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, the present 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, which is not limited here.
[0083] It can be understood that due to the uniform distribution of the enclosing sphere, uniform sampling can be achieved when multiple second-category sampling points are obtained by sampling based on the enclosing sphere; and then based on the multiple second-category sampling points, when multiple first-category sampling points located on the target virtual model are determined, uniform sampling of the target virtual model can be achieved, and then based on this, when the visibility of the target virtual model is subsequently determined, the accuracy can be improved.
[0084] Correspondingly, the above-mentioned determining the visibility of the target virtual model according to the quantity includes: determining the visibility of the target virtual model according to a proportion of the quantity in the total number of sampling points corresponding to the plurality of second-category sampling points.
[0085] Optionally, after determining the number of visible first-category sampling points from the plurality of first-category sampling points, the ratio of the number to the total number of sampling points corresponding to the plurality of second-category sampling points may be calculated to determine the visibility of the target virtual model.
[0086] Among them, the calculated proportion can be any value between 0 and 1. It can be understood that if the proportion is higher, it means that the target virtual model is less obscured and the visibility is higher. If the proportion is lower, it means that the target virtual model is more obscured and the visibility is lower.
[0087] Figure 4 A flow chart of another scene resource visibility processing method provided in an embodiment of the present application, in an optional implementation manner, as Figure 4 As shown, the above-mentioned sampling of the target virtual model based on the enclosing sphere to determine a plurality of first-type sampling points located on the target virtual model includes:
[0088] Step 401: Determine the coordinate position of each second type sampling point in the bounding sphere coordinate system according to a preset number of sampling points.
[0089] The number of the second type of sampling points is equal to the preset number of sampling points. Optionally, the position of each second type of sampling point on the bounding sphere can be determined randomly, or determined by a preset algorithm, which is not limited here.
[0090] The enclosing sphere coordinate system is composed 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 enclosing sphere coordinate system can be set at the center of the enclosing sphere. Then, the coordinate position of each second-class sampling point in the enclosing sphere coordinate system can be determined according to the position of each second-class sampling point on the enclosing sphere.
[0091] Step 402: Determine the third ray corresponding to each second-type sampling point according to the coordinate position of each second-type sampling point in the surrounding sphere coordinate system.
[0092] The third ray corresponding to each second-type sampling point passes through the center of the enclosing sphere and each second-type sampling point.
[0093] Step 403 : Taking each second-category sampling point as a starting point, each third ray is emitted, and each first-category sampling point corresponding to each second-category sampling point is determined according to the intersection point between each third ray and the target virtual model.
[0094] After obtaining each second-class sampling point located on the enclosing sphere, each second-class sampling point can be used as the emission starting point of the third ray, and the third ray is emitted through the center of the enclosing sphere, and the intersection of the third ray and the triangular surface of the target virtual model surface is used as the first-class sampling point corresponding to each second-class sampling point.
[0095] It can be understood that 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.
[0096] It should be noted that, in specific implementation, the third ray equations corresponding to each third ray can also be constructed according to the center of the enclosing sphere and each second type sampling point, and the intersection points of each third device and the target virtual model can be determined through each third ray equation.
[0097] Figure 5 A flowchart of another scene resource visibility processing method provided by an embodiment of the present application. In an optional implementation, the bounding sphere coordinate system is composed of a first coordinate axis, a second coordinate axis, and a third coordinate axis that are perpendicular to each other.
[0098] In an optional embodiment, if Figure 5 As shown, the above-mentioned method of determining the coordinate position of each second-type sampling point in the bounding sphere coordinate system according to the preset number of sampling points includes:
[0099] Step 501: Determine the value of each second type sampling point on the first coordinate axis according to a preset number of sampling points.
[0100] Step 502: Determine the values of each second type of sampling point on the second coordinate axis and the value of each second type of sampling point on the third coordinate axis according to the values of each second type of sampling point on the first coordinate axis and the radius of the enclosing sphere.
[0101] Optionally, when making a specific determination, let the preset number of sampling points be n, i be the sampling sequence number, then the coordinate position of the i-th second-category sampling point (xi, yi, zi) in the bounding sphere coordinate system can be calculated by referring to 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 represents the normalized value of the i-th second-category sampling point (xi, yi, zi) in the direction of the third coordinate axis in the enclosing spherical coordinate system, X i represents the normalized value of the i-th second-class sampling point (xi, yi, zi) in the direction of the first coordinate axis in the enclosing spherical coordinate system, Y i represents the normalized value of the i-th second-category sampling point (xi, yi, zi) in the direction of the second coordinate axis in the enclosing sphere coordinate system; Phi represents a constant representing the golden angle, Phi = Pi × (3-sqrt(5)), sqrt() represents the square root function, Pi represents the pi constant π, 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. Of course, it should be noted that the method for determining the coordinate position of each second type sampling point in the enclosing sphere coordinate system is not limited to this. In addition, it can also be understood that the more the number of preset sampling points, the higher the corresponding calculation accuracy and the more accurate the inspection result. Optionally, the setting of the preset number of sampling points can be flexibly set according to the actual application scenario.
[0107] Figure 6 A flow chart of another scene resource visibility processing method provided in an embodiment of the present application, in an optional implementation manner, as Figure 6 As shown, the above-mentioned obtaining of the occlusion model list corresponding to the target virtual model in the target three-dimensional scene includes:
[0108] Step 601: Calculate the bounding box corresponding to each virtual model in the target three-dimensional scene.
[0109] Step 602: Determine a list of occlusion models corresponding to the target virtual model according to the positional relationship between the bounding boxes corresponding to the target virtual model and other virtual models.
[0110] The determination of the bounding boxes corresponding to the virtual models may refer to the aforementioned process of determining the bounding boxes corresponding to the virtual models, which will not be described in detail here.
[0111] After the bounding boxes corresponding to the virtual models in the target three-dimensional scene are calculated, for the target virtual model, the occlusion model list corresponding to the target virtual model can be determined according to the intersection of the target bounding box with the bounding boxes corresponding to other virtual models.
[0112] It can be understood that if the bounding box corresponding to some other virtual model intersects with the target bounding box, the model identifier corresponding to the other virtual model is added to the occlusion model list.
[0113] Figure 7 A functional module diagram of a scene resource visibility processing device provided in an embodiment of the present application. The basic principles of the device and the technical effects produced are the same as those of the corresponding method embodiments described above. For the sake of brief description, parts not mentioned in this embodiment may refer to the corresponding contents in the method embodiments.
[0114] like Figure 7 As shown, the scene resource visibility processing device 100 includes:
[0115] An acquisition module 110 is used to acquire a bounding sphere corresponding to a target virtual model in a target three-dimensional scene and a list of occlusion models corresponding to the target virtual model, wherein the list of occlusion models includes a model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model;
[0116] A determination module 120, configured to sample the target virtual model based on the bounding sphere, and determine a plurality of first-category sampling points located on the target virtual model;
[0117] The screening module 130 is used to determine the number of visible first-category sampling points from the plurality of first-category sampling points according to the plurality of first-category sampling points and the occlusion model list, and determine the visibility of the target virtual model according to the number.
[0118] In an optional embodiment, the screening module 130 is specifically used to determine the number of visible first-category sampling points from the multiple first-category sampling points based on the first normal direction corresponding to each of the first-category sampling points and the first triangular face corresponding to each of the occluding virtual models indicated by the occlusion model list.
[0119] In an optional implementation, the screening module 130 is specifically used to screen 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 a 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 it is determined whether the first ray has an intersection with the back faces of each of the first triangular faces corresponding to each of the occluding virtual models, wherein the back faces of each of the first triangular faces are not visible, and the length of the first ray is determined according to the radius of the enclosing sphere corresponding to the target virtual model;
[0121] If not, each of the suspected visible sampling points is determined to be a visible first-category sampling point, and the number of the visible first-category sampling points is obtained by counting.
[0122] In an optional implementation, the screening module 130 is specifically configured to use the first type of sampling point as a launch start point, and launch a second ray along a positive direction of a third coordinate axis in an enclosing sphere coordinate system, wherein the origin of the enclosing sphere coordinate system is located at the center of the enclosing sphere, and the third coordinate axis is perpendicular to a virtual ground in the target three-dimensional scene;
[0123] If there is no intersection between the second ray and the ground component in the target three-dimensional scene, the first type of sampling point is marked as a suspected visible sampling point.
[0124] In an optional embodiment, the acquisition module 110 is specifically used to calculate a bounding sphere with the same center as the target bounding box according to the target bounding box corresponding to the target virtual model, wherein the radius of the bounding sphere is determined according to the coordinate positions of each vertex in the target bounding box.
[0125] In an optional implementation, the determination module 120 is specifically configured 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;
[0126] Determine a plurality of first-category sampling points located on the target virtual model according to the plurality of second-category sampling points;
[0127] The screening module 130 is specifically configured to include:
[0128] The visibility of the target virtual model is determined according to a proportion of the number in the total number of sampling points corresponding to the plurality of sampling points of the second category.
[0129] In an optional implementation, the determination module 120 is specifically configured to determine the coordinate position of each second type sampling point in the enclosing sphere coordinate system according to a preset number of sampling points;
[0130] Determine, according to the coordinate position of each of the second-category sampling points in the enclosing sphere coordinate system, a third ray corresponding to each of the second-category sampling points, wherein the third ray corresponding to each of the second-category sampling points passes through the center of the enclosing sphere and each of the second-category sampling points;
[0131] Taking each of the second-category sampling points as a starting point, emitting each of the third rays, and determining each of the first-category sampling points corresponding to each of the second-category sampling points according to intersection points of each of the third rays with the target virtual model.
[0132] In an optional implementation, the enclosing sphere coordinate system is composed of a first coordinate axis, a second coordinate axis, and a third coordinate axis that are perpendicular to each other, and the determination module 120 is specifically used to determine the value of each of the second-type sampling points on the first coordinate axis according to a preset number of sampling points;
[0133] According to the values of the second type sampling points on the first coordinate axis and the radius of the enclosing sphere, the values of the second type sampling points 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 three-dimensional scene;
[0135] According to the positional relationship between the bounding boxes corresponding to the target virtual model and other virtual models, a list of occlusion models corresponding to the target virtual model is determined.
[0136] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0137] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0138] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and the electronic device can be integrated into the above-mentioned scene resource visibility processing device. 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 and the storage medium 220 communicate through the bus 230, the processor 210 executes the machine-readable instructions to perform the steps of the following method embodiment:
[0139] Acquire a bounding sphere corresponding to a target virtual model in a target three-dimensional scene and a list of occlusion models corresponding to the target virtual model, wherein the list of occlusion models includes a model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model;
[0140] Sampling the target virtual model based on the bounding sphere to determine a plurality of first-category sampling points located on the target virtual model;
[0141] According to the plurality of first-category sampling points and the occlusion model list, the number of visible first-category sampling points is determined from the plurality of first-category sampling points, and the visibility of the target virtual model is determined according to the number.
[0142] In an optional implementation, determining the number of visible first-category sampling points from the plurality of first-category sampling points according to the plurality of first-category sampling points and the occlusion model list includes:
[0143] The number of visible first-category sampling points is determined from the plurality of first-category sampling points according to the first normal direction corresponding to each of the first-category sampling points and the first triangular face corresponding to each of the occluding virtual models indicated by the occluding model list.
[0144] In an optional implementation, determining the number of visible first-category sampling points from the plurality of first-category sampling points according to the first normal direction corresponding to each of the first-category sampling points and the first triangular face corresponding to each of the occluding virtual models indicated by the occlusion model list comprises:
[0145] Screening suspected visible sampling points from the first category of sampling points;
[0146] For each of the suspected visible sampling points, a first ray is emitted along a 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 it is determined whether the first ray has an intersection with the back faces of each of the first triangular faces corresponding to each of the occluding virtual models, wherein the back faces of each of the first triangular faces are not visible, and the length of the first ray is determined according to the radius of the enclosing sphere corresponding to the target virtual model;
[0147] If not, each of the suspected visible sampling points is determined to be a visible first-category sampling point, and the number of the visible first-category sampling points is obtained by counting.
[0148] In an optional implementation, screening suspected visible sampling points from the first category of sampling points includes:
[0149] Taking the first type of sampling point as the emission starting point, emitting a second ray along the positive direction of a third coordinate axis in an enclosing sphere coordinate system, wherein the origin of the enclosing sphere coordinate system is located at the center of the enclosing sphere, and the third coordinate axis is perpendicular to the virtual ground in the target three-dimensional scene;
[0150] If there is no intersection between the second ray and the ground component in the target three-dimensional scene, the first type of sampling point is marked as a suspected visible sampling point.
[0151] In an optional implementation manner, the step of obtaining a bounding sphere corresponding to the target virtual model in the target three-dimensional scene includes:
[0152] According to the target bounding box corresponding to the target virtual model, a bounding sphere having the same center as the target bounding box is calculated, wherein the radius of the bounding sphere is determined according to the coordinate position of each vertex in the target bounding box.
[0153] In an optional implementation, sampling the target virtual model based on the bounding sphere to determine a plurality of first-category sampling points located on the target virtual model includes:
[0154] Sampling the enclosing sphere according to a preset number of sampling points to determine a plurality of second-category sampling points located on the enclosing sphere;
[0155] Determine a plurality of first-category sampling points located on the target virtual model according to the plurality of second-category sampling points;
[0156] Determining the visibility of the target virtual model according to the quantity includes:
[0157] The visibility of the target virtual model is determined according to a proportion of the number in the total number of sampling points corresponding to the plurality of sampling points of the second category.
[0158] In an optional implementation, sampling the target virtual model based on the bounding sphere to determine a plurality of first-category sampling points located on the target virtual model includes:
[0159] According to a preset number of sampling points, determining the coordinate position of each second type sampling point in the enclosing sphere coordinate system;
[0160] Determine, according to the coordinate position of each of the second-category sampling points in the enclosing sphere coordinate system, a third ray corresponding to each of the second-category sampling points, wherein the third ray corresponding to each of the second-category sampling points passes through the center of the enclosing sphere and each of the second-category sampling points;
[0161] Taking each of the second-category sampling points as a starting point, emitting each of the third rays, and determining each of the first-category sampling points corresponding to each of the second-category sampling points according to intersection points of each of the third rays with the target virtual model.
[0162] In an optional implementation, the enclosing sphere coordinate system is composed of a first coordinate axis, a second coordinate axis, and a third coordinate axis that are perpendicular to each other, and determining the coordinate position of each second-type sampling point in the enclosing sphere coordinate system according to a preset number of sampling points includes:
[0163] Determine the value of each of the second-type sampling points on the first coordinate axis according to a preset number of sampling points;
[0164] According to the values of the second type sampling points on the first coordinate axis and the radius of the enclosing sphere, the values of the second type sampling points on the second coordinate axis and the third coordinate axis are determined respectively.
[0165] In an optional implementation manner, obtaining a list of occlusion models corresponding to the target virtual model in the target three-dimensional scene includes:
[0166] Calculating the bounding box corresponding to each virtual model in the target three-dimensional scene;
[0167] According to the positional relationship between the bounding boxes corresponding to the target virtual model and other virtual models, a list of occlusion models corresponding to the target virtual model is determined.
[0168] The specific implementation method and technical effects of the above method embodiment are similar to those mentioned above and will not be repeated here.
[0169] Optionally, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the following method embodiment are executed:
[0170] Acquire a bounding sphere corresponding to a target virtual model in a target three-dimensional scene and a list of occlusion models corresponding to the target virtual model, wherein the list of occlusion models includes a model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model;
[0171] Sampling the target virtual model based on the bounding sphere to determine a plurality of first-category sampling points located on the target virtual model;
[0172] According to the plurality of first-category sampling points and the occlusion model list, the number of visible first-category sampling points is determined from the plurality of first-category sampling points, and the visibility of the target virtual model is determined according to the number.
[0173] In an optional implementation, determining the number of visible first-category sampling points from the plurality of first-category sampling points according to the plurality of first-category sampling points and the occlusion model list includes:
[0174] The number of visible first-category sampling points is determined from the plurality of first-category sampling points according to the first normal direction corresponding to each of the first-category sampling points and the first triangular face corresponding to each of the occluding virtual models indicated by the occluding model list.
[0175] In an optional implementation, determining the number of visible first-category sampling points from the plurality of first-category sampling points according to the first normal direction corresponding to each of the first-category sampling points and the first triangular face corresponding to each of the occluding virtual models indicated by the occlusion model list comprises:
[0176] Screening suspected visible sampling points from the first category of sampling points;
[0177] For each of the suspected visible sampling points, a first ray is emitted along a 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 it is determined whether the first ray has an intersection with the back faces of each of the first triangular faces corresponding to each of the occluding virtual models, wherein the back faces of each of the first triangular faces are not visible, and the length of the first ray is determined according to the radius of the enclosing sphere corresponding to the target virtual model;
[0178] If not, each of the suspected visible sampling points is determined to be a visible first-category sampling point, and the number of the visible first-category sampling points is obtained by counting.
[0179] In an optional implementation, screening suspected visible sampling points from the first category of sampling points includes:
[0180] Taking the first type of sampling point as the emission starting point, emitting a second ray along the positive direction of a third coordinate axis in an enclosing sphere coordinate system, wherein the origin of the enclosing sphere coordinate system is located at the center of the enclosing sphere, and the third coordinate axis is perpendicular to the virtual ground in the target three-dimensional scene;
[0181] If there is no intersection between the second ray and the ground component in the target three-dimensional scene, the first type of sampling point is marked as a suspected visible sampling point.
[0182] In an optional implementation manner, the step of obtaining a bounding sphere corresponding to the target virtual model in the target three-dimensional scene includes:
[0183] According to the target bounding box corresponding to the target virtual model, a bounding sphere having the same center as the target bounding box is calculated, wherein the radius of the bounding sphere is determined according to the coordinate position of each vertex in the target bounding box.
[0184] In an optional implementation, sampling the target virtual model based on the bounding sphere to determine a plurality of first-category sampling points located on the target virtual model includes:
[0185] Sampling the enclosing sphere according to a preset number of sampling points to determine a plurality of second-category sampling points located on the enclosing sphere;
[0186] Determine a plurality of first-category sampling points located on the target virtual model according to the plurality of second-category sampling points;
[0187] Determining the visibility of the target virtual model according to the quantity includes:
[0188] The visibility of the target virtual model is determined according to a proportion of the number in the total number of sampling points corresponding to the plurality of sampling points of the second category.
[0189] In an optional implementation, sampling the target virtual model based on the bounding sphere to determine a plurality of first-category sampling points located on the target virtual model includes:
[0190] According to a preset number of sampling points, determining the coordinate position of each second type sampling point in the enclosing sphere coordinate system;
[0191] Determine, according to the coordinate position of each of the second-category sampling points in the enclosing sphere coordinate system, a third ray corresponding to each of the second-category sampling points, wherein the third ray corresponding to each of the second-category sampling points passes through the center of the enclosing sphere and each of the second-category sampling points;
[0192] Taking each of the second-category sampling points as a starting point, emitting each of the third rays, and determining each of the first-category sampling points corresponding to each of the second-category sampling points according to intersection points of each of the third rays with the target virtual model.
[0193] In an optional implementation, the enclosing sphere coordinate system is composed of a first coordinate axis, a second coordinate axis, and a third coordinate axis that are perpendicular to each other, and determining the coordinate position of each second-type sampling point in the enclosing sphere coordinate system according to a preset number of sampling points includes:
[0194] Determine the value of each of the second-type sampling points on the first coordinate axis according to a preset number of sampling points;
[0195] According to the values of the second type sampling points on the first coordinate axis and the radius of the enclosing sphere, the values of the second type sampling points on the second coordinate axis and the third coordinate axis are determined respectively.
[0196] In an optional implementation manner, obtaining a list of occlusion models corresponding to the target virtual model in the target three-dimensional scene includes:
[0197] Calculating the bounding box corresponding to each virtual model in the target three-dimensional scene;
[0198] According to the positional relationship between the bounding boxes corresponding to the target virtual model and other virtual models, a list of occlusion models corresponding to the target virtual model is determined.
[0199] The specific implementation method and technical effects of the above method embodiment are similar to those mentioned above and will not be repeated here.
[0200] Optionally, the present application also provides a computer program product, which includes instructions, and when the instructions are executed on an electronic device, the electronic device implements the steps of the above method embodiment.
[0201] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0202] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0203] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0204] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0205] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0206] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A scene resource visibility processing method, characterized in that: The method comprises: Acquire a bounding sphere corresponding to a target virtual model in a target three-dimensional scene and a list of occlusion models corresponding to the target virtual model, wherein the list of occlusion models includes a model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model; Sampling the target virtual model based on the bounding sphere to determine a plurality of first-category sampling points located on the target virtual model; According to the plurality of first-category sampling points and the occlusion model list, the number of visible first-category sampling points is determined from the plurality of first-category sampling points, and the visibility of the target virtual model is determined according to the number.
2. The method according to claim 1, characterized in that The step of determining the number of visible first-category sampling points from the plurality of first-category sampling points according to the plurality of first-category sampling points and the occlusion model list comprises: The number of visible first-category sampling points is determined from the plurality of first-category sampling points according to the first normal direction corresponding to each of the first-category sampling points and the first triangular face corresponding to each of the occluding virtual models indicated by the occluding model list.
3. The method according to claim 2, characterized in that The determining the number of visible first-category sampling points from the plurality of first-category sampling points according to the first normal direction corresponding to each of the first-category sampling points and the first triangular face corresponding to each of the occluding virtual models indicated by the occluding model list comprises: Screening suspected visible sampling points from the first category of sampling points; For each of the suspected visible sampling points, a first ray is emitted along a 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 it is determined whether the first ray has an intersection with the back face of each of the first triangular faces corresponding to each of the occluding virtual models, wherein the back face of each of the first triangular faces is not visible, and the length of the first ray is determined according to the radius of the enclosing sphere corresponding to the target virtual model; If not, each of the suspected visible sampling points is determined to be a visible first-category sampling point, and the number of the visible first-category sampling points is obtained by counting.
4. The method according to claim 3, characterized in that The screening of suspected visible sampling points from the first category of sampling points includes: Taking the first type of sampling point as the emission starting point, emitting a second ray along the positive direction of a third coordinate axis in an enclosing sphere coordinate system, wherein the origin of the enclosing sphere coordinate system is located at the center of the enclosing sphere, and the third coordinate axis is perpendicular to the virtual ground in the target three-dimensional scene; If there is no intersection between the second ray and the ground component in the target three-dimensional scene, 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 a bounding sphere corresponding to the target virtual model in the target three-dimensional scene includes: According to the target bounding box corresponding to the target virtual model, a bounding sphere having the same center as the target bounding box is calculated, wherein the radius of the bounding sphere is determined according to the coordinate position of each vertex in the target bounding box.
6. The method according to claim 1, characterized in that 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: Sampling the enclosing sphere according to a preset number of sampling points to determine a plurality of second-category sampling points located on the enclosing sphere; Determine a plurality of first-category sampling points located on the target virtual model according to the plurality of second-category sampling points; Determining the visibility of the target virtual model according to the quantity includes: The visibility of the target virtual model is determined according to a proportion of the number in the total number of sampling points corresponding to the plurality of sampling points of the second category.
7. The method according to claim 4, characterized in that 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: According to a preset number of sampling points, determining the coordinate position of each second type sampling point in the enclosing sphere coordinate system; Determine, according to the coordinate position of each of the second-category sampling points in the enclosing sphere coordinate system, a third ray corresponding to each of the second-category sampling points, wherein the third ray corresponding to each of the second-category sampling points passes through the center of the enclosing sphere and each of the second-category sampling points; Taking each of the second-category sampling points as a starting point, emitting each of the third rays, and determining each of the first-category sampling points corresponding to each of the second-category sampling points according to intersection points of each of the third rays with the target virtual model.
8. The method according to claim 7, characterized in that The enclosing sphere 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, according to a preset number of sampling points, the coordinate position of each second-type sampling point in the enclosing sphere coordinate system includes: Determine the value of each of the second-type sampling points on the first coordinate axis according to a preset number of sampling points; According to the values of the second type sampling points on the first coordinate axis and the radius of the enclosing sphere, the values of the second type sampling points on the second coordinate axis and the third coordinate axis are determined respectively.
9. The method according to claim 2, characterized in that: The step of obtaining a list of occlusion models corresponding to the target virtual model in the target three-dimensional scene includes: Calculating the bounding box corresponding to each virtual model in the target three-dimensional scene; According to the positional relationship between the bounding boxes corresponding to the target virtual model and 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: An acquisition module, used to acquire a bounding sphere corresponding to a target virtual model in a target three-dimensional scene and a list of occlusion models corresponding to the target virtual model, wherein the list of occlusion models includes a model identifier corresponding to at least one occlusion virtual model that occludes the target virtual model; A determination module, configured 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 screening module is used to determine the number of visible first-category sampling points from the plurality of first-category sampling points according to the plurality of first-category sampling points and the occlusion model list, and determine the visibility of the target virtual model according to the number.
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. When the electronic device is running, the processor and the storage medium communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of visibility of various objects in the scene as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of determining the visibility of various objects in a scene as claimed in any one of claims 1 to 9 are performed.
Citation Information
Patent Citations
Three-dimensional model shielding body selecting method and system, computer equipment and readable medium
CN108629106A
Method and system for obtaining visual parameters of scene object
CN111045664A
Model processing method, model processing device, electronic equipment and storage medium
CN112489203A
Method, device and equipment for determining space shielding information
CN114398707A
Static scene shielding processing method and device, electronic equipment and readable medium
CN114418829A