com.jme3.material
Class Technique

java.lang.Object
  extended by com.jme3.material.Technique

public class Technique
extends java.lang.Object

Represents a technique instance.


Constructor Summary
Technique()
          Serialization only.
Technique(Material owner, TechniqueDef def)
          Creates a new technique instance that implements the given technique definition.
 
Method Summary
 TechniqueDef getDef()
          Returns the technique definition that is implemented by this technique instance.
 Shader getShader()
          Returns the shader currently used by this technique instance.
 java.util.List<Uniform> getWorldBindUniforms()
          Returns a list of uniforms that implements the world parameters that were requested by the material definition.
 boolean isNeedReload()
          Returns true if the technique must be reloaded.
 void makeCurrent(AssetManager assetManager, boolean techniqueSwitched)
          Prepares the technique for use by loading the shader and setting the proper defines based on material parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Technique

public Technique(Material owner,
                 TechniqueDef def)
Creates a new technique instance that implements the given technique definition.

Parameters:
owner - The material that will own this technique
def - The technique definition being implemented.

Technique

public Technique()
Serialization only. Do not use.

Method Detail

getDef

public TechniqueDef getDef()
Returns the technique definition that is implemented by this technique instance.

Returns:
the technique definition that is implemented by this technique instance.

getShader

public Shader getShader()
Returns the shader currently used by this technique instance.

Shaders are typically loaded dynamically when the technique is first used, therefore, this variable will most likely be null most of the time.

Returns:
the shader currently used by this technique instance.

getWorldBindUniforms

public java.util.List<Uniform> getWorldBindUniforms()
Returns a list of uniforms that implements the world parameters that were requested by the material definition.

Returns:
a list of uniforms implementing the world parameters.

isNeedReload

public boolean isNeedReload()
Returns true if the technique must be reloaded.

If a technique needs to reload, then the Material should call #makeCurrent(com.jme3.asset.AssetManager) on this technique.

Returns:
true if the technique must be reloaded.

makeCurrent

public void makeCurrent(AssetManager assetManager,
                        boolean techniqueSwitched)
Prepares the technique for use by loading the shader and setting the proper defines based on material parameters.

Parameters:
assetManager - The asset manager to use for loading shaders.