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

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

    gvec4 textureLod (gsampler1D sampler, float P, float lod)
    gvec4 textureLod (gsampler2D sampler, vec2 P, float lod)
    gvec4 textureLod (gsampler3D sampler, vec3 P, float lod)
    gvec4 textureLod (gsamplerCube sampler, vec3 P, float lod)
    float textureLod (sampler1DShadow sampler, vec3 P, float lod)
    float textureLod (sampler2DShadow sampler, vec3 P, float lod)
    gvec4 textureLod (gsampler1DArray sampler, vec2 P, float lod)
    gvec4 textureLod (gsampler2DArray sampler, vec3 P, float lod)
    float textureLod (sampler1DArrayShadow sampler, vec3 P, float lod)
    

    Did you try one of those built-in? Also lod has to be a float type. What errors/warning is reporting GLSL compiler?

提交回复
热议问题