I have a texture which I’m using at multiple instances throughout my program.
At each instance I’m applying different texture parameters, which would effectively overwrite each other and generally just cause each other problems.
Is there a way to have multiple texture buffers pointing to the same texture, but with different parameters?
Or what would be the best way of proceeding without having to copy the entire texture?
You can either set different sampler objects (see glGenSamplers and friends) while keeping your texture bound (parameters on the sampler object take precedence over those set on the texture) or use texture views (see glTextureView) to share the storage.
[QUOTE=Silverlan;1255792]Is there a way to have multiple texture buffers pointing to the same texture, but with different parameters?
Or what would be the best way of proceeding without having to copy the entire texture?[/QUOTE]
Samplers (OpenGL 3.3 and higher) allow you to store the sampling state (filter modes, wrap modes, min/max LoD, LoD bias, compare function/mode and border colour) separately from the texture. When a sampler is bound to a texture unit, the sampler state overrides the equivalent state stored in the texture.
The minimum (base) and maximum mipmap levels and the R/G/B/A swizzle state are properties of the texture itself and can’t be overridden via samplers.