Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.j3d.threeD.raytracer.shaders
Class TextureShader

    java.lang.Object
      java.util.AbstractCollection<E>
          java.util.AbstractSet<E>
              java.util.HashSet
                  net.sf.j3d.threeD.raytracer.shaders.ShaderSet
                      net.sf.j3d.threeD.raytracer.shaders.TextureShader

All Implemented Interfaces:
  Serializable, Cloneable, Iterable, Collection, Set, ColorProducer, Shader, Editable, Producer

    public class TextureShader

extends ShaderSet
implements Editable, Shader

A TextureShader object uses a Texture object as a filter for shader output. The object allows you to set up Shader objects as input properties for Texture objects and takes care of evaluating the shader values with each call of the shade method.

Author:
  Mike Murray
See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from interface net.sf.j3d.threeD.raytracer.util.Editable
`Editable.Selection`

Constructor Summary
`TextureShader()` Constructs a new Texture shader object.
`TextureShader(Texture t, ShaderFactory factory)` Constructs a new TextureShader object using the specified Texture and ShaderFactory objects.

Method Summary
`RGB` | `evaluate(Object[] args)` Produces a color using the specified arguments.
`ShaderFactory` | `getFactory()`
`Producer[]` | `getInputPropertyValues()`
`String[]` | `getPropertyDescriptions()` Returns an array of String objects with descriptions for each editable property of this Editable object.
`String[]` | `getPropertyNames()` Returns an array of String objects with names for each editable property of this Editable object.
`Class[]` | `getPropertyTypes()` Returns an array of Class objects representing the class types of each editable property of this Editable object.
`Object[]` | `getPropertyValues()` Returns the values of the properties of this Editable object as an Object array.
`Texture` | `getTexture()`
`void` | `setFactory(ShaderFactory factory)` Sets the ShaderFactory object used by this TextureShader object.
`void` | `setInputPropertyValue(int index, Producer p)`
`void` | `setPropertyValue(Object value, int index)` Sets the value of the property of this Editable object at the specified index to the specified value.
`void` | `setPropertyValues(Object[] values)` Sets the values of properties of this Editable object to those specified.
`void` | `setTexture(Texture t)` Sets the Texture object used by this TextureShader object.
`RGB` | `shade(ShaderParameters p)` Returns an RGB object that represents the shaded color calculated using the values of the specified ShaderParameters object.
`String` | `toString()`

Methods inherited from class net.sf.j3d.threeD.raytracer.shaders.ShaderSet
`add, addAll, equals`

Methods inherited from class java.util.HashSet
`clear, clone, contains, isEmpty, iterator, remove, size`

Methods inherited from class java.util.AbstractSet
`hashCode, removeAll`

Methods inherited from class java.util.AbstractCollection
`containsAll, retainAll, toArray, toArray`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.Set
`containsAll, hashCode, removeAll, retainAll, toArray, toArray`

Constructor Detail

### TextureShader

    public TextureShader()

  Constructs a new Texture shader object.

### TextureShader

    public TextureShader(Texture t,
                         ShaderFactory factory)

  Constructs a new TextureShader object using the specified Texture and ShaderFactory objects.

  Parameters:
    `t` - The Texture object to use as a filter.
    `factory` - The ShaderFactory that can be used to create Shader objects as parameters.

Method Detail

### setTexture

    public void setTexture(Texture t)

  Sets the Texture object used by this TextureShader object.

  Parameters:
    `t` - The Texture object to be used.

### setFactory

    public void setFactory(ShaderFactory factory)

  Sets the ShaderFactory object used by this TextureShader object.

  Parameters:
    `factory` - The ShaderFactory object to use.

### getTexture

    public Texture getTexture()

  Returns:
    The Texture object used by this TextureShader object.

### getFactory

    public ShaderFactory getFactory()

  Returns:
    The ShaderFactory object used by this TextureShader object.

### getPropertyNames

    public String[] getPropertyNames()

  Description copied from interface: `Editable`
  Returns an array of String objects with names for each editable property of this Editable object.

  Specified by:
    `getPropertyNames` in interface `Editable`
  See Also:
    `Editable.getPropertyNames()`

### getPropertyDescriptions

    public String[] getPropertyDescriptions()

  Description copied from interface: `Editable`
  Returns an array of String objects with descriptions for each editable property of this Editable object.

  Specified by:
    `getPropertyDescriptions` in interface `Editable`
  See Also:
    `Editable.getPropertyDescriptions()`

### getPropertyTypes

    public Class[] getPropertyTypes()

  Description copied from interface: `Editable`
  Returns an array of Class objects representing the class types of each editable property of this Editable object.

  Specified by:
    `getPropertyTypes` in interface `Editable`
  See Also:
    `Editable.getPropertyTypes()`

### getPropertyValues

    public Object[] getPropertyValues()

  Description copied from interface: `Editable`
  Returns the values of the properties of this Editable object as an Object array.

  Specified by:
    `getPropertyValues` in interface `Editable`
  See Also:
    `Editable.getPropertyValues()`

### setPropertyValue

    public void setPropertyValue(Object value,
                                 int index)

  Description copied from interface: `Editable`
  Sets the value of the property of this Editable object at the specified index to the specified value.

  Specified by:
    `setPropertyValue` in interface `Editable`
  See Also:
    `Editable.setPropertyValue(java.lang.Object, int)`

### setPropertyValues

    public void setPropertyValues(Object[] values)

  Description copied from interface: `Editable`
  Sets the values of properties of this Editable object to those specified.

  Specified by:
    `setPropertyValues` in interface `Editable`
  See Also:
    `Editable.setPropertyValues(java.lang.Object[])`

### getInputPropertyValues

    public Producer[] getInputPropertyValues()

  Specified by:
    `getInputPropertyValues` in interface `Editable`
  Returns:
    An array of Producer objects containing the property values of those properties that are repeatedly evaluated.
  See Also:
    `Editable.getInputPropertyValues()`

### setInputPropertyValue

    public void setInputPropertyValue(int index,
                                      Producer p)

  Specified by:
    `setInputPropertyValue` in interface `Editable`
  Parameters:
    `index` - Index of input property (array index from this.getInputPropertyValue).
    `p` - Producer object to use for input property.
  See Also:
    `Editable.setInputPropertyValue(int, net.sf.j3d.threeD.raytracer.util.Producer)`

### shade

    public RGB shade(ShaderParameters p)

  Description copied from interface: `Shader`
  Returns an RGB object that represents the shaded color calculated using the values of the specified ShaderParameters object.

  Specified by:
    `shade` in interface `Shader`
  Overrides:
    `shade` in class `ShaderSet`
  Returns:
    The sum of the values given by the shade method for each Shader object stored by this ShaderSet object.
  See Also:
    `net.sf.j3d.threeD.raytracer.shaders.Shader#shade(net.sf.j3d.threeD.raytracer.engine.ShaderParameters)`

### evaluate

    public RGB evaluate(Object[] args)

  Description copied from interface: `ColorProducer`
  Produces a color using the specified arguments.

  Specified by:
    `evaluate` in interface `ColorProducer`
  Overrides:
    `evaluate` in class `ShaderSet`
  Parameters:
    `args` - Arguments.
  Returns:
    this.shade(args[0]).
  See Also:
    `ColorProducer.evaluate(java.lang.Object[])`

### toString

    public String toString()

  Overrides:
    `toString` in class `ShaderSet`
  Returns:
    The string representation of the Texture object used by this TextureShader object plus " Shader".

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD