使用es3.0 可以支持ETC2格式的压缩纹理.
修改方法如下:
1、 找到工程生成目录下的include文件夹,即OgreBuildSettings.h所在的文件夹。
找到 OgreGLES2Config.h 修改该文件中的宏
#define OGRE_NO_GLES3_SUPPORT 0
2、兼容低端机,如果不支持es3.0的设备,可以让其尝试创建es2.0
找到 CCES2Render-ios.m文件修改下面这个函数如下
// Create an OpenGL ES 2.0 context
- (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned int)pixelFormat withSharegroup:(EAGLSharegroup*)sharegroup withMultiSampling:(BOOL) multiSampling withNumberOfSamples:(unsigned int) requestedSamples
{
self = [super init];
if (self)
{
if( ! sharegroup )
{
context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
if (! context_)
context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
}
else
{
context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3 sharegroup:sharegroup];
if (!context_)
context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:sharegroup];
}
if (!context_ || ![EAGLContext setCurrentContext:context_] )
{
[self release];
return nil;
}