Method, device, electronic device and storage medium for determining transparency
By using the relative shooting angle of the target detection point and the target reconstruction function to calculate distance information in game technology, and dynamically adjust the transparency parameters, the problem of mismatch between the transparent display effect and the actual situation in the prior art is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202011445924.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-08
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2040-12-08
AI Technical Summary
When determining the translucent effect, the prior art relies on a fixed transparency display value, resulting in a deviation from the actual situation and poor user experience.
By determining the relative shooting angle information of the shooting device and each object detection point on the sub-model, the distance information between each object detection point and the sub-model is calculated using the target reconstruction function, and the transparency parameters are dynamically adjusted to achieve a more accurate and transparent display.
It achieves the matching of transparent display effect with actual conditions, improves the user experience, and solves the problem of poor display effect caused by fixed transparency display value.
Smart Images

Figure CN114612603B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of game technology, and in particular, to a method, device, electronic device and storage medium for determining transparency. Background Art
[0002] In animation design, a semi-transparent effect is usually set between the inner layer model and the outer layer model, for example, the semi-transparent display of the skin model and the clothing model. Correspondingly, the semi-transparent display mainly relies on the effect displayed after the light reflected by the inner layer object passes through the outer layer object after a certain distance and enters the human eye. Among them, each model is composed of points. The farther the distance between the point on the inner layer object and the corresponding point on the outer layer object, the weaker the semi-transparent effect, and vice versa.
[0003] At present, the semi-transparent effect is mainly determined by setting the transparency display value of the outer model. The transparency display value is usually fixed, and all points on the outer model are transparently displayed according to the set transparency display value. This method has a certain deviation between the transparent display and the actual situation, resulting in technical problems such as poor transparent display effect and poor user experience. Summary of the invention
[0004] The present invention provides a method, device, electronic device and storage medium for determining transparency, so as to achieve a transparent display effect consistent with reality, thereby improving the technical effect of user experience.
[0005] In a first aspect, an embodiment of the present invention provides a method for determining transparency, the method comprising:
[0006] Determine relative shooting angle information corresponding to each target detection point on the first sub-model and the shooting device;
[0007] For each target detection point, a target reconstruction function corresponding to the current target detection point is determined, and relative shooting angle information corresponding to the current target detection point is input into the target reconstruction function to obtain distance information between the first sub-model and the second sub-model of the target detection point under the current shooting angle information; the first sub-model is a sub-model that wraps a part of the second sub-model; the reconstruction function is constructed based on the projection coefficient value of the target detection point on each basis function in the spherical harmonic function;
[0008] According to the distance information corresponding to each target detection point, the transparency information of each target detection point is determined, and the first sub-model and the second sub-model are displayed based on the transparency information.
[0009] In a second aspect, an embodiment of the present invention further provides a device for determining transparency, the device comprising:
[0010] A relative shooting angle information determination module, used to determine the relative shooting angle information corresponding to the shooting device and each target detection point on the first sub-model;
[0011] A distance information determination module is used to determine, for each target detection point, a target reconstruction function corresponding to the current target detection point, and input the relative shooting angle information corresponding to the current target detection point into the target reconstruction function to obtain the distance information between the first sub-model and the second sub-model of the target detection point under the current shooting angle information; the first sub-model is a sub-model that wraps a part of the second sub-model; and the reconstruction function is constructed based on the projection coefficient value of the target detection point on each basis function in the spherical harmonic function;
[0012] The transparent display module is used to determine the transparency information of each target detection point according to the distance information corresponding to each target detection point, and display the first sub-model and the second sub-model based on the transparency information.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining transparency as described in any one of the embodiments of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to perform the method for determining transparency as described in any one of the embodiments of the present invention.
[0018] The technical solution of this embodiment determines the target shooting angle, retrieves the projection coefficient value from the vertex color and / or attribute information, and the distance information between the first sub-model and the second sub-model corresponding to the target detection point, and then determines the transparency parameter and displays it. This solves the technical problem that when the first sub-model is transparently displayed with a fixed transparency display value, the transparent display deviates from the actual situation, resulting in poor transparent display effect and poor user experience. It adjusts the transparency parameter according to the actual situation to make the transparent display effect consistent with the actual theoretical effect, thereby improving the technical effect of user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required to describe the embodiments. Obviously, the drawings introduced are only drawings of a part of the embodiments to be described in the present invention, rather than all the drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 A flowchart of a method for determining transparency provided in Embodiment 1 of the present invention;
[0021] Figure 2 A schematic flow chart of a method for determining transparency provided in Embodiment 2 of the present invention;
[0022] Figure 3 A schematic flow chart of a method for determining transparency provided in Embodiment 3 of the present invention;
[0023] Figure 4 A flowchart of a method for determining transparency provided in Embodiment 4 of the present invention;
[0024] Figure 5 A schematic diagram of the structure of a device for determining transparency provided in Embodiment 5 of the present invention;
[0025] Figure 6 This is a structural schematic diagram of an electronic device provided in Embodiment 6 of the present invention. DETAILED DESCRIPTION
[0026] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0027] Embodiment 1
[0028] Figure 1 A flow chart of a method for determining transparency provided in Embodiment 1 of the present invention is provided. This embodiment can be applied to determining a target reconstruction function corresponding to each target detection point based on pre-stored projection coefficient values, and based on the projection coefficient values, so as to determine the distance information between the first sub-model and the second sub-model corresponding to the target detection point at the corresponding visual angle according to the target reconstruction function of each target detection point, and then based on the situation of transparent display of the distance information, the method can be executed by a device for determining transparency, and the device can be implemented in the form of software and / or hardware. The hardware can be an electronic device. Optionally, the electronic device can be a mobile terminal, etc.
[0029] S110: Determine relative shooting angle information corresponding to the shooting device and each target detection point on the first sub-model.
[0030] Among them, the first sub-model and the second sub-model are relative. If the application scenario is a game scenario, the sub-models can be a skin model and a clothing model. The model corresponding to the clothing can be used as the first sub-model, and the model corresponding to the skin can be used as the second sub-model. The target detection point can be a detection point pre-set on the first sub-model; it can also be a detection point pre-set on the first sub-model divided into multiple blocks, and the center point of each block can be used as the target detection point; it can also be a detection point set by the developer according to actual needs; of course, it can also be that the first sub-model is composed of multiple points, and each point can be used as a target detection point. The shooting device is a device for observing and shooting the first sub-model, and the relative shooting angle is the relative angle between the shooting device and each target detection point on the first sub-model. The relative shooting angle information is determined based on the position information between the shooting device and each target detection point.
[0031] Specifically, there are differences in the target shooting angles corresponding to the shooting device and each target detection point. According to the relative position relationship between the shooting device and each target detection point on the first sub-model, the relative angle information between the shooting device and each target detection point can be determined respectively, and the angle information can be used as relative shooting angle information.
[0032] S120. For each target detection point, determine a target reconstruction function corresponding to the current target detection point, and input the relative shooting angle information corresponding to the current target detection point into the target reconstruction function to obtain the distance information between the first sub-model and the second sub-model of the target detection point under the current shooting angle information.
[0033] The first sub-model is a sub-model that wraps the second sub-model locally; the reconstruction function is constructed based on the projection coefficient values of the target detection point on each basis function in the spherical harmonic function. Each target detection point has a corresponding target reconstruction function.
[0034] In order to clearly introduce the technical solution of this embodiment, a reconstruction function for reconstructing one of the target detection points may be taken as an example.
[0035] The reconstruction function of the target detection point is a function constructed by processing the projection coefficient of the current target detection point according to the spherical harmonic function to obtain the distance value corresponding to the collision between the physical ray and the second sub-model when the current target detection point emits physical rays in various directions in space. The reconstruction function can be used to process the input relative shooting angle to determine the distance information between the first sub-model and the second sub-model corresponding to the target detection point at the relative shooting angle.
[0036] Specifically, by processing the projection coefficient value corresponding to the current target detection point based on each basis function in the preset spherical harmonic function, the distance information between the collision point when the physical ray collides with the second sub-model and the current target detection point when the current target detection point emits physical rays in various directions in space can be obtained. According to the distance information in various directions in space corresponding to the current target detection point, the reconstruction function corresponding to the current target detection point is constructed.
[0037] After determining the target shooting angle between the current target detection point and the target shooting device, the target shooting angle can be input into the reconstruction function corresponding to the current target detection point. The reconstruction function can process the target shooting angle and output the distance information between the collision point and the current target detection point when the straight line to which the current target detection point and the target shooting device belong collides with the second sub-model under the target shooting angle.
[0038] Exemplarily, after determining the reconstruction function of a target detection point A, and when determining that the relative shooting angle between the target detection point and the shooting device is 45°, the relative shooting angle can be input into the reconstruction function value of the target detection point A, and the distance information between the first sub-model and the second sub-model corresponding to the target detection point A at this angle can be obtained, for example, the obtained distance information is 5nm.
[0039] S130 , determining transparency information of each target detection point according to distance information corresponding to each target detection point, and displaying the first sub-model and the second sub-model based on the transparency information.
[0040] The transparency information is used to indicate the degree of transparency when the model is displayed, and can be expressed in percentage, for example: the transparency is 80%.
[0041] It should be noted that the transparency parameter of each target detection point is determined in the same manner. In order to clearly introduce the technical solution of this embodiment, the determination of the transparency parameter of one of the target detection points is taken as an example.
[0042] Specifically, according to the distance information between the first sub-model and the second sub-model corresponding to the current target detection point, the transparency parameter of the current target detection point can be determined by: determining the transparency parameter in the correspondence between the pre-stored distance information and the transparency parameter according to the distance information, or calculating according to a pre-set transparency parameter calculation model, inputting the distance information into the transparency parameter calculation model, and obtaining the transparency parameter corresponding to the distance information after calculation.
[0043] Exemplarily, the distance information is recorded as dist. If 0nm<dist≤5nm, the transparency parameter is 90%, 5nm<dist≤10nm, the transparency parameter is 80%, and when dist=7.5nm, the corresponding transparency parameter is 80%.
[0044] Of course, the transparency parameter can also be determined by a corresponding calculation method, where the transparency calculation formula is a i =f(l i ), where a i represents the i-th target detection point, l i Represents the distance information between the first sub-model and the second sub-model corresponding to the i-th target detection point, and f is a monotonic and monotonically decreasing function.
[0045] After determining the transparency parameters of the target detection points, in order to make the visual experience of the first sub-model and the second sub-model better, the target detection points on the first sub-model can be displayed according to the corresponding transparency parameters, and the intersection of the target detection points and the straight line to which the target shooting device belongs and the second sub-model can be displayed according to the corresponding transparency parameters to obtain a transparent display effect.
[0046] According to each target detection point, the transparency parameter of each target detection point is determined, and the effect of transparently displaying the first sub-model and the second sub-model can be achieved. Specifically, according to the distance information corresponding to each target detection point, the transparency parameter corresponding to the distance information can be determined in the pre-stored correspondence between each distance information and the transparency parameter, which can include the transparency parameter of the first sub-model and the transparency parameter of the second sub-model, so as to be used in subsequent transparent display. After determining the transparency parameters corresponding to each target detection point under the target shooting angle for displaying the first sub-model and the second sub-model, the transparency display effect of the relative position of the first sub-model and the second sub-model can be achieved based on the above transparency parameters.
[0047] The technical solution of this embodiment determines the target shooting angle, retrieves the projection coefficient value from the vertex color and / or attribute information, and the distance information between the first sub-model and the second sub-model corresponding to the target detection point, and then determines the transparency parameter and displays it. This solves the technical problem that when the first sub-model is transparently displayed with a fixed transparency display value, the transparent display deviates from the actual situation, resulting in poor transparent display effect and poor user experience. It adjusts the transparency parameter according to the actual situation to make the transparent display effect consistent with the actual theoretical effect, thereby improving the technical effect of user experience.
[0048] On the basis of the above technical solution, the transparency information of each target detection point is determined according to the distance information corresponding to each target detection point, and the first sub-model and the second sub-model are displayed based on the transparency information, including: for each target detection point, the transparency information of the current target detection point is determined according to the distance information corresponding to the current target detection point, the attribute information of the first sub-model and the second sub-model; the attribute information includes material and / or color; based on the transparency information corresponding to each target detection point, the display information of the first sub-model and the second sub-model is adjusted.
[0049] Among them, the attribute information may include the material and / or color used when making the target detection point. For example, if the clothes are dark in color, then the transparency information is relatively small; if the second sub-model, that is, the color of the skin is dark, and the first sub-model, that is, the color of the clothes is light in color, then the transparency information is relatively large, that is, the intensity of the transparent display is relatively strong.
[0050] Specifically, after determining the distance information between the first sub-model and the second sub-model corresponding to each target detection point, the attribute information of the first sub-model and the second sub-model can be obtained, and the transparency information corresponding to each target detection point can be comprehensively determined by combining the attribute information and the distance information, thereby achieving the technical effect of transparent display of the first sub-model and the second sub-model.
[0051] Embodiment 2
[0052] Figure 2 This is a flow chart of a method for determining transparency provided in the second embodiment of the present invention. Based on the above embodiment, a reconstruction function can be reconstructed according to the spherical harmonic function and the projection coefficient value, so as to determine the distance information corresponding to each target detection point at the relative shooting angle between each target detection point and the shooting device based on the reconstruction function, and then determine the transparency parameter corresponding to each target detection point. The specific implementation method can be found in the following specific description. Among them, the explanation of the terms that are the same or corresponding to the above embodiments will not be repeated here.
[0053] See also Figure 2 The method for determining transparency provided in this embodiment includes:
[0054] S210 , determining a target reconstruction function corresponding to each target detection point according to the projection coefficient values of each basis function of each target detection point in the spherical harmonic function received in advance.
[0055] Among them, the target reconstruction function is used to process the input current shooting angle to obtain the distance information between the first sub-model and the second sub-model to which the target detection point corresponding to the current shooting angle belongs. Each target detection point has a corresponding target reconstruction function. When emitting rays at each target detection point, physical rays can be emitted in various directions in space, and the distance information between each physical ray and the first sub-model and the second sub-model can be determined. The spherical harmonic function processes each distance information, and all distances can be compressed into several function values, which can be used as projection coefficient values. By processing the projection coefficient value corresponding to each target detection point with the spherical harmonic function, the spherical function corresponding to the target detection point can be reconstructed, so that the relative shooting angle can be input into the spherical function, that is, the reconstruction function, to obtain the distance information at this angle.
[0056] Specifically, the pre-stored projection coefficient values corresponding to each target detection point can be obtained, and the projection coefficient values can be processed based on the spherical harmonic function to reconstruct the target reconstruction function corresponding to each target detection point. The target reconstruction function is a function that can determine the distance information between the first sub-model and the second sub-model at each relative shooting angle.
[0057] S220: Determine relative shooting angle information corresponding to the shooting device and each target detection point on the first sub-model.
[0058] S230: Input the relative shooting angle information corresponding to the current target detection point into the target reconstruction function to obtain the distance information between the first sub-model and the second sub-model of the target detection point under the current shooting angle information.
[0059] S240: Determine transparency information of each target detection point according to distance information corresponding to each target detection point, and display the first sub-model and the second sub-model based on the transparency information.
[0060] The technical solution of the embodiment of the present invention can reconstruct the projection coefficient value corresponding to each target detection point according to the spherical harmonic function to obtain the reconstruction function of each target detection point. When the relative shooting angle corresponding to each target detection point is input into the corresponding reconstruction function, the distance information between the first sub-model and the second sub-model corresponding to each target detection point can be obtained, and the transparency parameter information is further determined in combination with the distance information, so that different target detection points correspond to different transparency parameters, so as to improve the transparent display effect when displaying the first sub-model based on the transparency parameter.
[0061] Embodiment 3
[0062] Figure 3A flow chart of a method for determining transparency provided in Embodiment 3 of the present invention. Before determining the target reconstruction function corresponding to each target detection point according to the coefficient values of each basis function in the spherical harmonic function of each target detection point received in advance, it also includes: determining the projection coefficient value of each target detection point. The specific implementation method can be referred to the following introduction, wherein the technical terms that are the same as or corresponding to the above embodiments are not repeated here.
[0063] like Figure 3 As shown, the method includes:
[0064] S310, determining the projection coefficient value of each target detection point on each basis function in the spherical harmonic function.
[0065] In this embodiment, the projection coefficient value of each target detection point can be determined by: for each target detection point on the first sub-model, determining the information of the collision point to be processed when the current target detection point emits physical rays in each direction through the second sub-model, and determining the distance value of the current target collision in each direction according to the current target detection point and the information of each collision point to be processed. According to the distance value of each target detection point in each direction, determine the distance function corresponding to each target detection point. Process the distance function of each target detection point based on the spherical harmonic function to obtain the projection coefficient value of each target detection point on each basis function in the spherical harmonic function; the spherical harmonic function includes multiple basis functions.
[0066] Among them, the first sub-model and the second sub-model are relative. If the application scenario is a skin model and a clothing model, the model corresponding to the clothing can be used as the first sub-model, and the model corresponding to the skin can be used as the second sub-model. The target detection point can be a pre-set detection point on the first sub-model; it can also be a pre-set on the first sub-model divided into multiple blocks, and the center point of each block can be used as the target detection point; it can also be a detection point set by the developer according to actual needs; of course, it can also be that the first sub-model is composed of multiple points, and each point can be used as a target detection point. The distance function corresponds to each target detection point, that is, one target detection point corresponds to one distance function. For each distance function, it can be understood that it can be determined based on the relative distance information between a certain target detection point and the second sub-model in various directions in space.
[0067] Since it is a spherically distributed distance function, the distance between each target detection point and the second sub-model in each direction can be: taking the target detection point as the center of the sphere, emitting physical rays in each direction in space, and determining the distance information between the intersection of each physical ray with the second sub-model and the target detection point.
[0068] For example, if there are 1000 target detection points, the number of distance functions is also 1000, wherein each distance function may be a distance function determined based on the distance between a certain target detection point and the second sub-model in each direction.
[0069] It should be noted that the spherical distribution distance function of each target detection point is determined in the same manner. In order to clearly introduce the technical solution of this embodiment, the spherical distribution function of one target detection point is taken as an example for description.
[0070] Specifically, a target detection point on the first sub-model can be used as the center of the sphere, and physical rays can be emitted in various directions in the space to determine the distance information between the intersection of each physical ray with the second sub-model and the target detection point. If the physical ray has an intersection with the second sub-model in the direction of the ray, the distance between the intersection and the target detection point is used as the distance information between the target detection point and the second sub-model in the direction. If the spherical ray does not have an intersection with the second sub-model in the direction of the ray, the preset maximum distance information can be used as the distance information between the target detection point and the second sub-model in the direction.
[0071] According to the determined distance information of the target detection point in each direction in space, the distance function of the spherical distribution of the target detection point can be determined. For example, the spherical distribution distance function of the target detection point A is:
[0072]
[0073] Among them, i represents the i-th direction, F(i) represents the distance information in the i-th direction, dist_i represents the specific distance information, and n represents the total number of directions.
[0074] It should be noted that the distance function of the spherical distribution of each target detection point is a composite function. The number of sub-functions in the composite function can be determined according to the preset sampling number. The default can be 16×32 precision, that is, the composite function contains 512 sub-functions. When the sampling number is larger, the number of sub-functions in the composite function is more, and the precision is higher. The specific sampling number can be determined according to actual needs.
[0075] It should also be noted that the projection coefficient value of each target detection point is determined in the same manner. In order to clearly introduce the technical solution of this embodiment, the determination of the projection coefficient value of one of the target detection points is taken as an example.
[0076] Among them, the spherical harmonic function is composed of multiple basis functions, and each distance function can be processed using the basis function. The number of basis functions corresponding to different orders of spherical harmonic functions is different. The second-order spherical harmonic function contains 4 basis functions, the third-order spherical harmonic function contains 9 basis functions, and the fourth-order spherical harmonic function contains 16 basis functions. The projection coefficient value is the coefficient value obtained after processing the distance function according to the basis function in the spherical harmonic function, and the number of coefficient values is the same as the number of basis functions. According to the spherical harmonic function and its corresponding multiple basis functions, the spherical distribution distance function of the target detection point can be compressed to obtain the projection coefficient value.
[0077] Exemplary: the spherical harmonic function is of second order, that is, it includes 4 basis functions, then the distance function corresponding to the target detection point is input into the spherical harmonic function to obtain 4 projection coefficient values, thereby achieving the effect of compressing the distance function into 4 projection coefficient values.
[0078] It should be noted that the higher the order of the spherical harmonic function, the higher the similarity between the reconstructed sphere and the actual sphere during reconstruction, so developers can choose spherical harmonic functions of different orders according to actual needs. The higher the order of the spherical harmonic function, the more basis functions it contains, and the higher the degree of restoration when restoring the distance function based on the spherical harmonic function and the projection coefficient value.
[0079] Specifically, after determining the specific order of the spherical harmonic function, the distance function of the spherical distribution of the target detection point can be input into the spherical harmonic function, and the distance function can be processed based on the basis function in the spherical harmonic function to obtain the projection coefficient value of the distance function on each basis function. It can be seen that the number of projection coefficient values is equal to the number of basis functions in the spherical harmonic function.
[0080] It should be noted that the distance function of the spherical distribution of each target detection point can be the same or different. When the distance information of different target detection points in each direction in space is the same, the distance functions corresponding to the different target detection points are the same. When there is at least one difference in the distance information of different target detection points in each direction in space, the distance functions corresponding to the different target detection points are different. Whether the distance functions are the same is determined based on the distance information of the target detection points in each direction in space. After different distance functions are input into the preset spherical harmonic function for processing, different projection coefficient values are obtained.
[0081] S320, storing the projection coefficient value of each target detection point in at least one image according to the spatial position relationship, and storing the at least one image to the target position, so as to obtain the projection coefficient values of all target detection points on the corresponding order spherical harmonic function from the target position.
[0082] On the basis of the above technical solution, after determining the projection coefficient value corresponding to each target detection point, it also includes storing the projection coefficient value in at least one image to obtain the projection coefficient value of the corresponding target detection point from at least one image, thereby reconstructing the corresponding target reconstruction function.
[0083] Optionally, the projection coefficient value of each target detection point is stored in at least one image according to the spatial position relationship, and the at least one image is stored in the target position to obtain the projection coefficient values of all target detection points on the corresponding order spherical harmonic function from the target position.
[0084] It should be noted that the method of storing the projection coefficient value of each target detection point is the same, and the storage of the projection coefficient value corresponding to a certain target detection point can be taken as an example for introduction.
[0085] Among them, if the spherical harmonic function is of second order, the number of basis functions can be four. After processing the distance function through the basis functions in the spherical harmonic function, four projection coefficient values can be obtained. The projection coefficient values can be stored in the image according to the spatial coordinate position information. Optionally, if there are four projection coefficient values, four images can be used to store the projection coefficient values, and each pixel in each image stores a projection coefficient value. At least one image can be stored in the engine, and the position stored in the engine can be used as the target position. The advantage of storing the image at the target position is that the stored projection coefficient value can be obtained from the target position so that a reconstruction function can be constructed based on the projection coefficient value.
[0086] Specifically, the number of images may be determined according to the number of projection coefficient values, and the projection coefficient values may be stored in corresponding pixel points in the image according to spatial coordinate information.
[0087] For example, if the order of the spherical harmonic function is 3, the number of basis functions in the spherical harmonic function is 9, and each target detection point has 9 projection coefficient values. At this time, nine images can be determined, and the nine projection coefficient values of each target detection point can be stored in the corresponding pixel points in each image according to the spatial coordinate information.
[0088] S330, for each target detection point, retrieve at least one image from the target position, and determine the target pixel point position of the current target detection point in the at least one image, and obtain the target reconstruction function corresponding to the current target detection point according to the retrieved projection coefficient values.
[0089] In actual application, if each target detection point on the first sub-model needs to be displayed transparently, it is necessary to determine the distance information of each target detection point at the relative shooting angle, and then determine the transparency parameter according to the distance information. When determining the distance information of each target detection point at the relative shooting angle, a reconstruction function corresponding to each target detection point can be reconstructed according to the projection coefficient value stored at the target position, so that the relative shooting angle is input into the corresponding reconstruction function to obtain the distance information corresponding to each target detection point.
[0090] Specifically, for each target detection point, the spatial coordinate information of the current target detection point can be obtained, and the target pixel position of the current target detection point in each image can be determined according to the spatial coordinate information, and the stored projection coefficient value can be obtained from the target pixel position of each image. The stored projection coefficient values are reconstructed according to the spherical harmonic function to obtain the distance information between the current target detection point and the point to be collided when the current target detection point corresponding to each physical ray collides with the second sub-model when the current target detection point emits physical rays in various directions in the space, and the distance function obtained according to each distance information, that is, the target reconstruction function corresponding to each target detection point is the distance function.
[0091] S340: Input the relative shooting angle information corresponding to the current target detection point into the target reconstruction function to obtain the distance information between the first sub-model and the second sub-model of the target detection point under the current shooting angle information.
[0092] S350: Determine transparency information of each target detection point according to distance information corresponding to each target detection point, and display the first sub-model and the second sub-model based on the transparency information.
[0093] The technical solution of the embodiment of the present invention predetermines the projection coefficient value corresponding to each target detection point, and stores the projection coefficient value in a preset number of maps, so that when transparently displayed, the stored projection coefficient value can be called from the corresponding position, and then a reconstruction function is reconstructed based on the projection coefficient value, thereby determining the distance information of each target detection point at different relative shooting angles based on the reconstruction function.
[0094] Embodiment 4
[0095] Figure 4 This is a flow chart of a method for determining transparency provided by Embodiment 4 of the present invention. Based on the above embodiments, the specific method for determining the distance function can be referred to the technical solution of this embodiment. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.
[0096] like Figure 4 As shown, the method includes:
[0097] S410 , for each target detection point on the first sub-model, determine each to-be-processed collision point information when the current target detection point emits physical rays in each direction through the second sub-model.
[0098] The information of each collision point to be processed may include the position information of each collision point to be processed, such as spatial coordinate information, etc. Optionally, with the current target detection point as the center of the sphere, physical rays are emitted in any direction in the space, and the collision points to be processed when each physical ray intersects with the second sub-model are recorded, and the distance value between each collision point to be processed and the target detection point is determined.
[0099] Specifically, physical rays may be emitted in various directions based on each target detection point on the first sub-model. Each of the physical rays may pass through the second sub-model. When the physical ray passes through the second sub-model, it is determined that there is a collision point to be processed between the physical ray and the second sub-model, and the intersection of the physical ray and the second sub-model is the collision point to be processed. The information of the collision point to be processed may be information used to describe the position of the point, such as spatial coordinate information. Therefore, based on the collision point to be processed, the spatial coordinate information corresponding to the collision point to be processed may be determined as the collision point information to be processed.
[0100] In this embodiment, the information of the collision point to be processed may be determined by emitting physical rays in any direction in space with the current target detection point as the center of the sphere, and determining the information of the collision point to be processed when each physical ray passes through the second sub-model.
[0101] Specifically, emitting physical rays from each target detection point on the first sub-model to each direction can be regarded as emitting physical rays to each direction of the sphere with the current target detection point as the center of the sphere. If the physical ray passes through the second sub-model, the spatial coordinate information of the intersection of the physical ray and the second sub-model is used as the collision point information to be processed.
[0102] S420: Determine the distance information between the current target detection point and the second sub-model in each direction according to the information of the current target detection point and each collision point to be processed.
[0103] When there is a collision point to be processed between the physical ray and the second sub-model, the distance information between the collision point information to be processed and the current target detection point is determined.
[0104] Specifically, when there is a collision point to be processed, the distance information between the collision point to be processed and the current target detection point can be calculated based on the spatial coordinate information of the current target detection point and the spatial coordinate information of the collision point to be processed using the calculation formula for the distance between two points in space.
[0105] When there is no collision point to be processed between the physical ray and the second sub-model, the distance information corresponding to the collision point to be processed is set to a set value.
[0106] Specifically, if the physical ray does not pass through the second sub-model, for example, the emitted physical ray is parallel to the second sub-model or is emitted in a direction opposite to the second sub-model, and there is no collision point between the physical ray and the second sub-model, the collision information to be processed at this time can be set to a set value. The set value can be the maximum distance information between the collision point information to be processed and the current target detection point.
[0107] According to the distance information or the set value corresponding to each collision point to be processed, the distance information between the current target detection point and the second sub-model in each direction is determined.
[0108] Specifically, based on the above two situations, the distance information or set value corresponding to each physical ray emitted by the current target detection point can be determined, and the distance information or set value can be used as the distance information between the current target detection point and the second sub-model in each direction.
[0109] S430: Determine a distance function of a spherical distribution of a corresponding target detection point according to the distance information of each target detection point in each direction.
[0110] Specifically, the distance information of each target detection point in each direction in space is used as a sub-function in the distance function of the spherical distribution of the target detection point, and the distance function of the spherical distribution of the target detection point can be obtained. The number of sub-functions in the distance function is the same as the number of distance information of the target detection point in each direction of the sphere.
[0111] It should be noted that, in order to improve the accuracy, the number of sub-functions can be increased, that is, the density of physical rays can be increased. The specific number of physical rays can be determined according to actual needs.
[0112] S440, determining the order of the spherical harmonic function and the distance function, and determining the number of basis functions and the representation method of the basis functions.
[0113] Among them, different orders of spherical harmonics contain different numbers of basis functions, for example, the second-order spherical harmonics contain 4 basis functions, the third-order spherical harmonics contain 9 basis functions, and the fourth-order spherical harmonics contain 16 basis functions. The higher the order of the spherical harmonics, the better the effect will be when the reconstruction function is used later. The specific order needs to be set according to actual needs.
[0114] Specifically, the order of the spherical harmonic function is determined to be a according to the requirements, so the number of basis functions in the spherical harmonic function can be determined to be a 2 The representation of each basis function can be determined based on the relationship between the distance function and the projection coefficient value.
[0115] S450 . For each target detection point, the distance function of the current target detection point is processed based on each basis function in the spherical harmonic function to obtain a projection coefficient value of the current target detection point.
[0116] It should be noted that the projection coefficient value of each target detection point is determined in the same manner. In order to clearly introduce the technical solution of this embodiment, the determination of the projection coefficient value of one of the target detection points is taken as an example.
[0117] The number of projection coefficient values is the same as the number of basis functions. The projection coefficient values are values determined by calculating the distance function using each basis function in the preset spherical harmonic function.
[0118] Specifically, the projection coefficient value corresponding to the basis function can be obtained by processing the distance function of the target detection point based on each basis function, so the number of projection coefficient values is the same as the number of basis functions. The distance function of the target detection point is input into each basis function of the spherical harmonic function, and the projection coefficient value of the distance function on each basis function can be obtained.
[0119] It should be noted that the distance function of the spherical distribution of each target detection point is different. After different distance functions are input into the preset spherical harmonic function for processing, different projection coefficient values are obtained.
[0120] S460, storing the projection coefficient value of each target detection point in at least one image according to the spatial position relationship, and storing at least one image in the target position to obtain the projection coefficient values of all target detection points on the corresponding order spherical harmonic function from the target position.
[0121] The target location may be stored in an engine. The engine may be a core component of a pre-written editable computer game system or some interactive real-time image application. The target location may be a storage space in the engine for storing data and / or information, and in this embodiment, it is a storage space for storing coordinate information of a target detection point.
[0122] Specifically, after determining the number of projection coefficient values of the current target detection point, multiple images corresponding to the number of coefficient values can be obtained. The storage position of the spatial coordinates in the image is determined according to the spatial coordinate information of the current target detection point, and the projection coefficient value of the current target detection point is stored in the corresponding storage position in the image, so as to obtain the stored projection coefficient value from the image at the target position, thereby reconstructing the reconstruction function. That is, if the projection coefficient value corresponding to a certain target detection point needs to be used, the projection coefficient value corresponding to the spatial coordinate information can be determined according to the target position of the spatial coordinate information of the target detection point in the engine, so as to be used by the subsequent reconstruction function.
[0123] S470: Determine relative shooting angle information corresponding to the shooting device and each target detection point on the first sub-model.
[0124] S480. For each target detection point, obtain the projection coefficient value of the current target detection point from the target position, and obtain the target reconstruction function of the current target detection point, input the relative shooting angle information corresponding to the current target detection point into the target reconstruction function, and obtain the distance information between the first sub-model and the second sub-model of the target detection point under the current shooting angle information.
[0125] S490: Determine transparency information of each target detection point according to distance information corresponding to each target detection point, and display the first sub-model and the second sub-model based on the transparency information.
[0126] On the basis of the above technical solution, it should be noted that after determining the distance function corresponding to each target detection point, the advantage of also wanting to compress the distance function based on the spherical harmonic function to obtain the projection coefficient value is that: the distance function corresponding to each target detection point can be one or more. At this time, the amount of data that needs to be stored is relatively large. In order to reduce the occupancy rate of the storage space, the projection function can be compressed into several projection coefficient values.
[0127] The technical solution of the embodiment of the present invention determines the distance function of the spherical distribution of each target detection point on the first sub-model, processes the distance function based on a preset spherical harmonic function to determine the projection coefficient and stores it in the vertex color and / or attribute information, so as to determine and display the transparency parameter at the target shooting angle according to the stored information and the reconstruction function, thereby solving the technical problem that when the first sub-model is transparently displayed with a fixed transparency display value, the transparent display deviates from the actual situation, resulting in poor transparent display effect and poor user experience, and realizes adjusting the transparency parameter according to the actual situation so that the transparent display effect is consistent with the actual theoretical effect, thereby improving the technical effect of user experience.
[0128] Embodiment 5
[0129] Figure 5 FIG. 5 is a schematic diagram of a device structure for determining transparency provided by Embodiment 5 of the present invention. Figure 5 As shown, the device includes: a relative shooting angle information determination module 510, a distance information determination module 520 and a transparent display module 530.
[0130] Among them, the relative shooting angle information determination module 510 is used to determine the relative shooting angle information corresponding to the shooting device and each target detection point on the first sub-model; the distance information determination module 520 is used to determine the target reconstruction function corresponding to the current target detection point for each target detection point, and input the relative shooting angle information corresponding to the current target detection point into the target reconstruction function to obtain the distance information between the first sub-model and the second sub-model of the target detection point under the current shooting angle information; the first sub-model is a sub-model that wraps the local part of the second sub-model; the reconstruction function is constructed based on the projection coefficient value of the target detection point on each basis function in the spherical harmonic function; the transparent display module 530 is used to determine the transparency information of each target detection point according to the distance information corresponding to each target detection point, and display the first sub-model and the second sub-model based on the transparency information.
[0131] Based on the above technical solution, the device further includes: determining a target reconstruction function module, and also used for
[0132] According to the coefficient values of each basis function of each target detection point in the spherical harmonic function received in advance, the target reconstruction function corresponding to each target detection point is determined; the target reconstruction function is used to process the input current shooting angle to obtain the distance information between the first sub-model and the second sub-model to which the target detection point corresponding to the current shooting angle belongs.
[0133] On the basis of the above-mentioned technical solutions, the module for determining the target reconstruction function, before being used to determine the target reconstruction function corresponding to each target detection point according to the coefficient values of each basis function of each target detection point in the spherical harmonic function received in advance, is also used to: determine the projection coefficient values of each target detection point on each basis function in the spherical harmonic function; the determination of the projection coefficient values of each target detection point on each basis function in the spherical harmonic function includes: for each target detection point on the first sub-model, determining the information of the collision point to be processed when the current target detection point emits physical rays in each direction through the second sub-model, and determining the distance value of the current target collision in each direction according to the current target detection point and the information of each collision point to be processed; determining the distance function corresponding to each target detection point according to the distance value of each target detection point in each direction; processing the distance function of each target detection point based on the spherical harmonic function to obtain the projection coefficient value of each target detection point on each basis function in the spherical harmonic function; the spherical harmonic function includes multiple basis functions.
[0134] On the basis of the above-mentioned technical solutions, the distance information determination module is used to determine the information of the collision point to be processed when the current target detection point emits physical rays in various directions through the second sub-model, and determines the distance value of the current target collision in various directions according to the information of the current target detection point and each collision point to be processed. It is also used to: take the current target detection point as the center of the sphere, emit physical rays in any direction in the space, record the collision point to be processed when each physical ray intersects with the second sub-model, and determine the distance value between each collision point to be processed and the target detection point; if there is no collision point to be processed between the physical ray and the second sub-model, mark the distance value corresponding to the physical ray as the set value; based on the distance value corresponding to each physical ray and the set value, determine the distance value of the current target detection point in various directions.
[0135] On the basis of the above-mentioned technical solutions, the device also includes: a projection coefficient value determination module, which is used to: determine the order of the spherical harmonic function, and determine the representation method of the basis function and the number of basis functions according to the order; for each target detection point, the distance function of the current target detection point is processed based on each basis function to obtain the projection coefficient value of the current target detection point in the direction of the basis function; the number of the projection coefficient values is the same as the number of the basis functions.
[0136] On the basis of the above-mentioned technical solutions, the device also includes: a projection coefficient value storage module, which is also used to store the projection coefficient value of each target detection point in at least one image according to the spatial position relationship, and store the at least one image to the target position, so as to obtain the projection coefficient values of all target detection points on the corresponding order spherical harmonic function from the target position.
[0137] On the basis of the above-mentioned technical solutions, the target reconstruction function determination module is also used to: retrieve the at least one image from the target position and determine the target pixel position of the current collision point in the at least one image; retrieve the stored projection coefficient values from the target pixel position in the at least one image respectively; and determine the target reconstruction function corresponding to the target detection point based on the projection coefficient values and the spherical harmonic function.
[0138] On the basis of the above-mentioned technical solutions, the distance information determination module is also used to: determine the relative shooting angle information corresponding to the current target detection point and the shooting device; input the relative shooting angle information into the target reconstruction function to determine the distance information corresponding to the current collision point under the relative shooting angle, wherein the distance information is the distance information between the target detection point and the collision point of the second sub-model when the straight line to which the target detection point and the shooting device belong collides with the second sub-model.
[0139] The basis of the above-mentioned technical solutions is that the device also includes: a transparency information determination module, which is also used to determine the transparency information corresponding to each target detection point according to the distance information corresponding to each target detection point and the pre-established correspondence between the distance information and the transparency information.
[0140] On the basis of the above-mentioned technical solutions, the device also includes a transparent display module, which is used to determine, for each target detection point, the transparency information of the current target detection point according to the distance information corresponding to the current target detection point, the attribute information of the first sub-model and the second sub-model; the attribute information includes material and / or color; based on the transparency information corresponding to each target detection point, adjust the display information of the first sub-model and the second sub-model.
[0141] The technical solution of this embodiment determines the distance function of the spherical distribution of each target detection point on the first sub-model, processes the distance function based on the preset spherical harmonic function to determine the projection coefficient and stores it in the vertex color and / or attribute information, so as to determine and display the transparency parameter at the target shooting angle according to the stored information and the reconstruction function, thereby solving the technical problem of poor transparent display effect and poor user experience caused by the deviation between the transparent display and the actual situation when the first sub-model is transparently displayed with a fixed transparency display value, and adjusting the transparency parameter according to the actual situation to make the transparent display effect consistent with the actual theoretical effect, thereby improving the technical effect of user experience.
[0142] The device for determining transparency provided by the embodiment of the present invention can execute the method for determining transparency provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0143] It is worth noting that the various units and modules included in the above-mentioned device for determining transparency are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.
[0144] Embodiment 6
[0145] Figure 6 A schematic diagram of the structure of an electronic device provided in Embodiment 6 of the present invention. Figure 6 A block diagram of an exemplary electronic device 60 suitable for implementing exemplary embodiments of the present invention is shown. Figure 6 The electronic device 60 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0146] like Figure 6As shown, the electronic device 60 is in the form of a general computing device. The components of the electronic device 60 may include but are not limited to: one or more processors or processing units 601, a system memory 602, and a bus 603 connecting different system components (including the system memory 602 and the processing unit 601).
[0147] Bus 603 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0148] The electronic device 60 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 60, including volatile and non-volatile media, removable and non-removable media.
[0149] The system memory 602 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 604 and / or cache memory 605. The electronic device 60 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 606 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 603 via one or more data medium interfaces. Memory 602 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.
[0150] A program / utility 608 having a set (at least one) of program modules 607 may be stored, for example, in the memory 602, such program modules 607 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 607 generally perform the functions and / or methods of the embodiments described herein.
[0151] The electronic device 60 may also communicate with one or more external devices 609 (e.g., keyboards, pointing devices, displays 610, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 60, and / or may communicate with any device that enables the electronic device 60 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 611. Furthermore, the electronic device 60 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 612. As shown, the network adapter 612 communicates with other modules of the electronic device 60 via a bus 603. It should be understood that although Figure 6 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 60, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0152] The processing unit 601 executes various functional applications and data processing by running the programs stored in the system memory 602, such as implementing the method for determining transparency provided in the embodiment of the present invention.
[0153] Embodiment 7
[0154] Embodiment 7 of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to perform a method for determining transparency when executed by a computer processor, the method comprising:
[0155] Determine relative shooting angle information corresponding to each target detection point on the first sub-model and the shooting device;
[0156] For each target detection point, a target reconstruction function corresponding to the current target detection point is determined, and relative shooting angle information corresponding to the current target detection point is input into the target reconstruction function to obtain distance information between the first sub-model and the second sub-model of the target detection point under the current shooting angle information; the first sub-model is a sub-model that wraps a part of the second sub-model; the reconstruction function is constructed based on the projection coefficient value of the target detection point on each basis function in the spherical harmonic function;
[0157] According to the distance information corresponding to each target detection point, the transparency information of each target detection point is determined, and the first sub-model and the second sub-model are displayed based on the transparency information.
[0158] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0159] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0160] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0161] Computer program code for performing the operation of embodiments of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0162] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for determining transparency, characterized in that include: Determine relative shooting angle information corresponding to each target detection point on the first sub-model and the shooting device; For each target detection point, a target reconstruction function corresponding to the current target detection point is determined, and relative shooting angle information corresponding to the current target detection point is input into the target reconstruction function to obtain distance information between the first sub-model and the second sub-model of the target detection point under the current shooting angle information; the first sub-model is a sub-model that wraps a part of the second sub-model; The reconstruction function is constructed based on the projection coefficient values of the target detection point on each basis function in the spherical harmonic function; According to the distance information corresponding to each target detection point, the transparency information of each target detection point is determined, and the first sub-model and the second sub-model are displayed based on the transparency information.
2. The method according to claim 1, characterized in that Also includes: Determine the target reconstruction function corresponding to each target detection point; The determining of the target reconstruction function corresponding to each target detection point includes: Determine a target reconstruction function corresponding to each target detection point according to the projection coefficient values of each basis function of each target detection point in the spherical harmonic function received in advance; The target reconstruction function is used to process the input current shooting angle to obtain the distance information between the first sub-model and the second sub-model to which the target detection point corresponding to the current shooting angle belongs.
3. The method according to claim 1, characterized in that Before determining the target reconstruction function corresponding to each target detection point according to the coefficient values of each basis function in the spherical harmonic function of each target detection point received in advance, the method further includes: Determine the projection coefficient value of each target detection point on each basis function in the spherical harmonic function; Determining the projection coefficient value of each target detection point on each basis function in the spherical harmonic function includes: For each target detection point on the first sub-model, determine the information of the collision point to be processed when the current target detection point emits physical rays in each direction through the second sub-model, and determine the distance value of the current target collision in each direction according to the current target detection point and the information of each collision point to be processed; According to the distance value of each target detection point in each direction, determine the distance function corresponding to each target detection point; The distance function of each target detection point is processed based on the spherical harmonic function to obtain the projection coefficient value of each target detection point on each basis function in the spherical harmonic function; the spherical harmonic function includes multiple basis functions.
4. The method according to claim 3, characterized in that The determining of the information of the collision points to be processed when the current target detection point emits physical rays in various directions through the second sub-model, and determining the distance value of the current target collision in various directions according to the current target detection point and the information of the collision points to be processed, includes: Taking the current target detection point as the sphere center, emitting physical rays in any direction in the space, recording the collision points to be processed when each physical ray intersects with the second sub-model, and determining the distance value between each collision point to be processed and the target detection point; If there is no collision point to be processed between the physical ray and the second sub-model, marking the distance value corresponding to the physical ray as a set value; Based on the distance values and set values corresponding to each physical ray, the distance values of the current target detection point in each direction are determined.
5. The method according to claim 3, characterized in that: The distance function of each target detection point is processed based on the spherical harmonic function to obtain the projection coefficient value of each target detection point on each basis function in the spherical harmonic function, including: Determining the order of the spherical harmonics, and determining the representation of basis functions and the number of basis functions according to the order; For each target detection point, the distance function of the current target detection point is processed based on each basis function to obtain the projection coefficient value of the current target detection point in the basis function direction; the number of the projection coefficient values is the same as the number of the basis functions.
6. The method according to claim 3, characterized in that Also includes: The projection coefficient value of each target detection point is stored in at least one image according to the spatial position relationship, and the at least one image is stored in the target position to obtain the projection coefficient values of all target detection points on the corresponding order spherical harmonic function from the target position.
7. The method according to claim 6, characterized in that The determining of the target reconstruction function corresponding to the current target detection point includes: For each target detection point, retrieve the at least one image from the target position, and determine the target pixel point position of the current target detection point in the at least one image; Retrieving the stored projection coefficient values from the target pixel positions in the at least one image respectively; Reconstructing each projection coefficient value corresponding to the current target detection point based on the spherical harmonic function to obtain a target reconstruction function corresponding to the current target detection point.
8. The method according to claim 1, characterized in that The step of inputting the relative shooting angle information corresponding to the current target detection point into the target reconstruction function to obtain the distance information between the first sub-model and the second sub-model of the target detection point under the current shooting angle information includes: Determine the relative shooting angle information corresponding to the current target detection point and the shooting device; The relative shooting angle information is input into the target reconstruction function to determine the distance information corresponding to the current collision point at the relative shooting angle, wherein the distance information is the distance information between the target detection point and the collision point of the second sub-model when the target detection point and the straight line to which the shooting device belongs collide with the second sub-model.
9. The method according to claim 1, characterized in that: The step of determining the transparency information of each target detection point according to the distance information corresponding to each target detection point includes: According to the distance information corresponding to each target detection point and the pre-established correspondence between the distance information and the transparency information, the transparency information corresponding to each target detection point is determined.
10. The method according to claim 1, characterized in that The step of determining transparency information of each target detection point according to distance information corresponding to each target detection point, and displaying the first sub-model and the second sub-model based on the transparency information includes: For each target detection point, determine the transparency information of the current target detection point according to the distance information corresponding to the current target detection point, the attribute information of the first sub-model and the second sub-model; the attribute information includes material and / or color; Based on the transparency information corresponding to each target detection point, the display information of the first sub-model and the second sub-model is adjusted.
11. A device for determining transparency, characterized in that include: A relative shooting angle information determination module, used to determine the relative shooting angle information corresponding to the shooting device and each target detection point on the first sub-model; a distance information determination module, for determining, for each target detection point, a target reconstruction function corresponding to the current target detection point, and inputting relative shooting angle information corresponding to the current target detection point into the target reconstruction function, to obtain distance information between the first sub-model and the second sub-model of the target detection point under the current shooting angle information; the first sub-model is a sub-model that wraps a part of the second sub-model; The reconstruction function is constructed based on the projection coefficient values of the target detection point on each basis function in the spherical harmonic function; The transparent display module is used to determine the transparency information of each target detection point according to the distance information corresponding to each target detection point, and display the first sub-model and the second sub-model based on the transparency information.
12. An electronic device, comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining transparency as described in any one of claims 1-10.
13. A storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to perform the method for determining transparency as claimed in any one of claims 1 to 10.
Citation Information
Patent Citations
Real-time transparent object GPU (graphic processing unit) parallel generating method based on three-dimensional point cloud
CN102915559A
Position indication information display method and device, electronic device and storage medium
CN108525300A