ombra-1.1.0.0: Render engine.

LicenseBSD3
Maintainerziocroc@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Graphics.Rendering.Ombra.Texture

Contents

Description

 

Synopsis

Documentation

class (Monad m, GLES) => MonadTexture m Source #

Minimal complete definition

getTexture, withActiveTextures, newTexture

Instances

GLES => MonadTexture (Draw o) Source # 

Methods

getTexture :: Texture -> Draw o (Either String LoadedTexture)

withActiveTextures :: [Texture] -> (String -> Draw o a) -> ([Sampler2D] -> Draw o a) -> Draw o a

newTexture :: Int -> Int -> TextureParameters -> Int -> (Texture -> GL ()) -> Draw o LoadedTexture

data Texture Source #

A texture.

Instances

mkTexture Source #

Arguments

:: GLES 
=> Int

Width.

-> Int

Height.

-> TextureParameters 
-> [[Color]]

List of pixels, one for each level of detail. The first element is the base image level, the second image is half the size of the base, and so on. Use just one level of detail if you don't want mipmaps, or you used True in the previous argument.

-> Texture 

Creates a Texture from a list of pixels.

mkTextureFloat Source #

Arguments

:: GLES 
=> Int

Width.

-> Int

Height.

-> TextureParameters 
-> [Vec4]

List of vectors.

-> Texture 

Creates a float Texture from a list of vectors.

mkTextureRaw Source #

Arguments

:: GLES 
=> Int

Width.

-> Int

Height.

-> TextureParameters 
-> [UInt8Array]

Array of pixel components, one for each level of detail.

-> Int

Hash of the arrays

-> Texture 

colorTex :: GLES => Color -> Texture Source #

Generate a 1x1 texture.

Parameters

data Filter Source #

Constructors

Linear

Average of the four nearest pixels.

Nearest

Nearest pixel.

Instances

parameters Source #

Arguments

:: Filter

Minification filter

-> Filter

Magnification filter

-> TextureParameters 

potParameters Source #

Arguments

:: (Filter, Maybe Filter)

Minification filter.

-> Filter

Magnification filter.

-> Bool

Generate mipmaps automatically. Do not use mipmaps with GBuffers or DepthBuffers.

-> WrappingFunction

Horizontal wrapping function.

-> WrappingFunction

Vertical wrapping function.

-> TextureParameters 

This function provides more features than parameters, but, on WebGL, the resulting TextureParameters will not work with textures whose width or height is not a power of two.

potLinear Source #

Arguments

:: Bool

Generate mipmaps

-> TextureParameters 

potParameters with linear filters and repeat.