OpenGL ES 1.x render system "OpenGL ES 1.x emulator" support

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
warmi
Gnoll
Posts: 674
Joined: Sun May 27, 2007 3:56 am
Location: USA

Re: OpenGL ES 1.x render system win32 support

Post by warmi »

I am kind of interested in your work because couple of months ago I wrote my own Engine for OpenGL ES 1.x (2.x) which was somewhat based on Ogre ... not code compatible but using the same concepts and often even the same interfaces. It was meant mainly for iPhone ( but I was working using PoverVR emulators so it is generic enough .)
I am going to lgpl my code once I get my first game out …

To get an acceptable performance on iPhone I had to completely change the way RenderSystem/RenderQueue is structured ... I got rid of Material based sorting and switched to mask based sorting ( everything in the render queue would be sorted based on a binary mask - a material would synthesize a mask composed of texture ids, blending states etc ).
In the end you would end up with a render queue which was sorted based on AlphaBlend,AlphaTest,DepthTest,DepthWrite,Texture1,Texture2,RenderableId.

If you structure everything around atlas based textures , you could get away with at most 3-4 texture bind calls within a frame - something you definitely want to do on iPhone.
Also, the OpenGL driver on the iPhone is really bad ... first of all, there is no benefit from using VBOs at all ... then there is that nasty CPU based CopyIndexedData call which literally limits your vertex throughput to about 10 000 per frame - this has nothing to do with hardware capabilities, just a bad driver implementation.
Hopefully , Apple will fix that but in the meantime the only way to get around is to minimize the size of your vertex data – quantize everything to shorts, use triangle strips etc …

Also, at this point the way Ogre handles OpenGL stats is a bit suboptimal – you are much better off doing client side caching of everything and minimize OpenGL calls as much as possible.

In the end, after rewriting parts of particle manager using ARM VFP, changing everything to handle quantized vertex data etc .., I got an equivalent of Magic of Stonehenge demo running at about 38 fps.

To summarize, there is no chance in hell a generic Ogre based code running at acceptable speeds on iPhone – you can get it to run using similar Ogre style API ( which I like, that’s why I based my code on Ogre ) acceptably, but internally you need to hack the hell out of it.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: OpenGL ES 1.x render system win32 support

Post by Assaf Raman »

Very interesting, I didn't know all of that. Thanks.
Watch out for my OGRE related tweets here.
davidcb
Gnoblar
Posts: 21
Joined: Wed Sep 17, 2008 1:47 pm

Re: OpenGL ES 1.x render system win32 support

Post by davidcb »

Ok, I have it working well now. I moved some things from the EGL source files to the Gtk and Win32 source files. I left the original code in and just commented it out.

I am now going to clean up, add comments where I think necessary to explain what I did, do an svn diff and zip the result up with the cmake file for GLES and the find GLES script.

I don't think I did very well on the cmake files. They worked well enough for me to build everything but you will probably want to fix up the windows parts. The find script I made by just editing the one that comes with cmake for OpenGL.

I can either e-mail the zip file to you or put it on my server for you to download. Let me know what you prefer and also if you need anything else.

Thanks.
David.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: OpenGL ES 1.x render system win32 support

Post by Assaf Raman »

Attach it to a post here (in a zip).
Watch out for my OGRE related tweets here.
davidcb
Gnoblar
Posts: 21
Joined: Wed Sep 17, 2008 1:47 pm

Re: OpenGL ES 1.x render system win32 support

Post by davidcb »

Ok, here it is.

David.

PS: I set it up to be unzipped into the root ogre directory.
Attachments
OgreGLES.zip
svn diff file and cmake files for the OpenGL ES render system
(11.58 KiB) Downloaded 233 times
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: OpenGL ES 1.x render system win32 support

Post by Assaf Raman »

