Search in sources :

Example 6 with ImageFormat

use of com.jme3.opencl.Image.ImageFormat in project jmonkeyengine by jMonkeyEngine.

the class EnvironmentCamera method initialize.

@Override
protected void initialize(Application app) {
    this.backGroundColor = app.getViewPort().getBackgroundColor();
    final Camera[] cameras = new Camera[6];
    Texture2D[] textures = new Texture2D[6];
    viewports = new ViewPort[6];
    framebuffers = new FrameBuffer[6];
    buffers = new ByteBuffer[6];
    images = new Image[6];
    for (int i = 0; i < 6; i++) {
        cameras[i] = createOffCamera(size, position, axisX[i], axisY[i], axisZ[i]);
        viewports[i] = createOffViewPort("EnvView" + i, cameras[i]);
        framebuffers[i] = createOffScreenFrameBuffer(size, viewports[i]);
        textures[i] = new Texture2D(size, size, imageFormat);
        framebuffers[i].setColorTexture(textures[i]);
    }
}
Also used : Texture2D(com.jme3.texture.Texture2D) Camera(com.jme3.renderer.Camera)

Aggregations

TextureCubeMap (com.jme3.texture.TextureCubeMap)3 ImageFormat (com.jme3.opencl.Image.ImageFormat)2 Camera (com.jme3.renderer.Camera)1 VertexBuffer (com.jme3.scene.VertexBuffer)1 FrameBuffer (com.jme3.texture.FrameBuffer)1 Image (com.jme3.texture.Image)1 Texture2D (com.jme3.texture.Texture2D)1 CLImageFormat (com.jogamp.opencl.CLImageFormat)1 ByteBuffer (java.nio.ByteBuffer)1 IntBuffer (java.nio.IntBuffer)1