Open topic with navigation
<texture>.filter
This will change the filter mode of the texture
<texture>.filter( |
|
parameter |
mode |
) |
|
parameter
This can be either viz.MIN_FILTER or viz.MAG_FILTER
mode
This can be one of the following values:
viz.LINEAR
viz.LINEAR_MIPMAP_LINEAR
viz.LINEAR_MIPMAP_NEAREST
viz.NEAREST
viz.NEAREST_MIPMAP_LINEAR
viz.NEAREST_MIPMAP_NEAREST
Remarks
Use this command to change the OpenGL filter mode of the texture. It wraps some the functionality of the OpenGL glTexParameter() function.
When the texture is shrunk to fit on the object the specified min filter algorithm is used. Possible values are all of the above. Default is NEAREST_MIPMAP_LINEAR.
When the texture is magnified to fit on an object the specified MAG_FILTER is used. Possible values are LINEAR and NEAREST. Default is LINEAR.
When a texture uses MIPMAP rendering speed is increased and artifacts are reduced at the cost of using more texture memory.
If a texture is using NEAREST filtering it will appear sharper. If using LINEAR, it will appear blurrier.
Return Value
None
Example
tex = viz.addTexture('picture.jpg')
# Disable mipmapping of the texture
tex.filter(viz.MIN_FILTER,viz.NEAREST)
tex.filter(viz.MAG_FILTER,viz.NEAREST)
See also