|
|
|
|
|
Description |
Textures are type safe in GPipe, e.g. when you sample a RGBFormat texture, you get an RGB value.
Textures are either created directly from memory, or by giving a framebuffer a concrete size (which
it otherwise don't have). The latter is however not possible for 3D textures.
Depth textures are textures that contains depth component data (of type DepthFormat) but takes the type
of LuminanceFormat or AlphaFormat textures, and are sampled as such.
|
|
Synopsis |
|
|
|
|
Data types
|
|
|
A 3D texture. May only be created from main memory in GPipe.
Texture3D f has the following associated types in its Texture instance:
- TextureFormat (Texture3D f)
- f
- TextureSize (Texture3D f)
- Vec3 Int
- TextureVertexCoord (Texture3D f)
- Vec3 (Vertex Float)
- TextureFragmentCoord (Texture3D f)
- Vec3 (Fragment Float)
| Instances | |
|
|
|
|
|
|
A 1D texture. Assumes a frame buffer of height 1 when created from such.
Texture1D f has the following associated types in its Texture instance:
- TextureFormat (Texture1D f)
- f
- TextureSize (Texture1D f)
- Int
- TextureVertexCoord (Texture1D f)
- Vertex Float
- TextureFragmentCoord (Texture1D f)
- Fragment Float
| Instances | |
|
|
|
A cube texture. The sides of the cube are always specified in this order: Positive X, negative X,
positive Y, negative Y, positive Z, negative Z.
TextureCube f has the following associated types in its Texture instance:
- TextureFormat (TextureCube f)
- f
- TextureSize (TextureCube f)
- Vec2 Int (The size of each side)
- TextureVertexCoord (TextureCube f)
- Vec3 (Vertex Float)
- TextureFragmentCoord (TextureCube f)
- Vec3 (Fragment Float)
| Instances | |
|
|
Operation
|
|
|
| Associated Types | | The color format of the texture, affects the type of the samples from the texture.
|
| | | The type that is used for the dimension of texture.
|
| | type TextureVertexCoord t | Source |
| The sample coordinate in Vertexs.
|
| | type TextureFragmentCoord t | Source |
| |
| | Methods | | Calculates the byte size of all mipmaps for a specific format and size, which eases the useage of
newTexture and newDepthTexture.
| | | Samples the texture using mipmaps in a Fragment.
| | | Samples the texture using mipmaps in a Fragment, with a bias to add to the mipmap level.
| | | Samples the texture using a specific mipmap in a Vertex.
|
| | Instances | |
|
|
Creation
|
|
|
:: (Texture t, GPUFormat (TextureFormat t)) | | => CPUFormat (TextureFormat t) | The format of the data in the provided Ptr's.
| -> TextureFormat t | The format of the resulting texture on the GPU.
| -> TextureSize t | The dimension of the texture.
| -> [Ptr a] | A list of Ptr's for each mipmap of the texture (you may provide as many as you want).
For TextureCube, this list starts with all mipmaps of the first side, then the mipmaps
of the second, and so on. In this case all sides must have the same number of mipmaps.
All rows and depth levels are tightly packed, i.e. no padding between them and 1 byte alignment.
| -> IO t | | Creates a texture from color data in main memory. It lives in the IO monad for the sake of the Ptr's, and could otherwise safely be wrapped in unsafePerformIO calls.
|
|
|
|
:: (Texture t, DepthColorFormat (TextureFormat t)) | | => CPUFormat (TextureFormat t) | The format of the data in the provided Ptr's.
| -> DepthFormat | The depth format of the resulting texture on the GPU.
| -> TextureSize t | The dimension of the texture.
| -> [Ptr a] | A list of Ptr's for each mipmap of the texture (you may provide as many as you want).
For TextureCube, this list starts with all mipmaps of the first side, then the mipmaps
of the second, and so on. In this case all sides must have the same number of mipmaps.
All rows and depth levels are tightly packed, i.e. no padding between them and 1 byte alignment.
| -> IO t | | Creates a depth texture from data in main memory. The texture will have the type of a color format and is sampled as such, but contains depth
component information internally. It lives in the IO monad for the sake of the Ptr's, and could otherwise safely be wrapped in unsafePerformIO calls.
|
|
|
|
The textures that is instances of this class may be created from a FrameBuffers color buffer.
| | Methods | | Create a texture of a specific format from a FrameBuffer and a size.
|
| | Instances | |
|
|
|
The textures that is instances of this class may be created from a FrameBuffers depth buffer.
The texture will have the type of a color format and is sampled as such, but contains depth
component information internally.
| | Methods | | Create a texture of a specific depth format from a FrameBuffer and a size.
|
| | Instances | |
|
|
|
|
|
|
Create a TextureCube of a specific format and size from the the color buffers of six framebuffers.
|
|
|
Create a TextureCube of a specific depth format and size from the the depth buffers of six framebuffers.
The texture will have the type of a color format and is sampled as such, but contains depth
component information internally.
|
|
Samplers
|
|
|
A structure describing how a texture is sampled
| Constructors | | Instances | |
|
|
|
Filter mode used in sampler state
| Constructors | | Instances | |
|
|
|
Edge mode used in sampler state
| Constructors | | Instances | |
|
|
Produced by Haddock version 2.4.2 |