I have a couple questions about glTexParameter and filtering
1) What is the scope when applying a glTexParameter (specifically the filtering)? Here’s a scenario:
- Bind a texture. Set the filters to LINEAR
- Set the texture to “Sampler1” of a shader
- Bind another texture. Set its filters to NEAREST
- Set that texture to “Sampler2” of a shader
- Draw
When I use the textures in a shader, will one be linear and the other be nearest? Or will they both be nearest because it was called last?
2) Is it possible to set the filtering method in GLSL?
1) Filtering mode is a parameter of the texture object, i.e. the filtering mode will only apply to the texture objects that has been active when setting the filter mode.
2) Filtering mode is a parameter of the sampler that must be constant during the whole shader execution. As such it can not be changed from within the shader. However it is possible to address individual texture levels and samples w/o any filtering applied, which can be used to implement custom filtering methods (though those will be much less performant).