CN115409926A - Distributed rendering method - Google Patents

Distributed rendering method Download PDF

Info

Publication number
CN115409926A
CN115409926A CN202110509225.XA CN202110509225A CN115409926A CN 115409926 A CN115409926 A CN 115409926A CN 202110509225 A CN202110509225 A CN 202110509225A CN 115409926 A CN115409926 A CN 115409926A
Authority
CN
China
Prior art keywords
rendering
server
client
data
file
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
CN202110509225.XA
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.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN202110509225.XA priority Critical patent/CN115409926A/en
Publication of CN115409926A publication Critical patent/CN115409926A/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/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining

Abstract

The invention discloses a distributed rendering method, which comprises the steps of defining a processing server as a client, wherein the client divides each static frame of rendering image into a plurality of areas; dividing the rendering tasks of each region to each rendering server, and monitoring the task conditions of all the rendering servers at the same time; and after the rendering tasks of all the rendering servers are finished, returning the rendering tasks to the processing server, and combining the rendering tasks into a complete rendering picture. Therefore, the rendering efficiency is improved, the computing resources of the computer are released, the problem of resource waste caused by idle self-built server clusters of a company is solved, and high-quality and high-efficiency rendering work is realized.

Description

Distributed rendering method
Technical Field
The invention relates to the technical field of distributed image rendering, in particular to a distributed rendering method.
Background
The rendering technology can be simply understood as representing the element data in the scene in the form of pixels, and the main function of the rendering engine is to convert the scene data containing various elements, which is designed in the modeling software, into the image desired by the user. Currently, domestic internet home decoration design companies generally do not directly use a game engine as a rendering engine but use an open source engine based on ray tracing for secondary development, because the game engine can achieve a certain degree of rendering, but when the game engine has material illumination effects such as diffuse reflection or the like or when a user can interact with an interface such as editing various elements in a scene, different lights can generate different effects on the material of a home, and the game engine is relatively weak in this respect.
The VRay engine is a well-known rendering engine at home and abroad, and is an index number in both software coverage and updating speed. At present, the domestic use of VRay is in the majority of plug-in versions in each large modeling software because of convenience and rapidness, but if higher requirements on the material and the illumination effect in an image are required, the VRay SDK is required to be used for development. Meanwhile, if the stand-alone rendering using the VRay engine obviously cannot meet the requirements, a distributed rendering method using the VRay engine is required.
Disclosure of Invention
The invention provides a distributed rendering method, aiming at the problems that the rendering efficiency is low when a user uses a local computer to render, the process management cannot be realized, the interactivity is poor, the utilization rate of a server and resources is unreasonable and the like in the prior art.
In order to achieve the purpose of the invention, the invention adopts the technical scheme that:
1. a distributed rendering method, comprising,
defining a processing server as a client, wherein the client divides each static frame of rendering image into a plurality of areas;
dividing the rendering tasks of each region to each rendering server, and monitoring the task conditions of all the rendering servers at the same time;
and after the rendering tasks of all the rendering servers are finished, returning the rendering tasks to the processing server, and combining the rendering tasks into a complete rendering picture.
2. A distributed rendering method according to claim 1, characterised in that the maximum number of threads corresponds to the maximum number of rendering regions, one thread being responsible for each region;
3. a distributed rendering method according to claim 1,
the client is a host used by a user, wherein the client is used as a node management server;
the client divides the single-frame image and transmits the single-frame image to the rendering server, and the client manages and organizes the rendering process;
the client manages the connection and the closing of the rendering server and the corresponding states of the rendering server comprise dormancy and use;
and returning a rendering result to the client after the rendering is finished.
The invention has the following beneficial effects:
according to the invention, through a distributed rendering mode, the rendering efficiency is improved, the computing resources of a local computer are liberated, the problem of a large amount of resource waste when a company self-built a server cluster is idle is solved, and high-quality and high-efficiency rendering work is realized.
Drawings
Fig. 1 is a schematic structural diagram of a VRay engine-based cloud rendering system according to the present invention;
FIG. 2 is a data processing logic diagram of a cloud rendering system based on a VRay engine according to the present invention;
FIG. 3 is a service flow diagram of a cloud rendering system based on a VRay engine according to the present invention;
fig. 4 is a flow diagram of the Vray distributed rendering module operation of the present invention.
Detailed Description
The following description of the embodiments of the present invention is provided to facilitate the understanding of the present invention by those skilled in the art, but it should be understood that the present invention is not limited to the scope of the embodiments, and it will be apparent to those skilled in the art that various changes may be made without departing from the spirit and scope of the invention as defined and defined in the appended claims, and all matters produced by the invention using the inventive concept are protected.
As shown in fig. 1 and fig. 2, an embodiment of the present invention provides a cloud rendering system based on a VRay engine, including a client model data parsing processing module, a VRay file server data processing module, a VRay cloud rendering server module, and a VRay distributed rendering module;
the client model data analysis processing module is used for acquiring a rendering request and a rendering model data file, analyzing the rendering model data file to obtain rendering data and a loading scene file, uploading the rendering data to the cloud rendering server, and uploading the loading scene file to the file server;
the Vlay file server data processing module is used for analyzing the loaded scene file according to a scene file loading request sent by the cloud rendering server to obtain scene data and picture data and uploading the scene data and the picture data to the cloud rendering server;
the Vray cloud rendering server module is used for receiving rendering data uploaded by the client model data analysis processing module and scene data and picture data uploaded by the Vray file server data processing module, analyzing all the data to generate a corresponding scene, and exporting a parameter file of the whole scene to be sent to the Vray distributed rendering module; receiving a rendered picture returned by the Vlay distributed rendering module and outputting the rendered picture to a client;
and the Vray distributed rendering module is used for calling rendering nodes to render according to the parameter files of the whole scene sent by the Vray cloud rendering server module by adopting a distributed rendering method, generating rendering pictures and transmitting the rendering pictures back to the Vray cloud rendering server module.
In the invention, a user initiates a rendering request through a client-side data processing module and analyzes data at the same time, an enterprise firewall sends an effective request to a cloud rendering server after filtering an invalid request, the file server uploads corresponding model file data to the server first and translates the model file data into corresponding VRay rendering data, then a scene file or other picture files are uploaded according to the necessity or non-necessity, if the scene file is not required, a system can automatically generate a simple scene comprising a camera and a light source, if the scene file is required to be loaded, the corresponding data file is loaded from the file server module, then the full-scene rendering data is exported after the scene is constructed and sent to a distributed rendering module for rendering, the cloud server module schedules the rendering server to render an image, and finally the effect image is output to the user.
In this embodiment, the client model data parsing module specifically includes:
inputting other shared rendering model data files exported by a virtual engine or downloaded by a network into a client model data analysis processing module in a front-end uploading or local setting mode;
verifying whether the rendering model data file is a resolvable data file or not by using a client model data analysis processing module, and loading model data in the rendering model data file after successful verification;
and analyzing the model data, and converting the geometric data into Mesh data and texture mapping data of the model and Mesh data of the scene.
The client model data analysis processing module also comprises a rendering event for representing different rendering periods, and a data processing log record of the Vlay model is obtained.
The client model data parsing processing module also includes a logical callback that adds a custom client when a rendering event occurs and that executes in a separate thread than the VRay rendering main thread.
Specifically, the client model data analysis processing module uploads the model data file exported from the modeling software to the client data processing module, and then the client data processing module analyzes the data in the model file, so as to analyze whether the scene file needs to be loaded from the file server besides obtaining the relevant data such as the model.
The Json model data of the user can be corresponding model and scene data exported by the UE4, or shared data of other people downloaded through a network, after the Json model data is uploaded through a front-end interface or the position of the local model data is manually set, the client data processing module firstly verifies whether the file is parsable data, and the system starts to process the Json data after the format and the like are correct. Only by analyzing the Json file can subsequent operations of loading the Vrsene file and the like be carried out.
After the model data in the Json file is loaded, the system can translate the model data into VRay rendering data. Firstly, geometric data are converted into Mesh data of a model, and the Mesh data are converted into data such as a texture map, wherein the Mesh data processing mode of a scene is similar to that of the model.
Logging and exception handling mechanisms. The rendering background in the VRay rendering process is running in a single thread, and VRay issues many events that can be captured by the system. These events can be obtained through the vrayrender instance. The events are states during different rendering periods for the progress monitoring of the system, and the current progress can be monitored by acquiring the states.
The VRay SDK provides a mode for adding custom client logical callbacks when events occur, while the callback code is executed in a separate thread from the VRay rendering main thread, which has the benefit of keeping VRay fast rendering speed without additional resource overhead during the rendering process and ensuring that operations in the client callback code do not overwhelm the total rendering time. However, although the thread of the callback function does not affect the main thread, the callback function runs on the thread, and thus execution of other callback functions may be slowed down.
Each event contains a parameter of the current time that provides the system with the exact time the event occurred. But due to the queue and asynchronous relationship, the callback function is likely to execute at a completely different time. Events can be roughly divided into three types in VRay: events common to all rendering modes, bucket-rendered specific events and progressive-rendered specific events. While a common rendering event occurs in the following cases:
1. the rendering engine's state changes (e.g. start rendering, stop rendering)
VRay outputs text messages before and during rendering
VRay switches the current task (e.g. load file, rendering) and reports the percentage of progress
And if the uploaded Json file data is damaged or in an incorrect format, transmitting a message to the server module, and informing the user of the message by the server module. And simultaneously, user information is required to be logged in the front end of the system, the logged user ID is data existing in a system database and is required to correspond to a rendering task, so that the user ID can be corresponded when an order is paid later, and an effect graph which is rendered later is downloaded on a front end interface.
In this embodiment, the Vray file server data processing module specifically includes:
splicing a plurality of scene files into a single scene file by utilizing a Vlay file server data processing module, and then loading the spliced and synthesized scene file;
attributes of different models in a scene are modified using a plug-in system.
Specifically, in the file server data processing module, after receiving a request for loading a scene file in the previous step, the file server data processing module finds the corresponding scene file, then parses out the picture file contained therein, and uploads the local scene file and the picture file data to the VRay server module.
After receiving a file request of the cloud rendering server, the file server data processing module processes the request, finds and records a corresponding Vrscene file and a map file in the server, and then transmits the data file back to the cloud rendering server.
The number of models in an actual scene is thousands of models, or a composite model composed of a plurality of models, then a Vrscan file in a file server needs to be used for configuring complex data of different models, before how the Vrscan file is used, the Vrscan file needs to be clearly determined as scene file format data based on a text, a general text editor cannot be used, and a VRay scene only loads the Vrscan file once, but a plurality of Vrscan files can be spliced in a single Vrscan file by using a # include' antenna.
The Vrscene file mainly modifies attributes of different models in a scene through a plugins plugin system in the VRay SDK, and the plugin system can consider that various data blocks (including nodes, material data, grid data, light, cameras, scene environment data, option settings and the like) constructing the scene have corresponding plugins to correspond to the different models, so that modification and addition are facilitated, and certainly, for example, one plugin attribute in the Vrscene file is not expected to be effective in the scene, and the component can also be selected to be disabled.
In this embodiment, the Vray cloud rendering server module specifically includes:
verifying the rendering data uploaded by the client model data analysis processing module and the scene data and the picture data uploaded by the Vray file server data processing module;
after the verification is successful, analyzing all the data to generate a scene file of the VRay full-scene parameters;
obtaining a deployment log record of a Vlay rendering node, and coordinating the load of resources and distributed rendering modules;
verifying the user identity information and downloading version updates;
and outputting the rendering picture returned by the Vray distributed rendering module to a client, and performing local optimization on a rendering effect after delivery by a user.
Specifically, in the VRay server module, after the module receives data in all scenes of the client data processing module and the file server data processing module, a scene corresponding to the data is generated in the VRay module after proper analysis processing, then a parameter file of the full scene is exported to be a scene file, the scene file is delivered to the distributed scheduling module for rendering, and then the effect graph is transmitted back to the client after the rendering is completed. In addition, the server module is also responsible for the identity authentication module of the user, including the functions of the front end and the back end, such as login registration, payment of corresponding task fees, and the like.
Completing various rendering tasks requires powerful computing resources for rendering and huge storage space for storing resources, so that the requirement for executing large-scale rendering tasks can be met. Therefore, in addition to the powerful rendering capability of the VRay rendering engine, efficient rendering task scheduling and flow arrangement are also the premise for ensuring the rendering task to be executed successfully. The main task flows of the VRay cloud rendering server module are firstly to verify a rendering model file and a scene file, analyze and translate the Vrscene file of VRay full scene parameters, coordinate resources and loads of a distributed rendering module, verify user identity information, download version updates, schedule a progress monitoring log, return a final rendering result to a client, solve the abnormity caused by network packet loss, file damage and the like, and locally optimize the rendering effect of the user after delivery.
And setting a node grid. The step of simulating a triangle patch in a VRay scene to implement various walls or models in Json data is to first define 5 data required by the mesh, including a Vertices data set, faces vertex indices, normals vertex Vertices, faceNormals vertex Normals indices, and Map _ Channel Map channels (mainly calculated by combining UV coordinates, scaling size, start coordinates, and vertex Normals of the Map).
And (5) setting the node construction. After Mesh grid data can be generated in a scene, models in an array corresponding to each Node in the scene need to be traversed again, elements in the scene are initialized in sequence,
and setting the material of the node. In the VRay material system, material materials are divided into MtlDiffuse and MtlSingleBRDF, the former is a diffuse reflection material, light rays irradiated to the surface can be reflected, and the properties of reflection and refraction can be set, and the latter is a material carried by VRay itself, so that the scene has better lighting effect, faster rendering speed and easier-to-set reflection and refraction parameters. And in BRDFVRayMtl, different texture maps can be applied, reflection and refraction are controlled, concavities and convexities are added, maps are replaced, and the like,
and setting the map of the node. For picture maps loaded from local, VRay texture maps of different file formats are loaded and rendered in various ways, UVW generator plug-ins can also be used to generate UVW map coordinates or to indirectly modify the original data in the source data. But not all cases use UVW plug-ins, followed by the typical texture types using texbitmaps and bitmapbuffers. The former uses data from the bitmap buffer, which may set parameters such as color, multipliers, tiling, etc. The latter is to load image files, i.e. various types of picture-supported formats including lossy or lossless, with the number of bits from 8 bits to 32 bits. Because it is not a texture plug-in, it simply provides the picture data to the TexBitmap. It also has some filterable options and gamma options. Currently supported picture formats are HDR, EXR, PNG, BMP, TGA, SGI, JPG, PIC, TIF, PSD, VRIMG, and the like. An image file list in the form of an IFL file is supported, but a VRay self-contained map library is more recommended, the variety of the VRay self-contained map library comprises daily wood grains, water grains and other pictures, the rendering effect is better, and related settable options are more.
In this embodiment, the Vray distributed rendering module specifically includes:
defining a processing server as a client, dividing each static frame of rendering image into a plurality of areas, dividing rendering tasks of the areas into the rendering servers, monitoring the task conditions of all the rendering servers, returning the rendering tasks of all the rendering servers to the processing server after the rendering tasks of all the rendering servers are completed, merging the rendering tasks into a complete rendering picture, checking the rendering picture, and returning the rendering picture to the Vray cloud rendering server module.
Specifically, in the distributed rendering module, a processing server needs to be defined as a client, which is responsible for dividing a rendered image into a plurality of regions, then reasonably dividing tasks into the following rendering servers, monitoring the task conditions of all the rendering servers, merging the tasks into a complete rendered image after the tasks of all the rendering servers are successfully completed and returned to the processing server, and then returning the image to the VRay server module after verifying that the file is not in trouble.
The system adopts the common method that each static frame is divided into a plurality of areas, each host machine renders a part of the areas and finally synthesizes a complete effect graph, and also needs to be noted that the maximum thread number of one host machine can correspond to the maximum rendering area number, and one thread is responsible for one area. VRay realizes the network connection of distributed rendering through a TCP/IP protocol, and is mainly divided into a server side and a client side, wherein the client side is a host used by a user, and the client side plays a role of a node management server in the system, divides a single-frame image and then transmits the divided single-frame image to the server side, and the whole rendering process is managed and organized by the client side. The connection and the closing of the server side and the corresponding state including dormancy, use and the like can be managed on the client side. And displaying the rendering area after the rendering area is completed. The server side is a rendering server cluster and is responsible for providing computing power, rendering results are returned to the client side after rendering is completed, and the state is monitored by the client side. The host of the cloud rendering server of the system is also used as a task of the node manager and is responsible for distributing and combining tasks,
the client process that the system initiates rendering will synchronize the results produced by the rendering server (also called the rendering slave server). All rendering modes support distributed rendering of the system. Rendering hosts may dynamically add and delete at any time during the rendering process. When a rendering client attempts to add a rendering host to its active host list, the rendering host also needs to run the VRay program because the client will verify whether a connection can be established for its distributed task at the time. Each rendering host is identified by a form of IP address and port pair that specifies the IP or DNS address of the host with the VRay server and the port on which the server is listening for rendering requests. Regardless of the progress made by the main rendering process in the client, the joining rendering hosts can successfully begin participating in rendering as long as they have run the VRay program.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
It will be appreciated by those of ordinary skill in the art that the embodiments described herein are intended to assist the reader in understanding the principles of the invention and are to be construed as being without limitation to such specifically recited embodiments and examples. Those skilled in the art, having the benefit of this disclosure, may effect numerous modifications thereto and changes may be made without departing from the scope of the invention in its aspects.

