Simulating non power of two texture behavior
AssigneeGoogle Inc.
InventorGreggory Alan Tavares
Life of this patent
Estimating the term…
Abstract
Aspects of the invention relate generally to enforcing elements of the OpenGL ES specification. More specifically, regardless of whether or not the underlying API system would allow NPOT textures, the systems and methods herein may disallow them. As a result, objects bound with these textures may be considered errors, non-renderable, and rendered in black. In order to accomplish this, various functions may be tracked to determine whether an NPOT texture that uses mips is being bound to an object, and if so, treat the condition as an error and bind (then draw) the object with a black texture.
Claims18
A computer-implemented method for binding textures and generating an image of an object using a graphics library including functions and elements, the method comprising:
- generating a variable to track a number of non power of two textures comprising a length dimension or a width dimension which is not a power of two, the non power of two textures being set to use mips;
- tracking the use of a first function;
- setting a value for the variable based on the use of the first function;
- receiving a request from a user to use a second function to bind one or more textures to the object and draw the object;
- when the value indicates that there are non power of two textures set to use mips, then:
- (a) identifying a plurality of textures including the one or more textures;
- (b) for each texture of the plurality of textures, determining, by one or more processors, whether the texture is an non power of two texture;
- (c) for each non power of two texture, determining whether the texture is set to use mips;
- (d) for each of the one or more textures which is an non power of two texture and set to use mips, binding a black texture to the object;
- (e) drawing the object in black;
- (f) calling the second function;
- and
- (g) after drawing the object in black, binding the one or more textures to the object.
A computer-implemented method for binding textures and generating an image of an object using a graphics library including functions and elements, the method comprising:
- generating a variable to track a number of non power of two textures comprising a length dimension or a width dimension which is not a power of two, which are set to use mips;
- tracking the use of a first function;
- setting a value for the variable based on the use of the first function;
- tracking the use of a second function;
- identifying, by one or more processors, a plurality of textures of the library;
- identifying N texture binding locations based on the use of the second function, where each of the N texture binding location is associated with a respective texture of the plurality of textures;
- receiving a request from a user to use a third function to bind one or more textures to the object and draw the object;
- when the value indicates that there are non power of two textures set to use mips, then:
- (a) for each of the N texture binding locations, the one or more processors determining whether the respective texture is an non power of two texture;
- (b) for each non power of two texture, determining whether the texture is set to use mips;
- (c) for each of the one or more textures which is an non power of two texture and set to use mips, binding a black texture to the object;
- (d) drawing the object in black;
- (e) calling the third function;
- and
- (f) after drawing the object in black, binding the one or more textures to the object.
A computer-implemented method for binding textures and generating an image of an object using a graphics library including functions and elements, the method comprising:
- generating a variable to track a number of non-power of two textures each comprising a length dimension or a width dimension which is not a power of two, the non-power of two textures being set to use mips;
- tracking the use of a first function;
- setting a value for the variable based on the use of the first function;
- tracking the use of a second function;
- identifying, by one or more processors, a plurality of textures of the library;
- identifying N texture binding locations based on the use of the second function, where each of the N texture binding locations is associated with a respective texture of the plurality of textures;
- tracking the use of a third function;
- identifying one or more of the N texture binding locations based on the use of the third function;
- receiving a request from a user to use a fourth function to bind one or more textures to the object and draw the object;
- when the value indicates that there are non-power of two textures set to use mips, then:
- (a) for each of the identified one or more N texture binding locations, determining by the one or more processors whether the respective texture is an non power of two texture;
- (b) for each non power of two texture, determining whether the texture is set to use mips;
- (c) for each of the one or more textures which is an non power of two texture and set to use mips, binding a black texture to the object;
- (d) drawing the object in black;
- (e) calling the fourth function;
- and
- (f) after drawing the object in black, binding the one or more textures to the object.
A computer comprising:
- memory storing a graphics library including functions and elements for binding textures and generating an image of an object;
- one or more processors configured to:
- generate a variable to track a number of non power of two textures comprising a length dimension or a width dimension which is not a power of two, the non power of two textures being set to use mips;
- track use of a first function;
- set a value for the variable based on the use of the first function;
- receive a request from a user to use a second function to bind one or more textures to the object and draw the object;
- when the value indicates that there are non power of two textures set to use mips, then:
- (a) identify a plurality of textures including the one or more textures;
- (b) for each texture of the plurality of textures, determine whether the texture is an non power of two texture;
- (c) for each non power of two texture, determine whether the texture is set to use mips;
- (d) for each of the one or more textures which is an non power of two texture and set to use mips, bind a black texture to the object;
- (e) draw the object in black;
- (f) call the second function;
- and
- (g) after the object is drawn in black, bind the one or more textures to the object.
A computer comprising:
- memory storing a graphics library including functions and elements for binding textures and generating an image of an object;
- one or more processors configured to:
- generate a variable to track a number of non power of two textures comprising a length dimension or a width dimension which is not a power of two, which are set to use mips;
- track use of a first function;
- set a value for the variable based on the use of the first function;
- track use of a second function;
- identify a plurality of textures of the library;
- identify N texture binding locations based on the use of the second function, where each of the N texture binding location is associated with a respective texture of the plurality of textures;
- receive a request from a user to use a third function to bind one or more textures to the object and draw the object;
- when the value indicates that there are non power of two textures set to use mips, then:
- (a) for each of the N texture binding locations, determine whether the respective texture is an non power of two texture;
- (b) for each non power of two texture, determine whether the texture is set to use mips;
- (c) for each of the one or more textures which is an non power of two texture and set to use mips, bind a black texture to the object;
- (d) draw the object in black;
- (e) call the third function;
- and
- (f) after the object is drawn in black, bind the one or more textures to the object.
A computer comprising:
- memory storing a graphics library including functions and elements for binding textures and generating an image of an object;
- one or more processors configured to:
- generate a variable to track a number of non power of two textures each comprising a length dimension or a width dimension which is not a power of two, the non power of two textures being set to use mips;
- track use of a first function;
- set a value for the variable based on the use of the first function;
- track use of a second function;
- identify a plurality of textures of the library;
- identify N texture binding locations based on the use of the second function, where each of the N texture binding locations is associated with a respective texture of the plurality of textures;
- track use of a third function;
- identify one or more of the N texture binding locations based on the use of the third function;
- receive a request from a user to use a fourth function to bind one or more textures to the object and draw the object;
- when the value indicates that there are non power of two textures set to use mips, then:
- (a) for each of the identified one or more N texture binding locations, determine whether the respective texture is an non power of two texture;
- (b) for each non power of two texture, determine whether the texture is set to use mips;
- (c) for each of the one or more textures which is an non power of two texture and set to use mips, bind a black texture to the object;
- (d) draw the object in black;
- (e) call the fourth function;
- and
- (f) after the object is drawn in black, bind the one or more textures to the object.
Dependencies are inferred from the claim text.