-
public class Texture.BuilderUse
Builderto construct aTextureobject instance.
-
-
Constructor Summary
Constructors Constructor Description Texture.Builder()Use Builderto construct aTextureobject instance.
-
Method Summary
Modifier and Type Method Description Texture.Builderwidth(@IntRange(from = 1) int width)Specifies the width of the texture in texels. Texture.Builderheight(@IntRange(from = 1) int height)Specifies the height of the texture in texels. Texture.Builderdepth(@IntRange(from = 1) int depth)Specifies the texture's number of layers. Texture.Builderlevels(@IntRange(from = 1) int levels)Specifies the number of mipmap levels Texture.Buildersampler(@NonNull() Texture.Sampler target)Specifies the type of sampler to use. Texture.Builderformat(@NonNull() Texture.InternalFormat format)Specifies the texture's internal format. Texture.Builderusage(int flags)Sets the usage flags, which is necessary when attaching to RenderTarget. Texture.Builderswizzle(@NonNull() Texture.Swizzle r, @NonNull() Texture.Swizzle g, @NonNull() Texture.Swizzle b, @NonNull() Texture.Swizzle a)Specifies how a texture's channels map to color components Texture.BuilderimportTexture(long id)Specify a native texture to import as a Filament texture. Texturebuild(@NonNull() Engine engine)Creates a new Textureinstance.-
-
Method Detail
-
width
@NonNull() Texture.Builder width(@IntRange(from = 1) int width)
Specifies the width of the texture in texels.
- Parameters:
width- texture width in texels, must be at least 1.
-
height
@NonNull() Texture.Builder height(@IntRange(from = 1) int height)
Specifies the height of the texture in texels.
- Parameters:
height- texture height in texels, must be at least 1.
-
depth
@NonNull() Texture.Builder depth(@IntRange(from = 1) int depth)
Specifies the texture's number of layers. Values greater than 1 create a 3D texture.
This
Textureinstance must use SAMPLER_2D_ARRAY or it has no effect.- Parameters:
depth- texture number of layers.
-
levels
@NonNull() Texture.Builder levels(@IntRange(from = 1) int levels)
Specifies the number of mipmap levels
- Parameters:
levels- must be at least 1 and less or equal tofloor(log2(max(width, height))) + 1.
-
sampler
@NonNull() Texture.Builder sampler(@NonNull() Texture.Sampler target)
Specifies the type of sampler to use.
- Parameters:
target- Sampler type
-
format
@NonNull() Texture.Builder format(@NonNull() Texture.InternalFormat format)
Specifies the texture's internal format.
The internal format specifies how texels are stored (which may be different from howthey're specified in setImage). InternalFormat specifiesboth the color components and the data type used.
- Parameters:
format- texture's internal format.
-
usage
@NonNull() Texture.Builder usage(int flags)
Sets the usage flags, which is necessary when attaching to RenderTarget.The flags argument much be a combination of Usage flags.
-
swizzle
@NonNull() Texture.Builder swizzle(@NonNull() Texture.Swizzle r, @NonNull() Texture.Swizzle g, @NonNull() Texture.Swizzle b, @NonNull() Texture.Swizzle a)
Specifies how a texture's channels map to color components
- Parameters:
r- texture channel for red componentg- texture channel for green componentb- texture channel for blue componenta- texture channel for alpha component
-
importTexture
@NonNull() Texture.Builder importTexture(long id)
Specify a native texture to import as a Filament texture.
The texture id is backend-specific:
- OpenGL: GLuint texture ID
- Parameters:
id- a backend specific texture identifier
-
-
-
-