Very nice work!
I want to commit it.
Before I can do it, can you sign our Contributor License (if you didn't in the past). Sign this PDF and send it to licensing(at)ogre3d.org. You only need to do it once.
I will commit your changes as soon as this issue is cleared up.
Watch out for my OGRE related tweets here.
davidcb
Gnoblar
Posts: 21
Joined: Wed Sep 17, 2008 1:47 pm

Re: OpenGL ES 1.x render system win32 support

Post by davidcb »

Ok, I just sent it in now.

David.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Re: OpenGL ES 1.x render system win32 support

Post by sinbad »

Confirmed, thanks.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: OpenGL ES 1.x render system win32 support

Post by Assaf Raman »

I will commit tomorrow - too late for me to do it today.
Watch out for my OGRE related tweets here.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: OpenGL ES 1.x render system win32 support

Post by Assaf Raman »

Committed.
Thanks for the patch.
Image
Watch out for my OGRE related tweets here.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: OpenGL ES 1.x render system win32 support

Post by Assaf Raman »

I have updated the trunk to compile and run with the latest PowerVR SDK for win32.
The biggest changes since I last tried to do this were the changes for the iPhone support.
I had a problem with OGRE_NEW - it didn't compile for some of the cases in the render system, to make it compile I added #define OGRE_NEW_FIX_FOR_WIN32 for windows to solve the issue for now - I will love it if any of you can have a look and try to resolve this.
I created a win32 dependencies package (based on the 2.05.25.0804 PowerVR version) and attached it to this post.
Basically if you unzip the zip to the source folder then add the render system to the cmake build - you should be able to run the render system and see it for yourself.
Watch out for my OGRE related tweets here.
User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm
x 12

Re: OpenGL ES 1.x render system win32 support

Post by lf3thn4d »

Nice work on GLES. But latest CMake setup is forcing a copy of GLES dependency even when GLES plugin is not set to compile. This is causing issue for me who doesn't deal with GLES and does not have the GLES dependency libs. CMake just fails and refuse to generate VC project files.
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: OpenGL ES 1.x render system win32 support

Post by Assaf Raman »

Should be fixed now.
Watch out for my OGRE related tweets here.
dustinlee
Kobold
Posts: 25
Joined: Sat Jan 14, 2006 1:11 pm

Re: OpenGL ES 1.x render system win32 support

Post by dustinlee »

I'm trying to build Ogre for PowerVR OpenGL ES 1.1 library on Ubuntu.

The following was what I have done upto now.
(1) Checkout the last SVN Ogre source
(2) Cmake-Configured Ogre source for native OpenGL on Ubuntu - build the Samplebrower to run well
I'm a bit surprised at the power of the Cmake tool - nicely compiled with kind compile information.
(3) Download & Install PowerVR OpenGL ES 1.1 SDK for PC emulation - test code runs well
(4) Cmake-Configured Ogre source for PowerVR ES 1.1 - copied libEGL.so and libGLES_CM.so to /usr/local/lib, archiving libGLES_CM.so into libGLES_CM.a with header files as well
(5) Compile Ogre source and got some errors of undefined symbols related to PowerVR texture format. So, I skipped it with #if macro like the following:

Code: Select all

            // PVRTC compressed formats
#if GL_IMG_texture_compression_pvrtc

            case GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG:
                return PF_PVRTC_RGB2;
            case GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:
                return PF_PVRTC_RGBA2;
            case GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG:
                return PF_PVRTC_RGB4;
            case GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:
                return PF_PVRTC_RGBA4;
#endif 
(6) Compile done with no errors.
(7) I run ./SampleBrower, .... but got the segment fault.
Any clues for resolving this issue?

Code: Select all

14:22:58: Creating resource group General
14:22:58: Creating resource group Internal
14:22:58: Creating resource group Autodetect
14:22:58: SceneManagerFactory for type 'DefaultSceneManager' registered.
14:22:58: Registering ResourceManager for type Material
14:22:58: Registering ResourceManager for type Mesh
14:22:58: Registering ResourceManager for type Skeleton
14:22:58: MovableObjectFactory for type 'ParticleSystem' registered.
14:22:58: OverlayElementFactory for type Panel registered.
14:22:58: OverlayElementFactory for type BorderPanel registered.
14:22:58: OverlayElementFactory for type TextArea registered.
14:22:58: Registering ResourceManager for type Font
14:22:58: ArchiveFactory for archive type FileSystem registered.
14:22:58: ArchiveFactory for archive type Zip registered.
14:22:58: FreeImage version: 3.10.0
14:22:58: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
14:22:58: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2
14:22:58: DDS codec registering
14:22:58: Registering ResourceManager for type HighLevelGpuProgram
14:22:58: Registering ResourceManager for type Compositor
14:22:58: MovableObjectFactory for type 'Entity' registered.
14:22:58: MovableObjectFactory for type 'Light' registered.
14:22:58: MovableObjectFactory for type 'BillboardSet' registered.
14:22:58: MovableObjectFactory for type 'ManualObject' registered.
14:22:58: MovableObjectFactory for type 'BillboardChain' registered.
14:22:58: MovableObjectFactory for type 'RibbonTrail' registered.
14:22:58: Loading library ../lib/RenderSystem_GLES
14:22:58: Installing plugin: OpenGL ES 1.x RenderSystem
14:22:58: OpenGL ES 1.x Rendering Subsystem created.
14:22:58: Plugin successfully installed
14:22:58: Loading library ../lib/Plugin_ParticleFX
14:22:58: Installing plugin: ParticleFX
14:22:58: Particle Emitter Type 'Point' registered
14:22:58: Particle Emitter Type 'Box' registered
14:22:58: Particle Emitter Type 'Ellipsoid' registered
14:22:58: Particle Emitter Type 'Cylinder' registered
14:22:58: Particle Emitter Type 'Ring' registered
14:22:58: Particle Emitter Type 'HollowEllipsoid' registered
14:22:58: Particle Affector Type 'LinearForce' registered
14:22:58: Particle Affector Type 'ColourFader' registered
14:22:58: Particle Affector Type 'ColourFader2' registered
14:22:58: Particle Affector Type 'ColourImage' registered
14:22:58: Particle Affector Type 'ColourInterpolator' registered
14:22:58: Particle Affector Type 'Scaler' registered
14:22:58: Particle Affector Type 'Rotator' registered
14:22:58: Particle Affector Type 'DirectionRandomiser' registered
14:22:58: Particle Affector Type 'DeflectorPlane' registered
14:22:58: Plugin successfully installed
14:22:58: Loading library ../lib/Plugin_BSPSceneManager
14:22:58: Installing plugin: BSP Scene Manager
14:22:58: Plugin successfully installed
14:22:58: Loading library ../lib/Plugin_PCZSceneManager
14:22:58: Installing plugin: Portal Connected Zone Scene Manager
14:22:58: PCZone Factory Type 'ZoneType_Default' registered
14:22:58: Plugin successfully installed
14:22:58: Loading library ../lib/Plugin_OctreeZone
14:22:58: Installing plugin: Octree Zone Factory
14:22:58: Plugin successfully installed
14:22:58: Loading library ../lib/Plugin_OctreeSceneManager
14:22:58: Installing plugin: Octree & Terrain Scene Manager
14:22:58: Plugin successfully installed
14:22:58: *-*-* OGRE Initialising
14:22:58: *-*-* Version 1.7.0dev-unstable (Cthugha)
14:22:58: CPU Identifier & Features
14:22:58: -------------------------
14:22:58:  *   CPU ID: GenuineIntel: Intel(R) Core(TM)2 Duo CPU     T8300  @ 2.40GHz
14:22:58:  *      SSE: yes
14:22:58:  *     SSE2: yes
14:22:58:  *     SSE3: yes
14:22:58:  *      MMX: yes
14:22:58:  *   MMXEXT: yes
14:22:58:  *    3DNOW: no
14:22:58:  * 3DNOWEXT: no
14:22:58:  *     CMOV: yes
14:22:58:  *      TSC: yes
14:22:58:  *      FPU: yes
14:22:58:  *      PRO: yes
14:22:58:  *       HT: no
14:22:58: -------------------------
14:22:58: GLESRenderSystem::_createRenderWindow "OGRE Sample Browser", 512x384 windowed  miscParams: FSAA=0 displayFrequency=52 MHz 
14:22:58: EGLWindow::create used FBConfigID = 1
14:22:58: GL_VERSION = OpenGL ES-CM 1.1 
14:22:58: GL_VENDOR = Imagination Technologies (Host GL: `NVIDIA Corporation`)
14:22:58: GL_RENDERER = PowerVR PVRVFrame 5.1 MBX with VGP (Host GL: `GeForce 8400M G/PCI/SSE2`) SDK Build: 2.05.25.0782
14:22:58: GL_EXTENSIONS = GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_IMG_read_format GL_OES_point_sprite GL_OES_query_matrix GL_OES_compressed_paletted_texture GL_IMG_texture_compression_pvrtc GL_OES_matrix_palette GL_OES_point_size_array GL_OES_draw_texture GL_IMG_vertex_program GL_IMG_texture_format_BGRA8888
14:22:58: **************************************
14:22:58: *** OpenGL ES 1.x Renderer Started ***
14:22:58: **************************************
14:22:58: Registering ResourceManager for type GpuProgram
14:22:58: GL ES: Using PBuffers for rendering to textures
14:22:58: RenderSystem capabilities
14:22:58: -------------------------
14:22:58: RenderSystem Name: OpenGL ES 1.x Rendering Subsystem
14:22:58: GPU Vendor: imagination technologies
14:22:58: Device Name: Imagination Technologies (Host GL: `NVIDIA Corporation`)
14:22:58: Driver Version: 0.0.0.0
14:22:58:  * Fixed function pipeline: yes
14:22:58:  * Hardware generation of mipmaps: yes
14:22:58:  * Texture blending: yes
14:22:58:  * Anisotropic texture filtering: no
14:22:58:  * Dot product texture operation: yes
14:22:58:  * Cube mapping: no
14:22:58:  * Hardware stencil buffer: no
14:22:58:  * Hardware vertex / index buffers: yes
14:22:58:  * Vertex programs: no
14:22:58:  * Number of floating-point constants for vertex programs: 0
14:22:58:  * Number of integer constants for vertex programs: 0
14:22:58:  * Number of boolean constants for vertex programs: 0
14:22:58:  * Fragment programs: no
14:22:58:  * Number of floating-point constants for fragment programs: 0
14:22:58:  * Number of integer constants for fragment programs: 0
14:22:58:  * Number of boolean constants for fragment programs: 0
14:22:58:  * Geometry programs: no
14:22:58:  * Number of floating-point constants for geometry programs: 0
14:22:58:  * Number of integer constants for geometry programs: 0
14:22:58:  * Number of boolean constants for geometry programs: 0
14:22:58:  * Supported Shader Profiles:
14:22:58:  * Texture Compression: yes
14:22:58:    - DXT: no
14:22:58:    - VTC: no
14:22:58:    - PVRTC: yes
14:22:58:  * Scissor Rectangle: yes
14:22:58:  * Hardware Occlusion Query: yes
14:22:58:  * User clip planes: yes
14:22:58:  * VET_UBYTE4 vertex element type: yes
14:22:58:  * Infinite far plane projection: yes
14:22:58:  * Hardware render-to-texture: yes
14:22:58:  * Floating point textures: no
14:22:58:  * Non-power-of-two textures: no
14:22:58:  * Volume textures: no
14:22:58:  * Multiple Render Targets: 1
14:22:58:    - With different bit depths: no
14:22:58:  * Point Sprites: yes
14:22:58:  * Extended point parameters: yes
14:22:58:  * Max Point Size: 0
14:22:58:  * Vertex texture fetch: no
14:22:58:  * Number of world matrices: 0
14:22:58:  * Number of texture units: 2
14:22:58:  * Stencil buffer depth: 0
14:22:58:  * Number of vertex blend matrices: 0
14:22:58:  * Render to Vertex Buffer : no
14:22:58:  * GL 1.5 without VBO workaround: no
14:22:58:  * Frame Buffer objects: no
14:22:58:  * Frame Buffer objects (ARB extension): no
14:22:58:  * Frame Buffer objects (ATI extension): no
14:22:58:  * PBuffer support: yes
14:22:58:  * GL 1.5 without HW-occlusion workaround: no
14:22:58: Registering ResourceManager for type Texture
14:22:58: DefaultWorkQueue('Root') initialising on thread main.
14:22:58: Particle Renderer Type 'billboard' registered
14:22:58: SceneManagerFactory for type 'BspSceneManager' registered.
14:22:58: Registering ResourceManager for type BspLevel
14:22:58: SceneManagerFactory for type 'PCZSceneManager' registered.
14:22:58: MovableObjectFactory for type 'PCZLight' registered.
14:22:58: MovableObjectFactory for type 'Portal' registered.
14:22:58: MovableObjectFactory for type 'AntiPortal' registered.
14:22:58: PCZone Factory Type 'ZoneType_Octree' registered
14:22:58: PCZone Factory Type 'ZoneType_Terrain' registered
14:22:58: SceneManagerFactory for type 'OctreeSceneManager' registered.
14:22:58: SceneManagerFactory for type 'TerrainSceneManager' registered.
14:22:58: Creating resource group Essential
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/thumbnails' of type 'FileSystem' to resource group 'Essential'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/packs/SdkTrays.zip' of type 'Zip' to resource group 'Essential'
14:22:58: Creating resource group Popular
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media' of type 'FileSystem' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/fonts' of type 'FileSystem' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/materials/programs' of type 'FileSystem' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/materials/scripts' of type 'FileSystem' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/materials/textures' of type 'FileSystem' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/materials/textures/nvidia' of type 'FileSystem' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/models' of type 'FileSystem' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/particle' of type 'FileSystem' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/DeferredShadingMedia' of type 'FileSystem' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/PCZAppMedia' of type 'FileSystem' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/RTShaderLib' of type 'FileSystem' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/packs/cubemap.zip' of type 'Zip' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/packs/cubemapsJS.zip' of type 'Zip' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/packs/dragon.zip' of type 'Zip' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/packs/fresneldemo.zip' of type 'Zip' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/packs/ogretestmap.zip' of type 'Zip' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/packs/ogredance.zip' of type 'Zip' to resource group 'Popular'
14:22:58: Added resource location '/home/dustinlee/Desktop/OgreCE3100/ogre/Samples/Media/packs/skybox.zip' of type 'Zip' to resource group 'Popular'
14:22:58: Initialising resource group Essential
14:22:58: Parsing scripts for resource group Essential
14:22:58: Parsing script SdkTrays.material
14:22:58: Parsing script SdkTrays.fontdef
14:22:58: Parsing script SdkTrays.overlay
14:22:58: Bad element attribute line: '# you can offset the image to change the cursor "hotspot"' for element SdkTrays/Cursor in overlay 
14:22:58: Texture: sdk_cursor.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
14:22:58: Texture: sdk_tray.png: Loading 1 faces(PF_A8R8G8B8,64x64x1) with 6 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x64x1.
14:22:58: Texture: sdk_button_up.png: Loading 1 faces(PF_A8R8G8B8,128x32x1) with 7 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,128x32x1.
14:22:58: Font SdkTrays/Captionusing texture size 512x256
14:22:58: Info: Freetype returned null for character 160 in font SdkTrays/Caption
14:22:58: Texture: SdkTrays/CaptionTexture: Loading 1 faces(PF_BYTE_LA,512x256x1) with  hardware generated mipmaps from Image. Internal format is PF_BYTE_LA,512x256x1.
14:22:58: Texture: sdk_text_box.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
14:22:58: Texture: sdk_mini_tray.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
14:22:58: Font SdkTrays/Valueusing texture size 512x256
14:22:58: Info: Freetype returned null for character 127 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 128 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 129 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 130 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 131 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 132 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 133 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 134 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 135 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 136 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 137 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 138 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 139 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 140 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 141 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 142 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 143 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 144 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 145 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 146 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 147 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 148 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 149 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 150 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 151 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 152 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 153 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 154 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 155 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 156 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 157 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 158 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 159 in font SdkTrays/Value
14:22:58: Info: Freetype returned null for character 160 in font SdkTrays/Value
14:22:58: Texture: SdkTrays/ValueTexture: Loading 1 faces(PF_BYTE_LA,512x256x1) with  hardware generated mipmaps from Image. Internal format is PF_BYTE_LA,512x256x1.
14:22:58: Texture: sdk_track.png: Loading 1 faces(PF_A8R8G8B8,16x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,16x32x1.
14:22:58: Texture: sdk_handle.png: Loading 1 faces(PF_A8R8G8B8,16x16x1) with 4 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,16x16x1.
14:22:58: Texture: sdk_mini_text_box.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
14:22:58: Texture: sdk_label.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
14:22:58: Texture: sdk_separator.png: Loading 1 faces(PF_A8R8G8B8,64x16x1) with 6 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x16x1.
14:22:58: Texture: sdk_logo.png: Loading 1 faces(PF_A8R8G8B8,128x64x1) with 7 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,128x64x1.
14:22:58: Texture: sdk_shade.png: Loading 1 faces(PF_A8R8G8B8,64x48x1) with 6 hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x64x1.

Segmantation Fault
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: OpenGL ES 1.x render system win32 support

Post by masterfalcon »

dustinlee wrote:I'm trying to build Ogre for PowerVR OpenGL ES 1.1 library on Ubuntu.
I can fix up the compile error for ya. But we'll need more info on the segfault. Can you debug it? Where is the segfault happening in the code?
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel
x 76

Re: OpenGL ES 1.x render system "OpenGL ES 1.x emulator" support

Post by Assaf Raman »

I just updated this thread title.
Watch out for my OGRE related tweets here.
dustinlee
Kobold
Posts: 25
Joined: Sat Jan 14, 2006 1:11 pm

Re: OpenGL ES 1.x render system "OpenGL ES 1.x emulator" support

Post by dustinlee »

masterfalcon wrote:
dustinlee wrote:I'm trying to build Ogre for PowerVR OpenGL ES 1.1 library on Ubuntu.
I can fix up the compile error for ya. But we'll need more info on the segfault. Can you debug it? Where is the segfault happening in the code?
masterfalcon:


Thanks for your comments.
In order to diagnose the problem-making part, I've created a small application that renders one ninja character. For opengl render system, it worked fine. But, for PowerVR ES render system, it crashed as well. I set the ulimit to unlimited, and was able to get the core dump file. Gdb with the core identified the crashed source line.

It crashed at OgreSceneManager.cpp:1070. I guess the mDestRenderSystem doesn't have _setSceneBlending implemetation? or stray pointer to the function.

Code: Select all

1060				if(pass->hasSeparateSceneBlendingOperations( ) )
1061				{
1062					mDestRenderSystem->_setSeparateSceneBlending(
1063						pass->getSourceBlendFactor(), pass->getDestBlendFactor(),
1064						pass->getSourceBlendFactor(), pass->getDestBlendFactor(),
1065						pass->getSceneBlendingOperation(), pass->getSceneBlendingOperationAlpha() );
1066				}
1067				else
1068				{
1069					mDestRenderSystem->_setSceneBlending(
1070						pass->getSourceBlendFactor(), pass->getDestBlendFactor(), pass->getSceneBlendingOperation() );
1071				}
1072			}
1073	
1074			// Set point parameters
1075			mDestRenderSystem->_setPointParameters(
1076				pass->getPointSize(),
1077				pass->isPointAttenuationEnabled(), 
1078				pass->getPointAttenuationConstant(), 
1079				pass->getPointAttenuationLinear(), 
1080	
pass->getPointAttenuationQuadratic(),


The following is the backtrace of the stack:

Code: Select all

#0  0x00000000 in ?? ()
#1  0x012d52bc in Ogre::SceneManager::_setPass (this=0xb76e3020, pass=0xb76fecc8, evenIfSuppressed=false, shadowDerivation=true)
    at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreSceneManager.cpp:1070
#2  0x012dcc86 in Ogre::SceneManager::BRAND NAME::visit (this=0xb76e748c, p=0xb76fecc8)
    at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreSceneManager.cpp:2855
#3  0x0126188d in Ogre::QueuedRenderableCollection::acceptVisitorGrouped (this=0xb7704018, visitor=0xb76e748c)
    at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreRenderQueueSortingGrouping.cpp:441
#4  0x012617af in Ogre::QueuedRenderableCollection::acceptVisitor (this=0xb7704018, visitor=0xb76e748c, om=Ogre::QueuedRenderableCollection::OM_PASS_GROUP)
    at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreRenderQueueSortingGrouping.cpp:418
#5  0x012dd06d in Ogre::SceneManager::renderObjects (this=0xb76e3020, objs=..., om=Ogre::QueuedRenderableCollection::OM_PASS_GROUP, lightScissoringClipping=true, 
    doLightIteration=true, manualLightList=0x0) at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreSceneManager.cpp:2945
#6  0x012dd363 in Ogre::SceneManager::renderBasicQueueGroupObjects (this=0xb76e3020, pGroup=0xb72db768, om=Ogre::QueuedRenderableCollection::OM_PASS_GROUP)
    at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreSceneManager.cpp:3023
#7  0x012dd2c4 in Ogre::SceneManager::_renderQueueGroupObjects (this=0xb76e3020, pGroup=0xb72db768, om=Ogre::QueuedRenderableCollection::OM_PASS_GROUP)
    at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreSceneManager.cpp:3002
#8  0x012dace3 in Ogre::SceneManager::renderVisibleObjectsDefaultSequence (this=0xb76e3020) at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreSceneManager.cpp:2282
#9  0x012daa6d in Ogre::SceneManager::_renderVisibleObjects (this=0xb76e3020) at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreSceneManager.cpp:2198
#10 0x012d6c8e in Ogre::SceneManager::_renderScene (this=0xb76e3020, camera=0xb76ec418, vp=0xb68323f8, includeOverlays=true)
    at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreSceneManager.cpp:1506
#11 0x0101c9b5 in Ogre::Camera::_renderScene (this=0xb76ec418, vp=0xb68323f8, includeOverlays=true) at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreCamera.cpp:407
#12 0x013df8eb in Ogre::Viewport::update (this=0xb68323f8) at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreViewport.cpp:236
#13 0x01288765 in Ogre::RenderTarget::_updateViewport (this=0xb76dbd60, viewport=0xb68323f8, updateStatistics=true)
    at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreRenderTarget.cpp:146
#14 0x0128869f in Ogre::RenderTarget::_updateAutoUpdatedViewports (this=0xb76dbd60, updateStatistics=true)
    at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreRenderTarget.cpp:124
#15 0x012885e4 in Ogre::RenderTarget::updateImpl (this=0xb76dbd60) at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreRenderTarget.cpp:101
#16 0x0128a18d in Ogre::RenderTarget::update (this=0xb76dbd60, swap=false) at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreRenderTarget.cpp:541
#17 0x0126bc70 in Ogre::RenderSystem::_updateAllRenderTargets (this=0xb76dc070, swapBuffers=false)
    at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreRenderSystem.cpp:112
#18 0x012bfb09 in Ogre::Root::_updateAllRenderTargets (this=0xb76d3260) at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreRoot.cpp:1287
#19 0x012bdd6a in Ogre::Root::renderOneFrame (this=0xb76d3260) at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreRoot.cpp:944
#20 0x012bdd16 in Ogre::Root::startRendering (this=0xb76d3260) at /home/dustinlee/Desktop/OgreCE3100/ogre/OgreMain/src/OgreRoot.cpp:934
#21 0x0804c346 in HelloNinjaApp::go (this=0xbf9f99ec) at /home/dustinlee/projects/HelloNinja/src/main.cpp:86
#22 0x0804b5e7 in main (argc=1, argv=0xbf9f9ad4) at /home/dustinlee/projects/HelloNinja/src/main.cpp:106
dustinlee
Kobold
Posts: 25
Joined: Sat Jan 14, 2006 1:11 pm

Re: OpenGL ES 1.x render system "OpenGL ES 1.x emulator" support

Post by dustinlee »

The following code is the simple ninja rendering code for the problem above. I've posted this code and uploaded the resource file as well:

Code: Select all

#include <Ogre.h>
#include <OIS/OIS.h>


using namespace Ogre;

class ESCListener : public FrameListener {
    OIS::Keyboard *mKeyboard;

public:
    ESCListener(OIS::Keyboard *keyboard) : mKeyboard(keyboard) {}
    bool frameStarted(const FrameEvent &evt)
    {
        mKeyboard->capture();
        return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
    }
};

class HelloNinjaApp {

    Root* mRoot;
    RenderWindow* mWindow;
    SceneManager* mSceneMgr;
    Camera* mCamera;
    Viewport* mViewport;
    OIS::Keyboard* mKeyboard;
    OIS::InputManager *mInputManager;
    ESCListener* mESCListener;

public:

    HelloNinjaApp() {}

    ~HelloNinjaApp() {}

    void go(void)
    {
       
        mRoot = new Root("plugins.cfg", "ogre.cfg", "ogre.log");

        if (!mRoot->restoreConfig()) {
            if (!mRoot->showConfigDialog()) return;
        }
        mWindow = mRoot->initialise(true, "Game Engine Lecture Application");

        size_t windowHnd = 0;
        std::ostringstream windowHndStr;
        OIS::ParamList pl;
        mWindow->getCustomAttribute("WINDOW", &windowHnd);
        windowHndStr << windowHnd;
        pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
        mInputManager = OIS::InputManager::createInputSystem(pl);
        mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, false));

        mESCListener = new ESCListener(mKeyboard);
        mRoot->addFrameListener(mESCListener);

        mSceneMgr = mRoot->createSceneManager(ST_GENERIC);

        mCamera = mSceneMgr->createCamera("camera");
        mCamera->setPosition(500.0f, 100.0f, 0.0f);
        mCamera->lookAt(0.0f, 100.0f, 0.0f);
        mCamera->setNearClipDistance(5.0f);

        mViewport = mWindow->addViewport(mCamera);
        mViewport->setBackgroundColour(ColourValue(0.0f,0.0f,0.0f));
        mCamera->setAspectRatio(Real(mViewport->getActualWidth()) / Real(mViewport->getActualHeight()));


        mSceneMgr->setAmbientLight(ColourValue(1.0f, 1.0f, 1.0f));

       
        ResourceGroupManager::getSingleton().addResourceLocation("./lecturepack.zip", "Zip");
        ResourceGroupManager::getSingleton().initialiseAllResourceGroups();



        Entity* ninjaEntity = mSceneMgr->createEntity("ninja#1", "ninja.mesh");

        SceneNode* ninjaNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
        ninjaNode->attachObject(ninjaEntity);

        mRoot->startRendering();

        mInputManager->destroyInputObject(mKeyboard);
        OIS::InputManager::destroyInputSystem(mInputManager);

        delete mRoot;
    }
};


