|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jreality.shader.TextureUtility
public class TextureUtility
A bunch of factory methods that create Textures and ReflectionMaps. Other shader related stuff should follow.
Field Summary | |
---|---|
static java.lang.String[] |
STANDARD_CUBEMAP_PARTS
{"bk","ft","dn","up","lf","rt"} |
Method Summary | |
---|---|
static CubeMap |
createCubeMap(Appearance app,
java.lang.String prefix,
ImageData[] imgs)
method to create a reflectionMap for the 6 given images (as ImageData). |
static CubeMap |
createCubeMap(Appearance app,
java.lang.String prefix,
java.lang.String resourcePrefix,
java.lang.String[] sides,
java.lang.String resourceEnding)
Convienience Method to load all 6 images for a ReflectionMap. |
static ImageData[] |
createCubeMapData(Input zipFile)
|
static ImageData[] |
createCubeMapData(java.lang.String resourcePrefix,
java.lang.String[] sides,
java.lang.String resourceEnding)
Convienience Method to load 6 images for a CubeMap. |
static ImageData |
createPointSprite(int textureSize,
double[] lightDirection,
java.awt.Color diffuseColor,
java.awt.Color specularColor,
double specularExponent)
|
static CubeMap |
createReflectionMap(Appearance app,
java.lang.String shader,
ImageData... imgs)
method to create a reflectionMap for the 6 given images (as ImageData). |
static CubeMap |
createReflectionMap(Appearance app,
java.lang.String shader,
Input[] data)
method to create a reflectionMap for the 6 given images (as Inputs). |
static CubeMap |
createReflectionMap(Appearance app,
java.lang.String shader,
java.lang.String resourcePrefix,
java.lang.String[] sides,
java.lang.String resourceEnding)
Convienience Method to load all 6 images for a ReflectionMap. |
static CubeMap |
createSkyBox(Appearance app,
ImageData[] imgs)
method to create a sky box for the 6 given images (as ImageData). |
static CubeMap |
createSkyBox(Appearance app,
Input[] data)
method to create a sky box for the 6 given images (as Inputs). |
static Texture2D |
createTexture(Appearance app,
java.lang.String shader,
ImageData img)
|
static Texture2D |
createTexture(Appearance app,
java.lang.String shader,
ImageData img,
boolean readDefaults)
method to create a reflectionMap for the given image (as ImageData). |
static Texture2D |
createTexture(Appearance app,
java.lang.String shader,
Input in)
|
static Texture2D |
createTexture(Appearance app,
java.lang.String shader,
Input in,
boolean readDefaults)
method to create a reflectionMap for the given image (as ImageData). |
static Texture2D |
createTexture(Appearance app,
java.lang.String shader,
int i,
ImageData img)
|
static Texture2D |
createTexture(Appearance app,
java.lang.String shader,
int i,
ImageData img,
boolean readDefaults)
|
static Texture2D |
createTexture(Appearance app,
java.lang.String shader,
java.lang.String resourceName)
|
static Texture2D |
createTexture(Appearance app,
java.lang.String shader,
java.lang.String resourceName,
boolean readDefaults)
method to create a reflectionMap for the given image (as a String to locate as a resource) |
static Texture2D |
getBackgroundTexture(Appearance rootApp)
|
static ImageData[] |
getCubeMapImages(CubeMap rm)
|
static boolean |
hasReflectionMap(Appearance app,
java.lang.String shader)
|
static boolean |
hasReflectionMap(EffectiveAppearance ea,
java.lang.String shader)
|
static void |
main(java.lang.String[] args)
|
static CubeMap |
readReflectionMap(EffectiveAppearance app,
java.lang.String prefix)
method to read the 6 sides of a ReflectionMap. |
static void |
removeReflectionMap(Appearance app,
java.lang.String shader)
|
static void |
removeTexture(Appearance app,
java.lang.String shader)
|
static void |
setBackgroundTexture(Appearance rootApp,
ImageData id)
Background image |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[] STANDARD_CUBEMAP_PARTS
Method Detail |
---|
public static Texture2D createTexture(Appearance app, java.lang.String shader, ImageData img, boolean readDefaults)
app
- the appearance where to create the Texture2Dshader
- the name of the shader, should be null, "", "polygonShader" maybe "lineShader" works alsoimg
- the ImageDatareadDefaults
- true for the Texture2D to return default values, if false it returns null for unset values
public static Texture2D createTexture(Appearance app, java.lang.String shader, int i, ImageData img, boolean readDefaults)
public static Texture2D createTexture(Appearance app, java.lang.String shader, ImageData img)
public static Texture2D createTexture(Appearance app, java.lang.String shader, int i, ImageData img)
public static Texture2D createTexture(Appearance app, java.lang.String shader, Input in, boolean readDefaults) throws java.io.IOException
app
- the appearance where to create the Texture2Dshader
- the name of the shader, should be null, "", "polygonShader" maybe "lineShader" works alsoin
- an Input to load the ImageData from
java.io.IOException
public static Texture2D createTexture(Appearance app, java.lang.String shader, Input in) throws java.io.IOException
java.io.IOException
public static Texture2D createTexture(Appearance app, java.lang.String shader, java.lang.String resourceName, boolean readDefaults) throws java.io.IOException
app
- the appearance where to create the Texture2Dshader
- the name of the shader, should be null, "", "polygonShader" maybe "lineShader" works alsoresourceName
-
java.io.IOException
- if the resource fails to loadReaders.getInput()
public static Texture2D createTexture(Appearance app, java.lang.String shader, java.lang.String resourceName) throws java.io.IOException
java.io.IOException
public static CubeMap createReflectionMap(Appearance app, java.lang.String shader, ImageData... imgs)
app
- the appearance where to create the ReflectionMapshader
- the name of the shader, should be null, "", "polygonShader" maybe "lineShader" works alsoimgs
-
public static CubeMap createReflectionMap(Appearance app, java.lang.String shader, Input[] data) throws java.io.IOException
app
- the appearance where to create the ReflectionMapshader
- the name of the shader, should be null, "", "polygonShader" maybe "lineShader" works alsodata
- an array of 6 images
java.io.IOException
- if data fails to loadpublic static CubeMap createReflectionMap(Appearance app, java.lang.String shader, java.lang.String resourcePrefix, java.lang.String[] sides, java.lang.String resourceEnding) throws java.io.IOException
resourcePrefix+sides[i=0..5]+resourceEndingThe order of the 6 images is the same as for the other ReflectionMap methods: {"bk","ft","dn","up","lf","rt"}
app
- the appearance where to create the ReflectionMapshader
- the name of the shader, should be null, "", "polygonShader" maybe "lineShader" works alsoresourcePrefix
- part of the resource namessides
- part of the resource namesresourceEnding
- part of the resource names
java.io.IOException
- if the resources fail to loadpublic static CubeMap readReflectionMap(EffectiveAppearance app, java.lang.String prefix)
app
- the ea to read fromprefix
- the prefix under which the ReflectionMap is written to the appearance
public static ImageData[] getCubeMapImages(CubeMap rm)
public static CubeMap createCubeMap(Appearance app, java.lang.String prefix, ImageData[] imgs)
app
- the appearance where to create the ReflectionMapprefix
- the prefix, i. e. "polygonShader.reflectionMap" or "skyBox", ...imgs
-
public static CubeMap createSkyBox(Appearance app, ImageData[] imgs)
app
- the appearance where to create the sky boximgs
-
public static CubeMap createSkyBox(Appearance app, Input[] data) throws java.io.IOException
app
- the appearance where to create the sky boxdata
- an array of 6 images
java.io.IOException
- if data fails to loadpublic static CubeMap createCubeMap(Appearance app, java.lang.String prefix, java.lang.String resourcePrefix, java.lang.String[] sides, java.lang.String resourceEnding) throws java.io.IOException
resourcePrefix+sides[i=0..5]+resourceEndingThe order of the 6 images is the same as for the other ReflectionMap methods: {"bk","ft","dn","up","lf","rt"}
app
- the appearance where to create the sky boxresourcePrefix
- part of the resource namessides
- part of the resource namesresourceEnding
- part of the resource names
java.io.IOException
- if the resources fail to loadpublic static ImageData[] createCubeMapData(java.lang.String resourcePrefix, java.lang.String[] sides, java.lang.String resourceEnding) throws java.io.IOException
resourcePrefix+sides[i=0..5]+resourceEndingThe order of the 6 images is the same as for the other CubeMap methods: {"bk","ft","dn","up","lf","rt"}
resourcePrefix
- part of the resource namessides
- part of the resource namesresourceEnding
- part of the resource names
ImageData
s
java.io.IOException
- if the resources fail to loadpublic static ImageData[] createCubeMapData(Input zipFile) throws java.io.IOException
java.io.IOException
public static ImageData createPointSprite(int textureSize, double[] lightDirection, java.awt.Color diffuseColor, java.awt.Color specularColor, double specularExponent)
public static void removeReflectionMap(Appearance app, java.lang.String shader)
public static void removeTexture(Appearance app, java.lang.String shader)
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
public static boolean hasReflectionMap(EffectiveAppearance ea, java.lang.String shader)
public static boolean hasReflectionMap(Appearance app, java.lang.String shader)
public static void setBackgroundTexture(Appearance rootApp, ImageData id)
public static Texture2D getBackgroundTexture(Appearance rootApp)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |