CN114155337A - Large-scale digital workshop rendering system and method based on Unity platform - Google Patents

Large-scale digital workshop rendering system and method based on Unity platform Download PDF

Info

Publication number
CN114155337A
CN114155337A CN202111287289.6A CN202111287289A CN114155337A CN 114155337 A CN114155337 A CN 114155337A CN 202111287289 A CN202111287289 A CN 202111287289A CN 114155337 A CN114155337 A CN 114155337A
Authority
CN
China
Prior art keywords
rendering
model
scene
digital workshop
texture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111287289.6A
Other languages
Chinese (zh)
Inventor
尤长虹
吴晖
魏斌
蔡力
黎伟雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Tobacco Hubei Industrial LLC
Original Assignee
China Tobacco Hubei Industrial LLC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Tobacco Hubei Industrial LLC filed Critical China Tobacco Hubei Industrial LLC
Priority to CN202111287289.6A priority Critical patent/CN114155337A/en
Publication of CN114155337A publication Critical patent/CN114155337A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses a large-scale digital workshop rendering system and method based on a Unity platform, and the system comprises an application stage, a geometric stage and a rasterization stage; the application stage receives a user input instruction to output a rendering primitive, the geometry stage receives the rendering primitive and then outputs vertex information of a screen space, and the rasterization stage outputs images in various expression forms to the client; the invention provides a platform-level rendering optimization component, which is used for realizing efficient real-time rendering of tens of thousands of high-precision models in a real-time application environment according to environmental changes, ensuring smooth operation of the whole digital workshop system, achieving the purpose of online visual monitoring of a production process and considering diversity of platform applications.

Description

