Known Direct Subclasses
ProgramFragment |
This class was deprecated
in API level 16.
in API 16
The Renderscript fragment program, also known as fragment shader is responsible
for manipulating pixel data in a user defined way. It's constructed from a GLSL
shader string containing the program body, textures inputs, and a Type object
that describes the constants used by the program. Similar to the vertex programs,
when an allocation with constant input values is bound to the shader, its values
are sent to the graphics program automatically.
The values inside the allocation are not explicitly tracked. If they change between two draw
calls using the same program object, the runtime needs to be notified of that
change by calling rsgAllocationSyncAll so it could send the new values to hardware.
Communication between the vertex and fragment programs is handled internally in the
GLSL code. For example, if the fragment program is expecting a varying input called
varTex0, the GLSL code inside the program vertex must provide it.
|
ProgramVertex |
This class was deprecated
in API level 16.
in API 16
ProgramVertex, also know as a vertex shader, describes a
stage in the graphics pipeline responsible for manipulating
geometric data in a user-defined way.
|
|
Known Indirect Subclasses
ProgramFragmentFixedFunction |
This class was deprecated
in API level 16.
in API 16
ProgramFragmentFixedFunction is a helper class that provides
a way to make a simple fragment shader without writing any
GLSL code. This class allows for display of constant color, interpolated
color from the vertex shader, or combinations of the both
blended with results of up to two texture lookups. |
ProgramVertexFixedFunction |
This class was deprecated
in API level 16.
in API 16
ProgramVertexFixedFunction is a helper class that provides a
simple way to create a fixed function emulation vertex shader
without writing any GLSL code.
|
|
Class Overview
Program is a base class for all the objects that modify
various stages of the graphics pipeline
Summary
Nested Classes |
class |
Program.BaseProgramBuilder |
|
enum |
Program.TextureType |
TextureType specifies what textures are attached to Program
objects
|
[Expand]
Inherited Methods |
From class
android.renderscript.BaseObj
synchronized
void
|
destroy()
destroy disconnects the object from the native object effectively
rendering this java object dead.
|
boolean
|
equals(Object obj)
Compare the current BaseObj with another BaseObj for equality.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
String
|
getName()
|
int
|
hashCode()
Calculates the hash code value for a BaseObj.
|
void
|
setName(String name)
setName assigns a name to an object.
|
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Public Methods
public
void
bindConstants
(Allocation a, int slot)
Binds a constant buffer to be used as uniform inputs to the
program
Parameters
a
| allocation containing uniform data |
slot
| index within the program's list of constant
buffer allocations
|
public
void
bindSampler
(Sampler vs, int slot)
Binds an object that describes how a texture at the
corresponding location is sampled
Parameters
vs
| sampler for a corresponding texture |
slot
| index within the program's list of textures to
use the sampler on
|
public
void
bindTexture
(Allocation va, int slot)
Binds a texture to be used in the program
Parameters
va
| allocation containing texture data |
slot
| index within the program's list of textures
|
public
Type
getConstant
(int slot)
Returns the type of the constant buffer used in the program
object. It could be used to query internal elements or create
an allocation to store constant data.
Parameters
slot
| index of the constant input type to return |
public
int
getConstantCount
()
Program object can have zero or more constant allocations
associated with it. This method returns the total count.
Returns
- number of constant input types
public
int
getTextureCount
()
Returns the number of textures used in this program object
public
String
getTextureName
(int slot)
Returns the name of the texture input at a given slot. e.g.
tex0, diffuse, spec
Parameters
slot
| index of the texture input |
Returns the type of texture at a given slot. e.g. 2D or Cube
Parameters
slot
| index of the texture input |