Rendering method and device based on webpage client and electronic terminal
By providing connection designs for multiple rendering pipelines and editable nodes on the web client, the problem of inconsistent rendering effects between the web client and the production side is solved, and the consistency of rendering effects and development efficiency are improved.
Patent Information
- Application Number
- CN202410965847.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-12
AI Technical Summary
There is a big difference between the rendering effect of web client on art resources and the rendering effect on production side, resulting in inconsistent effects in functions such as preview, review and sharing, which increases development complexity and cost.
By providing rendering pipelines corresponding to multiple art resource types on the web client and providing connection design for editable nodes through the pipeline editing interface, the target rendering pipeline is determined to simulate the rendering process at the production end, and the rendering effect consistency is achieved.
It achieves consistency between the rendering effect of the web client and the rendering effect on the production side, reduces development complexity and cost, and improves the sharing and usage experience of art resources.
Smart Images

Figure CN118941693A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a rendering method, device and electronic terminal based on a web client. Background Art
[0002] At present, with the development of fields such as virtual reality (VR), augmented reality (AR) and games, a large number of demands for the production of art resources such as three-dimensional (3D) models have been generated. Such demands not only involve the art team within the project, but may also connect with a large number of outsourcing companies to produce 3D models and other art resources, or introduce crowdsourcing, 3D asset purchases and other methods to obtain art resources.
[0003] Art resources from different sources are generally produced using different 3D modeling software, for example, 3DMax, Maya, Blender and other 3D modeling software, which use different file formats to store art resources. In order to improve the efficiency of sharing art resources, the review, sales and sharing platforms generally provide functions such as browsing, previewing, editing and sharing of art resources through the network (Web). This requires exporting art resources from the art resource development end that uses 3D modeling software to produce art resources, and then exporting them to the rendering engine of the web client. However, the rendering effects of the same art resources on different terminals are generally not aligned, that is, there is a large difference between the rendering effect of the art resources on the web client and the rendering effect of the art resource development end, which makes the rendering effect of the art resources on the web client poor. Summary of the invention
[0004] The purpose of the present disclosure is to provide a rendering method, device and electronic terminal based on a web client to alleviate the technical problem that there is a large difference between the rendering effect of an art resource by a web client and the rendering effect of the production end of the art resource.
[0005] In a first aspect, an embodiment of the present disclosure provides a rendering method based on a web client, wherein the web client provides rendering pipelines corresponding to a plurality of art resource types, wherein the input and output relationship of the rendering pipeline is related to the art resource type corresponding to the rendering pipeline, and is determined by designing the connection of a plurality of editable nodes provided in a pipeline editing interface, and the method includes:
[0006] Obtaining art resources to be rendered from the web client;
[0007] Determine a target art resource type corresponding to the art resource to be rendered;
[0008] Determine a target rendering pipeline corresponding to the target art resource type;
[0009] The art resource to be rendered is rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client.
[0010] In a second aspect, a rendering device based on a web client is provided, wherein the web client provides rendering pipelines corresponding to a plurality of art resource types, wherein the input and output relationship of the rendering pipeline is related to the art resource type corresponding to the rendering pipeline, and is determined by designing the connection of a plurality of editable nodes provided in a pipeline editing interface, wherein the device comprises:
[0011] An acquisition module, used to acquire art resources to be rendered from the web client;
[0012] A first determination module is used to determine a target art resource type corresponding to the art resource to be rendered;
[0013] A second determination module is used to determine a target rendering pipeline corresponding to the target art resource type;
[0014] The rendering module is used to render the art resource to be rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic terminal, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the method described in the first aspect when executing the computer program.
[0016] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to execute the method described in the first aspect.
[0017] The embodiments of the present disclosure bring the following beneficial effects:
[0018] The embodiments of the present disclosure provide a rendering method, device and electronic terminal based on a web client. The web client provides rendering pipelines corresponding to a plurality of art resource types. The input and output relationship of the rendering pipeline is related to the art resource type corresponding to the rendering pipeline and is determined by designing the connection of a plurality of editable nodes provided in a pipeline editing interface. The method comprises: obtaining the art resource to be rendered of the web client, determining the target art resource type corresponding to the art resource to be rendered, determining the target rendering pipeline corresponding to the target art resource type, rendering the art resource to be rendered on the web client through the target rendering pipeline, and obtaining the rendering result of the art resource to be rendered on the web client. In this solution, by utilizing the rendering pipelines corresponding to the various art resource types pre-set by the web client through the node connection design method, it is possible to determine a target rendering pipeline specifically used to render a certain type of art resource to be rendered, so that the art resource to be rendered is rendered on the web client through the target rendering pipeline, and the rendering result of the art resource to be rendered on the web client is obtained, thereby simulating the engine rendering process of the art resource to be rendered on the production end on the web client, so that the rendering effect of the web client reaches the rendering effect of the original file rendered on the production end, alleviating the technical problem that there is a large difference between the rendering effect of the art resource on the web client and the rendering effect of the art resource on the production end.
[0019] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present disclosure is shown;
[0022] Figure 2 A schematic diagram of the structure of a web page client provided by an embodiment of the present disclosure is shown;
[0023] Figure 3 A schematic diagram of a flow chart of a rendering method based on a web client provided in an embodiment of the present disclosure;
[0024] Figure 4A schematic diagram of the overall architecture corresponding to the rendering method based on the web client provided in the embodiment of the present application;
[0025] Figure 5 Another schematic diagram of a flow chart of a rendering method based on a web client provided in an embodiment of the present disclosure;
[0026] Figure 6 A schematic diagram of the process of Shader conversion in the rendering method based on a web client provided in the embodiment of the present disclosure of the present application;
[0027] Figure 7 A schematic diagram of a node editing application scenario provided by an embodiment of the present disclosure of the present application;
[0028] Figure 8 Another flowchart of the web page client-based rendering method provided in the embodiment of the present disclosure of the present application;
[0029] Fig. 9 A schematic diagram of a node connection debugging scenario provided by an embodiment of the present disclosure of the present application;
[0030] Fig.10 A schematic diagram of a rendering effect provided by an embodiment of the present disclosure of the present application;
[0031] Fig.11 Schematic diagram of Shader application scenarios such as channel mode, silhouette mode, Matcap combined with NormalMap, etc. provided in the embodiments of the present application;
[0032] Fig.12 A schematic diagram of an application scenario in which different project groups use different workflows according to an embodiment of the present disclosure;
[0033] Fig.13 A flowchart of another rendering effect provided by the embodiment of the present disclosure of the present application;
[0034] Fig.14 A schematic diagram of the structure of a rendering device based on a web client provided in an embodiment of the present disclosure;
[0035] Fig.15 A schematic structural diagram of an electronic terminal provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0037] The terms "including" and "having" and any variations thereof mentioned in the embodiments of the present disclosure are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0038] At present, the method of rendering art resources on the Web side is that the user first uploads the original file of the art resource, such as 3DMax, Maya, Blender and other files, and then the conversion module exports the general file format of the art resource, such as obj, fbx, gltf, etc. Then, the art resource file is loaded through the rendering engine on the Web side, the texture is bound as needed, and finally, the rendering is performed using general materials such as phong and pbr. Among them, for the rendering in the last step, due to the use of general materials, the rendering environment requirements of the art resources are generally not met, resulting in a large difference between the rendering effect of the Web side and the rendering effect of the original file, which affects the user's experience of previewing, reviewing, and purchasing art resources. The existing solutions usually include: adjusting the adjustable parameters of the general material, such as light intensity, light color, reflectivity, etc., to approach the rendering effect of the original file; using post-processing, such as tone mapping, ambient occlusion, anti-aliasing, etc., to improve the rendering effect, and adjusting the rendering effect by image-level processing; using Shader for rendering, and simulating the rendering algorithm of the original Digital Content Creation (DCC) software or rendering engine by writing Shader code.
[0039] This solution can barely meet the needs for art resources of general materials, but for art resources of complex materials, such as skin, hair, eyes, etc., due to the limited material support of the Web rendering engine, it is generally impossible to achieve the rendering effect of the original art resources in DCC. This results in the rendering effect of the art resources on the Web being inconsistent with the rendering effect of the original art resources, affecting the realization of functions such as review, sale, and sharing of art resources.
[0040] On the other hand, the gaming industry generally has self-developed engines, which often use different rendering pipelines, such as forward, deferred, deferred+, deferred clustered, etc. These rendering pipelines have different implementation methods and shader codes, which also makes it impossible to preview the effects in the game engine on the Web, affecting the review of art resources.
[0041] If you want to use engines such as threejs and babylonjs to implement custom materials on the Web, platform developers need to reproduce the rendering pipeline of the game engine and transplant the Shader code. This situation has the following problems: the implementation methods of the rendering pipeline are different, and different rendering codes need to be written for different rendering pipelines. This requires developers to have experience in implementing multiple rendering pipelines, which increases the workload of developers and the complexity of transplantation; the implementation methods of game engines are different, and it is difficult to understand the implementation method of the rendering pipeline without in-depth source code. Due to confidentiality reasons, platform developers generally cannot obtain the source code of the game engine, which makes it impossible for platform developers to implement the rendering pipeline of the game engine; the Shader codes of different game engines are different, and the languages are different, such as OpenGL, DirectX, Metal, etc., which requires different Shader codes to be written for different application programming interfaces (Application Programming Interface, API), and for the same reason as the above, platform developers often cannot obtain the Shader code of the game engine; different projects will have a large number of special materials, and from the perspective of the platform, it is impossible to meet the needs of all projects. Supporting all special materials is unrealistic from the perspective of development cost.
[0042] Of course, the above problems can also be solved by cloud gaming, that is, uploading the original 3D art resources to the cloud, sending user interactions to the cloud, and the cloud performing real-time rendering through the corresponding DCC software or engine. The rendered image is transmitted to the Web side in the form of a video stream. This method can ensure that the rendering effect is consistent with the original file.
[0043] However, the cloud gaming method requires all DCC software or engines to be deployed in the cloud, which requires the purchase of a large number of software licenses, increasing economic costs and personnel maintenance costs. In addition, DCC software or engines need to be rendered in real time in the cloud. Such professional software requires a large amount of resources, and the consumption of memory and display chips (graphics processing unit, GPU) far exceeds that of ordinary services, increasing the operation and maintenance costs of the cloud and failing to meet the needs of large-scale users. Furthermore, the video streaming method requires a large amount of bandwidth, otherwise it is impossible to interact with users smoothly, which increases the user's usage cost and reduces the user experience.
[0044] In summary, the production of art resources relies on different DCC software and is used in different engines. Conversion and alignment of rendering effects is a technical difficulty. Achieving consistent rendering effects on the Web requires a lot of work and the complexity of porting is high. The problem of Shader code porting on different platforms requires writing different Shader codes for different APIs, which are difficult to share. To complete the porting, you need to delve into the source code of the original engine, but usually the source code cannot be obtained due to confidentiality reasons, so it is difficult to align the effects, that is, there is still a big difference between the rendering effect of the art resources on the web client and the rendering effect of the art resources development end.
[0045] Based on this, the embodiments of the present disclosure provide a rendering method, device and electronic terminal based on a web client. This method can alleviate the technical problem that there is a large difference between the rendering effect of art resources by the web client and the rendering effect of the production end of the art resources.
[0046] In one embodiment of the present disclosure, the rendering method based on the web client can be run on a local terminal device or a server. When the rendering method based on the web client is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0047] In an optional implementation, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game method based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the rendering method based on the client device are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is responsible for information processing. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the data such as art resources, and returns it to the client device through the network. Finally, the client device decodes it and displays the game screen corresponding to the art resource through rendering.
[0048] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0049] In a possible implementation, an embodiment of the present disclosure provides a rendering method based on a web client, providing a graphical user interface through a web client, wherein the web client can be the local terminal device mentioned above, or can be a client device in the cloud interaction system mentioned above.
[0050] For example, Figure 1 As shown, Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present disclosure. The application scenario may include a web client 102 and a personal computer (PC) 101 for producing art resources, and the web client 102 may obtain the art resources from the PC. The web client is used to run a virtual desktop, and the web client displays the art resources by rendering.
[0051] The web client of this embodiment is described by taking the electronic terminal 102 as an example. The electronic terminal 102 includes components such as a radio frequency (RF) circuit 110, a memory 120, a processor 130, and a display screen 140. Those skilled in the art can understand that Figure 2 The electronic terminal structure shown in the figure does not constitute a limitation on the electronic terminal, and may include more or less components than shown in the figure, or combine some components, or separate some components, or arrange the components differently.
[0052] The RF circuit 110 can also communicate with the network and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobilecommunication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0053] The memory 120 can be used to store software programs and modules. The processor 130 executes various functional applications and data processing of the electronic terminal 102 by running the software programs and modules stored in the memory 120. The memory 120 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, etc.; the data storage area can store data created according to the use of the electronic terminal 102, etc. In addition, the memory 120 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0054] The display screen 140 may be used to display a graphical user interface, and various art resources may be displayed on the display screen through rendering. Specifically, the touch screen 130 may include a display panel, and the display panel may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0055] The processor 130 is the control center of the electronic terminal 102. It uses various interfaces and lines to connect the various parts of the entire electronic terminal. It executes various functions of the electronic terminal 102 and processes data by running or executing software programs and / or modules stored in the memory 120, and calling data stored in the memory 120, thereby monitoring the electronic terminal as a whole.
[0056] The embodiments of the present disclosure are further described below in conjunction with the accompanying drawings.
[0057] Figure 3A flowchart of a rendering method based on a web client provided in an embodiment of the present disclosure. The method can be applied to a web client, where a rendering pipeline corresponding to a plurality of art resource types is provided by the web client, and the input and output relationship of the rendering pipeline is related to the art resource type corresponding to the rendering pipeline, and is determined by designing the connection of a plurality of editable nodes provided in the pipeline editing interface. Figure 3 As shown, the method includes:
[0058] Step S310, obtaining art resources to be rendered from the web client.
[0059] The art resource to be rendered may be a 3D art resource, for example, a 3D art resource produced by a DCC tool, such as a Maya file, a 3ds Max file, a texture file produced by SubstancePainter, and the like.
[0060] In an optional implementation, the rendering pipeline in the embodiment of the present disclosure can be generated in the following manner: according to the connection design data for multiple editable nodes, the input and output relationship of the rendering pipeline is determined, and the rendering pipeline is built on the web client based on the input and output relationship; wherein the connection design data is determined according to the editing operation for the editable node. By editing the nodes in this way, the pipeline can be built on the web client flexibly and efficiently. Exemplarily, the editing operation may include any one or more of the following: adding operation, connecting operation, setting operation and drag-and-drop operation. Through a variety of operation methods, the connection relationship between editable nodes can be designed more flexibly and editably.
[0061] As an example, the editing operation includes a setting operation, the setting operation is used to set the stage parameters and configuration parameters for each rendering stage of the rendering pipeline based on the input content of the input operation; the rendering pipeline is built on the web client based on the input and output relationship, including: building the rendering pipeline on the web client based on the input and output relationship, the stage parameters and the configuration parameters. The rendering pipeline is built on the web client through the parameters set by the setting operation, so that the construction of the rendering pipeline can be freely and flexibly set and adjusted.
[0062] Through the editing operation of editable nodes, the rendering pipeline can be edited through the low-code node editing process, that is, the low-code rendering pipeline editor. Through the low-code method, developers can efficiently realize the transplantation of the rendering pipeline on the Web platform (web client) and restore the rendering effect in the self-developed engine. The overall architecture of this technical solution is as follows Figure 4 As shown, including the above-mentioned low-code rendering pipeline editor, the low-code rendering pipeline editor provides a visual interface, allowing developers to define various stages and parameters of the rendering pipeline by dragging and dropping and connecting nodes. For example, Figure 5 As shown in the flowchart, the low-code rendering pipeline editor allows developers to edit and configure the rendering pipeline through a visual interface. Developers can use drag and drop and connect nodes to define the various stages and parameters of the rendering pipeline, thereby quickly building and configuring the rendering pipeline. Developers can also use the low-code rendering pipeline editor to organize the input and output relationships of multiple passes by dragging and connecting nodes, that is, quickly build a rendering pipeline by dragging and connecting nodes, and debug the rendering effect through visual interaction, which reduces the development and debugging workload of developers and improves the efficiency of transplantation.
[0063] As a possible implementation, a rendering pipeline is constructed in the form of a node editor, in which there are two main data types, Node and Edge, which are defined as shown in the following table:
[0064] Node:
[0065] Fields type illustrate id string id data any User data of the node draggable boolean Is it draggable? selectable boolean Is it selectable? connectable boolean Is it possible to connect width number width height number high inputs Input[] Input connection slot outputs Output[] Output connection slot
[0066] Edge:
[0067]
[0068]
[0069] Editor components:
[0070]
[0071] Step S320: Determine the target art resource type corresponding to the art resource to be rendered.
[0072] In actual applications, the web client provides rendering pipelines corresponding to a variety of art resource types. The art resource to be rendered obtained in the above step S310 corresponds to the target art resource type among the multiple art resource types.
[0073] Step S330: determine the target rendering pipeline corresponding to the target art resource type.
[0074] It should be noted that, since the art resource to be rendered corresponds to a target art resource type among multiple art resource types, the rendering pipeline corresponding to the art resource to be rendered is the target rendering pipeline corresponding to the target art resource type in the web client.
[0075] Step S340 , rendering the art resource to be rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client.
[0076] By using the node connection design method to pre-set the rendering pipelines corresponding to the various art resource types on the web client, it is possible to determine a target rendering pipeline specifically used to render a certain type of art resource to be rendered, so that the art resource to be rendered is rendered on the web client through the target rendering pipeline, and the rendering result of the art resource to be rendered on the web client is obtained, thereby simulating the engine rendering process of the art resource to be rendered on the production end on the web client, so that the rendering effect of the web client reaches the rendering effect of the original file rendered on the production end, alleviating the technical problem that the rendering effect of the art resource on the web client is quite different from the rendering effect of the art resource on the production end.
[0077] The method provided by the disclosed embodiment also realizes fast, low-cost and efficient transplantation of the rendering pipeline. The user side can independently complete the transplantation of the rendering pipeline by editing the nodes, reducing the workload of platform developers, while avoiding the platform developers from contacting the source code of the game engine, ensuring the confidentiality of the game engine. For example, a game engine rendering on a PC is transplanted to the Web side, and the rendering pipelines corresponding to various types of art resources in the web client can be used to simulate the rendering process of other clients.
[0078] The above steps are described in detail below.
[0079] In some embodiments, the shader in DXBC format can be converted into a shading language code, and then the shading language code is parsed to generate a configurable shader node, thereby achieving the sharing and reuse of the shader code. As an example, the plurality of editable nodes include a first node and a second node, the first node is used to represent the geometric structure data, and the second node is used to represent the rendered shader; before step S340, the method may further include the following steps:
[0080] Obtain a first shader in DXBC format from an engine of a web client, and convert the first shader into a second shader in the form of a shading language code; parse the second shader into configurable shader node data, and use the configurable shader node data as a configurable material node for rendering; determine a current art resource to be rendered in the art resources to be rendered based on the configurable material node and the geometric structure data.
[0081] As a possible implementation method, the overall architecture of the system corresponding to this method is as follows: Figure 4As shown in the figure, it includes a low-code rendering pipeline editor and a shader conversion and parsing service. The shader conversion and parsing module provides shader node data and finally outputs code in the form of a domain-specific language (DSL). Shaders are some highly programmable stages on the GPU pipeline, and the final code compiled by the shader will run on the GPU to handle lighting, shadows, materials and other issues in computer graphics.
[0082] It should be noted that DXBC is an intermediate language format used to represent and store DirectX shader programs. The shader conversion and parsing module provides shader conversion services for DXBC, converting DXBC files compiled from hlsl code into shaders in shading language (glsl) code for the above-mentioned Web universal rendering framework. It also provides glsl parsing services for parsing shaders in glsl code into configurable shader nodes.
[0083] By using the parsing service through Shader conversion, you can convert custom Shader code into configurable material nodes, and use them with Mesh nodes to generate renderable objects. It can also be understood that custom material nodes are created through Shader code, and nodes are quickly configured according to Shader conversion and parsing services, and uniform variable input items are dynamically generated, which are used with Mesh nodes as renderable objects.
[0084] As an optional implementation, the DXBC-based Shader conversion service converts the DXBC file compiled from the hlsl code into glsl code for rendering on the Web platform. For example, the generated glsl code can be corrected based on the built-in uniform of Babylonjs to make it compatible with Web rendering. The customized or automatically converted glsl uniform variables are parsed to generate input items for the material nodes in the low-code rendering pipeline editor and accept other variable node outputs.
[0085] For the Shader conversion and parsing module, for example, nodes can be customized according to rendering needs, the most important of which is the Material node, which can be written by the user in Shader code or dynamically generated using Shader conversion and parsing capabilities.
[0086] Among them, for the Shader conversion process, such as Figure 6As shown, the Shader conversion module uses the HLSLLcc running Unity on the server to compile the DXBC intermediate code in the engine into GLSL code supported by WebGL. Among them, WebGL is the WebGraphics Library, a 3D drawing protocol. This drawing technology standard allows JavaScript and OpenGLES2.0 to be combined. By adding a JavaScript binding to OpenGL ES2.0, WebGL can provide hardware 3D accelerated rendering for HTML5Canvas, so that Web developers can use the system graphics card to display 3D scenes and models more smoothly in the browser, and can also create complex navigation and data visualization.
[0087] For the shader parsing process, for example, the syntax features that are not supported by WebGL can be corrected according to the converted shader code, and then the uniform variables corresponding to the GLSL shader can be parsed, such as Figure 7 Parse the Shader input uniform in the code, dynamically generate the input slot corresponding to the node, and the final node editor effect is as follows Figure 7 shown.
[0088] In the disclosed embodiment, a shader (Shader) conversion and parsing service is provided, which can convert the Shader in DXBC format into a shading language (glsl) code for rendering by a Web client, and at the same time parse the glsl code to generate a configurable Shader node, thereby realizing the sharing and reuse of Shader code and preventing platform developers from accessing the source code of the game engine, thereby ensuring the confidentiality of the game engine code.
[0089] Through shader conversion, the rendering process of other clients is simulated on the web side using the node editor, which solves the problem of shader code porting on different platforms and provides an abstract layer that allows developers to share and reuse shader rendering codes between different platforms.
[0090] In some embodiments, the rendering logic can be abstracted into a DSL data structure through a DSL rendering pipeline framework, so as to build a common data structure between different software and engines, and effectively align the rendering effects of multiple terminals. As an example, the above step S340 may include the following steps:
[0091] A DSL rendering pipeline framework in the form of DSL code is generated based on the target rendering pipeline and shader node data; different rendering logics of multiple target rendering pipelines are uniformly constructed into a target data structure in the form of DSL code through the DSL rendering pipeline framework; based on the target rendering pipeline under the target data structure, the web rendering framework of the web client is used to render the art resources to be rendered on the web client, and the rendering results of the art resources to be rendered on the web client are obtained.
[0092] For example, Figure 4 As shown in the figure, the overall architecture of this technical solution includes modules such as the Web Universal Rendering Framework, the Low-Code Rendering Pipeline Editor, the Shader Conversion and Parsing Service, and the File Conversion Service. Among them, the Web Universal Rendering Framework not only provides basic rendering functions, but also supports a variety of general materials such as PBR, Phong, and Lambert, provides a variety of rendering modes, and provides the ability to build a rendering pipeline based on the above DSL.
[0093] It should be noted that a domain-specific language (DSL) is a programming language for a specific domain, specific problem or specific application, and its purpose is to solve specific problems in the domain. For a DSL-based rendering framework, the definition of DSL is shown in the following table, which can refer to the Node and Edge types of the above-mentioned node editors.
[0094] Fields type illustrate nodes Node[] Node data edges Edge[] Pipeline connection data
[0095] As an optional implementation, the process of finding the rendering output node according to the DSL generated by the editor is as follows: Figure 8 As shown in the figure, recursive parsing starts based on the directed acyclic graph nodes, assembling all materials and meshes according to the flowchart, creating image textures or tender target outputs according to the texture type, building all render passes, and finally forming a render graph to render each output rendering node. In addition, during the construction of the rendering pipeline, such as Fig. 9 As shown, you can connect any render target node input to the output node for debugging and view any render target output.
[0096] In the disclosed embodiment, the rendering pipeline can be quickly built, and the rendering process of other clients can be simulated using a node editor to generate a universal DSL data. Finally, the generated DSL data is used through the Web universal rendering framework, and the final rendering is achieved on the Web side using the universal rendering framework rendering.
[0097] The Web universal rendering framework can achieve consistent rendering effects for commonly used materials on the Web side, reducing the workload of developers and the complexity of porting. At the same time, the DSL rendering pipeline framework abstracts the rendering logic into DSL, builds a common data structure between different software and engines, and the rendering framework completes the rendering of different pipelines according to DSL, achieving alignment of multi-end rendering effects.
[0098] In some embodiments, multiple rendering modes such as single-channel mode and silhouette mode can be used to preview and review 3D art resources from multiple dimensions. As an example, the web page rendering framework provides multiple rendering modes, wherein the multiple rendering modes correspond to multiple preview modes for art resources to be rendered; the multiple rendering modes include at least two of the following: single-channel mode, silhouette mode, and material capture combined with normal map mode.
[0099] Exemplarily, the Web Universal Rendering Framework can use Babylon.js as the underlying rendering library to provide basic operating functions. Babylon.js is used as the underlying rendering library to build the Web Universal Rendering Framework. Among them, Babylon.js is an open source 3D game engine and rendering engine based on WebGL technology. It provides a set of simple and easy-to-use APIs that enable developers to create high-performance, interactive 3D applications and games in Web browsers. In addition, the Web Universal Rendering Framework can also provide a variety of universal materials such as PBR, Phong, Lambert, etc. to meet basic rendering needs. The basic operations and rendering module effects of the Web Universal Rendering Framework are as follows: Fig.10 As shown, by parsing 3D model data, rendering wireframes and normals for assistance, and providing auxiliary functions such as lighting adjustment, quick selection and switching to help users quickly locate. Furthermore, the Web Universal Rendering Framework can also provide multiple rendering modes, such as single-channel mode, silhouette mode, Matcap combined with NormalMap (material capture combined with normal map) and other modes, to review 3D art resources in different dimensions. For example, Fig.11 As shown in the figure, single-channel Shader, silhouette, Matcap combined with NormalMap and other modes are constructed to achieve multiple rendering modes, so that 3D art resources can be reviewed and viewed from different dimensions.
[0100] As a possible implementation, Figure 4As shown, the overall architecture of the technical solution can include modules such as a low-code rendering pipeline editor, shader conversion and parsing services, and file conversion services. Among them, the file conversion service provides a way to convert art resources from different DCC software into common art resource formats, such as obj, fbx, gltf, etc., so that they can be rendered on the Web engine. Among them, DCC can be used as a digital content creation tool, such as maya and 3ds Max. For the DCC conversion layer, a variety of automated conversions from DCC to the gltf general format can be completed. This layer completes the corresponding conversion tasks by deploying the corresponding DCC software on the server side, starting it in a headless manner, executing the corresponding conversion script. By providing an art resource conversion function, art resources from different DCC software can be converted into common art resource formats, such as obj, fbx, gltf, etc., and automatic binding of textures can be completed, thereby reducing the user's workload.
[0101] like Fig.12 and Fig.13 As shown in the figure, different project groups use different workflows, such as metallic-roughness and specular-glossiness of pbr. This module cooperates with the DCC conversion layer, and the front end adapts to the rendering effects of different workflows. Due to performance considerations, different workflows can merge different channels into an RGBA map. During the review process, this module reads the corresponding channels according to different workflow configurations, uses canvas to dynamically separate the colors of each channel, and constructs a dynamic Texture to achieve channel split display, and matches the above-mentioned single-channel Shader to render the effects of different channels.
[0102] In the disclosed embodiment, through multiple rendering modes such as single-channel mode, silhouette mode, material capture combined with normal map (i.e. the above-mentioned Matcap combined with NormalMap), it is possible to preview and review 3D art resources from multiple different dimensions.
[0103] In some embodiments, the input and output nodes of the target rendering pipeline can be obtained by parsing the DSL rendering pipeline framework, and then the output of the rendering target object is connected with the input of the variable uniform in the shader based on the node, and the target rendering pipeline under the target data structure can be more accurately determined based on the connection relationship. As an example, based on the target rendering pipeline under the target data structure, the web rendering framework of the web client is used to render the art resource to be rendered on the web client, and before obtaining the rendering result of the art resource to be rendered on the web client, the method can also include the following steps:
[0104] Create resources for a rendering target object according to the DSL rendering pipeline framework; parse the DSL rendering pipeline framework to obtain input and output nodes of the target rendering pipeline, and connect the output of the rendering target object with the input of the variable uniform in the shader based on the input and output nodes; determine the target rendering pipeline under the target data structure based on the connection relationship between the output of the rendering target object and the input of the variable uniform.
[0105] As an optional implementation, the DSL rendering pipeline framework can dynamically create RenderTarget, texture, Geometry, Mesh and other rendering target object resources according to DSL, and then create custom materials according to the Shader code in DSL, and then parse DSL to parse the input and output nodes, and then connect the RenderTarget output with the Shader uniform input to organize the rendering pipeline. The DSL rendering pipeline framework can also support postprocess node access capabilities.
[0106] In the disclosed embodiment, the input and output nodes of the target rendering pipeline are obtained by parsing the DSL rendering pipeline framework, and then the output of the rendering target object is connected with the input of the variable uniform in the shader based on the node. Based on the connection relationship, the target rendering pipeline under the target data structure can be determined more accurately.
[0107] In some embodiments, the above-mentioned multiple editable nodes may include multiple nodes such as output nodes, output nodes, nodes for parameter configuration, etc., so that the editing of nodes is more flexible and comprehensive. As an example, the multiple editable nodes also include a third node, a fourth node, a fifth node, and a sixth node; the third node is used to provide input and output parameter configuration, and provides size settings and depth buffer shared access functions through input end nodes; the fourth node is used as a node input item to provide screen size parameters inside the engine of the web client; the fifth node is used as an input item for screen space post-processing of the web client, and is used to match the post-processing results of the material completion or the rendering intermediate results of the delayed rendering; the sixth node is used as an output node of the target rendering pipeline to display the rendering intermediate results or the rendering final results.
[0108] In multiple editable nodes, you can define a RenderTarget node (third node) to provide input and output parameter configuration, provide size settings and depth buffer shared access capabilities through input-end nodes, and dynamically create output nodes to support MultiRenderTarget and multi-channel output. In multiple editable nodes, you can add built-in nodes such as ScreenSize (fourth node) as node input items to provide parameters such as the screen size inside the engine. You can also add a ScreenMesh node (fifth node) as an input item for screen space post-processing, and use materials to complete the post-processing effect or the intermediate rendering result of delayed rendering. In multiple editable nodes, you can also define an Output node (sixth node) as the output node of the rendering pipeline, which can be used as the output point of any RenderTarget to facilitate viewing the intermediate rendering results or the final effect.
[0109] In the disclosed embodiment, the above-mentioned multiple editable nodes may include multiple nodes such as output nodes, output nodes, nodes for parameter configuration, etc., so that the editing of nodes can be more flexible and comprehensive.
[0110] Fig.14 A structural schematic diagram of a rendering device based on a web client is provided. The device can be applied to a web client, and the web client provides rendering pipelines corresponding to multiple art resource types. The input and output relationship of the rendering pipeline is related to the art resource type corresponding to the rendering pipeline, and is determined by designing the connection of multiple editable nodes provided in the pipeline editing interface. Fig.14 As shown, the rendering device 1400 based on the web client includes:
[0111] The acquisition module 1401 is used to acquire the art resources to be rendered of the web client;
[0112] A first determination module 1402 is used to determine a target art resource type corresponding to the art resource to be rendered;
[0113] A second determination module 1403 is used to determine a target rendering pipeline corresponding to the target art resource type;
[0114] The rendering module 1404 is used to render the art resource to be rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client.
[0115] Through the above method, by utilizing the rendering pipelines corresponding to the various types of art resources provided by the web client, it is possible to determine a target rendering pipeline specifically used to render a certain type of art resource to be rendered, so that the art resource to be rendered is rendered on the web client through the target rendering pipeline, and the rendering result of the art resource to be rendered on the web client is obtained, thereby simulating the engine rendering process of the art resource to be rendered on the production end on the web client, so that the rendering effect of the web client reaches the rendering effect of the original file rendered on the production end, alleviating the technical problem that there is a large difference between the rendering effect of the art resource on the web client and the rendering effect of the art resource on the production end.
[0116] In a feasible implementation scheme, the rendering pipeline is generated in the following manner:
[0117] According to the connection design data for the plurality of editable nodes, the input and output relationship of the rendering pipeline is determined, and the rendering pipeline is built on the web client based on the input and output relationship; wherein the connection design data is determined according to the editing operation for the editable nodes.
[0118] In a feasible implementation manner, the plurality of editable nodes include a first node and a second node, the first node is used to represent geometric structure data, and the second node is used to represent a rendered shader; the device further includes:
[0119] A conversion module, used for obtaining a first shader in DXBC format from the engine of the web client, and converting the first shader into a second shader in a shading language code form;
[0120] A parsing module, used for parsing the second shader into configurable shader node data, and using the configurable shader node data as a configurable material node for rendering;
[0121] The third determination module is used to determine the current art resource to be rendered in the art resources to be rendered based on the configurable material node and the geometric structure data.
[0122] In a feasible implementation scheme, the rendering module is specifically used for:
[0123] Generate a DSL rendering pipeline framework in the form of DSL code based on the target rendering pipeline and the shader node data;
[0124] By using the DSL rendering pipeline framework, the different rendering logics of the plurality of target rendering pipelines are uniformly constructed into a target data structure in the form of DSL code;
[0125] Based on the target rendering pipeline under the target data structure, the art resource to be rendered is rendered on the web client using the web rendering framework of the web client to obtain a rendering result of the art resource to be rendered on the web client.
[0126] In a feasible implementation scheme, the web page rendering framework provides multiple rendering modes, wherein the multiple rendering modes correspond to multiple preview modes for the art resources to be rendered; the multiple rendering modes include at least two of the following: single-channel mode, silhouette mode, and material capture combined with normal map mode.
[0127] In a feasible embodiment, the device further comprises:
[0128] A creation module, used to create resources of a rendering target object according to the DSL rendering pipeline framework;
[0129] A connection module, used for parsing the DSL rendering pipeline framework, obtaining input and output nodes of the target rendering pipeline, and connecting the output of the rendering target object with the input of the variable uniform in the shader based on the input and output nodes;
[0130] The fourth determination module is used to determine the target rendering pipeline under the target data structure based on the connection relationship between the output of the rendering target object and the input of the variable uniform.
[0131] In a feasible implementation manner, the plurality of editable nodes further include a third node, a fourth node, a fifth node and a sixth node;
[0132] The third node is used to provide input and output parameter configuration, and provides size setting and depth buffer shared access functions through the input end node;
[0133] The fourth node is used as a node input item to provide a screen size parameter inside the engine of the web client;
[0134] The fifth node is used as an input item of the screen space post-processing of the web client, and is used to match the post-processing result or the intermediate rendering result of the delayed rendering with the material;
[0135] The sixth node serves as an output node of the target rendering pipeline, and is used to display an intermediate rendering result or a final rendering result.
[0136] In a feasible implementation manner, the editing operation includes any one or more of the following:
[0137] Add actions, connect actions, set actions, and drag and drop actions.
[0138] In a feasible implementation scheme, the editing operation includes a setting operation, which is used to set stage parameters and configuration parameters for each rendering stage of the rendering pipeline based on the input content of the input operation; the rendering pipeline is also generated in the following manner: based on the input and output relationship, the stage parameters and the configuration parameters, the rendering pipeline is built on the web client.
[0139] The rendering device based on a web client provided in the embodiment of the present disclosure has the same technical features as the rendering method based on a web client provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0140] Fig.15 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is shown, including: a memory 1501, a processor 1502 and a bus 1503, wherein the memory 1501 stores machine-readable instructions executable by the processor 1502, and when the electronic device runs a rendering method based on a web client in the embodiment, the processor 1502 communicates with the memory 1501 through the bus 1503, and the processor 1502 executes the machine-readable instructions, and the processor 1502 executes the preamble of the method item to perform the following steps:
[0141] Obtaining art resources to be rendered from the web client;
[0142] Determine a target art resource type corresponding to the art resource to be rendered;
[0143] Determine a target rendering pipeline corresponding to the target art resource type;
[0144] The art resource to be rendered is rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client.
[0145] Through the above method, by utilizing the rendering pipelines corresponding to the various types of art resources provided by the web client, it is possible to determine a target rendering pipeline specifically used to render a certain type of art resource to be rendered, so that the art resource to be rendered is rendered on the web client through the target rendering pipeline, and the rendering result of the art resource to be rendered on the web client is obtained, thereby simulating the engine rendering process of the art resource to be rendered on the production end on the web client, so that the rendering effect of the web client reaches the rendering effect of the original file rendered on the production end, alleviating the technical problem that there is a large difference between the rendering effect of the art resource on the web client and the rendering effect of the art resource on the production end.
[0146] In a feasible implementation scheme, the rendering pipeline is generated in the following manner:
[0147] According to the connection design data for the plurality of editable nodes, the input and output relationship of the rendering pipeline is determined, and the rendering pipeline is built on the web client based on the input and output relationship; wherein the connection design data is determined according to the editing operation for the editable nodes.
[0148] In a feasible implementation manner, the plurality of editable nodes include a first node and a second node, the first node is used to represent geometric structure data, and the second node is used to represent a rendering shader; before rendering the art resource to be rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client, the processor is further used to:
[0149] Obtaining a first shader in DXBC format from an engine of the web client, and converting the first shader into a second shader in shading language code form;
[0150] Parsing the second shader into configurable shader node data, and using the configurable shader node data as a configurable material node for rendering;
[0151] A current art resource to be rendered is determined from among the art resources to be rendered based on the configurable material node and the geometric structure data.
[0152] In a feasible implementation manner, when the processor performs rendering of the art resource to be rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client, the processor is specifically used to:
[0153] Generate a DSL rendering pipeline framework in the form of DSL code based on the target rendering pipeline and the shader node data;
[0154] By using the DSL rendering pipeline framework, the different rendering logics of the plurality of target rendering pipelines are uniformly constructed into a target data structure in the form of DSL code;
[0155] Based on the target rendering pipeline under the target data structure, the art resource to be rendered is rendered on the web client using the web rendering framework of the web client to obtain a rendering result of the art resource to be rendered on the web client.
[0156] In a feasible implementation scheme, the web page rendering framework provides multiple rendering modes, wherein the multiple rendering modes correspond to multiple preview modes for the art resources to be rendered; the multiple rendering modes include at least two of the following: single-channel mode, silhouette mode, and material capture combined with normal map mode.
[0157] In a feasible implementation manner, based on the target rendering pipeline under the target data structure, the web rendering framework of the web client is used to render the art resource to be rendered on the web client, and before obtaining the rendering result of the art resource to be rendered on the web client, the processor is further used to:
[0158] Creating resources of a rendering target object according to the DSL rendering pipeline framework;
[0159] Parsing the DSL rendering pipeline framework to obtain input and output nodes of the target rendering pipeline, and connecting the output of the rendering target object with the input of the variable uniform in the shader based on the input and output nodes;
[0160] A target rendering pipeline under the target data structure is determined based on a connection relationship between an output of the rendering target object and an input of the variable uniform.
[0161] In a feasible implementation manner, the plurality of editable nodes further include a third node, a fourth node, a fifth node and a sixth node;
[0162] The third node is used to provide input and output parameter configuration, and provides size setting and depth buffer shared access functions through the input end node;
[0163] The fourth node is used as a node input item to provide a screen size parameter inside the engine of the web client;
[0164] The fifth node is used as an input item of the screen space post-processing of the web client, and is used to match the post-processing result or the intermediate rendering result of the delayed rendering with the material;
[0165] The sixth node serves as an output node of the target rendering pipeline, and is used to display an intermediate rendering result or a final rendering result.
[0166] In a feasible implementation manner, the editing operation includes any one or more of the following:
[0167] Add actions, connect actions, set actions, and drag and drop actions.
[0168] In a feasible implementation manner, the editing operation includes a setting operation, and the setting operation is used to set stage parameters and configuration parameters for each rendering stage of the rendering pipeline based on the input content of the input operation; when the processor executes the construction of the rendering pipeline on the web client based on the input and output relationship, it is specifically used to:
[0169] The rendering pipeline is constructed on the web client based on the input and output relationship, the stage parameters, and the configuration parameters.
[0170] In practical applications, the memory 1501 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 1504 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0171] The bus 1503 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.15 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0172] Among them, the memory 1501 is used to store programs, and the processor 1502 executes the program after receiving the execution instruction. The method executed by the device defined by the process disclosed in any embodiment of the present disclosure can be applied to the processor 1502 or implemented by the processor 1502.
[0173] The processor 1502 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1502. The above processor 1502 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1501, and the processor 1502 reads the information in the memory 1501 and completes the steps of the above method in combination with its hardware.
[0174] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored. The computer program is executed when a processor is running, and the processor performs the following steps:
[0175] Obtaining art resources to be rendered from the web client;
[0176] Determine a target art resource type corresponding to the art resource to be rendered;
[0177] Determine a target rendering pipeline corresponding to the target art resource type;
[0178] The art resource to be rendered is rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client.
[0179] Through the above method, by utilizing the rendering pipelines corresponding to the various types of art resources provided by the web client, it is possible to determine a target rendering pipeline specifically used to render a certain type of art resource to be rendered, so that the art resource to be rendered is rendered on the web client through the target rendering pipeline, and the rendering result of the art resource to be rendered on the web client is obtained, thereby simulating the engine rendering process of the art resource to be rendered on the production end on the web client, so that the rendering effect of the web client reaches the rendering effect of the original file rendered on the production end, alleviating the technical problem that there is a large difference between the rendering effect of the art resource on the web client and the rendering effect of the art resource on the production end.
[0180] In a feasible implementation scheme, the rendering pipeline is generated in the following manner:
[0181] According to the connection design data for the plurality of editable nodes, the input and output relationship of the rendering pipeline is determined, and the rendering pipeline is built on the web client based on the input and output relationship; wherein the connection design data is determined according to the editing operation for the editable nodes.
[0182] In a feasible implementation manner, the plurality of editable nodes include a first node and a second node, the first node is used to represent geometric structure data, and the second node is used to represent a rendering shader; before rendering the art resource to be rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client, the processor is further used to:
[0183] Obtaining a first shader in DXBC format from an engine of the web client, and converting the first shader into a second shader in shading language code form;
[0184] Parsing the second shader into configurable shader node data, and using the configurable shader node data as a configurable material node for rendering;
[0185] A current art resource to be rendered is determined from among the art resources to be rendered based on the configurable material node and the geometric structure data.
[0186] In a feasible implementation manner, when the processor performs rendering of the art resource to be rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client, the processor is specifically used to:
[0187] Generate a DSL rendering pipeline framework in the form of DSL code based on the target rendering pipeline and the shader node data;
[0188] By using the DSL rendering pipeline framework, the different rendering logics of the plurality of target rendering pipelines are uniformly constructed into a target data structure in the form of DSL code;
[0189] Based on the target rendering pipeline under the target data structure, the art resource to be rendered is rendered on the web client using the web rendering framework of the web client to obtain a rendering result of the art resource to be rendered on the web client.
[0190] In a feasible implementation scheme, the web page rendering framework provides multiple rendering modes, wherein the multiple rendering modes correspond to multiple preview modes for the art resources to be rendered; the multiple rendering modes include at least two of the following: single-channel mode, silhouette mode, and material capture combined with normal map mode.
[0191] In a feasible implementation manner, based on the target rendering pipeline under the target data structure, the web rendering framework of the web client is used to render the art resource to be rendered on the web client, and before obtaining the rendering result of the art resource to be rendered on the web client, the processor is further used to:
[0192] Creating resources of a rendering target object according to the DSL rendering pipeline framework;
[0193] Parsing the DSL rendering pipeline framework to obtain input and output nodes of the target rendering pipeline, and connecting the output of the rendering target object with the input of the variable uniform in the shader based on the input and output nodes;
[0194] A target rendering pipeline under the target data structure is determined based on a connection relationship between an output of the rendering target object and an input of the variable uniform.
[0195] In a feasible implementation manner, the plurality of editable nodes further include a third node, a fourth node, a fifth node and a sixth node;
[0196] The third node is used to provide input and output parameter configuration, and provides size setting and depth buffer shared access functions through the input end node;
[0197] The fourth node is used as a node input item to provide a screen size parameter inside the engine of the web client;
[0198] The fifth node is used as an input item of the screen space post-processing of the web client, and is used to match the post-processing result or the intermediate rendering result of the delayed rendering with the material;
[0199] The sixth node serves as an output node of the target rendering pipeline, and is used to display an intermediate rendering result or a final rendering result.
[0200] In a feasible implementation manner, the editing operation includes any one or more of the following:
[0201] Add actions, connect actions, set actions, and drag and drop actions.
[0202] In a feasible implementation manner, the editing operation includes a setting operation, and the setting operation is used to set stage parameters and configuration parameters for each rendering stage of the rendering pipeline based on the input content of the input operation; when the processor executes the construction of the rendering pipeline on the web client based on the input and output relationship, it is specifically used to:
[0203] The rendering pipeline is constructed on the web client based on the input and output relationship, the stage parameters, and the configuration parameters.
[0204] In the embodiments of the present disclosure, the computer program can also execute other machine-readable instructions when run by the processor to execute other methods described in the embodiments. For the specific execution method steps and principles, please refer to the description of the embodiments, which will not be repeated here.
[0205] In the embodiments provided in the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0206] For another example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0207] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0208] In addition, each functional unit in the embodiments provided in the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0209] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the rendering method based on the web client described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0210] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0211] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the aforementioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the aforementioned embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present disclosure. They should all be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be based on the protection scope of the claims.
Claims
1. A rendering method based on a web client, characterized in that: The web client provides rendering pipelines corresponding to a plurality of art resource types, wherein the input and output relationship of the rendering pipeline is related to the art resource type corresponding to the rendering pipeline, and is determined by designing the connection of a plurality of editable nodes provided in a pipeline editing interface, and the method includes: Obtaining art resources to be rendered from the web client; Determine a target art resource type corresponding to the art resource to be rendered; Determine a target rendering pipeline corresponding to the target art resource type; The art resource to be rendered is rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client.
2. The method according to claim 1, characterized in that The rendering pipeline is generated in the following way: According to the connection design data for the plurality of editable nodes, the input and output relationship of the rendering pipeline is determined, and the rendering pipeline is built on the web client based on the input and output relationship; wherein the connection design data is determined according to the editing operation for the editable nodes.
3. The method according to claim 1, characterized in that The plurality of editable nodes include a first node and a second node, the first node is used to represent geometric structure data, and the second node is used to represent a rendering shader; Before rendering the art resource to be rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client, the method further includes: Obtaining a first shader in DXBC format from an engine of the web client, and converting the first shader into a second shader in shading language code form; Parsing the second shader into configurable shader node data, and using the configurable shader node data as a configurable material node for rendering; A current art resource to be rendered is determined from among the art resources to be rendered based on the configurable material node and the geometric structure data.
4. The method according to claim 3, characterized in that The step of rendering the art resource to be rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client includes: Generate a DSL rendering pipeline framework in the form of DSL code based on the target rendering pipeline and the shader node data; By using the DSL rendering pipeline framework, the different rendering logics of the plurality of target rendering pipelines are uniformly constructed into a target data structure in the form of DSL code; Based on the target rendering pipeline under the target data structure, the art resource to be rendered is rendered on the web client using the web rendering framework of the web client to obtain a rendering result of the art resource to be rendered on the web client.
5. The method according to claim 4, characterized in that The web page rendering framework provides multiple rendering modes, wherein the multiple rendering modes correspond to multiple preview modes for the art resources to be rendered; the multiple rendering modes include at least two of the following: single-channel mode, silhouette mode, and material capture combined with normal map mode.
6. The method according to claim 4, characterized in that The target rendering pipeline based on the target data structure uses the web rendering framework of the web client to render the art resource to be rendered on the web client, and before obtaining the rendering result of the art resource to be rendered on the web client, it also includes: Creating resources of a rendering target object according to the DSL rendering pipeline framework; Parsing the DSL rendering pipeline framework to obtain input and output nodes of the target rendering pipeline, and connecting the output of the rendering target object with the input of the variable uniform in the shader based on the input and output nodes; A target rendering pipeline under the target data structure is determined based on a connection relationship between an output of the rendering target object and an input of the variable uniform.
7. The method according to claim 1, characterized in that The plurality of editable nodes further include a third node, a fourth node, a fifth node and a sixth node; The third node is used to provide input and output parameter configuration, and provides size setting and depth buffer shared access functions through the input end node; The fourth node is used as a node input item to provide a screen size parameter inside the engine of the web client; The fifth node is used as an input item of the screen space post-processing of the web client, and is used to match the post-processing result or the intermediate rendering result of the delayed rendering with the material; The sixth node serves as an output node of the target rendering pipeline, and is used to display an intermediate rendering result or a final rendering result.
8. The method according to claim 2, characterized in that: The editing operation includes any one or more of the following: Add actions, connect actions, set actions, and drag and drop actions.
9. The method according to claim 2, characterized in that: The editing operation includes a setting operation, wherein the setting operation is used to set stage parameters and configuration parameters for each rendering stage of the rendering pipeline based on the input content of the input operation; and the building of the rendering pipeline on the web client based on the input and output relationship includes: The rendering pipeline is constructed on the web client based on the input and output relationship, the stage parameters, and the configuration parameters.
10. A rendering device based on a web client, characterized in that: The web client provides rendering pipelines corresponding to a plurality of art resource types, wherein the input and output relationship of the rendering pipeline is related to the art resource type corresponding to the rendering pipeline and is determined by designing the connection of a plurality of editable nodes provided in a pipeline editing interface. The device comprises: An acquisition module, used to acquire art resources to be rendered from the web client; A first determination module is used to determine a target art resource type corresponding to the art resource to be rendered; A second determination module is used to determine a target rendering pipeline corresponding to the target art resource type; The rendering module is used to render the art resource to be rendered on the web client through the target rendering pipeline to obtain a rendering result of the art resource to be rendered on the web client.
11. An electronic terminal, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the method according to any one of claims 1 to 9.
