Package com.jme3.environment.generation
Class PrefilteredEnvMapFaceGenerator
java.lang.Object
com.jme3.environment.generation.RunnableWithProgress
com.jme3.environment.generation.PrefilteredEnvMapFaceGenerator
- All Implemented Interfaces:
Runnable
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.
-
Field Summary
Fields inherited from class com.jme3.environment.generation.RunnableWithProgress
listener
-
Constructor Summary
ConstructorDescriptionPrefilteredEnvMapFaceGenerator
(Application app, int face, JobProgressListener<Integer> listener) Creates a pem generator for the given face. -
Method Summary
Modifier and TypeMethodDescriptionimportanceSampleGGX
(Vector4f xi, float a2, Vector3f store) Computes GGX half vector in local spacevoid
run()
void
setGenerationParam
(TextureCubeMap sourceMap, int targetMapSize, EnvMapUtils.FixSeamsMethod fixSeamsMethod, EnvMapUtils.GenerationType genType, TextureCubeMap store) Fills all the generation parametersMethods inherited from class com.jme3.environment.generation.RunnableWithProgress
getProgress, progress, reset, setEnd
-
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.- Parameters:
app
- the Applicationface
- the face to generatelistener
- 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- Parameters:
sourceMap
- the source cube maptargetMapSize
- the size of the generated map (width or height in pixel)fixSeamsMethod
- the method used to fix seams as described inEnvMapUtils.FixSeamsMethod
genType
- select Fast or HighQualitystore
- The cube map to store the result in.
-
run
public void run() -
importanceSampleGGX
Computes GGX half vector in local space- Parameters:
xi
- (not null)a2
- fourth power of roughnessstore
- caller-provided storage- Returns:
- either store or a new vector (not null)
-