Manual Textures and Planes on iOS7

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
Carlyone
Kobold
Posts: 38
Joined: Thu Jul 05, 2012 3:51 pm

Manual Textures and Planes on iOS7

Post by Carlyone » Wed Oct 30, 2013 6:30 pm

Hello,
Recently (thanks to MasterFalcon) got Ogre to completely build on iOS7 with armv7,7s and 64 but I have run into another issue that I haven't seen a solution, or found a solution for.

In my project I was getting a crash on trr_texture->getBuffer() with a "pointer being freed was not allocated"

Code: Select all

Ogre::TexturePtr rtt_texture = Ogre::TextureManager::getSingleton().createManual("RttTex", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, width, height, 0, Ogre::PF_R8G8B8A8, Ogre::TU_RENDERTARGET,0,false,0,Ogre::StringUtil::BLANK);
    
    renderTarget = rtt_texture->getBuffer()->getRenderTarget();
I checked the status of rtt_texture just before the crash and it seems to have no width or height and none of the passed in settings so I'm guessing that's why it is crashing at the getBuffer() line, don't know why they are not being taken though.

If I take out this line I get a crash at boost::recursive_mutex::unlock() with the "error Assertion failed: (!pthread_mutex_unlock(&m)), function unlock, file /../include/boost/thread/pthread/recursive_mutex.hpp, line 115".

Code: Select all

void unlock(){
    BOOST_VERIFY(!pthread_mutex_unlock(&m));
}
This i caused from a line in my code:

Code: Select all

Ogre::MovablePlane* movablePlane = new Ogre::MovablePlane(Ogre::Vector3::UNIT_Y, 0.0);
            
            Ogre::MeshManager::getSingleton().createPlane(GROUND_NODE, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, *movablePlane, 1000, 1000, 1, 1, true, 1, 1, 1, Ogre::Vector3::UNIT_Z);
Looks like it tries to deconstruct the Ogre::MeshPtr and falls over, stack trace below:

Code: Select all

__pthread_kill
__assert_rtn
boost::recursive_mutex::unlock()
boost::unique_lock<boost::recursive_mutex>::~unique_lock()
boost::unique_lock<boost::recursive_mutex>::~unique_lock()
Ogre::SharedPtr<Ogre::Mesh>::release()
Ogre::SharedPtr<Ogre::Mesh>::~SharedPtr()
Ogre::MeshPtr::~MeshPtr()
Ogre::MeshPtr::~MeshPtr()
OgreWorld::createFloorFor3DWorld(bool)
Bit stuck on why these lines are crashing, if i remove them then Ogre just crashes on the first renderOneFrame.
No errors to be seen in the ogre output.

Code: Select all

Creating resource group General
Creating resource group Internal
Creating resource group Autodetect
SceneManagerFactory for type 'DefaultSceneManager' registered.
Registering ResourceManager for type Material
Registering ResourceManager for type Mesh
Registering ResourceManager for type Skeleton
MovableObjectFactory for type 'ParticleSystem' registered.
ArchiveFactory for archive type FileSystem registered.
ArchiveFactory for archive type Zip registered.
ArchiveFactory for archive type EmbeddedZip registered.
DDS codec registering
FreeImage version: 3.15.3
This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
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,pfm,pct,pict,pic,3fr,arw,bay,bmq,cap,cine,cr2,crw,cs1,dc2,dcr,drf,dsc,dng,erf,fff,ia,iiq,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,ptx,pxn,qtk,raf,raw,rdc,rw2,rwl,rwz,sr2,srf,srw,sti
PVRTC codec registering
ETC codec registering
Registering ResourceManager for type HighLevelGpuProgram
Registering ResourceManager for type Compositor
MovableObjectFactory for type 'Entity' registered.
MovableObjectFactory for type 'Light' registered.
MovableObjectFactory for type 'BillboardSet' registered.
MovableObjectFactory for type 'ManualObject' registered.
MovableObjectFactory for type 'BillboardChain' registered.
MovableObjectFactory for type 'RibbonTrail' registered.
*-*-* OGRE Initialising
*-*-* Version 1.9.0unstable (Ghadamon)
Installing plugin: OpenGL ES 2.0 RenderSystem
OpenGL ES 2.x Rendering Subsystem created.
Plugin successfully installed
Installing plugin: ParticleFX
Particle Emitter Type 'Point' registered
Particle Emitter Type 'Box' registered
Particle Emitter Type 'Ellipsoid' registered
Particle Emitter Type 'Cylinder' registered
Particle Emitter Type 'Ring' registered
Particle Emitter Type 'HollowEllipsoid' registered
Particle Affector Type 'LinearForce' registered
Particle Affector Type 'ColourFader' registered
Particle Affector Type 'ColourFader2' registered
Particle Affector Type 'ColourImage' registered
Particle Affector Type 'ColourInterpolator' registered
Particle Affector Type 'Scaler' registered
Particle Affector Type 'Rotator' registered
Particle Affector Type 'DirectionRandomiser' registered
Particle Affector Type 'DeflectorPlane' registered
Plugin successfully installed
CPU Identifier & Features
-------------------------
 *   CPU ID: ARM Cortex-A9
 *      VFP: no
 *     NEON: yes
