Systems and methods for responsive differentiable rendering

Through responsive programming technology, the problem of excessive peak computing time and memory usage in the existing technology is solved, and development productivity and scalability are improved.

CN116235214BActive Publication Date: 2025-03-07HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202080105566.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-27
Publication Date
2025-03-07
Estimated Expiration
2040-09-27

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently cache intermediate data in differentiable rendering, resulting in excessive peak computing time and memory usage, reducing development productivity and scalability.

Method used

Responsive programming technology automatically generates reverse code and automatically caches intermediate data used in calculations in differentiable rendering, reducing memory usage peaks and calculation time.

Benefits of technology

Improves the development productivity and scalability of differentiable rendering, reduces computing time and memory usage peaks, and achieves a more efficient rendering process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116235214B_ABST
    Figure CN116235214B_ABST
Patent Text Reader

Abstract

A rendering system includes: a processor; a memory storing a computer program, wherein the computer program, when executed by the processor, causes the processor to perform the following steps: create an expression graph according to a rendering pipeline of any reverse graphics application; establish an optimization target node and find a path from the optimization target node to an evaluation node; perform all forward calculations according to the expression graph; cache the values ​​of the nodes to be cached; evaluate the error between the current output value of the evaluation output node and the expected output value specified by the reverse graphics application for the evaluation output node; perform a backward calculation from the evaluation output node to the optimization target node using the cached value for the gradient; use the gradient to update the value of the optimization target node; responsively perform the minimum required forward calculation using the cached value; and determine whether the error converges. The system achieves high development productivity and reduces computing time through reasonable peak memory usage and high application interactivity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of rendering and optimization, and in particular to a system and method for responsive differentiable rendering (RDR). Background Art

[0002] Differentiable rendering describes the rendering process as a differentiable process. The rendering process loads "scene parameters", namely light source characteristics, object surface reflection characteristics, camera projection transformation, the shapes and poses of all objects and their timing to form a scene, simulates the physical phenomenon of light according to the scene parameters and the clear causal relationship between input and output, and calculates images corresponding to multiple cameras and their time series.

[0003] Differentiable rendering describes various operations in rendering as differentiable operations. Therefore, when there are slight changes in scene parameters and intermediate variables, it is possible to calculate what slight changes occur in a set of variables (including images) on the output side, where these scene parameters and intermediate variables are the input side of the causal relationship.

[0004] Differentiable rendering has various applications, but one important purpose is inverse graphics, also known as 3D reconstruction.

[0005] Inverse graphics is the process of estimating unknown scene parameters when one or more images and some scene parameters are available with reliable information. Rendering is a forward problem that simplifies various phenomena related to light and its records (such as light sources, materials, and cameras) and computes them by describing them as a chain of cause and effect relationships. However, inverse graphics is an inverse problem that infers the original scene parameters from images, where the shading result is the sum of many light sources projected and added together, so information is lost.

[0006] The inverse problem is usually more difficult to solve than the forward problem. However, if the value of the observable parameter (such as an image) includes a lot of indirect information about other unknown parameters, and if the problem can be modeled in a differentiable form, the inverse problem is relatively easier to solve. Differentiable rendering makes full use of this property to calculate the inverse graphics as much as possible. That is, according to the current estimation results of the scene parameters, the scene is rendered into an image. This image is required to evaluate the output error and calculate automatic differentiation. Images taken by real cameras and other devices, as well as 2D images drawn by end users and graphic designers are called expected images. The error between these expected images and the rendered images is back-propagated to the gradient of the input side scene parameters in order to update the estimated values ​​of the scene parameters. Rendering is performed again using the updated scene parameters, and optimization is iteratively performed so that the error between the rendered image and the expected image is close to 0 to achieve the inverse graphics.

[0007] Currently, 3D photos of objects can be taken with a smartphone and can be easily used in Augmented Reality (AR) applications. Differentiable Rendering (DR) is very useful for optimizing 3D reconstruction results and deep learning for 3D reconstruction.

[0008] To avoid repeated computation without automatic caching, programmers can carefully analyze their DR pipelines and write code to cache manually. Summary of the invention

[0009] The present invention provides a rendering system and a rendering method, which achieve high development productivity and reduce calculation time through reasonable memory usage peak and high application interactivity.

