com.jmex.terrain.util
Class ProceduralSplatTextureGenerator

java.lang.Object
  extended by com.jmex.terrain.util.ProceduralTextureGenerator
      extended by com.jmex.terrain.util.ProceduralSplatTextureGenerator

public class ProceduralSplatTextureGenerator
extends ProceduralTextureGenerator

ProceduralSplatTexture is an extension of the ProceduralTexture. It provides the capability to overlay one or more textures on a ProceduralTexture. To define a splat texture layer an alpha map and texture map are provided and the final overlay texture is calculated by using the alpha map to add the texture map color to the existing ProceduralTexture.

Version:
$Id: ProceduralSplatTextureGenerator.java 4133 2009-03-19 20:40:11Z blaine.dev $
Author:
Chris Gray

Field Summary
protected  java.util.List<java.awt.image.BufferedImage> splatMaps
           
protected  java.util.List<java.awt.image.BufferedImage> splatTextures
           
 
Fields inherited from class com.jmex.terrain.util.ProceduralTextureGenerator
proceduralTexture, size
 
Constructor Summary
ProceduralSplatTextureGenerator(AbstractHeightMap heightMap)
          Constructor instantiates a new ProceduralSplatTexture object initializing the list for textures and the height map.
 
Method Summary
 void addSplatTexture(javax.swing.ImageIcon map, javax.swing.ImageIcon texture)
          addSplatTexture adds an additional splat texture to the list of splat textures.
 void clearTextures()
           
 void createTexture(int textureSize)
          createTexture overrides the method in ProcduralTextureGenerator to provide the capability to overlay the existing procedural texture with one or more 'splat' maps.
 java.awt.image.BufferedImage getSplatMap(int index)
           
 int getSplatSize()
           
 java.awt.image.BufferedImage getSplatTexture(int index)
           
 
Methods inherited from class com.jmex.terrain.util.ProceduralTextureGenerator
addTexture, getImageIcon, saveTexture, setHeightMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

splatMaps

protected java.util.List<java.awt.image.BufferedImage> splatMaps

splatTextures

protected java.util.List<java.awt.image.BufferedImage> splatTextures
Constructor Detail

ProceduralSplatTextureGenerator

public ProceduralSplatTextureGenerator(AbstractHeightMap heightMap)
Constructor instantiates a new ProceduralSplatTexture object initializing the list for textures and the height map.

Parameters:
heightMap - the height map to use for the texture generation.
Method Detail

addSplatTexture

public void addSplatTexture(javax.swing.ImageIcon map,
                            javax.swing.ImageIcon texture)
addSplatTexture adds an additional splat texture to the list of splat textures. Each texture has an alpha map and a texture map associated with it. The alpha map determines the amount of color from the texture map to add to the existing procedural texture.

Parameters:
map - the alpha map.
texture - the texture map.

createTexture

public void createTexture(int textureSize)
createTexture overrides the method in ProcduralTextureGenerator to provide the capability to overlay the existing procedural texture with one or more 'splat' maps.

Overrides:
createTexture in class ProceduralTextureGenerator

getSplatSize

public int getSplatSize()
Returns:
Returns the number of splat maps currently defined.

getSplatMap

public java.awt.image.BufferedImage getSplatMap(int index)
Returns:
Returns the splat alpha map at the specified index.

getSplatTexture

public java.awt.image.BufferedImage getSplatTexture(int index)
Returns:
Returns the splat texture map at the specified index.

clearTextures

public void clearTextures()
Overrides:
clearTextures in class ProceduralTextureGenerator