Texture¶
-
class
pyrender.Texture(name=None, sampler=None, source=None, source_channels=None, width=None, height=None, tex_type=GL_TEXTURE_2D, data_format=GL_UNSIGNED_BYTE)[source]¶ Bases:
objectA texture and its sampler.
Parameters: - name (str, optional) – The user-defined name of this object.
- sampler (
Sampler) – The sampler used by this texture. - source ((h,w,c) uint8 or (h,w,c) float or
PIL.Image.Image) – The image used by this texture. If None, the texture is created empty and width and height must be specified. - source_channels (str) – Either D, R, RG, GB, RGB, or RGBA. Indicates the channels to extract from source. Any missing channels will be filled with 1.0.
- width (int, optional) – For empty textures, the width of the texture buffer.
- height (int, optional) – For empty textures, the height of the texture buffer.
- tex_type (int) – Either GL_TEXTURE_2D or GL_TEXTURE_CUBE.
- data_format (int) – For now, just GL_FLOAT.
Attributes Summary
data_formatThe format of the texture data. heightThe height of the texture buffer. nameThe user-defined name of this object. samplerThe sampler used by this texture. sourceThe image used in this texture. source_channelsThe channels that were extracted from the original source. tex_typeThe type of the texture. widthThe width of the texture buffer. Methods Summary
delete()Remove this texture from the OpenGL context. is_transparent([cutoff])bool : If True, the texture is partially transparent. Attributes Documentation
-
source¶ The image used in this texture.
Type: (h,w,c) uint8 or float or PIL.Image.Image
Methods Documentation