Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用OpenGL ES 2.0的iOS 360视频_Ios_Iphone_Opengl Es_Opengl Es 2.0_Opengl Es 3.0 - Fatal编程技术网

使用OpenGL ES 2.0的iOS 360视频

使用OpenGL ES 2.0的iOS 360视频,ios,iphone,opengl-es,opengl-es-2.0,opengl-es-3.0,Ios,Iphone,Opengl Es,Opengl Es 2.0,Opengl Es 3.0,我有一个应用程序,使用OpenGL ES 3.0,使用sky sphere实现播放360个视频。我想使用OpenGL ES 2.0来支持更多的设备 在ViewController.swift中,我在setupContext()方法中创建了EAGLContext,它与.OpenGLES3一起工作,但当我尝试使用.OpenGLES2时,我只看到一个黑屏。没有错误消息,我无法辨别OpenGL ES 2.0不支持哪些API函数 context = EAGLContext(API: .OpenGLES3)

我有一个应用程序,使用OpenGL ES 3.0,使用sky sphere实现播放360个视频。我想使用OpenGL ES 2.0来支持更多的设备

在ViewController.swift中,我在setupContext()方法中创建了EAGLContext,它与.OpenGLES3一起工作,但当我尝试使用.OpenGLES2时,我只看到一个黑屏。没有错误消息,我无法辨别OpenGL ES 2.0不支持哪些API函数

context = EAGLContext(API: .OpenGLES3)
EAGLContext.setCurrentContext(context)
如何使用OpenGL ES 2.0使用天空球体显示360个视频?主要实现在skyphere.swift中。谢谢


示例应用程序位于此处:

问题在于OpenGL 3自动推断像素宽度和高度。要使用OpenGL 2,我需要定义像素缓冲区属性kCVPixelBufferWidthKey和kCVPixelBufferHeightKey。我用这个补丁更新了测试回购协议

let pixelBufferAttributes = [kCVPixelBufferPixelFormatTypeKey as String : NSNumber(unsignedInt: kCVPixelFormatType_32BGRA),
                                       kCVPixelBufferWidthKey as String : 1024,
                                      kCVPixelBufferHeightKey as String : 512]

为什么不在视频中加载球体网格和纹理贴图?而不是使用天空球体实现。这样,您就可以轻松地支持旧设备。