Claims (3)

1. A distributed rendering method, comprising,
defining a processing server as a client, wherein the client divides each static frame of rendering image into a plurality of areas;
dividing the rendering tasks of each region to each rendering server, and monitoring the task conditions of all the rendering servers at the same time;
and after the rendering tasks of all the rendering servers are finished, returning the rendering tasks to the processing server, and combining the rendering tasks into a complete rendering picture.
2. A distributed rendering method according to claim 1, in which the maximum number of threads corresponds to the maximum number of rendering regions, and one thread is responsible for one region.
3. A distributed rendering method according to claim 1,
the client is a host used by a user, wherein the client is used as a node management server;
the client divides the single-frame image and then transmits the single-frame image to the rendering server, and the client manages and organizes the rendering process;
the client manages the connection and the closing of the rendering server and the corresponding states of the rendering server comprise dormancy and use; and returning a rendering result to the client after the rendering is finished.
CN202110509225.XA 2021-05-11 2021-05-11 Distributed rendering method Pending CN115409926A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110509225.XA CN115409926A (en) 2021-05-11 2021-05-11 Distributed rendering method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110509225.XA CN115409926A (en) 2021-05-11 2021-05-11 Distributed rendering method

Publications (1)

Publication Number Publication Date
CN115409926A true CN115409926A (en) 2022-11-29

