How to specify LOD bias in Metal?

时间:2019-05-31 11:43:52

标签: ios meta cifilter

I'm rewriting an OpenGL filter from the Android version of the app I'm currently working at in Metal. It uses the following texture lookup function: vec4 texture2D(sampler2D sampler, vec2 coord, float bias)

Assuming my filter kernel function looks like this:

float4 fname(sampler src) {
    ...
}

The texture lookup call would be the following:

src.sample(coord)

But how can I pass the bias parameter? (the sample function takes only 1 argument)

1 个答案:

答案 0 :(得分:1)

恐怕Core Image仅支持2D纹理-没有mipmapping和LOD选择。仅双线性采样可用。

如果需要不同的LOD,则需要将不同的采样器传递给内核,然后自己进行插值。