#ifdef __cplusplus
extern "C" {
#endif

    int main(int argc, char *argv[])
    {
        HelloNinjaApp app;

        try {

            app.go();

        } catch ( Ogre::Exception& e ) {
            std::cerr << "An exception has occured: " <<
                      e.getFullDescription().c_str() << std::endl;
        }

        return 0;
    }

#ifdef __cplusplus
}
#endif
Attachments
lecturepack.zip
(76.69 KiB) Downloaded 107 times
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: OpenGL ES 1.x render system "OpenGL ES 1.x emulator" support

Post by masterfalcon »

@dustinlee I just tried your code here(iPhone) and I didn't get a crash. The GL ES render system does have a setSceneBlending function. Without being able to reproduce the problem I'm not quite sure what to say. Might need some more debugging to see if where it's crashing within setSceneBlending or if it's never getting there at all.
dustinlee
Kobold
Posts: 25
Joined: Sat Jan 14, 2006 1:11 pm

Re: OpenGL ES 1.x render system "OpenGL ES 1.x emulator" support

Post by dustinlee »

masterfalcon wrote:@dustinlee I just tried your code here(iPhone) and I didn't get a crash. The GL ES render system does have a setSceneBlending function. Without being able to reproduce the problem I'm not quite sure what to say. Might need some more debugging to see if where it's crashing within setSceneBlending or if it's never getting there at all.
Masterfalcon:

