US2012236000A1PendingUtilityA1

Dynamic shader generation

44
Assignee: ABBAS GREGORY BPriority: Jan 28, 2008Filed: Mar 16, 2012Published: Sep 20, 2012
Est. expiryJan 28, 2028(~1.5 yrs left)· nominal 20-yr term from priority
G06T 2210/52G06T 15/005G06T 15/80
44
PatentIndex Score
0
Cited by
0
References
0
Claims

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.

Claims

exact text as granted — not AI-modified
26 . 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. 
   
     
     
         27 . The method of  claim 26 , wherein allocating the second subset of the set of operations to the GPU comprises:
 generating a set of output instructions in a shading language; and   sending the set of output instructions to the GPU for execution.   
     
     
         28 . The method of  claim 27 , wherein the shading language is one of OpenGL Shading Language (GLSL) and OpenGL Architecture Review Board (ARB) assembly language. 
     
     
         29 . The method of  claim 27 , wherein the shading language is based on open graphics library (OpenGL). 
     
     
         30 . The method of  claim 27 , wherein the frequency of computation of an operation comprises performing the operation once per each of a plurality of pixels of the graphic object. 
     
     
         31 . The method of  claim 27 , wherein the graphic object comprises a plurality of vertices, wherein the frequency of computation of an operation comprises performing the operation once per each of a set of vertices of the graphic object. 
     
     
         32 . 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.   
     
     
         33 . The computer readable medium of  claim 32 , wherein the computer program further comprises a set of instructions for receiving an input from a graphical user interface (GUI) to allocate the plurality of shading operations to a particular shader, wherein the set of instructions for allocating the set of shading operations further comprises a set of instructions for allocating the set of shading operations based on the input received from the GUI. 
     
     
         34 . The computer readable medium of  claim 32 , wherein the first subset of shading instructions has a constant value and does not require any calculations during execution of the computer program. 
     
     
         35 . 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.   
     
     
         36 . The method of  claim 35 , wherein receiving the rendering criteria comprises receiving a user interaction associated with the graphic object in GUI to modify the graphic object. 
     
     
         37 . The method of  claim 35 , wherein receiving the rendering criteria comprises receiving user input from a control in the GUI to modify the graphic object. 
     
     
         38 . The method of  claim 35 , further comprising:
 each time a new set of rendering criteria is received from the GUI:
 allocating each of a new set of shading instructions generated based on the received new set of rendering criteria to one of the plurality of shader programs; and 
 displaying the graphic object in the GUI by invoking the new set of shading instructions. 
   
     
     
         39 . The method of  claim 35 , wherein allocating each of the shading instructions comprises allocating each of the shading instructions based on a frequency of computation, wherein the frequency of computation for at least one shading instruction is one of: once per the graphic object, once per each of a plurality of pixels defining the graphic object, and once per each of a plurality of data points defining the graphic object. 
     
     
         40 . The method of  claim 35 , wherein the set of shading instructions are allocated to shader programs during an execution of an object program, the object program generated from a source program written in a high-level programming language. 
     
     
         41 . The method of  claim 35 , wherein said set of rendering criteria is received while said graphic object is being displayed. 
     
     
         42 . The method of  claim 35 , wherein the plurality of shader programs comprise a vertex shader that receives a set of vertices as input and performs shading computations once per each vertex. 
     
     
         43 . The method of  claim 35 , wherein the plurality of shader programs comprise a fragment shader that receives a set of pixels defining the graphic object and performs shading operations once per pixel. 
     
     
         44 . 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.   
     
     
         46 . The computer readable medium of  claim 44 , wherein the set of instructions for receiving the rendering criteria comprises a set of instructions for receiving user interactions associated with the graphic object in GUI to modify the graphic object. 
     
     
         47 . The computer readable medium of  claim 44 , wherein the set of instructions for receiving the rendering criteria comprises a set of instructions for receiving user input from a control in the GUI to modify the graphic object. 
     
     
         48 . The computer readable medium of  claim 44 , wherein the computer program further comprises sets of instructions for:
 allocating, each time a new set of rendering criteria is received from the GUI, each of a new set of shading instructions generated based on the received new set of rendering criteria to one of the plurality of shader programs; and   displaying the graphic object in the GUI by invoking the new set of shading instructions.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.