[0010] According to a first aspect, a rendering system is provided. The rendering system comprises: a processor; a memory storing a computer program, wherein the computer program, when executed by the processor, causes the processor to perform the following steps: create an expression graph according to a rendering pipeline of any reverse graphics application; establish an optimization target node and find a path from the optimization target node to an evaluation node; perform all forward calculations according to the expression graph; cache the values ​​of nodes to be cached; evaluate the error between the current output value of the evaluation output node and the expected output value specified by the reverse graphics application for the evaluation output node; perform a backward calculation from the evaluation output node to the optimization target node using the cached value for the gradient; use the gradient to update the value of the optimization target node; responsively perform the minimum required forward calculation using the cached value; and determine whether the error converges.

[0011] In a first possible implementation manner of the first aspect, the computer program enables the processor to cache the value of the node to be cached, and the value of the node to be cached is used for the forward calculation and the backward calculation.

[0012] In a second possible implementation of the first aspect, when the value of a node is updated or the structure of the expression graph changes, the computer program causes the processor to set a flag of the relevant node on the output side to indicate that the cached value of the node needs to be recalculated, or to start the required forward calculation.

[0013] In a third possible implementation of the first aspect, when performing forward calculation using the cache value, if a flag of the node holding the cache value has been set to indicate that the cache value of the node needs to be recalculated, the computer program causes the processor to recalculate the cache value of the node.

[0014] According to a second aspect, a rendering method is provided. The rendering method comprises: creating an expression graph according to a rendering pipeline of any reverse graphics application; establishing an optimization target node and finding a path from the optimization target node to an evaluation node; performing all forward calculations according to the expression graph; caching the value of the node to be cached; evaluating the error between the current output value of the evaluation output node and the expected output value specified by the reverse graphics application for the evaluation output node; performing a backward calculation from the evaluation output node to the optimization target node using the cached value for the gradient; using the gradient to update the value of the optimization target node; responsively performing the minimum required forward calculation using the cached value; and determining whether the error converges.

[0015] According to a third aspect, a computer-readable storage medium storing a program is provided, wherein the program enables a computer to execute the method provided in the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly describe the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. The drawings in the following description only illustrate some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1A The DR architecture provided by the prior art is shown.

[0018] Figure 1B and Figure 1C The RDR architecture provided by one embodiment of the present invention is shown.

[0019] Figure 2 An example of a portion of an actual expression graph in RDR is shown.

[0020] Figure 3 An example of a shader graph on the CG Application Node Editor is shown.

[0021] Figure 4 It is a block diagram of the RDR hardware configuration provided by an embodiment of the present invention.

[0022] Figure 5 is a block diagram of the RDR function configuration provided by an embodiment of the present invention;

[0023] Figure 6 is a flowchart of the operation of the RDR system 100 provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should belong to the scope of protection of the present invention.

[0025] In the present invention, reactive programming (RP) technology is applied to differentiable rendering (DR), which is called a Reactive Differentiable Rendering (RDR) system. RP performs efficient propagation, DR is suitable for backward operations, and RDR has these two characteristics. The present invention implements a method for caching intermediate data in differentiable rendering, which can reduce calculation time through reasonable memory usage peaks. In the description of the renderer and shader, the system automatically controls the caching of intermediate data, and automatically generates backward calculations corresponding to forward calculations in complex graph networks, thereby achieving high development productivity.

[0026] The RDR system only computes functions that need to be updated during the optimization step. If the input values ​​do not change at all in some forward calculations, the calculation time can be reduced by caching the output values ​​and continuing to use these cached values. There are cases in differentiable rendering where some scene parameters can be assumed to be true values; only some scene parameters are optimized and not others.

[0027] Here, a set of all nodes obtained by tracking and enumerating the nodes from the node "f" corresponding to the operation to the input side is called the "input side node group" of "f". When the value of any node in the input side node group is updated, the cached value owned by f becomes dirty, that is, old and inaccurate. If f is dirty when using the output value of f, all dirty nodes and f in the input side node group of f are recalculated. If f is not dirty, the cached value of f is used instead of recalculation.

[0028] The RDR mechanism achieves fast optimization through differential rendering (DR). Since the DR pipeline has complex function connections, responsive programming works well in this case. Figure 1A The DR architecture provided by the prior art is shown. Figure 1B and Figure 1C The RDR architecture provided by one embodiment of the present invention is shown. Figure 1A , Figure 1B and Figure 1C shows the calculation process of the value of a node on the graph using an expression. Figure 1B In the cache function A, the output value is Figure 1C In , the cached value is used in the forward computation of function C.

