Package gov.nasa.worldwind.render
Class FramebufferTexture
- java.lang.Object
-
- gov.nasa.worldwind.render.FramebufferTexture
-
- All Implemented Interfaces:
WWTexture
- Direct Known Subclasses:
FBOTexture
public class FramebufferTexture extends java.lang.Object implements WWTexture
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<LatLon>cornersprotected static intDEFAULT_TESSELLATION_DENSITYThe default density of texture coordinates to specify for the quadrilateral the texture's applied to.protected intheightprotected Sectorsectorprotected WWTexturesourceTextureprotected inttessellationDensityThe density of explicit texture coordinates to specify for the quadrilateral the texture's applied to.protected com.jogamp.opengl.util.texture.TextureCoordstextureCoordsprotected intwidth
-
Constructor Summary
Constructors Constructor Description FramebufferTexture(WWTexture imageSource, Sector sector, java.util.List<LatLon> corners)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyInternalTransform(DrawContext dc)Applies any necessary transformations to the texture prior to its being rendered.booleanbind(DrawContext dc)Makes this texture the current texture for rendering.protected MatrixcomputeGeographicToCartesianTransform(Sector sector)protected voiddrawQuad(DrawContext dc, BilinearInterpolator interp, int slices, int stacks)protected voiddrawQuad(DrawContext dc, Matrix geoToCartesian, int slices, int stacks)protected booleangenerateTexture(DrawContext dc, int width, int height)java.util.List<LatLon>getCorners()intgetHeight(DrawContext dc)Returns the texture's heightjava.lang.ObjectgetImageSource()Returns the texture's image source.SectorgetSector()protected intgetTessellationDensity()com.jogamp.opengl.util.texture.TextureCoordsgetTexCoords()Returns the texture's texture coordinates, which may be other than [0,0],[1,1] if the texture size is not a power of two or the texture must be flipped when rendered.intgetWidth(DrawContext dc)Returns the texture's width.protected com.jogamp.opengl.util.texture.TextureinitializeTexture(DrawContext dc)booleanisTextureCurrent(DrawContext dc)Indicates whether the texture is currently available for use without regenerating it from its image source.booleanisTextureInitializationFailed()Indicates whether an attempt to initialize the texture failed, which occurs when the image source is a non-existent image file or for other reasons specific to the image source.protected Vec4transformToQuadCoordinates(Matrix geoToCartesian, LatLon latLon)
-
-
-
Field Detail
-
sourceTexture
protected WWTexture sourceTexture
-
sector
protected Sector sector
-
corners
protected java.util.List<LatLon> corners
-
width
protected int width
-
height
protected int height
-
textureCoords
protected com.jogamp.opengl.util.texture.TextureCoords textureCoords
-
tessellationDensity
protected int tessellationDensity
The density of explicit texture coordinates to specify for the quadrilateral the texture's applied to.
-
DEFAULT_TESSELLATION_DENSITY
protected static final int DEFAULT_TESSELLATION_DENSITY
The default density of texture coordinates to specify for the quadrilateral the texture's applied to.- See Also:
- Constant Field Values
-
-
Method Detail
-
getWidth
public int getWidth(DrawContext dc)
Description copied from interface:WWTextureReturns the texture's width.
-
getHeight
public int getHeight(DrawContext dc)
Description copied from interface:WWTextureReturns the texture's height
-
getSector
public Sector getSector()
-
getCorners
public java.util.List<LatLon> getCorners()
-
isTextureCurrent
public boolean isTextureCurrent(DrawContext dc)
Description copied from interface:WWTextureIndicates whether the texture is currently available for use without regenerating it from its image source.- Specified by:
isTextureCurrentin interfaceWWTexture- Parameters:
dc- the current draw context- Returns:
- true if the texture is available and consistent with its image source, otherwise false.
-
getImageSource
public java.lang.Object getImageSource()
Description copied from interface:WWTextureReturns the texture's image source.- Specified by:
getImageSourcein interfaceWWTexture- Returns:
- the texture's image source.
-
getTexCoords
public com.jogamp.opengl.util.texture.TextureCoords getTexCoords()
Description copied from interface:WWTextureReturns the texture's texture coordinates, which may be other than [0,0],[1,1] if the texture size is not a power of two or the texture must be flipped when rendered.- Specified by:
getTexCoordsin interfaceWWTexture- Returns:
- returns the texture's texture coordinates.
-
isTextureInitializationFailed
public boolean isTextureInitializationFailed()
Description copied from interface:WWTextureIndicates whether an attempt to initialize the texture failed, which occurs when the image source is a non-existent image file or for other reasons specific to the image source.- Specified by:
isTextureInitializationFailedin interfaceWWTexture- Returns:
- true if texture initialization failed, otherwise false.
-
bind
public boolean bind(DrawContext dc)
Description copied from interface:WWTextureMakes this texture the current texture for rendering.If the implementing instance's internal texture has not been created from its image source, the implementing class determines when the texture is retrieved and available.
If a texture cannot be created from its image source it cannot be bound. This method returns an indication of whether the texture was bound or was not bound due to a failure during creation.
-
applyInternalTransform
public void applyInternalTransform(DrawContext dc)
Description copied from interface:WWTextureApplies any necessary transformations to the texture prior to its being rendered. A common transformation is mapping texture coordinates from a flipped or non-square state to conventionally oriented OpenGL values.- Specified by:
applyInternalTransformin interfaceWWTexture- Parameters:
dc- the current draw context.
-
getTessellationDensity
protected int getTessellationDensity()
-
initializeTexture
protected com.jogamp.opengl.util.texture.Texture initializeTexture(DrawContext dc)
-
generateTexture
protected boolean generateTexture(DrawContext dc, int width, int height)
-
computeGeographicToCartesianTransform
protected Matrix computeGeographicToCartesianTransform(Sector sector)
-
transformToQuadCoordinates
protected Vec4 transformToQuadCoordinates(Matrix geoToCartesian, LatLon latLon)
-
drawQuad
protected void drawQuad(DrawContext dc, Matrix geoToCartesian, int slices, int stacks)
-
drawQuad
protected void drawQuad(DrawContext dc, BilinearInterpolator interp, int slices, int stacks)
-
-