Java 类com.badlogic.gdx.graphics.Cubemap 实例源码

项目:ChessGDX    文件:AssetHandler.java   
/**
 * @return Cubemap used for the environmental cubemap
 */
public Cubemap getCubeMap() {
    if (mCubemap == null) {
        Texture back = mAssetManager.get("3D/cubemap/background_back.jpg", Texture.class);
        Texture front = mAssetManager.get("3D/cubemap/background_front.jpg", Texture.class);
        Texture up = mAssetManager.get("3D/cubemap/background_up.jpg", Texture.class);
        Texture down = mAssetManager.get("3D/cubemap/background_down.jpg", Texture.class);
        Texture left = mAssetManager.get("3D/cubemap/background_left.jpg", Texture.class);
        Texture right = mAssetManager.get("3D/cubemap/background_right.jpg", Texture.class);

        FacedCubemapData data = new FacedCubemapData(right.getTextureData(), left.getTextureData(), up.getTextureData(),
                down.getTextureData(), front.getTextureData(), back.getTextureData());
        return new Cubemap(data);
    } else {
        return mCubemap;
    }
}
项目:libgdxcn    文件:AndroidGraphics.java   
@Override
public void onSurfaceCreated (javax.microedition.khronos.opengles.GL10 gl, EGLConfig config) {
    eglContext = ((EGL10)EGLContext.getEGL()).eglGetCurrentContext();
    setupGL(gl);
    logConfig(config);
    updatePpi();

    Mesh.invalidateAllMeshes(app);
    Texture.invalidateAllTextures(app);
    Cubemap.invalidateAllCubemaps(app);
    ShaderProgram.invalidateAllShaderPrograms(app);
    FrameBuffer.invalidateAllFrameBuffers(app);

    logManagedCachesStatus();

    Display display = app.getWindowManager().getDefaultDisplay();
    this.width = display.getWidth();
    this.height = display.getHeight();
    this.mean = new WindowedMean(5);
    this.lastFrameTime = System.nanoTime();

    gl.glViewport(0, 0, this.width, this.height);
}
项目:ZombieInvadersVR    文件:CardBoardGraphics.java   
@Override
public void onSurfaceCreated (EGLConfig config) {
   eglContext = ((EGL10)EGLContext.getEGL()).eglGetCurrentContext();
   setupGL();
   logConfig(config);
   updatePpi();

   Mesh.invalidateAllMeshes(app);
   Texture.invalidateAllTextures(app);
   Cubemap.invalidateAllCubemaps(app);
   ShaderProgram.invalidateAllShaderPrograms(app);
   FrameBuffer.invalidateAllFrameBuffers(app);

   logManagedCachesStatus();

   Point outSize = new Point();
   Display display = app.getWindowManager().getDefaultDisplay();
   display.getSize(outSize);
   this.width = outSize.x;
   this.height = outSize.y;
   this.mean = new WindowedMean(5);
   this.lastFrameTime = System.nanoTime();

   gl20.glViewport(0, 0, this.width, this.height);
}
项目:ZombieInvadersVR    文件:CardBoardGraphics.java   
public void clearManagedCaches () {
   Mesh.clearAllMeshes(app);
   Texture.clearAllTextures(app);
   Cubemap.clearAllCubemaps(app);
   ShaderProgram.clearAllShaderPrograms(app);
   FrameBuffer.clearAllFrameBuffers(app);

   logManagedCachesStatus();
}
项目:ZombieInvadersVR    文件:CardBoardGraphics.java   
protected void logManagedCachesStatus () {
   Gdx.app.log(LOG_TAG, Mesh.getManagedStatus());
   Gdx.app.log(LOG_TAG, Texture.getManagedStatus());
   Gdx.app.log(LOG_TAG, Cubemap.getManagedStatus());
   Gdx.app.log(LOG_TAG, ShaderProgram.getManagedStatus());
   Gdx.app.log(LOG_TAG, FrameBuffer.getManagedStatus());
}
项目:LibGDX-PBR    文件:PBRShader.java   
public void loadReflection(String refl){
    ref=new Cubemap(Gdx.files.internal("cubemaps/" + refl + "_c00.bmp"), Gdx.files.internal("cubemaps/" + refl + "_c01.bmp"),
            Gdx.files.internal("cubemaps/" + refl + "_c02.bmp"), Gdx.files.internal("cubemaps/" + refl + "_c03.bmp"),
            Gdx.files.internal("cubemaps/" + refl + "_c04.bmp"), Gdx.files.internal("cubemaps/" + refl + "_c05.bmp"));
    ref.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
    ref.setWrap(Texture.TextureWrap.ClampToEdge, Texture.TextureWrap.ClampToEdge);
}
项目:LibGDX-PBR    文件:PBRSadherTexture.java   
public void loadReflection(String refl){
    ref=new Cubemap(Gdx.files.internal("cubemaps/" + refl + "_c00.bmp"), Gdx.files.internal("cubemaps/" + refl + "_c01.bmp"),
            Gdx.files.internal("cubemaps/" + refl + "_c02.bmp"), Gdx.files.internal("cubemaps/" + refl + "_c03.bmp"),
            Gdx.files.internal("cubemaps/" + refl + "_c04.bmp"), Gdx.files.internal("cubemaps/" + refl + "_c05.bmp"));
    ref.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
    ref.setWrap(Texture.TextureWrap.ClampToEdge, Texture.TextureWrap.ClampToEdge);
}
项目:ForgE    文件:CubemapAsset.java   
@Override
protected Cubemap loadObject(FileHandle file) {
  Array<TextureData> textures = new Array<TextureData>();
  for(String sideName : SIDES) {
    FileHandle sideHandle = Gdx.files.internal(file.pathWithoutExtension() + sideName + "." + file.extension());
    if (sideHandle.exists()) {
      TextureAsset sideAsset = manager.getTexture(sideHandle.file().getAbsolutePath());
      Texture texture        = sideAsset.get();
      addDependency(sideAsset);
      textures.add(texture.getTextureData());
    } else {
      throw new GdxRuntimeException("Could not find " + sideHandle.path());
    }
  }
  Cubemap cm = new Cubemap(
      textures.get(0),
      textures.get(1),
      textures.get(2),
      textures.get(3),
      textures.get(4),
      textures.get(5)
  );

  cm.setWrap(Texture.TextureWrap.ClampToEdge, Texture.TextureWrap.ClampToEdge);
  cm.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
  return cm;
}
项目:libgdxcn    文件:AndroidGraphics.java   
public void clearManagedCaches () {
    Mesh.clearAllMeshes(app);
    Texture.clearAllTextures(app);
    Cubemap.clearAllCubemaps(app);
    ShaderProgram.clearAllShaderPrograms(app);
    FrameBuffer.clearAllFrameBuffers(app);

    logManagedCachesStatus();
}
项目:libgdxcn    文件:AndroidGraphics.java   
protected void logManagedCachesStatus () {
    Gdx.app.log(LOG_TAG, Mesh.getManagedStatus());
    Gdx.app.log(LOG_TAG, Texture.getManagedStatus());
    Gdx.app.log(LOG_TAG, Cubemap.getManagedStatus());
    Gdx.app.log(LOG_TAG, ShaderProgram.getManagedStatus());
    Gdx.app.log(LOG_TAG, FrameBuffer.getManagedStatus());
}
项目:nhglib    文件:IBLAttribute.java   
public static IBLAttribute createIrradiance(final Cubemap cubemap) {
    return new IBLAttribute(IrradianceType, cubemap);
}
项目:nhglib    文件:IBLAttribute.java   
public static IBLAttribute createPrefilter(final Cubemap cubemap) {
    return new IBLAttribute(PrefilterType, cubemap);
}
项目:nhglib    文件:IBLAttribute.java   
public <T extends Cubemap> IBLAttribute(final long type, final TextureDescriptor<T> textureDescription) {
    this(type);
    this.textureDescription.set(textureDescription);
}
项目:nhglib    文件:IBLAttribute.java   
public <T extends Cubemap> IBLAttribute(final long type, final TextureDescriptor<T> textureDescription, int uvIndex) {
    this(type, textureDescription);
    this.uvIndex = uvIndex;
}
项目:nhglib    文件:IBLAttribute.java   
public IBLAttribute(final long type, final Cubemap texture) {
    this(type);
    textureDescription.texture = texture;
}
项目:nhglib    文件:IBLAttribute.java   
public void set(final Cubemap cubemap) {
    textureDescription.texture = cubemap;
}
项目:ForgE    文件:CubemapSkybox.java   
public Cubemap getSkyboxCubemap() {
  if (skyboxCubemap == null) {
    skyboxCubemap = skyboxAsset.get();
  }
  return skyboxCubemap;
}
项目:libgdxcn    文件:CubemapAttribute.java   
public CubemapAttribute (final long type) {
    super(type);
    if (!is(type)) throw new GdxRuntimeException("Invalid type specified");
    textureDescription = new TextureDescriptor<Cubemap>();
}
项目:libgdxcn    文件:CubemapAttribute.java   
public <T extends Cubemap> CubemapAttribute (final long type, final TextureDescriptor<T> textureDescription) {
    this(type);
    this.textureDescription.set(textureDescription);
}
项目:libgdxcn    文件:CubemapAttribute.java   
public CubemapAttribute (final long type, final Cubemap texture) {
    this(type);
    textureDescription.texture = texture;
}