[0029] Figure 2 An example of a portion of an actual expression graph in RDR is shown, where black circles, white circles, and trapezoids represent nodes, and arrows represent connection relationships between nodes. In contrast, for example, deep learning does not require responsiveness because its connections are not as complex as those of differentiable rendering.

[0030] From the programmer and designer's point of view, there is no need to care about responsiveness and backward calculation. They write forward calculation code, such as the traditional 3D graphics pipeline. An example of a shader description is as follows:

[0031] dif_spec=kD*dif_color+spec_color

[0032] col=dif_spec*occl_tex_v+emis_tex_v

[0033] Graphic designers only use node editors, which are usually used for material construction, such as Figure 3 The end user of an application using RDR as a backend processing system only needs to use the application graphical user interface (GUI) to select or modify optimization settings, i.e., estimation targets, inputs, and target outputs, such as images.

[0034] RDR is a meta-algorithm for rendering and reverse rendering, and is also applicable to various types of DR systems, including the following:

[0035] RDR applies not only to physically based material models, but also to artistic material representations. Shader designers can only write forward code in the same way as before.

[0036] Rendering algorithms are not limited to triangle rasterizers. Fuzzy rasterizers, ray tracers, forward / inverse neural renderers, etc. can also be used.

[0037] Available data is not limited to 2D images. You can also use 3D point clouds, RGB depth images, meshes, surface elements (surfel), signed distance functions (SDF), implicit functions, primitive sets, neural shape expressions, etc. You can also use their time series.

[0038] Object pose and shape estimation, camera pose estimation as an improved bundle adjustment method, material estimation, ambient light field estimation, training of forward / inverse neural renderers and some of their modules, etc. can be used, that is, anything related to rendering and inverse rendering can be used.

[0039] Even if some algorithms have difficulty getting their automatic differentiation or useful derivative values, programmers can modify these algorithms into better differentiable forward algorithms and add these algorithms to the rendering pipeline (the entire process of creating 2D images from 3D model data in multiple stages).

[0040] While the present invention is intended to automatically store intermediate data, programmers, designers, and end users may choose to control caching by saving or recalculating intermediate data through code, shader graph settings, and user interfaces.

[0041] The RDR system also has the following applications. In recent years, the concept of responsiveness has focused on solving various problems related to processes with data streams and event streams (such as user input and sensor data, etc.), where these processes are scheduled and called asynchronously through declarative and more concise code descriptions. This concept is implemented through various asynchronous responsive frameworks (for example, ReactiveX, UniRx, React, VueJS, etc.). These frameworks have achieved high productivity in actual application development.

[0042] In RDR, the concept of responsiveness in this sense is useful at its application layer. RDR application users, i.e., end users, designers, programmers, etc., have various requests: view and edit scene parameters, optimize target and expression graphs, check forward calculation results and expected values, execute these requests dynamically at runtime during optimization, etc. RDR can flexibly respond to these requests using concise descriptions. By pre-calculating and push-propagating anything that can be calculated in advance (such as information presented to application users), RDR can also reduce waiting time for application users and improve application interactivity.

[0043] The purpose of optimization is usually to solve the inverse problem. Responsive programming is similar to constraint programming, and one of its applications is direct inverse calculation from the output side to the input side. There can be some nodes that obtain the input by performing the inverse operation on the output without automatic differentiation and optimization. For example, the statement "y:=x^2; y=4;" can be easily calculated to x=±2. Recently, there are some methods that directly use neural networks to calculate this inverse calculation instead of optimizing the calculation, and this type of framework can be a type of constraint programming. On the contrary, using differentiable programming to implement constraint programming is also an important application of the methods used in RDR. These applications are not limited to differentiable rendering, but are also used in differentiable programming to solve differentiable nonlinear optimization problems.

[0044] In an embodiment of the present invention, an RDR system using top-down automatic differentiation is described below. However, even when calculating bottom-up automatic differentiation, symbolic differentiation, and high-order differentiation, the benefits of RDR can be achieved by constructing the expression graph used in RDR.

[0045] Figure 4 2 is a block diagram of the RDR hardware configuration provided by an embodiment of the present invention. The hardware includes a central processing unit (CPU) 201, a graphics processing unit (GPU) 202 or other types of processors, a read only memory (ROM) 203, a random access memory (RAM) 204, a memory 205, a display 206, a user input / output (I / O) device 207 (such as a keyboard, a mouse, a touch screen, etc.), a communication device 208 (such as a LAN and Wi-Fi), a bus 209 connecting these components, and the like. The memory 205 stores computer programs related to RDR. The hardware including the above components can be, for example, a personal computer, a smart phone, a mobile device, and the like.

