Class GenericEnvBaker

java.lang.Object
com.jme3.environment.baker.GenericEnvBaker
All Implemented Interfaces:
EnvBaker
Direct Known Subclasses:
IBLGLEnvBaker, IBLHybridEnvBakerLight

public abstract class GenericEnvBaker extends Object implements EnvBaker
Render the environment into a cubemap
  • Field Details

  • Constructor Details

  • Method Details

    • setTexturePulling

      public void setTexturePulling(boolean v)
      Description copied from interface: EnvBaker
      Specifies whether textures should be pulled from the GPU.
      Specified by:
      setTexturePulling in interface EnvBaker
    • isTexturePulling

      public boolean isTexturePulling()
      Description copied from interface: EnvBaker
      Gets if textures should be pulled from the GPU.
      Specified by:
      isTexturePulling in interface EnvBaker
      Returns:
    • getEnvMap

      public TextureCubeMap getEnvMap()
      Description copied from interface: EnvBaker
      Gets the environment map.
      Specified by:
      getEnvMap in interface EnvBaker
      Returns:
      The environment map
    • updateAndGetInternalCamera

      protected Camera updateAndGetInternalCamera(int faceId, int w, int h, Vector3f position, float frustumNear, float frustumFar)
      Updates the internal camera to face the given cubemap face and return it.
      Parameters:
      faceId - the id of the face (0-5)
      w - width of the camera
      h - height of the camera
      position - position of the camera
      frustumNear - near frustum
      frustumFar - far frustum
      Returns:
      The updated camera
    • clean

      public void clean()
      Description copied from interface: EnvBaker
      Cleans the environment baker This method should be called when the baker is no longer needed It will clean up all the resources.
      Specified by:
      clean in interface EnvBaker
    • bakeEnvironment

      public void bakeEnvironment(Spatial scene, Vector3f position, float frustumNear, float frustumFar, Predicate<Geometry> filter)
      Description copied from interface: EnvBaker
      Bakes the environment.
      Specified by:
      bakeEnvironment in interface EnvBaker
      Parameters:
      scene - The scene to bake
      position - The position of the camera
      frustumNear - The near frustum
      frustumFar - The far frustum
      filter - A filter to select which geometries to bake
    • startPulling

      protected void startPulling()
      Starts pulling the data from the framebuffer into the texture.
    • pull

      protected ByteBuffer pull(FrameBuffer fb, Texture env, int faceId)
      Pulls the data from the framebuffer into the texture Nb. mipmaps must be pulled sequentially on the same faceId.
      Parameters:
      fb - the framebuffer to pull from
      env - the texture to pull into
      faceId - id of face if cubemap or 0 otherwise
      Returns:
      the ByteBuffer containing the pulled data
    • endPulling

      protected void endPulling(Texture tx)
      Ends pulling the data into the texture
      Parameters:
      tx - the texture to pull into
    • limitMips

      protected int limitMips(int nbMipMaps, int baseW, int baseH, RenderManager rm)