有人成功使用过这个扩展吗?Khronos 规范可以在这里阅读:NV_depth_nonlinear extension
我已经通过 EGL 配置选择成功检查了扩展:
public class CustomEGLConfigChooser implements EGLConfigChooser {
private static final int EGL_DEPTH_ENCODING_NV = 0x30E2;
private static final int EGL_DEPTH_ENCODING_NONLINEAR_NV = 0x30E3;
private int[] mValue = new int[1];
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
// request configs
EGLConfig[] configs = egl.eglChooseConfig(...);
// ...
EGLConfig bestConfig = null;
for(EGLConfig config : configs){
// check for EGL_DEPTH_ENCODING_NV
egl.eglGetConfigAttrib(display, config, EGL_DEPTH_ENCODING_NV, 0);
int hasDepthNonLinear = findConfigAttrib(egl, display, config, EGL_DEPTH_ENCODING_NV, 0);
if(hasDepthNonLinear == EGL_DEPTH_ENCODING_NONLINEAR_NV) {
// what to do now ???...
}
}
return bestConfig;
}
private int findConfigAttrib (EGL10 egl, EGLDisplay display, EGLConfig config, int attribute, int defaultValue) {
if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
return mValue[0];
}
return defaultValue;
}
}
但是如何使用非线性深度扩展?我必须使用:
glBindRenderbuffer(...);
glRenderbufferStorage(...);