[0046] Figure 5 It is a block diagram of the RDR function configuration provided by an embodiment of the present invention. Figure 5 The diagram shows functional blocks including an RDR system 100 and a reverse graphics application (3D reconstruction application) 301. The RDR system 100 and the reverse graphics application 301 are implemented by executing related computer programs by the CPU 201 or the GPU 202. The computer programs for the RDR system 100 and the reverse graphics application 301 can be executed on one computer.

[0047] The reverse graphics application 301 is an application that uses the RDR system 100 as its backend processing system. The reverse graphics application 301 is created by describing the scene parameters of the optimization target, the scene parameters that do not need to be optimized to known values ​​or true values, the output side variables called the objective function, the errors and losses, and the operations between the variables. The rendering pipeline manager 302 enables the expression graph builder 303 to build an expression graph according to the request of the reverse graphics application 301, and manages the settings and operations of the RDR rendering pipeline stored in the expression graph memory 304.

[0048] The expression graph builder 303 builds the expression graph according to the rendering pipeline. The expression graph storage 304 stores the expression graph and related information.

[0049] The optimization target manager 305 manages data and processes related optimizations, and uses various optimization methods to update the value of the optimization target according to the derivative value given by the backward calculation.

[0050] The forward manager 306 manages the forward computation and calculates the error between the current output value of the expression graph and the expected value of the output value specified by the inverse graph application 301 .

[0051] The backward manager 307 manages the backward calculation. The backward manager 307 also manages "retained variables". Retained variables are input variables of the forward function and are retained in each partial differential expression of the forward function. For example, if f(x,y):=x*y, then y is The reserved variable x is If f(x,y):=x+y, then there are no reserved variables.

[0052] Scheduler 308 cooperates with forward manager 306 and backward manager 307 to schedule asynchronous parallel computations in RDR.

[0053] The strategies for selecting nodes to cache include the following:

[0054] Cache all nodes. This is the fastest and simplest to implement, but memory consumption is high.

[0055] Cache all nodes with the GRADIENT FLAG OFF. This is as fast as caching all nodes in normal DR usage.

[0056] Cache nodes with gradient flag OFF, which are inputs to every node with gradient flag ON. Peak memory usage may be significantly reduced.

[0057] · Only cache the retained variable nodes for each node with the gradient flag ON.

[0058] Based on the statistics of node reference frequency and recalculation execution time, decide on a per-node basis whether to cache calculation results in the actual optimization iteration.

[0059] In one embodiment of the present invention, a method for implementing RDR using the strategy of "caching all nodes with gradient flags OFF" is described below.

[0060] Each compute node that makes up the expression graph represents an arbitrary element-wise differentiable operation. A compute node takes one or more nodes as input and a single scalar or tensor as output, which also acts as a buffer, and computes the output value based on the input value. The compute node uses the input to compute the value of the partial derivative of the output and saves it as a retained variable if necessary.

[0061] Each compute node adds the following properties:

[0062] A dirty flag (DIRTY FLAG) indicates whether the cached value currently held by the node is correct or needs to be recalculated.

[0063] The gradient flag (GRADIENT FLAG) indicates whether the node is included in the path from the input-side optimization variable node to the output-side evaluation variable node (called the objective function or loss).

[0064] For example, suppose Figure 1B and Figure 1C The expression graph in includes the following expressions:

[0065] A(x1,x2):=x1+x2;

[0066] B(x2,x3):=x2+x3;

[0067] C(A,B):=A*B; / / :=(x1+x2)*(x2+x3);

[0068] x1=1; / / fixed

[0069] x2=2; / / fixed

[0070] x3=0; / / initial value of optimization target

[0071] In reverse automatic differentiation (the output variable to be differentiated is fixed and the partial differential value is calculated recursively), variables need to be retained.

[0072]

[0073] At this time, A is calculated Required retained variables. Since A is known to be a retained variable in the forward calculation of C:=A*B, the node recording A is associated with C.

[0074] on the other hand,

[0075]

[0076] At this time, there are no reserved variables in the forward addition operation, such as B:=x1+x2. In other words, the reserved variables depend on the type of operation performed on the node.

[0077] Figure 6 FIG. 1 is a flowchart of the operation of the RDR system 100 provided by an embodiment of the present invention. Figure 1B and Figure 1C The specific process of the example.