Large-scale digital workshop rendering system and method based on Unity platform
Technical Field
The invention belongs to the technical field of digital workshop modeling, relates to a large-scale digital workshop rendering system and method, and particularly relates to a large-scale digital workshop rendering system and method based on a Unity platform.
Background
With the advent of the information-oriented era, the demand for digital workshop and digital factory construction based on the digital twin technology is increasing day by day, and with the increasing popularization of Building Information Modeling (BIM) technology and Internet of things technology, more and more large production workshops have the basis of three-dimensional digital modeling. However, the scale of the workshop is larger and larger, the number of models after three-dimensional modeling is increased by geometric multiples, meanwhile, the three-dimensional visual monitoring in the operation and maintenance process of the digital workshop puts a high requirement on the precision of the models, and the existing three-dimensional rendering engine cannot well give consideration to both performance and effect under the condition of limited economic investment.
The Unity (real-time 3D content production and operation platform of Unity corporation) as a commercial software can provide a whole set of solution, but it is more used for the development of the game field, and for example, the system provides rendering components which cannot meet the requirements of real-time rendering of tens of thousands of models, and most of the provided shader components are game-customized and cannot meet the requirements of rendering effects in the industrial field.
Disclosure of Invention
As a rendering engine for supporting the operation of a large-scale digital workshop, the three-dimensional real-time rendering engine is required, namely various solid substances in reality are abstracted in the form of various curves or polygons, and an algorithm realization set for outputting a final image through a computer in real time can be realized according to the change of the environment and an observation point. Under the condition, the invention provides a large-scale digital workshop rendering system and method based on a Unity platform.
The technical scheme adopted by the system of the invention is as follows: a large-scale digital workshop rendering system based on a Unity platform is subjected to modular reconstruction on the basis of a Unity engine architecture and comprises a low-order renderer subsystem, a scene graph/elimination optimization subsystem and a visual effect subsystem;
the low-order renderer subsystem optimizes rendering geometric primitives as many as possible in the same GPU calling process on the basis of a Unity rendering engine to realize real-time rendering of tens of thousands of models in a digital workshop;
the scene graph/rejection optimization subsystem realizes model rejection in a large-scale digital workshop scene through a space analysis method, a logic and potential visible set method and a fine degree method on the basis of the Unity engine shielding rejection function;
the visual effect subsystem adopts a CG shader to support cross-platform capability.
The method adopts the technical scheme that: a large-scale digital workshop rendering method based on a Unity platform comprises an application stage, a geometric stage and a rasterization stage; the application stage receives a user input instruction to output a rendering primitive, the geometry stage receives the rendering primitive and then outputs vertex information of a screen space, and the rasterization stage outputs images in various expression forms to the client;
the rendering process is developed in parallel in a pipeline mode and comprises parallel processing on functions, data and time; the functional parallelism is that different stages of the rendering process are executed simultaneously on the same data stream, and each stage processes different data in sequence; the data parallelism is to distribute the data into a plurality of data streams and process the data by a plurality of rendering units simultaneously; the temporal parallelism is realized by utilizing temporal decomposition, each frame of the animation sequence is a basic unit of task allocation, and each processor independently completes a plurality of frames of images.
The invention provides a platform-level rendering optimization component, which solves the problem that tens of thousands of high-precision models are efficiently rendered in real time in a real-time application environment according to environmental changes, ensures the smooth operation of the whole digital workshop system, further achieves the purpose of online visual monitoring of the production process, and simultaneously considers the diversity of platform applications.
Drawings
FIG. 1 is a system framework diagram of an embodiment of the present invention;
FIG. 2 is a flow chart of a method of an embodiment of the present invention;
FIG. 3 is a flowchart of a dynamic merging batch process based on the number and number of vertices of the model mesh according to an embodiment of the present invention;
FIG. 4 is a flowchart of a same type model texture atlas dynamic and batch processing based on an embodiment of the invention;
FIG. 5 is a flowchart illustrating a scene management optimization procedure according to an embodiment of the present invention;
fig. 6 is a flowchart of optimizing the real-time illumination and shadow effects according to the embodiment of the present invention.
Detailed Description
In order to facilitate the understanding and implementation of the present invention for those of ordinary skill in the art, the present invention is further described in detail with reference to the accompanying drawings and examples, it is to be understood that the embodiments described herein are merely illustrative and explanatory of the present invention and are not restrictive thereof.
This embodiment will use the following terminology:
(1) digital workshop: the comprehensive application of digitalization and networking technology in production workshop integrates the information of numerical control equipment and process design system, production organization system and other management system to form integrated manufacturing system with integrated information flow automation.
(2) Visualization: the technical means for converting data into graphs.
(3) Three-dimensional modeling: the digital representation of the characteristic information of the real three-dimensional object is formed by hand or a certain computer algorithm.
(4) A rendering engine: and performing optimized traversal on the three-dimensional model loaded by the system, and displaying after adding contents such as colors, illumination, shadows, materials and the like, so that the three-dimensional model is closer to the combination of a series of functional modules of the physical visual effect of a real object.
(5) GPU (graphics processor) programming: in order to fully exert the polygon conversion and light source processing capacity of a graphic processor in a display card, the overall performance of a software and hardware system in the graphic processing process is improved by a computer programming technology.
Referring to fig. 1, the large-scale digital workshop rendering system based on the Unity platform provided by the invention performs modular reconstruction on the basis of a Unity engine architecture, and comprises a low-order renderer subsystem, a scene graph/culling optimization subsystem and a visual effect subsystem;
the rendering function of the Unity engine focuses on rendering geometric primitives as fast as possible, and is responsible for connecting and enumerating graphics devices and establishing a rendering surface. The low-order renderer subsystem of the embodiment optimizes rendering geometric primitives as many as possible in the same GPU calling process on the basis of a Unity rendering engine, and realizes real-time rendering of tens of thousands of models in a digital workshop.
The low-order renderer subsystem of the present embodiment comprises 6 optimization components:
(1) a geometric primitive submission component: and the method is responsible for merging the static model primitives and merging the texture atlas in the digital workshop scene.
(2) Texture and surface management component: the method is responsible for mapping used by the digital workshop model, establishing the mapping relation of the material balls, caching data, optimizing and managing dynamic cache and the like.
(3) Material and shader components: and the system is responsible for mapping relation management of the rendering shader.
(4) Static and dynamic illumination assemblies: and the system is responsible for managing the mapping relation between the digital workshop model and a real-time light source, the relation between the light source and a time shaft and the like.
(5) A camera assembly: is responsible for managing the various cameras in the scene.
(6) The character and font management component: the method is responsible for managing fonts and texts used in the system, dynamically combining the texts, generating a texture atlas of the texts, and solving the problem of efficiency of the Unity engine in processing the texts and the fonts. And meanwhile, reserving a skeleton network rendering component for three-dimensional roaming to support visual operation of the digital workshop.
The Unity engine mainly has three forms of occlusion rejection, namely, viewing cone rejection, occlusion rejection and far and near rejection, which are related to a camera in a scene. View frustum culling is the culling of objects that should not be displayed with the frustum matrix of the camera. And the shielding elimination is to eliminate the objects without the bound identifications by setting the shielding identifications. And the distance elimination is to calculate the distance between an object and the camera in real time through an algorithm and eliminate the object with unexpected distance. The three modes have better efficiency under the condition of small quantity of rendering models, and the rendering process of tens of thousands of models is not smooth in real time. On the basis of the Unity engine occlusion rejection function, the scene graph/rejection optimization subsystem of the embodiment realizes 3 methods for model rejection in large-scale digital workshop scenes.
(1) The space analysis method comprises the following steps: the method is suitable for static scenes, static model relative displacement information is established, when the camera is shielded and removed, the sequenced rendering geometric objects are rapidly obtained through the BSP tree according to the position of the camera, and then the model outside the set range is hidden according to the model relative displacement information. The BSP tree has the advantage that it can cut overlapping objects, thereby solving the problem of cyclic overlapping.
(2) Logic and latent methods: in the visible set method, by classifying and labeling models in the digital workshop, the models are removed according to categories, and all process-related models are displayed quickly in the digital workshop.
(3) The method for the degree of fineness comprises the following steps: and the system is responsible for managing the mapping relation between the high-precision model and the low-precision model and establishing model data cache. The LOD (level of detail) is used to determine which model to display in a digital plant scene based on the distance between the camera and the model, and generally displays a high-precision multi-detail model when the distance is close and displays a low-precision low-detail model when the distance is far. Through the detailed system mapping relation and the cache, the LOD can dynamically and quickly complete the conversion work of the high-precision model and the low-precision model.
The shader provided by the Unity engine is mainly suitable for the field of games and has insufficient customized support for the industrial field. The sharerlab shader native to the Unity engine is limited to Unity platform usage and lacks cross-platform capability. The visual effects subsystem of the present embodiment employs a CG shader to support cross-platform capabilities. A plurality of components are provided to improve visual effects, including illumination mapping and real-time shadows, particle special effects, high dynamic illumination, particle and mapping special effects, post-processing effects, environmental mapping, and the like.
Referring to fig. 2, the large-scale digital workshop rendering method based on the Unity platform provided by the invention comprises an application stage, a geometric stage and a rasterization stage; the application stage receives a user input instruction to output a rendering primitive, the geometry stage receives the rendering primitive and then outputs vertex information of a screen space, and the rasterization stage outputs images in various expression forms to the client;
in order to improve the efficiency, the rendering work developed in the whole pipeline mode of the embodiment must be developed in parallel, and the purpose of improving the efficiency is achieved through parallel processing decomposition on functions, data and time.
(1) Parallelization based on functional decomposition: different stages of the rendering process are performed simultaneously on the same data stream, each stage being capable of sequentially processing different data. If each processing unit performs a sub-function and a sequentially connected data path is established between the processing units, a rendering pipeline is in fact formed. The design based on the functional decomposition pipeline should avoid the occurrence of bottlenecks as much as possible, and in order to improve the number of stages of the pipeline and obtain a higher speed-up ratio, the functions which particularly consume resources need to be optimized in a key manner, and a more detailed scheme description is provided below.
(2) Parallelization based on data decomposition: the data is distributed into multiple data streams and processed simultaneously with multiple rendering units. The parallel algorithm based on data decomposition has the greatest advantage that the algorithm has better expandability and can obtain higher acceleration ratio.
(3) Parallelization based on temporal decomposition: although the number of graphics renderings increases during three-dimensional roaming, the animation effect of the roaming may not be the most important in terms of rendering speed per frame, and the rendering time of the entire animation is of concern. This allows parallelism to be achieved using temporal decomposition, with each frame of the animation sequence being the basic unit of task allocation and each processor performing several of the images separately.
The embodiment optimizes the application stage, the geometric stage and the rasterization stage:
(1) optimizing in an application stage: the attribution judgment of the application stage parallel graphic rendering system occurs before the geometric processing, and the image space of the final display screen is divided into a plurality of areas to be distributed to different rendering servers. Before each frame is rendered, a rendering server responsible for processing is confirmed according to the projection of the scene geometric data on the display screen, then the corresponding data is sent to the rendering server for processing, and the results of all the rendering servers are spliced into a final display image after rendering is completed. Each rendering pipeline is complete and independent, and the cluster type parallel graph rendering system is favorably constructed. The attribution determination is the major overhead and bottleneck of the parallel graphics rendering system at this stage.
(2) Geometric phase optimization: the geometry stage parallel graphics rendering system requires that intermediate results after geometric processing and before rasterization of a rendering pipeline are redistributed, and after customized GPU (vertex shader and fragment shader optimization) processing, geometric processing and rasterization functions are integrated together, so that the parallel operation efficiency of the link is improved.
(3) And (3) optimization of a rasterization stage: in the rasterization stage, the image space is not divided, only the scene data is equally divided into a plurality of subsets, the division of the subsets is not limited by the space range, and the number of the triangular patches is ensured to be approximately equal so as to keep the load balance. And (3) processing each data subset by a GPU (graphic processing unit) program, then entering a corresponding rendering pipeline, and performing geometric processing and synthesis to obtain a final display result.
On a processing flow line of a digital workshop, a scene is often encountered, the appearances of processing objects on the whole flow line have high similarity, and batch optimization can be established by utilizing the similarity.
The Unity engine supports both dynamic and static batch processing, but there is no universal approach to model mesh merging and texture atlas merging, which is dynamically implemented by the post-labeling system. When the number of models is small, the support of Unity dynamic partitioning is good. In a digital workshop scene with more models, the dynamic implementation mode is not flexible enough and cannot meet the requirement of optimizing GPU (DrawCall).
Therefore, according to the rendering requirement of the digital workshop scene, two kinds of batch optimization are developed on the Unity engine: carrying out dynamic merging and batch processing based on the number and the number of model mesh vertexes and carrying out dynamic merging and batch processing based on the same type of model texture atlas;
referring to fig. 3, in the rendering process, the embodiment is developed in parallel in a pipeline manner, and dynamic merging batch processing is performed based on the number and number of vertices of the model mesh;
in a digital workshop scenario, many identical models belong to the same family and the same type. The material of these models is the same but the mesh is different. The function of the Unity dynamic pool is applied to the model, and the reduction of GPU calling times (DrawCall) is not obvious. Therefore, the system component is realized, model meshes are automatically combined according to the rules of the same family, the same type and the same material ball under the condition that the maximum number of single model vertexes of the Unity engine is 64K, and the rendering efficiency is obviously improved. The realization process is as follows:
(1) in a digital workshop scene, models belonging to the same family and the same type are searched according to model attributes. Judging whether the material of the model is the same or not, and eliminating the model with different material balls;
(2) calculating the number of grid vertexes of each model;
(3) calculating a merged model batch to meet the models of the same batch, wherein the sum of the grid vertexes is less than 64K;
(4) the meshes of the model are merged according to the batches.
Referring to fig. 4, in the rendering process, the embodiment is developed in parallel in a pipeline manner, and dynamic and batch processing is performed based on the same type of model texture atlas;
the system can dynamically calculate the size of the pixels needing to process the model textures in batch, set the size of the texture atlas according to the system, and dynamically combine different textures into a large texture atlas, so that different materials and the same texture can be used, the GPU calling frequency (DrawCall) is reduced, and the rendering and running efficiency of a digital workshop is improved. The realization process is as follows:
(1) in a digital workshop scene, searching models which belong to the same family and are different in type according to model attributes;
(2) the model texture is divided into three classes of Albedo, Metallic and Normal. Respectively modeling different types of textures, and calculating the size of texture pixels;
(3) calculating texture merging batches according to the pixel size (2048 × 2048) of the texture atlas prefabricated by the system;
(4) and (4) merging the textures according to batches, wherein whether the merged textures have Alpha channels needs to be judged, and if the merged textures have the Alpha channels, the merged textures need to be processed independently. Generating texture image sets and texture UV coordinates after batch processing;
(5) and calculating the position of the model texture in the atlas according to the texture atlas and the texture UV coordinates, and updating the texture of the model.
Referring to fig. 5, in the rendering process, the models that do not need to be rendered are removed in a pipeline manner, and meanwhile, the models that do not need to be rendered are removed in a scene division manner, a view frustum cutting manner and a shielding cutting manner, so that scene management optimization is realized.
Because the digital workshop has relatively fixed large-scale equipment design position, has the operation regulation of relative solidification simultaneously, patrols and examines the circuit etc. consequently can carry out the pre-optimization to scene management, including scene division, the frustum is cut off, is sheltered from and cuts off etc..
The scene division optimization is to classify the processing objects which need to be operated in different regions according to the operation rules, and to divide the processing objects as small objects into the levels where the processing objects are located, and the processing objects can be divided according to the classification in the same level. The redundancy of the node number is avoided, and the rendering efficiency is improved.
The viewing cone cutting is to cut the rendering model to optimize the rendering efficiency by using the perspective effect of human vision, and distinguish the visibility of the rendering object to reduce the rendering content. Meanwhile, the routing inspection route in the digital workshop is relatively fixed, and the simulation visual angle can also be set with some common points for pre-optimization, so that the rendering content can be reduced, the real-time operation during the cutting of the viewing cone can be reduced, the occupation of CPU resources is reduced, and the rendering efficiency is improved. The shielding cutting is similar to the viewing cone cutting, the position and the shape of large equipment in a large-scale digital workshop are mainly established to be fixed, the shielding objects can be pre-judged in advance by combining with a routing inspection line, and the rendering efficiency is improved.
In a digital workshop scene, models are rendered in high precision and real time, namely the vertexes and the faces of the models are large in number, the models comprise a plurality of types of textures, and the models are rendered in real time according to illumination. In order to improve the fluency and the rendering efficiency of the system, models which do not need to be rendered are removed in the modes of scene division, viewing cone cutting, shielding cutting and the like, and the rendering efficiency is improved. The scene management optimization process is as follows:
(1) dividing different sub-regions of the whole digital workshop according to functions, and calculating the global coordinates of the center points of the sub-regions;
(2) the process equipment model of the digital plant includes many internal details, particle effects and animation effects. The model has high precision. Under the overall display scene of the digital workshop, a low-precision model needs to be replaced, and the rendering efficiency is improved. Therefore, two sets of models need to be prepared for different scene rendering requirements;
(3) setting LOD values of scene elimination and cone clipping to complete initialization work of scene management optimization;
(4) judging the current system operation scene, if the display state of the whole digital workshop is the display state, rendering and selecting a low-precision process equipment model, and if the display state of the whole digital workshop is the roaming and equipment operation and maintenance state, rendering a high-precision process equipment model;
(5) and calculating the distance between the camera and the central point of the sub-area in real time. If the distance is greater than the scene culling LOD value, the entire sub-region model is not rendered. If the distance is smaller than the scene elimination LOD value, rendering the model in the sub-region according to the next step rule;
(6) real-time light source rendering efficiency is also one of the main factors influencing the smoothness of system operation. Rendering is realized through a Shader (Shader), and real-time light source rendering is realized by calculating the normal texture of the model and the position, the intensity and the color of a light source in real time to output a rendering effect. And the fixed light source rendering is to calculate and output a rendering effect through the normal map and a light source fixed value. Therefore, the real-time light source rendering efficiency is lower than that of the fixed light source rendering efficiency, but the rendering effect is good. Therefore, the distance between the camera and the model in the sub-area is calculated, the model in a certain range is rendered by adopting a real-time light source, and the model outside the area range is rendered by adopting a fixed light source, so that the fluency and the rendering efficiency of the system are improved.
Referring to fig. 6, in the rendering process, the embodiment is developed in parallel in a pipeline manner, and meanwhile, the optimization of real-time illumination and shadow effects is realized by adopting a forward rendering path.
Real-time illumination and shadow calculation greatly influence rendering efficiency, a plurality of light sources exist in a large-scale digital workshop scene, each light source participates in calculation, and the system realizes optimization of real-time illumination and shadow effects through a Shader (Shader). The Unity rendering path determines how lighting is applied in shaders. Render path in Unity support 3: vertex lighting rendering path, delay rendering path, forward rendering path.
The vertex illumination rendering path typically renders the object in one pass, with the illumination of all light sources being calculated at the vertices of the object. The vertex lighting rendering path is the fastest rendering path and is supported by the most extensive hardware, but since all illumination is computed at the vertex level, this rendering path does not support most of the per-pixel rendering effects: such as shadows, normal maps, lighting masks, high-precision highlights.
The deferred rendering path is one of the current highest-level rendering paths that can achieve ray and shadow fidelity. There is no upper limit on the amount of light that can affect any object, and evaluating light in a per-pixel manner is used entirely, meaning that all will interact with the object correctly in a normal map fashion. All rays can have information cache and all rays can produce shadows. The performance overhead of delayed rendering is large, rendering of semi-transparent material is not possible, an extra forward channel needs to be added to the semi-transparent material, and a large number of Draw calls are generated.
The forward rendering path renders the object with a single or multiple channels depending on the light source affecting the object. The light sources themselves may also be treated differently depending on their settings and intensities. In forward rendering, the brightest few light sources that affect the object use a pixel-by-pixel illumination pattern. A maximum of 4 point sources will be calculated in a vertex-by-vertex rendering. Other light sources will be calculated in a spherical harmonic manner, taking only little CPU computation time and practically no GPU computation time, the spherical harmonic technique is fast to calculate but only approximate.
Based on the advantages of the three rendering paths and the characteristics of a large-scale digital workshop, the system adopts the forward rendering path to realize the optimization of real-time illumination and shadow effects, and the rendering process is optimized as follows:
(1) multiple light sources in a scene are defined. If an object is in the influence area of multiple pixel-by-pixel light sources, the object needs to execute multiple passes (rendering channels), each Pass calculates the illumination results of one pixel-by-pixel light source, and then mixes the illumination results in a frame buffer to obtain the final color value.
(2) A plurality of real-time rendering channels are defined according to light sources in a scene. The forward rendering path defines a Base Pass and an Additional Pass. The Base Pass will be executed only once, and the Additional Pass will be called up multiple times according to the number of other pixel-by-pixel light sources affecting the object, i.e. each pixel-by-pixel light source will execute the Additional Pass once.
(3) A Shadow Pass rendering Pass is defined. In the forward rendering path, Unity computes its shadow-mapped texture for the illuminant if the parallel light turns on a shadow in the scene. The shadow mapping texture is a depth map that records the position of the nearest surface in the scene that can be seen starting from the position of the light source. When calculating the shadow mapping texture, the camera is placed at the position of the light source, and then the depth information is updated according to the normal rendering process, namely the Base Pass and the Additional Pass are called to obtain the shadow mapping texture. However, this method will cause a certain waste of performance, and especially in a digital workshop scenario with tens of thousands of models, the smoothness of operation will be affected. Because only depth information is actually needed, many complex illumination model calculations are often involved in the Base Pass and the Additional Pass. Unity therefore provides an additional Pass to exclusively update the shadow mapping texture of the light source, i.e. the ShadowCaster Pass. The system optimizes and calculates the process of shadow mapping texture (depth texture) through a ShaderCaster Pass rendering channel, places a camera on the position of a light source, calls the Pass, obtains the position of the light source in the space after vertex transformation, and outputs depth information to the shadow mapping texture according to the position.
(4) According to a scene management optimization algorithm, model rendering of a real-time light source is divided into three types. The first model setting Base Shader for real-time rendering of the main light source. The second model of multi-light source real-time rendering sets Base Shader and additional Shader. The third model of shadow effect real-time rendering sets sharedcaster. The second type of rendering efficiency is affected by multiple light source calculations, so pixel-by-pixel calculations need to be done in Base Shader, with the auxiliary light sources being mainly post-processing calculations.
It should be understood that the above description of the preferred embodiments is given for clarity and not for any purpose of limitation, and that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A large-scale digital workshop rendering system based on a Unity platform is characterized in that: modular reconstruction is carried out on the basis of a Unity engine architecture, and the system comprises a low-order renderer subsystem, a scene graph/elimination optimization subsystem and a visual effect subsystem;
the low-order renderer subsystem optimizes rendering geometric primitives as many as possible in the same GPU calling process on the basis of a Unity rendering engine to realize real-time rendering of tens of thousands of models in a digital workshop;
the scene graph/rejection optimization subsystem realizes model rejection in a large-scale digital workshop scene through a space analysis method, a logic and potential visible set method and a fine degree method on the basis of the Unity engine shielding rejection function;
the visual effect subsystem adopts a CG shader to support cross-platform capability.
2. The Unity platform-based large-scale digital workshop rendering system of claim 1, wherein: the low-order renderer subsystem comprises a geometric primitive submitting component, a texture and surface management component, a material and shader component, a static and dynamic illumination component, a camera component and a character and font management component; the geometric primitive submitting component is responsible for merging the static model primitives and merging the texture atlas in the digital workshop scene; the texture and surface management component is responsible for mapping used in a digital workshop, establishing a mapping relation of material balls, caching data, optimizing and managing dynamic cache; the texture and shader component is responsible for mapping relation management of a rendering shader; the static and dynamic illumination component is responsible for managing the mapping relation between the digital workshop and the real-time light source and the relation between the light source and the time axis; the camera assembly is responsible for managing each camera in a digital workshop scene; the character and font management component is responsible for managing fonts and texts used in the system, dynamically combining the texts, and generating a texture atlas of the texts, so that the problem of efficiency in processing the texts and the fonts by the Unity engine is solved.
3. The Unity platform-based large-scale digital workshop rendering system of claim 1, wherein: the space analysis method is used for establishing relative displacement information of a static model in a static scene, rapidly acquiring sequenced rendering geometric objects according to the position of a camera through a BSP tree while shielding and removing the camera, and hiding the model outside a set range according to the relative displacement information of the model;
the logic and potential visible set method realizes elimination according to categories by classifying models and labels in the digital workshop;
and the detail degree method is responsible for managing the mapping relation between the high-precision model and the low-precision model and establishing model data cache.
4. The Unity platform-based large-scale digital workshop rendering system of claim 1, wherein: the visual effect subsystem comprises an illumination chartlet and real-time shadow component, a particle special effect component, a high dynamic illumination component, a particle and chartlet special effect component, a post-processing effect component and an environment chartlet component.
5. A large-scale digital workshop rendering method based on a Unity platform is characterized by comprising the following steps: the method comprises an application stage, a geometric stage and a rasterization stage; the application stage receives a user input instruction to output a rendering primitive, the geometry stage receives the rendering primitive and then outputs vertex information of a screen space, and the rasterization stage outputs images in various expression forms to the client;
the rendering process is developed in parallel in a pipeline mode and comprises parallel processing on functions, data and time; the functional parallelism is that different stages of the rendering process are executed simultaneously on the same data stream, and each stage processes different data in sequence; the data parallelism is to distribute the data into a plurality of data streams and process the data by a plurality of rendering units simultaneously; the temporal parallelism is realized by utilizing temporal decomposition, each frame of the animation sequence is a basic unit of task allocation, and each processor independently completes a plurality of frames of images.
6. The Unity platform-based large-scale digital workshop rendering method according to claim 5, wherein: in the process of rendering, carrying out parallel development in a pipeline mode, and simultaneously carrying out dynamic merging batch processing based on the number and number of model mesh vertexes;
the specific implementation comprises the following steps:
(1) in a digital workshop scene, searching models belonging to the same family and the same type according to the model attributes; judging whether the material of the model is the same or not, and eliminating the model with different material balls;
(2) calculating the number of grid vertexes of each model;
(3) calculating a merged model batch to meet the models of the same batch, wherein the sum of the grid vertexes is less than a preset value;
(4) the meshes of the model are merged according to the batches.
7. The Unity platform-based large-scale digital workshop rendering method according to claim 5, wherein: in the process of rendering, parallel development is carried out in a pipeline mode, and dynamic and parallel batch processing is carried out on the basis of the same type of model texture atlas;
the specific implementation comprises the following steps:
(1) in a digital workshop scene, searching models which belong to the same family and are different in type according to model attributes;
(2) the model texture is divided into three types of Albedo, Metallic and Normal; respectively modeling different types of textures, and calculating the size of texture pixels;
(3) calculating texture merging batches according to the pixel size of a system prefabricated texture atlas;
(4) merging the textures according to batches, judging whether the merged textures have Alpha channels or not, and if so, independently processing the merged textures; generating texture image sets and texture UV coordinates after batch processing;
(5) and calculating the position of the model texture in the atlas according to the texture atlas and the texture UV coordinates, and updating the texture of the model.
8. The Unity platform-based large-scale digital workshop rendering method according to claim 5, wherein: in the rendering process, the models which do not need to be rendered are removed in a pipeline mode, and meanwhile, the models which do not need to be rendered are removed in a scene division, visual cone cutting and shielding cutting mode, so that the scene management optimization is realized;
the specific implementation comprises the following steps:
(1) dividing different sub-regions of the whole digital workshop according to functions, and calculating the global coordinates of the center points of the sub-regions;
(2) preparing two sets of models, including a low-precision process equipment model and a high-precision process equipment model, for different scene rendering requirements;
(3) setting LOD values of scene elimination and cone clipping to complete initialization work of scene management optimization;
(4) judging the current system operation scene, if the display state of the whole digital workshop is the display state, rendering and selecting a low-precision process equipment model, and if the display state of the whole digital workshop is the roaming and equipment operation and maintenance state, rendering a high-precision process equipment model;
(5) calculating the distance between the camera and the central point of the sub-area in real time; if the distance is larger than the scene elimination LOD value, the whole sub-region model is not rendered; if the distance is smaller than the scene elimination LOD value, rendering the model in the sub-region according to the next step rule;
(6) by calculating the distance between the camera and the model in the sub-area, the model in a certain range is rendered by adopting a real-time light source, and the model outside the area range is rendered by adopting a fixed light source, so that the fluency and the rendering efficiency of the system are improved.
9. The Unity platform-based large-scale digital workshop rendering method according to claim 5, wherein: in the rendering process, the parallel development is carried out in a pipeline mode, and meanwhile, the optimization of real-time illumination and shadow effects is realized by adopting a forward rendering path;
the specific implementation comprises the following steps:
(1) defining multiple light sources in a scene;
if an object is in the influence area of a plurality of pixel-by-pixel light sources, the object needs to execute a plurality of passes, each Pass calculates the illumination result of one pixel-by-pixel light source, and then the illumination results are mixed in a frame buffer area to obtain a final color value;
(2) defining a plurality of real-time rendering channels according to light sources in a scene;
defining a Base Pass and an additional Pass for a forward rendering path; the Base Pass is executed only once, and the Additional Pass is called for many times according to the number of other pixel-by-pixel light sources influencing the object, namely, the Additional Pass is executed once by each pixel-by-pixel light source;
(3) defining a Shadow Shadow Pass rendering channel;
optimizing and calculating a shadow mapping texture process through a ShaderCaster Pass rendering channel, placing a camera on a light source position, calling the Pass, obtaining a position under a light source space after vertex transformation, and outputting depth information to the shadow mapping texture according to the position;
(4) according to the scene management optimization method, a Shader of the model is set;
the model rendering of the real-time light source is divided into three types; setting Base Shader for a first main light source real-time rendering model; setting a Base Shader and an additional Shader in a second multi-light-source real-time rendering model; the third model of shadow effect real-time rendering sets sharedcaster.
10. The Unity platform based large-scale digital workshop rendering method according to any of claims 5-9, wherein: the method comprises the steps of optimization in an application stage, optimization in a geometric stage and optimization in a rasterization stage;
the application stage optimization comprises the steps of firstly judging the affiliation of a parallel graphic rendering system, and then dividing the image space of a display screen of a client into a plurality of areas to be distributed to different rendering servers; before each frame is rendered, confirming a rendering server responsible for processing according to the projection of scene geometric data on a display screen, then sending corresponding data to the rendering server for processing, and splicing the results of all the rendering servers into a final display image after rendering is finished;
the geometry phase optimization integrates geometry processing and rasterization functions together after being optimized by a vertex shader and a fragment shader;
the rasterization stage is optimized, the scene data are equally divided into a plurality of data subsets, the subsets are not limited by the space range, and the number of triangular patches is ensured to be approximately equal so as to keep load balance; and each data subset enters a corresponding rendering pipeline after being processed by a GPU program, and a final display result is obtained after geometric processing and synthesis.
CN202111287289.6A 2021-11-02 2021-11-02 Large-scale digital workshop rendering system and method based on Unity platform Pending CN114155337A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111287289.6A CN114155337A (en) 2021-11-02 2021-11-02 Large-scale digital workshop rendering system and method based on Unity platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111287289.6A CN114155337A (en) 2021-11-02 2021-11-02 Large-scale digital workshop rendering system and method based on Unity platform

