In a GLSL fragment shader, how to access to texel at a specific mipmap level?

前端 未结 3 927
北荒
北荒 2021-01-12 20:33

I am using OpenGL to do some GPGPU computations through the combination of one vertex shader and one fragment shader. I need to do computations on a image at different scale

3条回答
  •  爱一瞬间的悲伤
    2021-01-12 21:11

    The GLSL 1.20 specification (section 8.7) states that fragment shaders cannot choose their own mipmap level (and that the texture*Lod function are only available in vertex shaders). If anything, you may be able to use the bias parameter to the non-Lod variants to change the mipmap level, but it can only change it relative to what that the card has already calculated for you.

    I don't know if latter versions of GLSL may have changed that.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题