CN-122023633-A - Optimization method and system for multilayer semitransparent materials in virtual reality scene
Abstract
The invention discloses a method and a system for optimizing multilayer semitransparent materials in a virtual reality scene, and relates to the technical field of virtual reality rendering. The method comprises the steps of traversing material groups in a virtual reality scene, screening out picture materials to be processed in the same group, classifying and identifying the materials in each group, distinguishing static materials from dynamic materials, executing adjacent graph merging processing aiming at the static materials, merging adjacent subgraphs into one graph, executing adjacent graph axis alignment processing aiming at the dynamic materials, enabling the connecting lines and the orientations of the central points of the two pictures to be completely overlapped, outputting the processed dynamic materials, static merged graphs and isolated materials, and packaging and outputting the integrated dynamic materials, static merged graphs and isolated materials according to a target platform. The invention achieves the purposes of simplifying the scene and optimizing the frame rate by combining the adjacent pictures, avoids the OIT problem, ensures the experience quality of users and has better universality.
Inventors
- TAO JINZHOU
- SONG YANG
Assignees
- 北京灵境世界科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260210
Claims (10)
- 1. The optimizing method of the multilayer semitransparent material in the virtual reality scene is characterized by comprising the following steps of: traversing the material groups in the virtual reality scene, and screening out the picture materials to be processed in the same group; classifying materials, namely classifying and identifying the materials in each group and distinguishing static materials from dynamic materials; The material processing comprises the steps of executing adjacent graph merging processing aiming at static materials, merging adjacent subgraphs into one graph, executing adjacent graph axis aligning processing aiming at dynamic materials, and completely overlapping the connecting line and the orientation of the central points of the two graphs; and outputting the scene, namely outputting the processed dynamic materials, static merged pictures and isolated materials, and packaging and outputting according to a target platform after integration.
- 2. The method of claim 1, wherein in the material processing step, the adjacent map merging process includes the steps of: coplanarity and connectivity judgment, namely sequentially carrying out coplanarity judgment and connectivity test on the static materials in the same group, screening out aggregated coplanarity materials and outputting a plurality of picture sets; Picture set sorting, namely bidirectional sorting is carried out on the static materials in each picture set according to the design logic priority; Calculating image parameters, namely sequentially calculating pixel density of all static materials in each image set and a minimum area bounding rectangle of a final image size, and determining the resolution of a final image based on the pixel density and the minimum area bounding rectangle of the final image size; Combining and baking, namely creating blank canvas according to the final resolution, and writing the image data of all subgraphs and corresponding position, rotation and scaling parameters into the canvas through a Unity graphic API according to the sequencing result to finish baking; And (3) circulating and outputting, namely judging whether all the material groups are processed, returning to a picture set sorting step if not, sequentially executing subsequent steps, and replacing an aggregation static subgraph in the original corresponding material group with a static merging graph obtained by baking if the processing is completed, so as to finish optimization.
- 3. A method as claimed in claim 2, wherein the co-planar material determination is specifically: calculating the normal angle of two material patches in the space, and when the normal angle is When the absolute value of the difference between the two materials is smaller than a preset angle threshold and the absolute value of the difference between the two materials is smaller than a preset distance threshold, judging that the two materials are coplanar; wherein the normal angle The formula used for the calculation is as follows: wherein a and b are vectors corresponding to two pictures respectively, and a and b are modes of a and b respectively.
- 4. The method of claim 2, wherein the connectivity determination is specifically: Extracting Alpha channels of the coplanar materials, extracting contours, and respectively constructing rough grids corresponding to the contours for the coplanar materials; Traversing all triangles of the coarse grid, performing overlap judgment with grid triangles of the rest coplanar materials, and judging that the two coplanar materials belong to communication when overlap exists.
- 5. The method of claim 2, wherein in the image parameter calculation, a formula for calculating pixel density is as follows: Wherein pixelwidth is the pixel width, pixelheight is the pixel height, scalex is the scaling factor X, scaley is the scaling factor Y.
- 6. The method according to claim 2, wherein the step of calculating the final image size in the parameter calculation is specifically: Vertex collection, namely obtaining minimum area circumscribed rectangles corresponding to all sub-graphs to be combined, and respectively calculating four vertexes of each rectangle to form a point set S containing 4n points, wherein n is the number of the sub-graphs to be combined; calculating a convex hull, namely processing the point set S by adopting a convex hull algorithm to obtain convex hull geometry corresponding to the point set S; solving the minimum area bounding rectangle, namely traversing all sides of the convex hull based on the geometric property that at least one side of the minimum area bounding rectangle coincides with the side of the convex hull, screening and recording the rectangle with the minimum area, wherein the rectangle is the minimum area bounding rectangle capable of wrapping all subgraphs.
- 7. A method as claimed in claim 2, wherein, when the co-planar materials are combined and baked, the baking process is performed on different sides of the gathered co-planar materials to ensure rendering accuracy at different viewing angles.
- 8. The method of claim 1, wherein in the material processing step, the adjacent graph axes are aligned such that the adjacent graph of the dynamic material is in a perfectly parallel state with the patch of the dynamic material, and the axes of the adjacent graph and the patch of the dynamic material are aligned.
- 9. The method of claim 8, wherein the adjacent map axis alignment comprises the steps of: counting dynamic materials, judging whether the dynamic materials have adjacent graphs, and taking the dynamic materials as alignment targets if the adjacent graphs exist; expanding grids of the adjacent graph to align the axes of the grids of the adjacent graph with the axes of the alignment targets, and synchronously amplifying textures borne by the grids; And (3) the texture of the adjacent graph is reduced and displayed according to the expansion proportion by customizing the expansion proportion of the grid transmitted by the loader, and the redundant part of the expanded grid is left invisible.
- 10. An optimization system for multi-layered translucent material in a virtual reality scene, characterized in that a method according to any of claims 1-9 is applied, the system comprising: the material grouping module is used for traversing the material groups in the virtual reality scene and screening out the picture materials to be processed in the same group; the material classification module is used for classifying and identifying the materials in each group and distinguishing static materials from dynamic materials; The material processing module is used for executing adjacent graph merging processing aiming at the static material and merging adjacent subgraphs into one graph, executing adjacent graph axis alignment processing aiming at the dynamic material and completely overlapping the central point connecting line and the orientation of the two graphs; and the scene output module is used for outputting the processed dynamic materials, static merged pictures and isolated materials, and packaging and outputting the integrated materials according to the target platform.
Description
Optimization method and system for multilayer semitransparent materials in virtual reality scene Technical Field The invention relates to the technical field of virtual reality rendering, in particular to a method and a system for optimizing multilayer semitransparent materials in a virtual reality scene. Background At present, the application of a game engine in the XR field is more and more extensive, the scene rendering function is used as a core support, the continuous development of virtual reality experience is promoted, but the rendering of semitransparent objects is always a technical problem which is not completely solved in the industry. In opaque object rendering, a depth buffer algorithm (z-buffer algorithm) has become a mature scheme, by initializing a depth buffer to infinity, recording the nearest depth of each pixel position, updating the buffer and writing a color buffer when the depth is better for a new pixel, and can efficiently process object shielding relation and ensure accurate rendering results. However, the semitransparent objects still need to be visible due to the blocked part, the z-buffer algorithm cannot be used, and currently, a game engine generally adopts an artist algorithm to perform semitransparent rendering, namely, before drawing, sequencing all semitransparent objects from back to front, and then sequentially rendering according to sequencing results, wherein the process is called as 'sequence related semitransparent mixing'. At the same time, the industry has also emerged a variety of order independent semi-transparent blending (OIT) techniques that attempt to improve the semi-transparent rendering effect from different angles, where per-pixel linked lists have been used by partially authoring tools for auxiliary rendering of scene authoring stages because they guarantee pixel-level accuracy. The prior art has the defects that the artist algorithm consumes a large amount of CPU (Central processing Unit) computational power in the sorting process, can only realize object-level sorting, and cannot sort pixel by pixel, and is more critical in that the sorting result can be changed along with the position change of a camera, so that the shielding sequence of a semitransparent object jumps, when a large number of semitransparent pictures exist in a scene, the picture stability is extremely poor, the VR experience is seriously influenced, meanwhile, the inherent attribute of the semitransparent object determines that the phenomenon of repeated drawing (Overdraw) exists in multilayer semitransparent rendering, and the repeated drawing of a large number of invalid pixels causes the computational power waste. The OIT technologies also have obvious short boards, namely the deep stripping and the template routing speed are extremely low, multiple rendering is needed, and the practicability is extremely low; although each pixel chain table has higher precision, the performance is insufficient in a VR equipment scene, the smoothness requirement of VR equipment cannot be met, the adaptive transparency and weighted mixing OIT has higher speed, but approximate calculation is adopted, the accuracy and universality are lacking, the effect of professional image editing software cannot be restored, the problem that the viewing colors of the same area at different angles are inconsistent still exists, the pixel synchronization is used as a newer advanced algorithm, not only the Intel specific hardware and graphic driving are relied on, but also the underlying rendering logic needs to be deeply changed, and the sealing performance of a main stream engine such as Unity is difficult to adapt. In addition, VR equipment has limited hardware capability, but needs to simultaneously render left and right high-resolution pictures, has extremely high requirements on frame rate to avoid dizziness of users, and simultaneously has functions of space positioning, eye tracking and the like to further occupy hardware resources so as to enable rendering optimization requirements to be more urgent. Therefore, the development of a virtual reality multilayer semitransparent material optimization scheme which can ensure semitransparent rendering quality, avoid shielding jump and Overdraw problems, adapt to VR equipment performance limitation, consider universality and usability, and meet the requirements of large-scale creation scenes is a problem to be solved by the technicians in the field. Disclosure of Invention In view of the above, the present invention provides a method of optimizing multi-layered translucent material in a virtual reality scene that overcomes or at least partially solves the above-mentioned problems. In a first aspect, an embodiment of the present invention provides a method for optimizing a multi-layer semitransparent material in a virtual reality scene, including the following steps: traversing the material groups in the virtual reality scene, and screening out the picture materials