Dynamic shader generation
OwnerGregory B. Abbasinventor
Life of this patent
Estimating the term…
Abstract
Some embodiments provide a method of performing several shading operations for a graphic object in a scene that is displayed on a device. The device includes several processing units. The method receives a set of criteria that can define a set of parameters that relate to the shading operations. The method determines an allocation of the shading operations to the processing units based on the received criteria. The method allocates the shading operations to the processing units based on the determined allocations. The method renders the graphic object based on several instructions that comprise the shading operations. In some embodiments, the set of criteria is received during execution of the operations.
Claims22
A method of shading a graphic object based on a plurality of operations comprising a set of shading operations, the plurality of operations performed on a plurality of processing units comprising a central processing unit (CPU) and a graphical processing unit (GPU), the method comprising:
- receiving an input from a graphical user interface (GUI) to allocate a plurality of shading operations to a particular shader;
- performing a set of operations from the plurality of operations on the CPU, the set of operations not comprising shading operations;
- and
- when the set of shading operations is invoked:
- (i) determining a frequency of computation for each shading operation;
- (ii) based on the determined frequency of computation of the shading operations and the input received from the GUI, allocating a first subset of the set of shading operations to the CPU and a second subset of the set of shading operations to the GPU;
- and
- (iii) rendering the graphic object by performing the first subset of the set of shading operations on the CPU and performing the second subset of the set of shading operations on the GPU.
A computer readable medium storing a computer program for execution by a plurality of processing units comprising a central processing unit (CPU) and a graphical processing unit (GPU), the computer program for shading a graphic object based on a plurality of operations comprising a set of shading operations, the computer program comprising sets of instructions for:
- performing a set of operations from a plurality of operations on the CPU, the set of operations not comprising shading operations;
- determining, when the set of shading operations is invoked, a frequency of computation for each shading operation;
- allocating, based on the determined frequency of computation of the shading operations, a first subset of the set of shading operations to the CPU and a second subset of the set of shading operations to the GPU;
- and
- rendering the graphic object by performing the first subset of the set of shading operations on the CPU and performing the second subset of the set of shading operations on the GPU.
A method of interactively shading a graphic object using a graphical user interface (GUI), the method comprising:
- allocating each of a first set of shading instructions to one of a plurality of shader programs;
- displaying the graphic object in the GUI by invoking the first set of shading instructions to render the graphic object;
- receiving, from the GUI, a set of rendering criteria that modifies a set of attributes of the graphic object;
- allocating each of a second set of shading instructions generated based on the received set of rendering criteria to one of the plurality of shader programs;
- and
- displaying the graphic object in the GUI by invoking the second set of shading instructions.
A computer readable medium storing a computer program for execution by at least one processing unit, the computer program for interactively shading a graphic object using a graphical user interface (GUI), the computer program comprising sets of instructions for:
- allocating each of a first set of shading instructions to one of a plurality of shader programs;
- displaying the graphic object in the GUI by invoking the first set of shading instructions to render the graphic object;
- receiving, from the GUI, a set of rendering criteria that modifies a set of attributes of the graphic object;
- allocating each of a second set of shading instructions generated based on the received set of rendering criteria to one of the plurality of shader programs;
- and
- displaying the graphic object in the GUI by invoking the second set of shading instructions.
Dependencies are inferred from the claim text.