-------------------------
Registering ResourceManager for type Texture
GLES2RenderSystem::_createRenderWindow "OgreWindow", 768x1024 fullscreen  miscParams: FSAA=0 contentScalingFactor=2 displayFrequency=0 
iOS: Window created 1024 x 768 with backing store size 2048 x 1536 using content scaling factor 2.0
GL_VERSION = OpenGL ES 2.0 IMGSGX543-97
GL_VENDOR = Imagination Technologies
GL_RENDERER = PowerVR SGX 543
GL_EXTENSIONS = GL_OES_depth_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_vertex_array_object GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_draw_instanced GL_EXT_instanced_arrays GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_pvrtc_sRGB GL_EXT_read_format_bgra GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sRGB GL_EXT_texture_filter_anisotropic GL_EXT_texture_rg GL_EXT_texture_storage GL_APPLE_copy_texture_levels GL_APPLE_framebuffer_multisample GL_APPLE_rgb_422 GL_APPLE_sync GL_APPLE_texture_format_BGRA8888 GL_APPLE_texture_max_level GL_IMG_read_format GL_IMG_texture_compression_pvrtc 
EXT:GL_OES_depth_texture
EXT:GL_OES_depth24
EXT:GL_OES_element_index_uint
EXT:GL_OES_fbo_render_mipmap
EXT:GL_OES_mapbuffer
EXT:GL_OES_packed_depth_stencil
EXT:GL_OES_rgb8_rgba8
EXT:GL_OES_standard_derivatives
EXT:GL_OES_texture_float
EXT:GL_OES_texture_half_float
EXT:GL_OES_texture_half_float_linear
EXT:GL_OES_vertex_array_object
EXT:GL_EXT_blend_minmax
EXT:GL_EXT_color_buffer_half_float
EXT:GL_EXT_debug_label
EXT:GL_EXT_debug_marker
EXT:GL_EXT_discard_framebuffer
EXT:GL_EXT_draw_instanced
EXT:GL_EXT_instanced_arrays
EXT:GL_EXT_map_buffer_range
EXT:GL_EXT_occlusion_query_boolean
EXT:GL_EXT_pvrtc_sRGB
EXT:GL_EXT_read_format_bgra
EXT:GL_EXT_separate_shader_objects
EXT:GL_EXT_shader_framebuffer_fetch
EXT:GL_EXT_shader_texture_lod
EXT:GL_EXT_shadow_samplers
EXT:GL_EXT_sRGB
EXT:GL_EXT_texture_filter_anisotropic
EXT:GL_EXT_texture_rg
EXT:GL_EXT_texture_storage
EXT:GL_APPLE_copy_texture_levels
EXT:GL_APPLE_framebuffer_multisample
EXT:GL_APPLE_rgb_422
EXT:GL_APPLE_sync
EXT:GL_APPLE_texture_format_BGRA8888
EXT:GL_APPLE_texture_max_level
EXT:GL_IMG_read_format
EXT:GL_IMG_texture_compression_pvrtc
**************************************
*** OpenGL ES 2.x Renderer Started ***
**************************************
GLSL ES support detected
Registering ResourceManager for type GpuProgram
GL ES 2: Using FBOs for rendering to textures
FBO PF_UNKNOWN depth/stencil support: D16S0 D24S0 Packed-D24S8 
FBO PF_R5G6B5 depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_B5G6R5 depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_A4R4G4B4 depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_A1R5G5B5 depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_R8G8B8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_B8G8R8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_A8R8G8B8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_A8B8G8R8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_B8G8R8A8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_FLOAT16_RGB depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_X8R8G8B8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_SHORT_RGBA depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_R8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
FBO PF_RG8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 Packed-D24S8 
[GLES2] : Valid FBO targets PF_UNKNOWN PF_R5G6B5 PF_B5G6R5 PF_A4R4G4B4 PF_A1R5G5B5 PF_R8G8B8 PF_B8G8R8 PF_A8R8G8B8 PF_A8B8G8R8 PF_B8G8R8A8 PF_FLOAT16_RGB PF_X8R8G8B8 PF_SHORT_RGBA PF_R8 PF_RG8 
RenderSystem capabilities
-------------------------
RenderSystem Name: OpenGL ES 2.x Rendering Subsystem
GPU Vendor: imagination technologies
Device Name: PowerVR SGX 543
Driver Version: 0.0.0.0
 * Fixed function pipeline: no
 * Hardware generation of mipmaps: yes
 * Texture blending: yes
 * Anisotropic texture filtering: yes
 * Dot product texture operation: yes
 * Cube mapping: yes
 * Hardware stencil buffer: no
 * Hardware vertex / index buffers: yes
 * Vertex programs: yes
 * Number of floating-point constants for vertex programs: 128
 * Number of integer constants for vertex programs: 128
 * Number of boolean constants for vertex programs: 128
 * Fragment programs: yes
 * Number of floating-point constants for fragment programs: 64
 * Number of integer constants for fragment programs: 64
 * Number of boolean constants for fragment programs: 64
 * Geometry programs: no
 * Number of floating-point constants for geometry programs: 0
 * Number of integer constants for geometry programs: 0
 * Number of boolean constants for geometry programs: 0
 * Tesselation Hull programs: no
 * Number of floating-point constants for tesselation hull programs: 0
 * Number of integer constants for tesselation hull programs: 0
 * Number of boolean constants for tesselation hull programs: 0
 * Tesselation Domain programs: no
 * Number of floating-point constants for tesselation domain programs: 0
 * Number of integer constants for tesselation domain programs: 0
 * Number of boolean constants for tesselation domain programs: 0
 * Compute programs: no
 * Number of floating-point constants for compute programs: 0
 * Number of integer constants for compute programs: 0
 * Number of boolean constants for compute programs: 0
 * Supported Shader Profiles: glsles
 * Texture Compression: yes
   - DXT: no
   - VTC: no
   - PVRTC: yes
   - ATC: no
   - ETC1: no
   - ETC2: no
   - BC4/BC5: no
   - BC6H/BC7: no
 * Scissor Rectangle: yes
 * Hardware Occlusion Query: yes
 * User clip planes: no
 * VET_UBYTE4 vertex element type: yes
 * Infinite far plane projection: yes
 * Hardware render-to-texture: yes
 * Floating point textures: yes
 * Non-power-of-two textures: no
 * 1d textures: yes
 * Volume textures: no
 * Multiple Render Targets: 1
   - With different bit depths: no
 * Point Sprites: yes
 * Extended point parameters: yes
 * Max Point Size: 0
 * Vertex texture fetch: no
 * Number of world matrices: 0
 * Number of texture units: 8
 * Stencil buffer depth: 0
 * Number of vertex blend matrices: 0
 * Render to Vertex Buffer : no
 * Hardware Atomic Counters: no
 * GL 1.5 without VBO workaround: no
 * Frame Buffer objects: yes
 * Frame Buffer objects (ARB extension): no
 * Frame Buffer objects (ATI extension): no
 * PBuffer support: no
 * GL 1.5 without HW-occlusion workaround: no
 * Vertex Array Objects: yes
 * Separate shader objects: yes
