Method, device, electronic device and storage medium for determining transparency
By processing coordinate information and distance functions of the object detection points on the first sub-model in animation design, and using spherical harmonics to generate projection coefficient values, reconstruct transparency parameters, the problem of poor transparent display effect in the existing technology is solved, and a better user experience is achieved.
Patent Information
- Application Number
- CN202011444007.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
In the prior art, a fixed transparency display value is usually used when determining the translucent effect, resulting in a deviation from the actual situation, resulting in poor transparent display effect and poor user experience.
By determining the current coordinate information and distance function for each target detection point on the first sub-model, and processing the distance function based on the preset spherical harmonic function, the projection coefficient value is obtained. These projection coefficient values are used to reconstruct the target reconstruction function, thereby determining the transparency parameters, and realizing dynamic adjustment of transparency to match the actual situation.
The transparent display effect is consistent with the actual situation, improves the user experience, and solves the problem of poor transparent display effect caused by fixed transparency display value.
Smart Images

Figure CN114612602B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to game development technology, and more particularly 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 usually determined by setting the transparency display value of the outer model, which 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 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] For each target detection point on the first sub-model, determine the current coordinate information of the current target detection point, and determine the distance function with the current target detection point based on the current coordinate information; the current coordinate information is the coordinate obtained after matrix transformation of the three-dimensional space coordinates of the current target detection point, and the distance function is determined according to the relative distance information between the target detection point and the second sub-model in each direction; the first sub-model is a model that wraps the second sub-model;
[0007] Processing the distance function of each target detection point based on a preset spherical harmonic function to obtain a projection coefficient value of each target detection point; the spherical harmonic function is composed of multiple basis functions;
[0008] For each target detection point, the projection coefficient value of the current target detection point is stored in the target storage position in the engine, so that when transparent display is detected, a target reconstruction function is reconstructed based on the projection coefficient value stored in the target storage position, and the target distance information between the first sub-model and the second sub-model under the target shooting angle is determined based on the target reconstruction function, and the transparency parameter corresponding to the target distance information is determined, so as to display each target detection point on the first sub-model based on the transparency parameter of each target detection point.
[0009] In a second aspect, an embodiment of the present invention further provides a method for determining transparency, the method comprising:
[0010] Determine a target shooting angle corresponding to each target detection point on the first sub-model and the shooting device;
[0011] For each target detection point, the target coordinate information is determined according to the current coordinate information of the current target detection point, and the target reconstruction function of the current target detection point is reconstructed according to the target coordinate information and the projection coefficient value of the current target detection point; the current coordinate information is the coordinates obtained after matrix transformation of the three-dimensional space coordinates of the current target detection point; the first sub-model is a model wrapping the second sub-model; the projection coefficient value is determined after processing the distance function of the spherical distribution of each target detection point on the first sub-model based on the spherical harmonic function;
[0012] Based on the reconstruction function corresponding to each target detection point and the corresponding target shooting angle, the distance information corresponding to each target detection point is determined, the transparency parameter between the first sub-model and the second sub-model is determined based on the distance information, and the first sub-model is displayed based on the transparency parameter.
[0013] In a third aspect, an embodiment of the present invention further provides a device for determining transparency, the device comprising:
[0014] a distance information determination module, for determining the current coordinate information of the current target detection point for each target detection point on the first sub-model, and determining a distance function with the current target detection point based on the current coordinate information; the current coordinate information is the coordinate obtained by performing a matrix transformation on the three-dimensional space coordinates of the current target detection point, and the distance function is determined according to the relative distance information between the target detection point and the second sub-model in each direction; the first sub-model is a model that wraps the second sub-model;
[0015] A projection coefficient value determination module is used to process the distance function of each target detection point based on a preset spherical harmonic function to obtain the projection coefficient value of each target detection point; the spherical harmonic function is composed of multiple basis functions;
[0016] A transparency parameter determination module is used to store the projection coefficient value of the current target detection point to the target storage position in the engine for each target detection point, so as to reconstruct a target reconstruction function based on the projection coefficient value stored in the target storage position when transparent display is detected, determine the target distance information between the first sub-model and the second sub-model under the target shooting angle based on the target reconstruction function, and determine the transparency parameter corresponding to the target distance information, so as to display each target detection point on the first sub-model based on the transparency parameter of each target detection point.
[0017] In a fourth aspect, an embodiment of the present invention further provides a device for determining transparency, including:
[0018] A target shooting angle determination module, used to determine the target shooting angle corresponding to each target detection point on the first sub-model and the shooting device;
[0019] A target reconstruction function reconstruction module is used to determine the target coordinate information of each target detection point according to the current coordinate information of the current target detection point, and reconstruct the target reconstruction function of the current target detection point according to the target coordinate information and the projection coefficient value of the current target detection point; the current coordinate information is the coordinates obtained after matrix transformation of the three-dimensional space coordinates of the current target detection point; the first sub-model is a model wrapping the second sub-model; the projection coefficient value is determined based on the distance function processing of the spherical distribution of each target detection point on the first sub-model by the spherical harmonic function;
[0020] A transparent display module is used to determine the distance information corresponding to each target detection point based on the reconstruction function corresponding to each target detection point and the corresponding target shooting angle, determine the transparency parameter between the first sub-model and the second sub-model based on the distance information, and display the first sub-model based on the transparency parameter.
[0021] In a fifth aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0022] one or more processors;
[0023] a storage device for storing one or more programs,
[0024] 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.
[0025] In a sixth 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 execute the method for determining transparency as described in any one of the embodiments of the present invention.
[0026] The technical solution of the embodiment of the present invention determines the current coordinate information of the current target detection point for each target detection point on the first sub-model, determines the distance function with the current target detection point based on the current coordinate information, and processes the distance function of each target detection point based on a preset spherical harmonic function to obtain the projection coefficient value of each target detection point, and then stores the projection coefficient value of the current target detection point to the target storage position in the engine, 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 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
[0027] 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.
[0028] Figure 1 A flowchart of a method for determining transparency provided in Embodiment 1 of the present invention;
[0029] Figure 2 A schematic flow chart of a method for determining transparency provided in Embodiment 2 of the present invention;
[0030] Figure 3 A schematic flow chart of a method for determining transparency provided in Embodiment 3 of the present invention;
[0031] Figure 4 A flowchart of a method for determining transparency provided in Embodiment 4 of the present invention;
[0032] Figure 5 A schematic diagram of the structure of a device for determining transparency provided in Embodiment 5 of the present invention;
[0033] Figure 6 A schematic diagram of the structure of a device for determining transparency provided by Embodiment 6 of the present invention;
[0034] Figure 7 This is a structural schematic diagram of an electronic device provided in Embodiment 7 of the present invention. DETAILED DESCRIPTION
[0035] 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.
[0036] Embodiment 1
[0037] 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 the situation where the transparency parameter is adjusted according to the actual situation so that the transparent display effect is consistent with the actual theoretical effect. The method can be executed by a device for determining transparency, which 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.
[0038] like Figure 1 The present embodiment specifically includes the following steps:
[0039] S110 . For each target detection point on the first sub-model, determine current coordinate information of the current target detection point, and determine a distance function with the current target detection point based on the current coordinate information.
[0040] 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 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 current coordinate information is the coordinate obtained after the three-dimensional space coordinates of the current target detection point are matrix-changed, and can be determined based on the tangent, sub-tangent and normal of the current target detection point. Specifically, a coordinate system can be established based on the tangent, sub-tangent and normal of the current target detection point, and the spatial coordinates under the three-dimensional space coordinate system are converted into coordinates in the directions of the tangent, sub-tangent and normal. The coordinates obtained at this time are the current coordinate information. 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. Since it is a spherically distributed distance function, the distance between each target detection point and the second sub-model in various directions can be: with the target detection point as the center of the sphere, physical rays are emitted in various directions in space, and the distance information between the intersection of each physical ray and the second sub-model and the target detection point is determined. Exemplarily, if there are 1000 target detection points, the number of distance functions is also 1000, and each distance function can be a distance function determined based on the distance between a certain target detection point and the second sub-model in various directions.
[0041] 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.
[0042] Specifically, a target detection point on the first sub-model can be used as the center of the sphere to emit physical rays 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 physical 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.
[0043] It should be noted that the distance information of the current target detection point in each direction in space is determined in the same manner. In order to clearly introduce the technical solution of this embodiment, the determination of one direction is taken as an example.
[0044] The current target detection point emits a physical ray in a certain direction in space. If the physical ray intersects with the second sub-model, the method for determining the distance information of the current target detection point in the current direction may be based on the three-dimensional spatial coordinate information of the current target detection point and the three-dimensional spatial coordinate information of the collision point of the intersection of the current physical ray and the second sub-model, which can be determined by the straight-line distance formula between two points in space. For example, if the current coordinate information is (am1, am2, am3), and the collision point coordinate information is (ap1, ap2, ap3), then the distance information between the first sub-model and the second sub-model corresponding to the current physical ray can be determined as follows: If there is no intersection between the physical ray and the second sub-model, the distance information of the current target detection point in the current direction may be a preset maximum distance information, for example: L=10 nm.
[0045] It should be noted that other methods may also be used to determine the distance between two points, which will not be specifically shown here, as long as the distance information between the two points can be determined.
[0046] Furthermore, according to each target detection point, distance information between the first sub-model and the second sub-model corresponding thereto can be determined.
[0047] After determining the distance information, 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:
[0048]
[0049] 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.
[0050] 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.
[0051] S120 , processing the distance function of each target detection point based on a preset spherical harmonic function to obtain a projection coefficient value of each target detection point.
[0052] 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.
[0053] 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 the multiple basis functions corresponding to it, the spherical distribution distance function of the target detection point can be compressed to obtain the projection coefficient value. 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, which achieves the effect of compressing the distance function into 4 projection coefficient values.
[0054] 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.
[0055] 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.
[0056] 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.
[0057] S130. For each target detection point, the projection coefficient value of the current target detection point is stored in the target storage position in the engine, so that when transparent display is detected, a target reconstruction function is reconstructed based on the projection coefficient value stored in the target storage position, and target distance information between the first sub-model and the second sub-model under the target shooting angle is determined based on the target reconstruction function, and a transparency parameter corresponding to the target distance information is determined, so that each target detection point on the first sub-model is displayed based on the transparency parameter of each target detection point.
[0058] Specifically, for each target detection point, the projection coefficient value corresponding to the current target detection point can be stored in the vertex color corresponding to the current target detection point and / or the attribute information of the current target detection point, and imported into the target storage position in the engine according to the index coordinates of the vertex.
[0059] Each target detection point on the first sub-model can be used as a vertex color, and each target detection point corresponds to a pixel channel, that is, four channels of RGBA, and the projection coefficient value of the target detection point can be stored in each channel. The attribute information can be the scalable information corresponding to each target detection point, such as UV, that is, u, v texture mapping coordinates. The vertex color corresponding to the target detection point and the attribute information of the current target detection point can be used together to store the projection coefficient value.
[0060] Specifically, when the projection coefficient value corresponding to the current target detection point is stored in the vertex color corresponding to the current target detection point, four projection coefficient values may be stored in four channels, R, G, B, and A, respectively, and the number of vertex colors required may be determined according to the number of projection coefficient values. It is also possible to store four projection coefficient values in one vertex color, and store the remaining projection coefficient values in the UV coordinates corresponding to the current target detection point. The above method can reduce the use of vertex colors and facilitate the storage, subsequent retrieval, and use of projection coefficient values.
[0061] Optionally, the vertex color corresponding to the target detection point and the UV coordinate corresponding to the current target detection point can be used together to store the projection coefficient value. For example, if 9 projection coefficient values are stored, two vertex colors can be used to store 8 projection coefficient values, and the remaining 1 projection coefficient value can be stored in the UV coordinate corresponding to the current target detection point.
[0062] The projection coefficient value may also be stored in the following manner: for each target detection point, the projection coefficient value corresponding to the current target detection point is stored in a pixel point in at least one picture, and the number of pictures is the same as the number of projection coefficient values corresponding to the current target detection point. All pictures storing the projection coefficient values are imported into the target storage location in the engine according to the index coordinates of the vertices.
[0063] For example, if 9 projection coefficient values are stored, 9 pictures may be used to store the projection coefficient values in the pixel points corresponding to the current target detection point.
[0064] After the projection coefficient value is stored, it can be imported into the target position in the engine for storage according to the index coordinates of the current target detection point, so as to retrieve the projection coefficient value corresponding to the current target detection point from the engine according to the target detection point, and determine the transparency parameters of each target detection point according to the target distance information reconstructed according to the projection coefficient value, and then display the first sub-model and the second sub-model based on the transparency parameters.
[0065] The technical solution of this embodiment determines the current coordinate information of the current target detection point for each target detection point on the first sub-model, determines the distance function with the current target detection point based on the current coordinate information, and processes the distance function of each target detection point based on a preset spherical harmonic function to obtain the projection coefficient value of each target detection point, and then stores the projection coefficient value of the current target detection point to the target storage position in the engine, 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 realizes adjusting the transparency parameters 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.
[0066] Embodiment 2
[0067] Figure 2 This is a flow chart of a method for determining transparency provided by Embodiment 2 of the present invention. Based on the above embodiments, the specific methods for determining the current coordinate information and the distance function, as well as the specific storage methods for storing the projection coefficient values of each target detection point in the target storage location 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.
[0068] See also Figure 2 The method for determining transparency provided in this embodiment includes:
[0069] S210 . For each target detection point, determine the three-dimensional space coordinates of the current target detection point.
[0070] Specifically, a three-dimensional space coordinate system is established with a certain point in space as the origin of the space coordinates. The coordinate information of the current target detection point in the three-dimensional space coordinate system is the three-dimensional space coordinate of the current target detection point. For example, a point under the feet of a person in space is taken as the origin of the space coordinates, that is, (0, 0, 0). At this time, a three-dimensional space coordinate system is established. The current target detection point may be a point on the head of the person. The coordinate information of the point in the three-dimensional space coordinate system is (0, 1, 0). This coordinate information is the three-dimensional space coordinate of the point. In the three-dimensional space coordinate system, the three-dimensional space coordinates of each target detection point are fixed.
[0071] S220 , processing the three-dimensional space coordinates according to a predetermined coordinate transformation matrix to determine current coordinate information of the current target detection point.
[0072] Among them, the coordinate transformation matrix is a transformation matrix used to convert three-dimensional space coordinates into current coordinate information. The current coordinate information is determined by obtaining the specific values of the current target detection point on the tangent, sub-tangent and normal according to the change matrix.
[0073] Specifically, the current coordinate axis is defined based on the tangent, bitangent and normal of the current target detection point, and the three-dimensional space coordinates are transformed according to the coordinate transformation matrix corresponding to the current coordinate axis to obtain the current coordinate information of the current target detection point. For example, through the formula x'=Tx, T is the coordinate transformation matrix, which is determined by the tangent, bitangent and normal of the current target detection point, and x is the three-dimensional space coordinate to be transformed.
[0074] For example, a point on a person's hand in space is used as the current target detection point, for example, the three-dimensional space coordinates of the current target detection point are (0, 0, 0). The current coordinate axis is determined based on the tangent, bitangent and normal of the current target detection point, and the three-dimensional space coordinates are transformed according to the coordinate transformation matrix corresponding to the current coordinate axis. The three-dimensional space coordinates of the current target detection point (0, 0, 0) are changed to (-0.2, 0.5, 0.3).
[0075] It should be noted that the current coordinate information of the current target detection point is located in the space of the current target detection point, rather than relative coordinate information determined based on other points in the space. When the position of the current target detection point changes in space, the tangent, sub-tangent and normal of the current target detection point will also change accordingly, and the changed current coordinate information can be further determined based on the changed current target detection point.
[0076] That is to say, when the three-dimensional spatial coordinates of each target detection point in the model change, the corresponding coordinates in the tangent, normal and sub-tangent directions can be determined, and then a reconstruction function can be reconstructed based on the coordinates, which can be used to determine the distance information of the deformed object, and then determine the transparency parameter based on the distance information.
[0077] S230 . For each target detection point, determine information of each collision point to be processed when the current target detection point emits physical rays in each direction in space through the second sub-model.
[0078] The information of each to-be-processed collision point may include position information of each to-be-processed collision point, for example, space coordinate information corresponding to the current target information.
[0079] 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 corresponding to the current target 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.
[0080] 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.
[0081] 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.
[0082] S240: 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.
[0083] 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.
[0084] Specifically, when there is a collision point to be processed, the spatial coordinate information corresponding to the collision point to be processed and the current target information is used as the spatial coordinate information of the collision point to be processed. The distance information between the collision point information to be processed and the current target detection point can be calculated based on the current 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.
[0085] 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.
[0086] 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.
[0087] 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.
[0088] 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.
[0089] S250: Determine a distance function of a spherical distribution of a corresponding target detection point according to distance information of each target detection point in each direction.
[0090] 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.
[0091] 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.
[0092] S260, determining the order of the spherical harmonic function, and determining the representation method of the basis functions in the spherical harmonic function and the number of the basis functions according to the order.
[0093] Spherical harmonics of different orders 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.
[0094] 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.
[0095] S270 . For each target detection point, the distance function of the current target detection point is processed based on each basis function to obtain a projection coefficient value of the current target detection point.
[0096] 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.
[0097] 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.
[0098] 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.
[0099] 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.
[0100] S280. For each target detection point, store the projection coefficient value and current coordinate information of the current target detection point into a target storage location.
[0101] Optionally, the projection coefficient value corresponding to the current target detection point can be stored in the vertex color corresponding to the current target detection point and / or the attribute information of the current target detection point. The projection coefficient value corresponding to the current target detection point can also be stored in the pixel point of at least one image corresponding to the current target detection point.
[0102] In order to store the projection coefficient value corresponding to the current target detection point, the projection coefficient value may be stored in the vertex color corresponding to the current target detection point and / or the attribute information of the current target detection point for subsequent retrieval and use.
[0103] Optionally, determine the target number of projection coefficient values corresponding to the current target detection point; determine the number of vertex colors corresponding to the current target detection point based on the target number and the storage number corresponding to the vertex color; store the projection coefficient value in the vertex color corresponding to the current target detection point.
[0104] The target number is the number of projection coefficient values, which is also the number of basis functions in the preset spherical harmonics. The storage number is the number of projection coefficient values that can be stored in each vertex color. For example, if the vertex color contains four channels of RGBA, the storage number is 4. The vertex color number is the number of vertex colors used to store projection coefficient values.
[0105] Specifically, the vertex color can be stored by RGBA channel, that is, there are values of 4 channels, or it can be stored by RGB channel, that is, there are values of 3 channels. Taking the storage of vertex colors using RGBA channels as an example, if the pre-set spherical harmonic function is a second-order spherical harmonic function, which contains 4 basis functions, then 4 projection coefficient values can be obtained, and the above 4 projection coefficient values are stored in a vertex color corresponding to the current target detection point. If the pre-set spherical harmonic function is a fourth-order spherical harmonic function, which contains 16 basis functions, then 16 projection coefficient values can be obtained, and the above 16 projection coefficient values are stored in the four vertex colors corresponding to the current target detection point. The four vertex colors belong to different pictures and correspond to the current target detection point.
[0106] It should be noted that since each vertex color can store 4 projection coefficient values, if the number of projection coefficient values is not a multiple of 4, the number of vertex colors needs to be rounded. For example: the third-order spherical harmonic function contains 9 basis functions, corresponding to 9 projection coefficient values. Then, two vertex colors can be used to store 8 projection coefficient values, and the remaining 1 projection coefficient value still requires one vertex color to store, so a total of 3 vertex colors are required.
[0107] Another method that can be adopted is: after using a vertex color to store part of the projection coefficient values, use the attribute information of the vertex color to store the remaining projection coefficient values.
[0108] Optionally, determine the target number of projection coefficient values corresponding to the current target detection point; determine a preset number of stored projection coefficient values based on the vertex color of the current target detection point; and store the remaining projection coefficient values in the attribute information of the vertex color based on the target number and the preset number.
[0109] The preset number is the number of projection coefficient values that can be stored in the vertex color.
[0110] Specifically, the remaining projection coefficient values can be determined according to the difference between the target number and the preset number, and the remaining projection coefficient values are stored in the attribute information of the vertex color. For example, each vertex color can store 4 projection coefficient values, and the third-order spherical harmonic function contains 9 basis functions, corresponding to 9 projection coefficient values. A vertex color corresponding to the target detection point can store 4 projection coefficient values, and the 5 remaining projection coefficient values are stored in the UV coordinates corresponding to the target detection point.
[0111] Alternatively, two vertex colors corresponding to the target detection point are used to store eight projection coefficient values, and one remaining projection coefficient value is stored in the UV coordinate corresponding to the target detection point. The above storage method can reduce the use of vertex colors.
[0112] In order to store the projection coefficient value corresponding to the current target detection point, the projection coefficient value may also be stored in a pixel point of at least one image corresponding to the current target detection point, so as to facilitate subsequent retrieval and use.
[0113] For example, if 9 projection coefficient values are stored, 9 pictures may be used to store the projection coefficient values in the pixel points corresponding to the current target detection point.
[0114] Further, the vertex color and / or attribute information and the current coordinate information are imported into the target position in the engine for storage. Or, the pixel points and the current coordinate information of at least one image are imported into the target position in the engine for storage.
[0115] 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 target detection points.
[0116] Specifically, after the projection coefficient value corresponding to the current target detection point is stored in the vertex color corresponding to the current target detection point and / or the attribute information of the current target detection point or in the pixel point of at least one image corresponding to the current target detection point, in order for the engine to retrieve and use the stored projection coefficient value, the vertex color and / or attribute information of the current target detection point, or the pixel point of at least one image, needs to be stored according to the target position imported into the engine, and the current coordinate information is also imported into the target position in the engine for storage. If the engine needs to use the projection coefficient value corresponding to a certain target detection point, the projection coefficient value corresponding to the coordinate information can be determined at the target position in the engine for subsequent reconstruction.
[0117] The technical solution of the embodiment of the present invention determines the three-dimensional space coordinates of the current target detection point for each target detection point, processes the three-dimensional space coordinates according to a predetermined coordinate transformation matrix to determine the current coordinate information of the current target detection point, determines the distance information of the current target detection point in each direction according to the information of the current target detection point and each collision point to be processed, and then determines the distance function of the spherical distribution of the corresponding target detection point, processes the distance function of the current target detection point for each target detection point based on each basis function to obtain the projection coefficient value of the current target detection point, stores the projection coefficient value of the current target detection point and the current coordinate information to the target storage location, 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, and realizes the adjustment of 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.
[0118] Embodiment 3
[0119] Figure 3 A flow chart of a method for determining transparency provided in the third embodiment of the present invention is provided. This embodiment is applicable to the case where the distance information between the target detection point and the second sub-model at each angle can be reconstructed according to the projection coefficient value, and transparent display is performed according to the distance information. The method can be executed by a device for determining transparency, which 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. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.
[0120] like Figure 3 The present embodiment specifically includes the following steps:
[0121] S310: Determine a target shooting angle corresponding to a shooting device and each target detection point on the first sub-model.
[0122] The shooting device is a device for observing and shooting the first sub-model, and the target shooting angle is a relative angle between the shooting device and each target detection point on the first sub-model.
[0123] 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 the target shooting angle.
[0124] S320 , for each target detection point, determine target coordinate information according to current coordinate information of the current target detection point, and reconstruct a target reconstruction function of the current target detection point according to the target coordinate information and the projection coefficient value of the current target detection point.
[0125] 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 coordinate information is the coordinate information of the current target detection point in the current scene, for example: the current coordinate information before the current target detection point is deformed is converted into the target coordinate information after the deformation. The projection coefficient value of the current target detection point includes the projection coefficient value determined after processing the distance function of the spherical distribution of the current target detection point on the first sub-model based on the spherical harmonic function. The target reconstruction function is a function constructed by processing the projection coefficient value of the current target detection point to obtain the distance information corresponding to the physical ray colliding with the second sub-model when the current target detection point emits physical rays in various directions in space.
[0126] Specifically, in the current scene, the target coordinate information of the current target detection point in the current scene can be determined according to the current coordinate information of the current target detection point and the coordinate axis determined according to the tangent, the secondary tangent and the normal of the current detection point. When it is necessary to transparently display each target detection point on the first sub-model, the projection coefficient value of the current target detection point can be obtained from the target storage position corresponding to the current target detection point. According to the stored projection coefficient value and the target coordinate information of the current target detection point, a distance function including the distance information corresponding to each angle is simulated. For example, according to the projection coefficient value, the distance values corresponding to the second sub-model in each direction when the physical rays are emitted in each direction of the space with the current target detection point as the center of the sphere can be simulated. In addition, the target reconstruction function of the current target detection point can be reconstructed according to the distance information. Exemplarily, with the eye as the shooting device, when the second sub-model, such as the arm, is stretched forward, a target detection point on the first sub-model is in the y-axis direction, for example, the clothes on the arm are the first sub-model. At this time, the x-axis and the z-axis are parallel to the ground and are approximately in a straight line with the eye. In this case, the first sub-model is approximately opaque; when the arm is erected, the target detection point on the first sub-model is located in the positive direction of the y-axis, but the z-axis is toward the second sub-model. In this case, the coordinate information of the same target detection point has changed, that is, the coordinates of the tangent, sub-tangent and normal corresponding to the same target detection point at different positions are different, and then the reconstruction function reconstructed based on the coordinates is also different, thereby achieving the technical effect that under the condition of object deformation, the reconstruction function corresponding to each target detection point can still be determined, and then the distance information corresponding to each target detection point can be determined.
[0127] It should be noted that the above method can be used to determine the target shooting angle between the target detection point and the shooting device for each target detection point, and determine the distance information between each target detection point and the collision point in the second sub-model based on the target shooting angle, and reconstruct the target reconstruction function.
[0128] Exemplarily, when the current target detection point on the first sub-model is displayed transparently, two vertex colors and one attribute information corresponding to the current target detection point can be determined according to the current target detection point. Since one projection coefficient value is stored in each of the four RGBA channels of each vertex color, nine projection coefficient values corresponding to the current target detection point can be obtained. The nine projection coefficient values are processed according to a preset spherical harmonic function to determine nine distance information. The nine distance information are the distance information corresponding to the target detection point at nine angles in space, and a reconstruction function can be constructed according to the distance information. S330: Based on the reconstruction function corresponding to each target detection point and the corresponding template shooting angle, the distance information corresponding to each target detection point is determined, the transparency parameter between the first sub-model and the second sub-model is determined based on the distance information, and the first sub-model is displayed based on the transparency parameter.
[0129] The transparency parameter is used to indicate the degree of transparency of the model when it is displayed, and can be expressed as a percentage, for example: the transparency is 80%.
[0130] Specifically, the target reconstruction function can be used to process the input target 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 target shooting angle. According to the current target detection point and the shooting device, optionally, the camera device in the display screen or the pupil position of the human eye, the target shooting angle between the shooting device and the current target detection point can be determined, and the target shooting angle is input into the target reconstruction function, and the collision point on the second sub-model corresponding to the current target detection point can be determined, and then the distance information between the collision point and the current target detection point can be determined.
[0131] 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.
[0132] 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.
[0133] 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%.
[0134] Exemplarily, 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.
[0135] After determining the transparency parameters of the target detection points, in order to provide a better visual experience for the first sub-model and the second sub-model, the target detection points on the first sub-model may be displayed according to the corresponding transparency parameters to obtain a transparent display effect.
[0136] The technical solution of this embodiment determines the target shooting angle, determines the target coordinate information according to the current coordinate information of the current target detection point, and reconstructs the target reconstruction function according to the target coordinate information and the projection coefficient value of the current target detection point, determines the corresponding distance information based on the reconstruction function and the corresponding target shooting angle, and then determines the transparency parameter and displays based on the transparency parameter. This solves 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 realizes 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.
[0137] Embodiment 4
[0138] Figure 4This is a flow chart of a method for determining transparency provided by the fourth embodiment of the present invention. Based on the above embodiments, a reconstruction function can be reconstructed according to the spherical harmonic function and the projection coefficient value, and the transparency parameter corresponding to the target detection point under the target shooting angle of the target detection point and the shooting device can be determined based on the reconstruction function. The specific implementation method can be referred to the following specific description. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.
[0139] See also Figure 4 The method for determining transparency provided in this embodiment includes:
[0140] S410: Determine a target shooting angle corresponding to a shooting device and each target detection point on the first sub-model.
[0141] S420: Determine target coordinate information of the current target detection point in the current scene according to the current coordinate information of the current target detection point.
[0142] Specifically, the current coordinate information of the current target detection point is the coordinate information obtained by processing the three-dimensional space coordinates of the current target detection point according to a predetermined coordinate transformation matrix. In the current scene, the target coordinate information of the current target detection point in the current scene can be determined according to the current coordinate information of the current target detection point and the coordinate axis determined according to the tangent, the bitangent and the normal of the current detection point.
[0143] S430, processing the target coordinate information and the projection coefficient value of the current target detection point by using a preset spherical harmonic function to reconstruct a target reconstruction function of the current target detection point.
[0144] The target coordinate information is the coordinate information obtained by further converting the current coordinate information of the target detection point in the current scene.
[0145] Based on the preset spherical harmonic functions, a reconstruction function corresponding to each target detection point can be reconstructed. In order to clearly introduce the technical solution of this embodiment, the reconstruction function of one of the target detection points can be taken as an example for introduction.
[0146] 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 target 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 target shooting angle.
[0147] Specifically, by processing the target coordinate information and the projection coefficient value of the current target detection point based on 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 the space can be obtained. According to the distance information in various directions in the space corresponding to the current target detection point, the reconstruction function corresponding to the current target detection point is constructed.
[0148] S440: Input the target shooting angle corresponding to the current target detection point into the reconstruction function to obtain distance information when the current target detection point and the straight line to which the target shooting device belongs intersect with the first sub-model and the second sub-model.
[0149] Specifically, 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 belonging to the current target detection point and the target shooting device collides with the second sub-model under the target shooting angle.
[0150] Exemplarily, if 9 projection coefficient values corresponding to the current target detection point are obtained, the reconstruction function corresponding to the target detection point can be obtained by performing inverse transformation processing through a preset spherical harmonic function according to the above 9 projection coefficient values and target coordinate information. The target shooting angle, such as 45°, is input into the reconstruction function, and the distance information between the first sub-model and the second sub-model corresponding to the current target detection point under the target shooting angle can be determined based on the reconstruction function, such as 5nm.
[0151] S450: Determine the transparency parameter of each target detection point according to the preset correspondence between the distance information and the transparency parameter and the distance information corresponding to each target detection point.
[0152] Among them, the correspondence between each distance information and its corresponding transparency parameter can be pre-stored. For example, the transparency parameter decreases by 10% every time 10nm increases. The distance information is recorded as dist, 0nm<dist≤10nm, the transparency parameter is 100%, 10nm<dist≤20nm, the transparency parameter is 90%, 20nm<dist≤30nm, the transparency parameter is 80%, etc.
[0153] It should be noted that the transparency parameter may include a transparency parameter of the first sub-model and a transparency parameter of the second sub-model.
[0154] Specifically, according to the distance information corresponding to each target detection point, the transparency parameter corresponding to the distance information can be determined from the pre-stored correspondence between each distance information and the transparency parameter, which may 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.
[0155] S460 , displaying the first sub-model and the second sub-model based on the transparency parameter.
[0156] Specifically, after determining the transparency parameters for displaying the first sub-model and the second sub-model corresponding to each target detection point under the target shooting angle, 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.
[0157] The technical solution of this embodiment reconstructs the target reconstruction function of the current target detection point by determining the target shooting angle and the target coordinate information of the current target detection point in the current scene, and processing the target coordinate information and the projection coefficient value of the current target detection point based on a preset spherical harmonic function, determines the distance information according to the target shooting angle and the reconstruction function, and then determines the transparency parameter and displays it, which solves 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 realizes 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.
[0158] Embodiment 5
[0159] Figure 5 This is a schematic diagram of the structure of a device for determining transparency provided in Embodiment 5 of the present invention. The device includes: a distance information determination module 510, a projection coefficient value determination module 520 and a transparency parameter determination module 530.
[0160] The distance information determination module 510 is used to determine the current coordinate information of the current target detection point for each target detection point on the first sub-model, and determine the distance function with the current target detection point based on the current coordinate information; the current coordinate information is the coordinate obtained after matrix transformation of the three-dimensional space coordinates of the current target detection point, and the distance function is determined according to the relative distance information between the target detection point and the second sub-model in each direction; the first sub-model is a model that wraps the second sub-model; the projection coefficient value determination module 520 is used to process the distance function of each target detection point based on a preset spherical harmonic function to obtain the projection coefficient value of each target detection point; the spherical harmonic function is composed of multiple basis functions; the transparency parameter determination module 530 is used to store the projection coefficient value of the current target detection point to the target storage position in the engine for each target detection point, so that when transparent display is detected, a target reconstruction function is reconstructed based on the projection coefficient value stored in the target storage position, the target distance information between the first sub-model and the second sub-model under the target shooting angle is determined based on the target reconstruction function, and the transparency parameter corresponding to the target distance information is determined, so that each target detection point on the first sub-model is displayed based on the transparency parameter of each target detection point.
[0161] Optionally, the distance information determination module 510 is specifically used to determine, for each target detection point, information on each collision point to be processed when the current target detection point emits physical rays in each direction in the space through the second sub-model; determine the distance information between the current target detection point and the second sub-model in each direction based on the information on the current target detection point and each collision point; determine the spherical distribution distance function of the current target detection point based on the current coordinate information of the current target detection point and the distance information of the current target detection point in each direction.
[0162] Optionally, the distance information determination module 510 is specifically used to emit physical rays in any direction in space with the current target detection point as the sphere center, and determine the collision point information to be processed when each physical ray passes through the second sub-model.
[0163] Optionally, the distance information determination module 510 is specifically used to determine the distance information between the collision point to be processed and the current target detection point when there is a collision point to be processed between the physical ray and the second sub-model; 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; based on the distance information corresponding to each collision point to be processed and the set value, the distance information between the current target detection point and the second sub-model in each direction is determined.
[0164] Optionally, the distance information determination module 510 is specifically used to determine the three-dimensional space coordinates of the current target detection point for each target detection point; the three-dimensional space coordinates are processed according to a predetermined coordinate transformation matrix to determine the current coordinate information of the current target detection point; the current coordinate information is determined based on the tangent, secondary tangent and normal of the current target detection point.
[0165] Optionally, the projection coefficient value determination module 520 is specifically used to determine the order of the spherical harmonic function, and determine the representation method of the basis function in the spherical harmonic 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; the number of projection coefficient values is the same as the number of basis functions.
[0166] Optionally, the transparency parameter determination module 530 is specifically configured to store the projection coefficient value and current coordinate information of the current target detection point to a target storage location for each target detection point.
[0167] The technical solution of this embodiment determines the current coordinate information of the current target detection point for each target detection point on the first sub-model, determines the distance function with the current target detection point based on the current coordinate information, and processes the distance function of each target detection point based on a preset spherical harmonic function to obtain the projection coefficient value of each target detection point, and then stores the projection coefficient value of the current target detection point to the target storage position in the engine, 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 realizes adjusting the transparency parameters 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.
[0168] 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.
[0169] 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.
[0170] Embodiment 6
[0171] Figure 6This is a schematic structural diagram of a device for determining transparency provided by Embodiment 6 of the present invention. The device includes: a target shooting angle determination module 610, a target reconstruction function reconstruction module 620 and a transparent display module 630.
[0172] Among them, the target shooting angle determination module 610 is used to determine the target shooting angle corresponding to the shooting device and each target detection point on the first sub-model; the target reconstruction function reconstruction module 620 is used to determine the target coordinate information for each target detection point according to the current coordinate information of the current target detection point, and reconstruct the target reconstruction function of the current target detection point according to the target coordinate information and the projection coefficient value of the current target detection point; the current coordinate information is the coordinates obtained after matrix transformation of the three-dimensional space coordinates of the current target detection point; the first sub-model is a model that wraps the second sub-model; the projection coefficient value is determined after processing the distance function of the spherical distribution of each target detection point on the first sub-model based on the spherical harmonic function; the transparent display module 630 is used to determine the distance information corresponding to each target detection point based on the reconstruction function corresponding to each target detection point and the corresponding target shooting angle, determine the transparency parameter between the first sub-model and the second sub-model based on the distance information, and display the first sub-model based on the transparency parameter.
[0173] Optionally, the target reconstruction function reconstruction module 620 is specifically used to determine the target coordinate information of the current target detection point in the current scene based on the current coordinate information of the current target detection point; the target coordinate information and the projection coefficient value of the current target detection point are processed by a preset spherical harmonic function to reconstruct the target reconstruction function of the current target detection point; the spherical harmonic function includes at least one basis function.
[0174] Optionally, the transparent display module 630 is used to input the target shooting angle corresponding to the current target detection point into the reconstruction function to obtain the distance information when the current target detection point and the straight line belonging to the target shooting device intersect with the first sub-model and the second sub-model.
[0175] Optionally, the transparent display module 630 is used to determine the transparency parameter of each target detection point according to the correspondence between the preset distance information and the transparency information and the distance information corresponding to each target detection point; and display the first sub-model and the second sub-model based on the transparency parameter.
[0176] The technical solution of this embodiment determines the three-dimensional space coordinates of the current target detection point for each target detection point, processes the three-dimensional space coordinates according to a predetermined coordinate transformation matrix to determine the current coordinate information of the current target detection point, determines the distance information of the current target detection point in each direction according to the information of the current target detection point and each collision point to be processed, and then determines the distance function of the spherical distribution of the corresponding target detection point, processes the distance function of the current target detection point for each target detection point based on each basis function to obtain the projection coefficient value of the current target detection point, stores the projection coefficient value of the current target detection point and the current coordinate information to the target storage location, solves 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 realizes the adjustment of 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.
[0177] 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.
[0178] 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.
[0179] Embodiment 7
[0180] Figure 7 This is a structural schematic diagram of an electronic device provided in Embodiment 7 of the present invention. Figure 7 A block diagram of an exemplary electronic device 70 suitable for use in implementing exemplary embodiments of the present invention is shown. Figure 7 The electronic device 70 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.
[0181] like Figure 7 As shown, the electronic device 70 is in the form of a general-purpose computing device. The components of the electronic device 70 may include, but are not limited to: one or more processors or processing units 701, a system memory 702, and a bus 703 connecting different system components (including the system memory 702 and the processing unit 701).
[0182] Bus 703 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.
[0183] The electronic device 70 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 70, including volatile and non-volatile media, removable and non-removable media.
[0184] The system memory 702 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 704 and / or cache memory 705. The electronic device 70 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 706 may be used to read and write non-removable, non-volatile magnetic media ( Figure 7 not shown, usually called a "hard drive"). Although Figure 7 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 the bus 703 via one or more data medium interfaces. The memory 702 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 the embodiments of the present invention.
[0185] A program / utility 708 having a set (at least one) of program modules 707 may be stored, for example, in the memory 702, such program modules 707 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 707 generally perform the functions and / or methods of the embodiments described herein.
[0186] The electronic device 70 may also communicate with one or more external devices 709 (e.g., keyboards, pointing devices, displays 710, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 70, and / or communicate with any device that enables the electronic device 70 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 711. Furthermore, the electronic device 70 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 712. As shown, the network adapter 712 communicates with other modules of the electronic device 70 via the bus 703. It should be understood that although Figure 7 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 70, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0187] The processing unit 701 executes various functional applications and data processing by running the programs stored in the system memory 702, such as implementing the method for determining transparency provided by the embodiment of the present invention.
[0188] Embodiment 8
[0189] Embodiment 8 of the present invention further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions are used to execute a method for determining transparency when executed by a computer processor.
[0190] The method includes:
[0191] For each target detection point on the first sub-model, the current coordinate information of the current target detection point is determined, and the distance function with the current target detection point is determined based on the current coordinate information; the current coordinate information is the coordinate obtained after matrix transformation of the three-dimensional space coordinates of the current target detection point, and the distance function is determined according to the relative distance information between the target detection point and the second sub-model in each direction; the first sub-model is a model that wraps the second sub-model;
[0192] The distance function of each target detection point is processed based on a preset spherical harmonic function to obtain a projection coefficient value of each target detection point; the spherical harmonic function is composed of multiple basis functions;
[0193] For each target detection point, the projection coefficient value of the current target detection point is stored in the target storage position in the engine, so that when transparent display is detected, a target reconstruction function is reconstructed based on the projection coefficient value stored in the target storage position, and the target distance information between the first sub-model and the second sub-model under the target shooting angle is determined based on the target reconstruction function, and the transparency parameter corresponding to the target distance information is determined, so as to display each target detection point on the first sub-model based on the transparency parameter of each target detection point.
[0194] Or, the method comprises:
[0195] Determine a target shooting angle corresponding to each target detection point on the first sub-model and the shooting device;
[0196] For each target detection point, the target coordinate information is determined according to the current coordinate information of the current target detection point, and the target reconstruction function of the current target detection point is reconstructed according to the target coordinate information and the projection coefficient value of the current target detection point; the current coordinate information is the coordinates obtained after matrix transformation of the three-dimensional space coordinates of the current target detection point; the first sub-model is a model that wraps the second sub-model; the projection coefficient value is determined based on the distance function of the spherical distribution of each target detection point on the first sub-model processed by the spherical harmonic function;
[0197] Based on the reconstruction function corresponding to each target detection point and the corresponding target shooting angle, the distance information corresponding to each target detection point is determined, the transparency parameter between the first sub-model and the second sub-model is determined based on the distance information, and the first sub-model is displayed based on the transparency parameter.
[0198] 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.
[0199] 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.
[0200] 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.
[0201] 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).
[0202] 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: For each target detection point on the first sub-model, determine the current coordinate information of the current target detection point, and determine the distance function with the current target detection point based on the current coordinate information; the current coordinate information is the coordinate obtained after matrix transformation of the three-dimensional space coordinates of the current target detection point, and the distance function is determined according to the relative distance information between the target detection point and the second sub-model in each direction; the first sub-model is a model that wraps the second sub-model; Processing the distance function of each target detection point based on a preset spherical harmonic function to obtain a projection coefficient value of each target detection point; the spherical harmonic function is composed of multiple basis functions; For each target detection point, the projection coefficient value of the current target detection point is stored in the target storage position in the engine, so that when transparent display is detected, a target reconstruction function is reconstructed based on the projection coefficient value stored in the target storage position, and the target distance information between the first sub-model and the second sub-model under the target shooting angle is determined based on the target reconstruction function, and the transparency parameter corresponding to the target distance information is determined, so as to display each target detection point on the first sub-model based on the transparency parameter of each target detection point.
2. The method according to claim 1, characterized in that The determining the current coordinate information of the current target detection point, and determining the distance function from the current target detection point based on the current coordinate information, includes: For each target detection point, determine the information of each collision point to be processed when the current target detection point emits physical rays in each direction in space through the second sub-model; 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 to-be-collision point; According to the current coordinate information of the current target detection point and the distance information of the current target detection point in each direction, the spherical distribution distance function of the current target detection point is determined.
3. The method according to claim 2, characterized in that The step of determining, for each target detection point, information of each collision point to be processed when the current target detection point emits physical rays in each direction in space and passes through the second sub-model includes: Taking the current target detection point as the sphere center, physical rays are emitted to any direction in the space to determine the collision point information to be processed when each physical ray passes through the second sub-model.
4. The method according to claim 2, characterized in that: The determining, based on information of the current target detection point and each to-be-collision point, distance information between the current target detection point and the second sub-model in each direction includes: When there is a collision point to be processed between the physical ray and the second sub-model, determining the distance information between the collision point information to be processed and the current target detection point; 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; The distance information between the current target detection point and the second sub-model in each direction is determined according to the distance information and the set value corresponding to each collision point to be processed.
5. The method according to claim 1, characterized in that The step of determining the current coordinate information of the current target detection point for each target detection point on the first sub-model includes: For each target detection point, determine the three-dimensional spatial coordinates of the current target detection point; Processing the three-dimensional space coordinates according to a predetermined coordinate transformation matrix to determine current coordinate information of the current target detection point; The current coordinate information is determined based on the tangent, the bitangent and the normal of the current target detection point.
6. The method according to claim 1, characterized in that The distance function of each target detection point is processed based on the preset spherical harmonic function to obtain the projection coefficient value of each target detection point, including: Determining the order of the spherical harmonic function, and determining the representation method of the basis function in the spherical harmonic function and the number of the 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 a projection coefficient value of the current target detection point; the number of the projection coefficient values is the same as the number of the basis functions.
7. The method according to claim 1, characterized in that The step of storing the projection coefficient value of the current target detection point to a target storage location in the engine includes: For each target detection point, the projection coefficient value and current coordinate information of the current target detection point are stored in the target storage location.
8. A method for determining transparency, characterized in that include: Determine a target shooting angle corresponding to each target detection point on the first sub-model and the shooting device; For each target detection point, the target coordinate information is determined according to the current coordinate information of the current target detection point, and the target reconstruction function of the current target detection point is reconstructed according to the target coordinate information and the projection coefficient value of the current target detection point; the current coordinate information is the coordinates obtained after matrix transformation of the three-dimensional space coordinates of the current target detection point; the first sub-model is a model wrapping the second sub-model; the projection coefficient value is determined after processing the distance function of the spherical distribution of each target detection point on the first sub-model based on the spherical harmonic function; Based on the reconstruction function corresponding to each target detection point and the corresponding target shooting angle, the distance information corresponding to each target detection point is determined, the transparency parameter between the first sub-model and the second sub-model is determined based on the distance information, and the first sub-model is displayed based on the transparency parameter.
9. The method according to claim 8, characterized in that The step of determining target coordinate information according to current coordinate information of the current target detection point, and reconstructing a target reconstruction function of the current target detection point according to the target coordinate information and a projection coefficient value of the current target detection point, comprises: According to the current coordinate information of the current target detection point, determine the target coordinate information of the current target detection point in the current scene; The target coordinate information and the projection coefficient value of the current target detection point are processed by a preset spherical harmonic function to reconstruct a target reconstruction function of the current target detection point; the spherical harmonic function includes at least one basis function.
10. The method according to claim 8, characterized in that The determining of the distance information corresponding to each target detection point based on the reconstruction function corresponding to each target detection point and the corresponding relative shooting angle includes: The target shooting angle corresponding to the current target detection point is input into the reconstruction function to obtain the distance information when the current target detection point and the straight line to which the target shooting device belongs intersect with the first sub-model and the second sub-model.
11. The method according to claim 8, characterized in that The determining a transparency parameter between the first sub-model and the second sub-model based on the distance information, and displaying the first sub-model based on the transparency parameter, comprises: Determine the transparency parameter of each target detection point according to the preset correspondence between the distance information and the transparency information and the distance information corresponding to each target detection point; The first sub-model and the second sub-model are displayed based on the transparency parameter.
12. A device for determining transparency, characterized in that include: a distance information determination module, for determining the current coordinate information of the current target detection point for each target detection point on the first sub-model, and determining a distance function with the current target detection point based on the current coordinate information; the current coordinate information is the coordinate obtained by performing a matrix transformation on the three-dimensional space coordinates of the current target detection point, and the distance function is determined according to the relative distance information between the target detection point and the second sub-model in each direction; the first sub-model is a model that wraps the second sub-model; A projection coefficient value determination module is used to process the distance function of each target detection point based on a preset spherical harmonic function to obtain the projection coefficient value of each target detection point; the spherical harmonic function is composed of multiple basis functions; A transparency parameter determination module is used to store the projection coefficient value of the current target detection point to the target storage position in the engine for each target detection point, so as to reconstruct a target reconstruction function based on the projection coefficient value stored in the target storage position when transparent display is detected, determine the target distance information between the first sub-model and the second sub-model under the target shooting angle based on the target reconstruction function, and determine the transparency parameter corresponding to the target distance information, so as to display each target detection point on the first sub-model based on the transparency parameter of each target detection point.
13. A device for determining transparency, characterized in that include: A target shooting angle determination module, used to determine the target shooting angle corresponding to each target detection point on the first sub-model and the shooting device; A target reconstruction function reconstruction module is used to determine the target coordinate information of each target detection point according to the current coordinate information of the current target detection point, and reconstruct the target reconstruction function of the current target detection point according to the target coordinate information and the projection coefficient value of the current target detection point; the current coordinate information is the coordinates obtained after matrix transformation of the three-dimensional space coordinates of the current target detection point; the first sub-model is a model wrapping the second sub-model; the projection coefficient value is determined based on the distance function processing of the spherical distribution of each target detection point on the first sub-model by the spherical harmonic function; A transparent display module is used to determine the distance information corresponding to each target detection point based on the reconstruction function corresponding to each target detection point and the corresponding target shooting angle, determine the transparency parameter between the first sub-model and the second sub-model based on the distance information, and display the first sub-model based on the transparency parameter.
14. 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-8 or 9-11.
15. 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-8 or 9-11.
Citation Information
Patent Citations
Efficiently rendering objects in the presence of transparency
AU2007202126A1
Real-time transparent object GPU (graphic processing unit) parallel generating method based on three-dimensional point cloud
CN102915559A