ios - 扩展 EXT_shader_texture_lod 不适用于 OpenGL ES 3.0 iOS

标签 ios opengl-es opengl-es-2.0 opengl-es-3.0

即使 glGetString (GL_EXTENSIONS) 调用说扩展存在

GL version:   OpenGL ES 3.0 Apple A8 GPU - 95.58
GL vendor:    Apple Inc.
GL renderer:  Apple A8 GPU
GLSL version: OpenGL ES GLSL ES 3.00
GLSL extensions:
  1 > GL_OES_standard_derivatives
  2 > GL_KHR_texture_compression_astc_ldr
  3 > GL_EXT_color_buffer_half_float
  4 > GL_EXT_debug_label
  5 > GL_EXT_debug_marker
  6 > GL_EXT_pvrtc_sRGB
  7 > GL_EXT_read_format_bgra
  8 > GL_EXT_separate_shader_objects
  9 > GL_EXT_shader_framebuffer_fetch
 10 > GL_EXT_shader_texture_lod <--------------------
 11 > GL_EXT_shadow_samplers
 12 > GL_EXT_texture_filter_anisotropic
 13 > GL_APPLE_clip_distance
 14 > GL_APPLE_color_buffer_packed_float
 15 > GL_APPLE_copy_texture_levels
 16 > GL_APPLE_rgb_422
 17 > GL_APPLE_texture_format_BGRA8888
 18 > GL_IMG_read_format
 19 > GL_IMG_texture_compression_pvrtc

着色器似乎忽略了 textureLod 调用中的 level 参数。视觉结果与 texture 相同。我用 renderdoc 检查了一下,纹理已经生成了 mipmap。 mag 过滤模块也使用 LINEAR_MIPMAP_LINEAR。另外,我确定 level 参数是正确的。

此外,当我在开头插入此语句时着色器编译失败使用 #version 100 和扩展编译成功。

我没有尝试完全切换到#version 100,我不确定它是否有效。

我的问题是为什么我无法编译带有 texture_lod 扩展的 300 es 着色器,即使它存在于设备上?

最佳答案

My question is why I can't compile 300 es shader with the texture_lod extension even though it is present on the device?

...因为它是专门针对 OpenGL ES ES 2.x 着色器的扩展 (#version 100)。

textureLod() 的支持是 OpenGL ES 3.x ESSL #version 300 中的核心配置文件,因此您不需要扩展 ...

关于ios - 扩展 EXT_shader_texture_lod 不适用于 OpenGL ES 3.0 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41986625/

相关文章:

ios - MonoTouch - 将代码签名身份设置为不进行代码签名

ios - 获取录制视频原始帧

iphone - NSPredicate 过滤器

iphone - OpenGL 从另一个 View 返回后绘制黑屏

java - GLSL 着色器无法在 Android 上编译

iphone - 如何在 iOS 的一个证书中分发两个应用程序?

java - glTexImage3D - 无效操作

ios - 我可以在 iOS 上的 OpenGL ES 渲染中添加水印吗

android - glDepthMask(GL_FALSE) 破坏某些 GPU 上的帧缓冲区

iphone - 使用 glVertexAttrib3f 在 glDrawArrays 上崩溃