Family

ID=84156267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110509225.XA Pending CN115409926A (en) 2021-05-11 2021-05-11 Distributed rendering method

Country Status (1)

Country Link
CN (1) CN115409926A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117061792A (en) * 2023-10-12 2023-11-14 深圳云天畅想信息科技有限公司 Cloud video collaborative rendering method and device and computer equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117061792A (en) * 2023-10-12 2023-11-14 深圳云天畅想信息科技有限公司 Cloud video collaborative rendering method and device and computer equipment
CN117061792B (en) * 2023-10-12 2024-01-30 深圳云天畅想信息科技有限公司 Cloud video collaborative rendering method and device and computer equipment

Similar Documents

Publication Publication Date Title
CN103106680B (en) Implementation method for three-dimensional figure render based on cloud computing framework and cloud service system
CN110751712A (en) Online three-dimensional rendering technology and system based on cloud platform
WO2021036447A1 (en) Flink engine-based service data processing method and apparatus
CN113160373A (en) Cloud rendering method and system based on VRay engine
CN113742031B (en) Node state information acquisition method and device, electronic equipment and readable storage medium
CN105184847A (en) 3D game rendering engine rendering method
CN112581578A (en) Cloud rendering system based on software definition
WO2022095714A1 (en) Image rendering processing method and apparatus, storage medium, and electronic device
CN111951363A (en) Cloud computing chain-based rendering method and system and storage medium
CN105183566A (en) Resource management method for 3D game rendering engine
CN115409926A (en) Distributed rendering method
US11663349B2 (en) System and method for managing data object creation
CN111857757B (en) Container cloud-based efficient deployment method for aerial image processing service
US20170213395A1 (en) Methods and Systems for Processing 3D Graphic Objects at a Content Processor
KR20230118794A (en) Method and apparatus for providing 3d contents packaging and streaming service based on web to construct and control of virtual space
CN111767345B (en) Modeling data synchronization method, modeling data synchronization device, computer equipment and readable storage medium
TWI579709B (en) Instantly analyze the scene file and automatically fill the cloud of the cloud system and methods
Wang et al. Performance bottleneck analysis and resource optimized distribution method for IoT cloud rendering computing system in cyber-enabled applications
CN113805850A (en) Artificial intelligence management system based on multiple deep learning and machine learning frameworks
CN112783653A (en) Resource scheduling method and device based on containerization
CN101441777A (en) Precaculating optical energy transferring method of computer cartoon
CN113760836B (en) Wide table calculation method and device
CN116661767B (en) File generation method, device, equipment and storage medium
Wang et al. Cloud rendering learning platform technology research for visual analysis of large scale 3D multimedia data
CN116402984B (en) Three-dimensional model processing method and device 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