[0078] In step 401, the expression graph builder 303 creates an expression graph according to the rendering pipeline of the reverse graphics application 301. In the initial state, the dirty flags (DIRTY FLAG) of all nodes are ON, and the gradient flags (GRADIENT FLAG) are OFF. Assume that x1, x2, x3, A, B and C are the nodes that make up the expression graph. It should be noted that in the following explanation, x1, x2, x3, A, B and C not only represent the names of the nodes, but also represent the values ​​of the nodes or the values ​​of the functions of the nodes.

[0079] In step 402, the optimization target manager 305 establishes the optimization target node and finds the nodes that make up the path from the optimization target node to the evaluation node. Initial values ​​are assigned to x1, x2, and x3, and then the dirty flags of x1, x2, and x3 are cleared (set to OFF). Since x1 and x2 are not optimization targets but fixed values, the gradient flag is OFF. x3 is the value to be calculated by optimization, and the gradient flag is set to ON. x3 is the optimization target, C is the evaluation variable, and the gradient flags of B and C are set to ON.

[0080] In step 403, the forward manager 306 performs all forward calculations according to the expression graph. It does not make sense to cache the values ​​of nodes with the gradient flag ON because their values ​​are updated every time in the optimization iteration. For nodes with the gradient flag OFF, the forward manager 306 caches the values ​​and sets the gradient flag to OFF every time the forward calculation is completed. For nodes with the gradient flag ON, the backward manager 307 records the retained variables required in the backward calculation. When all forward calculations are completed, the forward manager 306 evaluates the error. Assume A = 3, B = 2, C = 6, and The error is then equal to 6–15=–9 (6 is the current output value of the expression graph, and 15 is the expected value of the output specified by the inverse graphics application 301).

[0081] In step 404, the backward manager 307 performs a backward calculation of the gradient from the evaluation output value to the optimization target by back-propagation. In the above example, (C is the evaluation variable and x3 is the optimization target).

[0082] In step 405, the optimization target manager 305 uses the gradient calculated by the backward calculation and the optimizer to update the value of the optimization target node. Assume that δC = α * error, α = -1, δC = 9. At this time, δx3=9 / 3=3, x3=0+δx3=3 (δx3 is the difference corresponding to δC).

[0083] In step 406, the value of any node may be updated externally due to runtime processes of the application, user input, etc. In this case, the cache retained by the output node group of the updated node is old and inaccurate.

[0084] In step 407, when a node is updated, the forward manager 306 only propagates the dirty flag while tracing all nodes with a gradient flag of OFF from the updated node toward the output direction (pull mode responsive rendering), or the forward manager 306 starts forward calculation in parallel (push mode responsive rendering). For example, considering the case where a user updates x2 to 0 in a pull mode responsive RDR system but restores x2 to 2 shortly thereafter, when x2 is updated to 0, the forward manager 306 sets the dirty flag of A and recursively sets the dirty flag of C (i.e., the output side node of A). The forward manager 306 also sets the dirty flag of B, but since B is a node with a gradient flag of ON, the dirty flag of C (i.e., the output side node of B) is not set. When x2 is restored to 2, since the forward manager 306 detects that the dirty flags of A and B have been set, nothing is changed.

[0085] In step 408, in the reverse graph, the optimization target node may change due to the order of the variables to be optimized or the request of the reverse graph application 301. For example, the optimization target changes from x3 to x1. Moreover, due to the runtime process of the application, user input, etc., the structure of any expression graph can be changed by adding a new expression graph or deleting a part of the expression graph externally. For example, x3:=x4+x5 is defined at runtime. However, such cases are not described here.

[0086] In step 409 , if the target node or the structure of the expression graph for optimization changes, the optimization target manager 305 resets all gradient flags to OFF and then performs the same operation as step 402 again.

[0087] In step 410, forward calculation is started again from the optimization target node to the node with the gradient flag ON using the cache according to the input value updated using the optimizer. For the node with the dirty flag ON, recalculation is performed starting from the input side or recursively starting from the output side. When all forward calculations are completed, the forward manager 306 evaluates the error. Considering the situation after step 407, the forward manager 306 starts forward calculation from x3. Since the output of x3 is used in B and B is a node with the gradient flag ON, the forward manager 306 calculates B=x2+x3=5. Since the output of B is used in C and C is a node with the gradient flag ON, the forward manager 306 starts to calculate C=A*B. However, the forward manager 306 detects that the dirty flag of A is ON, and first, the forward manager 306 calculates A=x1+x2=3, and then calculates C=A*B=3*5=15. The error is 15–15=0.

