是否有人知道在Google VR SDK GvrView
上启用sRGB的方法?
对于经典GLSurfaceView
,我使用setEGLWindowSurfaceFactory
,效果很好 - 见下文。
根据我的理解,GvrView
没有公开这个表面工厂,是否有任何解决方法或替代方法?通过NDK api?
我在官方文档中找不到任何内容。
view.setEGLWindowSurfaceFactory(mWindow_sRGB_SurfaceFactory);
private final EGLWindowSurfaceFactory mWindow_sRGB_SurfaceFactory = new EGLWindowSurfaceFactory() {
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
EGLConfig config, Object nativeWindow) {
EGLSurface result = null;
final int EGL_GL_COLORSPACE_KHR = 0x309D;
final int EGL_GL_COLORSPACE_SRGB_KHR = 0x3089;
final int[] surfaceAttribs = {
EGL_GL_COLORSPACE_KHR, EGL_GL_COLORSPACE_SRGB_KHR,
EGL10.EGL_NONE
};
result = egl.eglCreateWindowSurface(display, config, nativeWindow, surfaceAttribs);
...
}