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

前端 未结 3 924
北荒
北荒 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:10

    try:

    glGenerateMipmapEXT(GL_TEXTURE_2D);
    

    after you bind the texture. (And before doing the rendering of course)

    The glTexParameteri-GL_GENERATE_MIPMAP is deprecated I think... MfG Digi

提交回复
热议问题