本文整理汇总了Java中com.jme3.texture.Image.Format.Luminance8方法的典型用法代码示例。如果您正苦于以下问题:Java Format.Luminance8方法的具体用法?Java Format.Luminance8怎么用?Java Format.Luminance8使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.texture.Image.Format
的用法示例。
在下文中一共展示了Format.Luminance8方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateNormalMap
import com.jme3.texture.Image.Format; //导入方法依赖的package包/类
/**
* Generates a normal map from a base texture. The normal map is based
* on a displacement map that is automatically generated beforehand. Both
* maps are printed as images.
*
* @param tex The texture used as base.
* @param flipX Used to flip the texture.
* @param flipY Used to flip the texture.
* @param normalStrength Edges becomes more accented with a higher normalStrength.
*/
public void generateNormalMap(Texture tex, boolean flipX, boolean flipY, float normalStrength){
this.normalStrength = normalStrength;
float[] disp = generateDispMap(tex,flipX,flipY);
byte[] normals = generateNormMap(disp);
byte[] dispByte = new byte[disp.length];
for(int i = 0; i < disp.length; i++){
dispByte[i] = (byte) (disp[i]*255);
}
//Don't print another displacement map if image uses a grayscale format.
if(tex.getImage().getFormat() != Format.Luminance8 &&
tex.getImage().getFormat() != Format.Luminance16F){
printImage(dispByte,1,tex);
}
printImage(normals,3,tex);
}
示例2: UDGrassProvider
import com.jme3.texture.Image.Format; //导入方法依赖的package包/类
public UDGrassProvider(GrassLoader grassLoader){
this.grassLoader = grassLoader;
int size = grassLoader.getTileSize();
byte[] array = new byte[size*size];
for(int i = 0; i < array.length; i++){
array[i] = (byte)127;
}
ByteBuffer buf = BufferUtils.createByteBuffer(array.length);
Image image = new Image(Format.Luminance8,size,size,buf);
Texture tex = new Texture2D();
tex.setImage(image);
tex.setName("UDGrassTex");
map = new DensityMap(tex,size);
}
示例3: makecheckerpattern
import com.jme3.texture.Image.Format; //导入方法依赖的package包/类
/**
* Makes the checkered pattern image.
*
* A sequence of bytes is written to a buffer and interpreted as an 8-bit
* grayscale image.
*
* @param reverse When true, the image will be inverse of normal (black
* texels will be white and vice versa).
* @return Image object for this texture.
*
* @author ccfreak2k
*/
private Image makecheckerpattern(boolean reverse) {
// I forgot how to flatten 2D loops into 1D arrays :(
byte check_pattern[] = new byte[screen_x*screen_y];
boolean white = false;
int k = 0;
if (reverse) {
white = !white;
}
for (int i = 0; i < screen_y; i++) {
for (int j = 0; j < screen_x; j++) {
white = !white;
if (white) {
check_pattern[k] = (byte)0xFF;
} else {
check_pattern[k] = (byte)0x00;
}
k++;
}
white = !white;
}
ByteBuffer tempData = BufferUtils.createByteBuffer(screen_x*screen_y);
tempData.put(check_pattern).flip();
return new Image(Format.Luminance8, screen_x, screen_y, tempData);
}
示例4: initialize
import com.jme3.texture.Image.Format; //导入方法依赖的package包/类
public void initialize(RenderManager rm, ViewPort vp){
if (!enabled)
return;
renderer = rm.getRenderer();
renderManager = rm;
viewPort = vp;
// loadInitial()
fsQuad = new Picture("HDR Fullscreen Quad");
Format lumFmt = Format.Luminance8;
scene64FB = new FrameBuffer(64, 64, 1);
scene64 = new Texture2D(64, 64, lumFmt);
scene64FB.setColorTexture(scene64);
scene64.setMagFilter(fbMagFilter);
scene64.setMinFilter(fbMinFilter);
scene8FB = new FrameBuffer(8, 8, 1);
scene8 = new Texture2D(8, 8, lumFmt);
scene8FB.setColorTexture(scene8);
scene8.setMagFilter(fbMagFilter);
scene8.setMinFilter(fbMinFilter);
scene1FB[0] = new FrameBuffer(1, 1, 1);
scene1[0] = new Texture2D(1, 1, lumFmt);
scene1FB[0].setColorTexture(scene1[0]);
scene1FB[1] = new FrameBuffer(1, 1, 1);
scene1[1] = new Texture2D(1, 1, lumFmt);
scene1FB[1].setColorTexture(scene1[1]);
// prepare tonemap shader
tone = new Material(manager, "Common/MatDefs/Hdr/ToneMap.j3md");
tone.setFloat("A", 0.18f);
tone.setFloat("White", 100);
// load();
int w = vp.getCamera().getWidth();
int h = vp.getCamera().getHeight();
reshape(vp, w, h);
}
示例5: TextureGeneratorWood
import com.jme3.texture.Image.Format; //导入方法依赖的package包/类
/**
* Constructor stores the given noise generator.
* @param noiseGenerator
* the noise generator
*/
public TextureGeneratorWood(NoiseGenerator noiseGenerator) {
super(noiseGenerator, Format.Luminance8);
}
示例6: TextureGeneratorMusgrave
import com.jme3.texture.Image.Format; //导入方法依赖的package包/类
/**
* Constructor stores the given noise generator.
* @param noiseGenerator
* the noise generator
*/
public TextureGeneratorMusgrave(NoiseGenerator noiseGenerator) {
super(noiseGenerator, Format.Luminance8);
}
示例7: TextureGeneratorNoise
import com.jme3.texture.Image.Format; //导入方法依赖的package包/类
/**
* Constructor stores the given noise generator.
* @param noiseGenerator
* the noise generator
*/
public TextureGeneratorNoise(NoiseGenerator noiseGenerator) {
super(noiseGenerator, Format.Luminance8);
}
示例8: TextureGeneratorStucci
import com.jme3.texture.Image.Format; //导入方法依赖的package包/类
/**
* Constructor stores the given noise generator.
* @param noiseGenerator
* the noise generator
*/
public TextureGeneratorStucci(NoiseGenerator noiseGenerator) {
super(noiseGenerator, Format.Luminance8);
}
示例9: TextureGeneratorVoronoi
import com.jme3.texture.Image.Format; //导入方法依赖的package包/类
/**
* Constructor stores the given noise generator.
* @param noiseGenerator
* the noise generator
*/
public TextureGeneratorVoronoi(NoiseGenerator noiseGenerator) {
super(noiseGenerator, Format.Luminance8);
}
示例10: TextureGeneratorDistnoise
import com.jme3.texture.Image.Format; //导入方法依赖的package包/类
/**
* Constructor stores the given noise generator.
* @param noiseGenerator
* the noise generator
*/
public TextureGeneratorDistnoise(NoiseGenerator noiseGenerator) {
super(noiseGenerator, Format.Luminance8);
}
示例11: TextureGeneratorClouds
import com.jme3.texture.Image.Format; //导入方法依赖的package包/类
/**
* Constructor stores the given noise generator.
* @param noiseGenerator
* the noise generator
*/
public TextureGeneratorClouds(NoiseGenerator noiseGenerator) {
super(noiseGenerator, Format.Luminance8);
}
示例12: TextureGeneratorBlend
import com.jme3.texture.Image.Format; //导入方法依赖的package包/类
/**
* Constructor stores the given noise generator.
* @param noiseGenerator
* the noise generator
*/
public TextureGeneratorBlend(NoiseGenerator noiseGenerator) {
super(noiseGenerator, Format.Luminance8);
}