Texture 2D

Can someone please tell me how to use the “float bias” in the following syntax,

texture2D(sampler2D sampler, vec2 coord[,float bias])

Thank you.

I have never used it but this is from the specs

In all functions below, the bias parameter is optional for fragment shaders. The bias parameter is not
accepted in any other shaders. For a fragment shader, if bias is present, it is added to the implicit level of
detail prior to performing the texture access operation. No bias or lod parameters for rectangular textures,
multi-sample textures, or texture buffers are supported because mip-maps are not allowed for these types
of textures.
The implicit level of detail is selected as follows: For a texture that is not mip-mapped, the texture is used
directly. If it is mip-mapped and running in a fragment shader, the LOD computed by the implementation
is used to do the texture lookup. If it is mip-mapped and running on the vertex shader, then the base
texture is used.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.