[0088] In step 411, if the optimization does not converge, the RDR process returns to step 404. If the optimization converges, the RDR process ends.

[0089] The present invention provides a method for solving the following problems in differentiable rendering:

[0090] Scalability and development productivity are low when reverse engineering code needs to be manually written and debugged to reduce computation time and memory usage.

[0091] There are methods and frameworks that can automatically differentiate more flexible computational descriptions, but naive implementations, such as storing all intermediate computation results, are difficult to apply to the scale that differentiable rendering can handle, because the amount of spatial computation exceeds the memory capacity of real hardware.

[0092] There is a technique called checkpointing, which is not automatic caching, but can control the balance between computation time and memory usage in automatic differentiation by storing intermediate computation results. However, unlike the network described by a chain of blocks in a convolutional neural network (CNN), differentiable shaders, etc. are complex graph networks, and checkpointing is difficult to perform manually.

[0093] · Traditional responsive programming aims to perform computations through declarative descriptions of data flows, while recent responsive programming aims to describe high application interactivity with excellent development productivity. Responsive programming provides various suggestions in terms of caching of computation results, propagation of events, scheduling of computations, coding methods with high development productivity, etc. However, there is no example of responsive programming applied to differentiable rendering based on the characteristics of inverse computation in differentiable rendering.

[0094] According to an embodiment of the present invention, by automatically generating reverse code, while reducing or balancing the computation time and peak memory usage, scalability and development productivity are improved. By applying responsive programming to differentiable rendering in a manner different from checkpoints, peak memory usage is reduced in complex graph networks (e.g., differentiable shaders).

[0095] This application discloses various methods for responsive programming for differential rendering. Specifically, in differentiable rendering, methods that minimize computation time and peak memory usage (balancing the two if necessary) automatically cache intermediate data used in computation without explicit description by programmers and designers.

[0096] The above disclosure is only an exemplary embodiment of the present invention, and is certainly not intended to limit the scope of protection of the present invention. It can be understood by those skilled in the art that all or part of the processes for implementing the above embodiments and the equivalent modifications made according to the claims of the present invention should all fall within the scope of the present invention.

Claims

1. A rendering system, characterized in that: The rendering system comprises: processor; A memory storing a computer program, wherein the computer program, when executed by the processor, causes the processor to perform the following steps: Create an expression graph based on the rendering pipeline of any inverse graphics application; Establishing an optimization target node and finding a path from the optimization target node to an evaluation node; Perform all forward computations according to the expression graph; Cache the value of the node to be cached; evaluating an error between a current output value of an evaluation output node and an expected output value specified for the evaluation output node by the inverse graph application; performing a backward computation of gradients from the evaluation output node to the optimization target node using cached values; Using the gradient to update the value of the optimization target node; responsively performing minimum required forward computation using the cached value; It is determined whether the error converges.

2. The rendering system according to claim 1, characterized in that: The computer program enables the processor to cache the value of the node to be cached, and the value of the node to be cached is used for the forward calculation and the backward calculation.

3. The rendering system according to claim 1 or 2, characterized in that: When the value of a node is updated or the structure of the expression graph changes, the computer program causes the processor to set a flag of the relevant node on the output side to indicate that the cached value of the node needs to be recalculated, or to start the required forward calculation.

4. The rendering system according to claim 3, characterized in that: When performing a forward calculation using the cached value, if a flag of a node having a cached value has been set to indicate that the cached value of the node needs to be recalculated, the computer program causes the processor to recalculate the cached value of the node.

5. A rendering method, characterized in that: The rendering method comprises: Create an expression graph based on the rendering pipeline of any inverse graphics application; Establishing an optimization target node and finding a path from the optimization target node to an evaluation node; Perform all forward computations according to the expression graph; Cache the value of the node to be cached; evaluating an error between a current output value of an evaluation output node and an expected output value specified for the evaluation output node by the inverse graph application; performing a backward computation of gradients from the evaluation output node to the optimization target node using cached values; Using the gradient to update the value of the optimization target node; responsively performing minimum required forward computation using the cached value; It is determined whether the error converges.

6. A computer-readable storage medium storing a program, characterized in that: The program causes a computer to execute the method according to claim 5.

Citation Information

Patent Citations

  • Large-landform generation method based on PC platform in 3-D game

    CN1936962A

  • System and method for optimizing the processing of images

    US20030085932A1