有人知道在 Google VR SDK 上启用 sRGB 的方法GvrView
吗?
对于 classic 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);
...
}