DefaultWorkQueue('Root') initialising on thread 0x3c17318c.
DefaultWorkQueue('Root')::WorkerFunc - thread 0x4a60000 starting.
DefaultWorkQueue('Root')::WorkerFunc - thread 0x4e11000 starting.
Particle Renderer Type 'billboard' registered
Creating resource group EyeSee
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/eyesee by Pinnacle Visualisation.app/media/EyeSee/programs' of type 'FileSystem' to resource group 'EyeSee'
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/eyesee by Pinnacle Visualisation.app/media/EyeSee/textures/bumpmapping' of type 'FileSystem' to resource group 'EyeSee'
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/eyesee by Pinnacle Visualisation.app/media/EyeSee/textures/offsetmapping' of type 'FileSystem' to resource group 'EyeSee'
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/eyesee by Pinnacle Visualisation.app/media/EyeSee/textures/skyboxes' of type 'FileSystem' to resource group 'EyeSee'
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/eyesee by Pinnacle Visualisation.app/media/EyeSee/textures/terrain' of type 'FileSystem' to resource group 'EyeSee'
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/eyesee by Pinnacle Visualisation.app/media/EyeSee/textures/general' of type 'FileSystem' to resource group 'EyeSee'
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/eyesee by Pinnacle Visualisation.app/media/EyeSee/scripts' of type 'FileSystem' to resource group 'EyeSee'
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/eyesee by Pinnacle Visualisation.app/media/EyeSee/fonts' of type 'FileSystem' to resource group 'EyeSee'
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/eyesee by Pinnacle Visualisation.app/media/RTShaderLib' of type 'FileSystem' to resource group 'General'
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/eyesee by Pinnacle Visualisation.app/media/RTShaderLib/materials' of type 'FileSystem' to resource group 'General'
Parsing scripts for resource group Autodetect
Finished parsing scripts for resource group Autodetect
Creating resources for group Autodetect
All done
Parsing scripts for resource group EyeSee
Parsing script Basic.program
Parsing script BumpMapping.program
Parsing script Monster_2.program
Parsing script OffsetMapping.program
Parsing script Skyboxes.program
Parsing script Billboards.material
Parsing script BumpMapping.material
Parsing script EyeSee.material
Parsing script Monster_2.material
Parsing script OffsetMapping.material
Parsing script Skyboxes.material
Finished parsing scripts for resource group EyeSee
Creating resources for group EyeSee
All done
Parsing scripts for resource group General
Parsing script HardwareSkinningShadow.material
Parsing script RTShaderSystem.material
Finished parsing scripts for resource group General
Creating resources for group General
All done
Parsing scripts for resource group Internal
Finished parsing scripts for resource group Internal
Creating resources for group Internal
All done
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/Documents/7e828dee-ead8-4ac7-84b9-1f50497fa935/resources/meshes' of type 'FileSystem' to resource group 'General'
2013-10-30 17:15:49.906 eyesee by Pinnacle Visualisation[6732:60b] void RenderHandlerImpl::renderOverlay(eyesee::Overlay *) line 43 $ Displaying overlay ogre
2013-10-30 17:15:49.909 eyesee by Pinnacle Visualisation[6732:60b] void RenderHandlerImpl::renderOverlay(eyesee::Overlay *) line 43 $ Displaying overlay guioverlay
startOgre +-+-+ 
-----------------------------------------------------
Starting Scene Creation
-----------------------------------------------------
Total Allocated Memory: 27938
Mesh Manager Memory: 13492
Texture Manager Memory: 0
Resource Manager Memory: 14446
-----------------------------------------------------
Starting Scene Creation
-----------------------------------------------------
Creating resource group 9c8c76db-3f37-41df-91e7-cf8674234ca5
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/Documents/7e828dee-ead8-4ac7-84b9-1f50497fa935/resources/materials/9c8c76db-3f37-41df-91e7-cf8674234ca5' of type 'FileSystem' to resource group '9c8c76db-3f37-41df-91e7-cf8674234ca5'
Added resource location '/var/mobile/Applications/9AC76310-AB72-4AD9-8993-35675D5DCBB1/Documents/7e828dee-ead8-4ac7-84b9-1f50497fa935/resources/images/9c8c76db-3f37-41df-91e7-cf8674234ca5' of type 'FileSystem' to resource group '9c8c76db-3f37-41df-91e7-cf8674234ca5'
2013-10-30 17:15:50.034 eyesee by Pinnacle Visualisation[6732:60b] TOTAL BYTES NOW: 0
Initialising resource group 9c8c76db-3f37-41df-91e7-cf8674234ca5
Parsing scripts for resource group 9c8c76db-3f37-41df-91e7-cf8674234ca5
Parsing script Eames.material
Finished parsing scripts for resource group 9c8c76db-3f37-41df-91e7-cf8674234ca5
Creating resources for group 9c8c76db-3f37-41df-91e7-cf8674234ca5
All done
Mesh: Loading fbc90c80-5e0f-446d-a38a-3744ff94ebbe.mesh.
Texture: 1379948917_1_HMI_OT.jpg: Loading 1 faces(PF_R8G8B8,512x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_R8G8B8,512x256x1.
Texture: 1379948917_2_HMI_OT.jpg: Loading 1 faces(PF_R8G8B8,512x256x1) with 5 hardware generated mipmaps from Image. Internal format is PF_R8G8B8,512x256x1.
Derived Positioning: 9c8c76db-3f37-41df-91e7-cf8674234ca5 X:0 Y:0 Z:0
Eames - SO X: 1.63395 Y: 0.896564 Z: 0.980201
Eames - SO X: 1.63395 Y: 0.896564 Z: 0.980201
-----------------------------------------------------
Scene Created
-----------------------------------------------------
Total Allocated Memory: 4557855
Mesh Manager Memory: 1490788
Texture Manager Memory: 786432
Resource Manager Memory: 2280635
-----------------------------------------------------
Scene Created
-----------------------------------------------------
Texture: spot_shadow_fade.png: Loading 1 faces(PF_R8G8B8,128x128x1) with 5 hardware generated mipmaps from Image. Internal format is PF_R8G8B8,128x128x1.
Any help on this would be fantastic as I'm very stuck.

Kind Regards

Carl
0 x

Carlyone
Kobold
Posts: 38
Joined: Thu Jul 05, 2012 3:51 pm

Re: Manual Textures and Planes on iOS7

Post by Carlyone » Fri Nov 01, 2013 12:55 pm

Hello,
This was absolutely my bad, I hadn't updated the headers in my project, when I realised this and then put in the correct ones it works.

Kind Regards

Carl
0 x

Post Reply