OpenGLES 1.1 Driver Porting Issues
Posted: Mon Feb 23, 2009 6:20 am
Hi;
While I was trying to migrate OpenGLES driver, which was developed in 1.4 version, on 1.5 version, I found 2 issue points.
I have been interested with OpenGL or OpenGLES, actually 3D technologies, but this is the first time for deep diving for real code beyond example code, but still I need to improve more skills.
Anyway, I hope somebody can give me some idea to solve this issues.
1. PixelFormat
Original OpenGL Driver uses BGR or BGRA order to handle pixel format, but OpenGLES doesn't support those, and the relative codes are changed with RGB order. everything are fine except colour flipping between Blue and Red.
so, anybody recommends me to modify some place to fix this problem ?
//! copies the the texture into an open gl texture.
void COpenGLESTexture::copyTexture(bool newTexture)
{
if (!Image)
{
Printer::log("No image for OpenGL texture to upload", ELL_ERROR);
return;
}
switch (ColorFormat)
{
case ECF_A1R5G5B5:
InternalFormat=GL_RGBA;
PixelFormat=GL_RGBA;//GL_BGRA_EXT
PixelType=GL_UNSIGNED_SHORT_5_5_5_1;//GL_UNSIGNED_SHORT_1_5_5_5_REV
break;
case ECF_R5G6B5:
InternalFormat=GL_RGB;
PixelFormat=GL_RGB;//GL_BGR
PixelType=GL_UNSIGNED_SHORT_5_6_5;//GL_UNSIGNED_SHORT_5_6_5_REV
break;
case ECF_R8G8B8:
InternalFormat=GL_RGB;
PixelFormat=GL_RGB;//GL_BGR
PixelType=GL_UNSIGNED_BYTE;
break;
case ECF_A8R8G8B8:
InternalFormat=GL_RGBA;
PixelFormat=GL_RGBA;//GL_BGRA_EXT
PixelType=GL_UNSIGNED_BYTE;//GL_UNSIGNED_INT_8_8_8_8_REV
break;
default:
Printer::log("Unsupported texture format", ELL_ERROR);
break;
}
2. GUI is not coming out
Seems like, "05.UserInterface" application is working well internally when I track the OpenGLES driver, but I can't see any widgets except background colour on screen.
so, currently 2D GUI and 2D graphic logo aren't on screen even though lots of functions are called between beginScene(...) & endScene(...).
I just attached part of my log file to check function call sequence.
OGLESPCViewer Version 2, 15/04/05
OpenGL ES desktop PC emulation viewer for MBX IP cores
Copyright Imagination Technologies Ltd 2004-2005.
Reading oglespcviewer.cfg file...
Using profile: PowerVR MBX1 With VGP - GENERIC PROFILE
Please select the driver you want for this example:
(c) OpenGL 1.5
(e) OpenGL|ES 1.1
(f) NullDevice
(otherKey) exit
Irrlicht Engine version 1.5
Linux 2.6.27.9-159.fc10.i686 #1 SMP Tue Dec 16 15:12:04 EST 2008 i686
Creating X window...
Visual chosen: : 33
COpenGLESDriver.cpp:COpenGLESDriver:36
Error: eglChooseConfig, no matched config.
EGL: Using config #1
ScreenSize of renderer: 640, 480
COpenGLESDriver.cpp:genericDriverInit:198
COpenGLESDriver.cpp:getName:1839
Using renderer: OpenGL|ES 1.1
PowerVR MBX1 With VGP - GENERIC PROFILE: Imagination Technologies
OpenGL|ES driver version is 1.2 or better.
Failed to load OpenGL|ES's multitexture extension, proceeding without.
GLSL not available.
COpenGLESDriver.cpp:setAmbientLight:1960
COpenGLESDriver.cpp:createMaterialRenderers:297
COpenGLESDriver.cpp:setRenderStates3DMode:1415
COpenGLESDriver.cpp:createGLMatrix:1318
COpenGLESDriver.cpp:disableTextures:1307
COpenGLESDriver.cpp:setTexture:1268
COpenGLESDriver.cpp:setBasicRenderStates:1547
COpenGLESDriver.cpp:setWrapMode:1462
COpenGLESDriver.cpp:setFog:2280
COpenGLESDriver.cpp:createDeviceDependentTexture:1352
Image Color Format: 0, Color Format: 3
COpenGLESDriver.cpp:testGLError:1376
COpenGLESDriver.cpp:testGLError:1376
COpenGLESDriver.cpp:createDeviceDependentTexture:1352
Image Color Format: 3, Color Format: 3
COpenGLESDriver.cpp:testGLError:1376
COpenGLESDriver.cpp:testGLError:1376
COpenGLESDriver.cpp:createDeviceDependentTexture:1352
Image Color Format: 3, Color Format: 3
COpenGLESDriver.cpp:testGLError:1376
COpenGLESDriver.cpp:testGLError:1376
Loaded texture: /root/irrlicht-1.5-2009-02-21/media/irrlichtlogo2.png
COpenGLESDriver.cpp:beginScene:361
COpenGLESDriver.cpp:draw2DRectangle:1085
COpenGLESDriver.cpp:disableTextures:1307
COpenGLESDriver.cpp:setTexture:1268
COpenGLESDriver.cpp:setRenderStates2DMode:1739
COpenGLESDriver.cpp:endScene:350
Regards;
SeongNam.
________
KLONOPIN REHAB FORUMS
While I was trying to migrate OpenGLES driver, which was developed in 1.4 version, on 1.5 version, I found 2 issue points.
I have been interested with OpenGL or OpenGLES, actually 3D technologies, but this is the first time for deep diving for real code beyond example code, but still I need to improve more skills.
Anyway, I hope somebody can give me some idea to solve this issues.
1. PixelFormat
Original OpenGL Driver uses BGR or BGRA order to handle pixel format, but OpenGLES doesn't support those, and the relative codes are changed with RGB order. everything are fine except colour flipping between Blue and Red.
so, anybody recommends me to modify some place to fix this problem ?
//! copies the the texture into an open gl texture.
void COpenGLESTexture::copyTexture(bool newTexture)
{
if (!Image)
{
Printer::log("No image for OpenGL texture to upload", ELL_ERROR);
return;
}
switch (ColorFormat)
{
case ECF_A1R5G5B5:
InternalFormat=GL_RGBA;
PixelFormat=GL_RGBA;//GL_BGRA_EXT
PixelType=GL_UNSIGNED_SHORT_5_5_5_1;//GL_UNSIGNED_SHORT_1_5_5_5_REV
break;
case ECF_R5G6B5:
InternalFormat=GL_RGB;
PixelFormat=GL_RGB;//GL_BGR
PixelType=GL_UNSIGNED_SHORT_5_6_5;//GL_UNSIGNED_SHORT_5_6_5_REV
break;
case ECF_R8G8B8:
InternalFormat=GL_RGB;
PixelFormat=GL_RGB;//GL_BGR
PixelType=GL_UNSIGNED_BYTE;
break;
case ECF_A8R8G8B8:
InternalFormat=GL_RGBA;
PixelFormat=GL_RGBA;//GL_BGRA_EXT
PixelType=GL_UNSIGNED_BYTE;//GL_UNSIGNED_INT_8_8_8_8_REV
break;
default:
Printer::log("Unsupported texture format", ELL_ERROR);
break;
}
2. GUI is not coming out
Seems like, "05.UserInterface" application is working well internally when I track the OpenGLES driver, but I can't see any widgets except background colour on screen.
so, currently 2D GUI and 2D graphic logo aren't on screen even though lots of functions are called between beginScene(...) & endScene(...).
I just attached part of my log file to check function call sequence.
OGLESPCViewer Version 2, 15/04/05
OpenGL ES desktop PC emulation viewer for MBX IP cores
Copyright Imagination Technologies Ltd 2004-2005.
Reading oglespcviewer.cfg file...
Using profile: PowerVR MBX1 With VGP - GENERIC PROFILE
Please select the driver you want for this example:
(c) OpenGL 1.5
(e) OpenGL|ES 1.1
(f) NullDevice
(otherKey) exit
Irrlicht Engine version 1.5
Linux 2.6.27.9-159.fc10.i686 #1 SMP Tue Dec 16 15:12:04 EST 2008 i686
Creating X window...
Visual chosen: : 33
COpenGLESDriver.cpp:COpenGLESDriver:36
Error: eglChooseConfig, no matched config.
EGL: Using config #1
ScreenSize of renderer: 640, 480
COpenGLESDriver.cpp:genericDriverInit:198
COpenGLESDriver.cpp:getName:1839
Using renderer: OpenGL|ES 1.1
PowerVR MBX1 With VGP - GENERIC PROFILE: Imagination Technologies
OpenGL|ES driver version is 1.2 or better.
Failed to load OpenGL|ES's multitexture extension, proceeding without.
GLSL not available.
COpenGLESDriver.cpp:setAmbientLight:1960
COpenGLESDriver.cpp:createMaterialRenderers:297
COpenGLESDriver.cpp:setRenderStates3DMode:1415
COpenGLESDriver.cpp:createGLMatrix:1318
COpenGLESDriver.cpp:disableTextures:1307
COpenGLESDriver.cpp:setTexture:1268
COpenGLESDriver.cpp:setBasicRenderStates:1547
COpenGLESDriver.cpp:setWrapMode:1462
COpenGLESDriver.cpp:setFog:2280
COpenGLESDriver.cpp:createDeviceDependentTexture:1352
Image Color Format: 0, Color Format: 3
COpenGLESDriver.cpp:testGLError:1376
COpenGLESDriver.cpp:testGLError:1376
COpenGLESDriver.cpp:createDeviceDependentTexture:1352
Image Color Format: 3, Color Format: 3
COpenGLESDriver.cpp:testGLError:1376
COpenGLESDriver.cpp:testGLError:1376
COpenGLESDriver.cpp:createDeviceDependentTexture:1352
Image Color Format: 3, Color Format: 3
COpenGLESDriver.cpp:testGLError:1376
COpenGLESDriver.cpp:testGLError:1376
Loaded texture: /root/irrlicht-1.5-2009-02-21/media/irrlichtlogo2.png
COpenGLESDriver.cpp:beginScene:361
COpenGLESDriver.cpp:draw2DRectangle:1085
COpenGLESDriver.cpp:disableTextures:1307
COpenGLESDriver.cpp:setTexture:1268
COpenGLESDriver.cpp:setRenderStates2DMode:1739
COpenGLESDriver.cpp:endScene:350
Regards;
SeongNam.
________
KLONOPIN REHAB FORUMS