Publications (1)

Publication Number Publication Date
CN114155337A true CN114155337A (en) 2022-03-08

Family

ID=80459201

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111287289.6A Pending CN114155337A (en) 2021-11-02 2021-11-02 Large-scale digital workshop rendering system and method based on Unity platform

Country Status (1)

Country Link
CN (1) CN114155337A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116385614A (en) * 2023-03-29 2023-07-04 深圳海拓时代科技有限公司 3D vision module rendering control system based on visualization
CN116630486A (en) * 2023-07-19 2023-08-22 山东锋士信息技术有限公司 Semi-automatic animation production method based on Unity3D rendering
CN117315121A (en) * 2023-10-12 2023-12-29 重庆爱车天下科技有限公司 3D rendering engine system based on vehicle-mounted chip
CN118052921A (en) * 2024-02-06 2024-05-17 西南石油大学 Image rendering method, device, storage medium and product

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116385614A (en) * 2023-03-29 2023-07-04 深圳海拓时代科技有限公司 3D vision module rendering control system based on visualization
CN116385614B (en) * 2023-03-29 2024-03-01 深圳海拓时代科技有限公司 3D vision module rendering control system based on visualization
CN116630486A (en) * 2023-07-19 2023-08-22 山东锋士信息技术有限公司 Semi-automatic animation production method based on Unity3D rendering
CN116630486B (en) * 2023-07-19 2023-11-07 山东锋士信息技术有限公司 Semi-automatic animation production method based on Unity3D rendering
CN117315121A (en) * 2023-10-12 2023-12-29 重庆爱车天下科技有限公司 3D rendering engine system based on vehicle-mounted chip
CN118052921A (en) * 2024-02-06 2024-05-17 西南石油大学 Image rendering method, device, storage medium and product