Thank you so much for you caring of this problem. You know that I'm doing this for Ubuntu (not for Iphone). I would like to know if anyone has ever succeeded in porting Ogre to PowerVR ES 1.1 on Ubuntu. I know that this forum thread started from the success of porting Ogre to PowerVR OpenGL ES simulator on Windows.

Anyway, I'm going to try hard to make it work :)
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: OpenGL ES 1.x render system "OpenGL ES 1.x emulator" support

Post by masterfalcon »

dustinlee wrote:
masterfalcon wrote:@dustinlee I just tried your code here(iPhone) and I didn't get a crash. The GL ES render system does have a setSceneBlending function. Without being able to reproduce the problem I'm not quite sure what to say. Might need some more debugging to see if where it's crashing within setSceneBlending or if it's never getting there at all.
Masterfalcon:

Thank you so much for you caring of this problem. You know that I'm doing this for Ubuntu (not for Iphone). I would like to know if anyone has ever succeeded in porting Ogre to PowerVR ES 1.1 on Ubuntu. I know that this forum thread started from the success of porting Ogre to PowerVR OpenGL ES simulator on Windows.

Anyway, I'm going to try hard to make it work :)
Not a problem. I think it has worked on Linux. I've got Ubuntu installed in VMware, maybe I'll give it a shot in there.
dustinlee
Kobold
Posts: 25
Joined: Sat Jan 14, 2006 1:11 pm

