Class PrefilteredEnvMapFaceGenerator

All Implemented Interfaces:

public class PrefilteredEnvMapFaceGenerator extends RunnableWithProgress
Generates one face of the prefiltered environment map for PBR. This job can be launched from a separate thread.

TODO there is a lot of duplicate code here with the EnvMapUtils.

  • Constructor Details

    • PrefilteredEnvMapFaceGenerator

      public PrefilteredEnvMapFaceGenerator(Application app, int face, JobProgressListener<Integer> listener)
      Creates a pem generator for the given face. The app is needed to enqueue the call to the EnvironmentCamera when the generation is done, so that this process is thread safe.
      app - the Application
      face - the face to generate
      listener - to monitor progress (alias created)
  • Method Details

    • setGenerationParam

      public void setGenerationParam(TextureCubeMap sourceMap, int targetMapSize, EnvMapUtils.FixSeamsMethod fixSeamsMethod, EnvMapUtils.GenerationType genType, TextureCubeMap store)
      Fills all the generation parameters
      sourceMap - the source cube map
      targetMapSize - the size of the generated map (width or height in pixel)
      fixSeamsMethod - the method used to fix seams as described in EnvMapUtils.FixSeamsMethod
      genType - select Fast or HighQuality
      store - The cube map to store the result in.
    • run

      public void run()
    • importanceSampleGGX

      public Vector3f importanceSampleGGX(Vector4f xi, float a2, Vector3f store)
      Computes GGX half vector in local space
      xi - (not null)
      a2 - fourth power of roughness
      store - caller-provided storage
      either store or a new vector (not null)