Multi-pass shading
First Claim
1. A method for rendering an image with a graphics processor driven by a multi-pass shader program including a descriptor and an input parameter, the method comprising:
- pre-compiling, before run time, the multi-pass shader program to generate binary execution code for execution by the graphics processor by configuring a binary shader for each value in a predetermined set of values, wherein a variable of each binary shader is fixed at compile time to one of the predetermined values in the set;
receiving a first parameter of the image, a value of the first parameter being limited to one of the values in the predetermined set of values in the multi-pass shader program;
executing a first pass of the multi-pass shader program utilizing the binary execution code and the first parameter as the input parameter to obtain a first data value wherein the multi-pass shader program selects, at run-time, the binary shader comprising the binary execution code identified by the value of the first parameter in the first pass;
binding, at run time, the first data value as the input parameter for a second pass of the multi-pass shader program;
executing a second pass of the multi-pass shader program utilizing the binary execution code including the bound first data value to obtain a second data value;
performing an operation on the first data value and the second data value to obtain image rendering data; and
rendering the image, a portion of the image based upon the image rendering data, and wherein the multi-pass shader program effectuates a photorealistic effect in the portion of the image through the alteration of a color based on the angle and distance of an object with respect to a light source in the portion of the image.
4 Assignments
0 Petitions
Accused Products
Abstract
An application binary interface includes a descriptor specifying a binary shader for each pass of a multi-pass shader. The application binary interface also includes a graphics state of a graphics object for each pass of the multi-pass shader. The graphics state for the first pass is an initial graphics state of the graphics object. The graphics state for each subsequent pass specifies a change from the graphics state of a previous pass. The application binary interface further includes parameters for the binary shaders. The application binary interface links the binary shaders together based on the parameters. Further, the parameters of the binary shaders may be modified at run time to configure the multi-pass shader. The binary shader of each pass is then executed based on the graphics state and parameters of the pass to render the graphics object.
-
Citations
15 Claims
-
1. A method for rendering an image with a graphics processor driven by a multi-pass shader program including a descriptor and an input parameter, the method comprising:
-
pre-compiling, before run time, the multi-pass shader program to generate binary execution code for execution by the graphics processor by configuring a binary shader for each value in a predetermined set of values, wherein a variable of each binary shader is fixed at compile time to one of the predetermined values in the set; receiving a first parameter of the image, a value of the first parameter being limited to one of the values in the predetermined set of values in the multi-pass shader program; executing a first pass of the multi-pass shader program utilizing the binary execution code and the first parameter as the input parameter to obtain a first data value wherein the multi-pass shader program selects, at run-time, the binary shader comprising the binary execution code identified by the value of the first parameter in the first pass; binding, at run time, the first data value as the input parameter for a second pass of the multi-pass shader program; executing a second pass of the multi-pass shader program utilizing the binary execution code including the bound first data value to obtain a second data value; performing an operation on the first data value and the second data value to obtain image rendering data; and rendering the image, a portion of the image based upon the image rendering data, and wherein the multi-pass shader program effectuates a photorealistic effect in the portion of the image through the alteration of a color based on the angle and distance of an object with respect to a light source in the portion of the image. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A method for rendering an image with a graphics processor driven by a multi-pass shader program including a descriptor and an input parameter, the method comprising:
-
pre-compiling, before run time, the multi-pass shader program to generate binary execution code for execution by the graphics processor by configuring a binary shader for each value in a predetermined set of values, wherein a variable of each binary shader is fixed at compile time to one of the predetermined values in the set; receiving a first parameter of the image, a value of the first parameter being limited to one of the values in the predetermined set of values in the multi-pass shader program; executing a first pass of the multi-pass shader program utilizing the binary execution code and the first parameter as the input parameter to obtain a first data value wherein the multi-pass shader program selects, at run-time, the binary shader comprising the binary execution code identified by the value of the first parameter in the first pass; receiving a second parameter of the image; binding, at run time, the first data value as the input parameter for a second pass of the multi-pass shader program; executing a second pass of the multi-pass shader program utilizing the binary execution code including both the second parameter and the bound first data value to obtain a second data value; performing an operation on the first data value and the second data value to obtain image rendering data; and rendering the image, a portion of the image based upon the image rendering data, and wherein the multi-pass shader program effectuates a photorealistic effect in the portion of the image through the alteration of a color based on the angle and distance of an object with respect to a light source in the portion of the image. - View Dependent Claims (8, 9, 10, 11, 12)
-
-
13. A graphics processor driven by a multi-pass shader program including a descriptor and an input parameter, the graphics processor configured to:
-
pre-compile, before run time, the multi-pass shader program to generate binary execution code for execution by the graphics processor by configuring a binary shader for each value in a predetermined set of values, wherein a variable of each binary shader is fixed at compile time to one of the predetermined values in the set; receive a first parameter of the image, a value of the first parameter being limited to one of the values in the predetermined set of values in the multi-pass shader program; execute a first pass of the multi-pass shader program utilizing binary execution code pre-compiled by the multi-pass shader, before run time, and further utilizing the first parameter as the input parameter to obtain a first data value wherein the multi-pass shader program selects, at run-time, the binary shader comprising the binary execution code identified by the value of the first parameter in the first pass; bind, at run time, the first data value as the input parameter for a second pass of the multi-pass shader program; and execute a second pass of the multi-pass shader program utilizing the binary execution code including the bound first data value to obtain a second data value, wherein an image is rendered in response to execution of the graphics processor, a portion of the image based upon the image rendering data, and wherein the multi-pass shader program effectuates a photorealistic effect in the portion of the image through the alteration of a color based on the angle and distance of an object with respect to a light source in the portion of the image.
-
-
14. A method for rendering an image with a graphics processor driven by a multi-pass shader program including a descriptor and an input parameter, the method comprising:
-
pre-compiling, before run time, the multi-pass shader program to generate binary execution code for execution by the graphics processor by configuring a binary shader for each value in a predetermined set of values, wherein a variable of each binary shader is fixed at compile time to one of the predetermined values in the set, wherein binary execution code is identified by the descriptor; receiving a first parameter of the image, a value of the first parameter being limited to one of the values in the predetermined set of values in the multi-pass shader program; executing a first pass of the multi-pass shader program utilizing the binary execution code and the first parameter as the input parameter to obtain a first data value wherein the multi-pass shader program selects, at run-time, the binary shader comprising the binary execution code identified by the value of the first parameter in the first pass; binding, at run time, the first data value as the descriptor for a second pass of the multi-pass shader program; executing a second pass of the multi-pass shader program utilizing the binary execution code including the bound first data value to obtain a second data value; performing an operation on the first data value and the second data value to obtain image rendering data; and rendering the image, a portion of the image based upon the image rendering data, and wherein the multi-pass shader program effectuates a photorealistic effect in the portion of the image through the alteration of a color based on the angle and distance of an object with respect to a light source in the portion of the image.
-
-
15. A computer implemented memory having embodied thereon a program, the program being executable by a processor to perform a method for rendering an image, the method comprising:
-
pre-compiling, before run time, a multi-pass shader program including a descriptor and an input parameter to generate binary execution code for execution by the processor by configuring a binary shader for each value in a predetermined set of values, wherein a variable of each binary shader is fixed at compile time to one of the predetermined values in the set; receiving a first parameter of the image, a value of the first parameter being limited to one of the values in the predetermined set of values in the multi-pass shader program; executing a first pass of the multi-pass shader program utilizing the binary execution code and the first parameter as an input parameter to obtain a first data value wherein the multi-pass shader program selects, at run-time, the binary shader comprising the binary execution code identified by the value of the first parameter in the first pass; binding, at run time, the first data value as the input parameter for a second pass of the multi-pass shader program; executing a second pass of the multi-pass shader program utilizing the binary execution code including the bound first data value to obtain a second data value; performing an operation on the first data value and the second data value to obtain image rendering data; and rendering the image, a portion of the image based upon the image rendering data, and wherein the multi-pass shader program effectuates a photorealistic effect in the portion of the image through the alteration of a color based on the angle and distance of an object with respect to a light source in the portion of the image.
-
Specification