Re: OpenGL ES 1.x render system "OpenGL ES 1.x emulator" support

Post by dustinlee »

I've stepped into the code deeper, and finally found why it crashed. But have no idea of how to cure it.
Please have a look at the following code.

Code: Select all

#0  Ogre::GLESRenderSystem::_setSceneBlending (this=0xb7eeb070, 
    sourceFactor=Ogre::SBF_ONE, destFactor=Ogre::SBF_ZERO, op=Ogre::SBO_ADD)
    at /home/dustinlee/Desktop/OgreCE3100/ogre/RenderSystems/GLES/src/OgreGLESRenderSystem.cpp:1390
1390	        glBlendEquationOES(func);
(gdb) l
1385	#if GL_EXT_blend_minmax
1386	            func = GL_MAX_EXT;
1387	#endif
1388				break;
1389			}
1390	        glBlendEquationOES(func);
1391	        GL_CHECK_ERROR;
1392	#endif
1393		}
1394	
The code crashed at the line #1390. I've watched the value of 'glBlendEquationOES', which is

Code: Select all

(gdb) p glBlendEquationOES 
$7 = (PFNGLBLENDEQUATIONOESPROC) 0
As far as I understand, Ogre gets the value by querying like the following:

Code: Select all

GLES/src/OgreGLESSupport.cpp:		glBlendEquationOES = (PFNGLBLENDEQUATIONOES)getProcAddress("glBlendEquationOES");
I suspect PowerVR ES returns 0 for the above query. How to cure it??????
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: OpenGL ES 1.x render system "OpenGL ES 1.x emulator" support

Post by masterfalcon »

oh ok. that extension must not be supported in that implementation. I'll look at the headers and find a better way to check for that extensions existence.
dustinlee
Kobold
Posts: 25
Joined: Sat Jan 14, 2006 1:11 pm

Re: OpenGL ES 1.x render system "OpenGL ES 1.x emulator" support

Post by dustinlee »

Masterfalcon:

Have you ever had a chance to resolve this issue of missing glBlendEquationOES function?
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: OpenGL ES 1.x render system "OpenGL ES 1.x emulator" support

Post by masterfalcon »

Crap, I totally forgot about this. I'll get on it sometime today.
Post Reply