Package com.jme3.environment.baker
Class GenericEnvBaker
java.lang.Object
com.jme3.environment.baker.GenericEnvBaker
- All Implemented Interfaces:
- EnvBaker
- Direct Known Subclasses:
- IBLGLEnvBaker,- IBLHybridEnvBakerLight
Render the environment into a cubemap
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final AssetManagerprotected static Vector3f[]protected static Vector3f[]protected static Vector3f[]protected List<ByteArrayOutputStream>protected final Cameraprotected Image.Formatprotected TextureCubeMapprotected final RenderManagerprotected boolean
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedGenericEnvBaker(RenderManager rm, AssetManager am, Image.Format colorFormat, Image.Format depthFormat, int env_size) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidbakeEnvironment(Spatial scene, Vector3f position, float frustumNear, float frustumFar, Predicate<Geometry> filter) Bakes the environment.voidclean()Cleans the environment baker This method should be called when the baker is no longer needed It will clean up all the resources.protected voidendPulling(Texture tx) Ends pulling the data into the textureGets the environment map.booleanGets if textures should be pulled from the GPU.protected intlimitMips(int nbMipMaps, int baseW, int baseH, RenderManager rm) protected ByteBufferpull(FrameBuffer fb, Texture env, int faceId) Pulls the data from the framebuffer into the texture Nb.voidsetTexturePulling(boolean v) Specifies whether textures should be pulled from the GPU.protected voidStarts pulling the data from the framebuffer into the texture.protected CameraupdateAndGetInternalCamera(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.
- 
Field Details- 
axisX
- 
axisY
- 
axisZ
- 
envMap
- 
depthFormat
- 
renderManager
- 
assetManager
- 
cam
- 
texturePullingprotected boolean texturePulling
- 
bos
 
- 
- 
Constructor Details- 
GenericEnvBakerprotected GenericEnvBaker(RenderManager rm, AssetManager am, Image.Format colorFormat, Image.Format depthFormat, int env_size) 
 
- 
- 
Method Details- 
setTexturePullingpublic void setTexturePulling(boolean v) Description copied from interface:EnvBakerSpecifies whether textures should be pulled from the GPU.- Specified by:
- setTexturePullingin interface- EnvBaker
 
- 
isTexturePullingpublic boolean isTexturePulling()Description copied from interface:EnvBakerGets if textures should be pulled from the GPU.- Specified by:
- isTexturePullingin interface- EnvBaker
- Returns:
 
- 
getEnvMapDescription copied from interface:EnvBakerGets the environment map.
- 
updateAndGetInternalCameraprotected 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
 
- 
cleanpublic void clean()Description copied from interface:EnvBakerCleans the environment baker This method should be called when the baker is no longer needed It will clean up all the resources.
- 
bakeEnvironmentpublic void bakeEnvironment(Spatial scene, Vector3f position, float frustumNear, float frustumFar, Predicate<Geometry> filter) Description copied from interface:EnvBakerBakes the environment.- Specified by:
- bakeEnvironmentin 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
 
- 
startPullingprotected void startPulling()Starts pulling the data from the framebuffer into the texture.
- 
pullPulls 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
 
- 
endPullingEnds pulling the data into the texture- Parameters:
- tx- the texture to pull into
 
- 
limitMips
 
-