Similar Documents

Publication Publication Date Title
CN111340928B (en) Ray tracing-combined real-time hybrid rendering method and device for Web end and computer equipment
CN112270756B (en) Data rendering method applied to BIM model file
CN114155337A (en) Large-scale digital workshop rendering system and method based on Unity platform
US8004518B2 (en) Combined spatial index for static and dynamic objects within a three-dimensional scene
US8111260B2 (en) Fast reconfiguration of graphics pipeline state
EP1594091B1 (en) System and method for providing an enhanced graphics pipeline
US7940266B2 (en) Dynamic reallocation of processing cores for balanced ray tracing graphics workload
Montrym et al. The geforce 6800
US20080259075A1 (en) Dynamically Configuring and Selecting Multiple Ray Tracing Intersection Methods
US9684997B2 (en) Efficient rendering of volumetric elements
US11615575B2 (en) Methods and systems for constructing a shader
US7400325B1 (en) Culling before setup in viewport and culling unit
US7064755B2 (en) System and method for implementing shadows using pre-computed textures
CN113076152B (en) Rendering method and device, electronic equipment and computer readable storage medium
Hu et al. Parallel view-dependent level-of-detail control
CN114742931A (en) Method and device for rendering image, electronic equipment and storage medium
US7292239B1 (en) Cull before attribute read
CN115937389A (en) Shadow rendering method, device, storage medium and electronic equipment
CN117101127A (en) Image rendering method and device in virtual scene, electronic equipment and storage medium
EP3211598B1 (en) System and method for accelerated rendering of two-dimensional graphics
CN117036562A (en) Three-dimensional display method and related device
CN109816761B (en) Graph conversion method, graph conversion device, storage medium and electronic equipment
CN113256771A (en) Graphics system and graphics processing method therefor
US20240242403A1 (en) System and Method for Creating a Design Tool Using a Clockwise Fill Rule
CN117808951A (en) Three-dimensional scene updating method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination