Hi everybody,
I have compiled Irrlicht library for iPhone successfully using instructions at here: http://irrlicht.sourceforge.net/phpBB2/ ... e&start=60
And I have built some simple applications on Iphone using compiled library.
However, now I got a problem of texture rendering:
when I try to run HelloWorld example on iPhone, everything works well except the texture of the girl. The texture does not display.
When I change the texture file from "sydney.bmp" to other image file such as "wall.bmp", the texture displays successfully.
But when I try other image files, most of them don't not display as texture of the girl.
does any body have the same problem?
Any comment would be appreciated.
Thanks in advance.
Texture rendering problem of Irrlicht on iPhone
-
- Posts: 4
- Joined: Sat Jul 03, 2010 9:47 am
-
- Posts: 4
- Joined: Sat Jul 03, 2010 9:47 am
Hi All,
I'm having the same issue. The sydney.md2 is not loading it's own texture, but is loading the wall.bmp texture. I read this topic and resized the image to 256x256 (same dimensions as the wall.bmp) and the app crashes when I try to load the texture.
The following error is thrown
I added a malloc_error_break and the line that is causing the issue is the marked below (found in the file CImage.cpp, line 43)
Size.Height has the value 4294967040 assigned to it and Pitch as 1024 assigned to it. Judging by the value in size... this is where the issue may be but not sure why.
Anyone know why this issue is thrown when i resize the bmp to 256x256 yet other images of the same size work fine.
Thanks in advance.
Matt
I'm having the same issue. The sydney.md2 is not loading it's own texture, but is loading the wall.bmp texture. I read this topic and resized the image to 256x256 (same dimensions as the wall.bmp) and the app crashes when I try to load the texture.
The following error is thrown
Code: Select all
Loaded mesh: sydney.md2
TestApp(377,0x3e2b47c8) malloc: *** mmap(size=4294705152) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Code: Select all
void CImage::initData()
{
#ifdef _DEBUG
setDebugName("CImage");
#endif
BytesPerPixel = getBitsPerPixelFromFormat(Format) / 8;
// Pitch should be aligned...
Pitch = BytesPerPixel * Size.Width;
if (!Data)
Data = new u8[Size.Height * Pitch]; //<--- ERROR ON THIS LINE
}
Anyone know why this issue is thrown when i resize the bmp to 256x256 yet other images of the same size work fine.
Thanks in advance.
Matt
Hi All,
I figured out what the issue was.
Depending on what software you use to resize the image, the software embeds specific header information into the file which is not filtered by the irrlicht engine.
I found this out by testing the image in PNG format. I created the image using photoshop and when trying to load the image a Fatal PNG error was given out by the app.
I ran a program called PNGenie (MAC OSX Software) that strips useless information out of PNGs and reduces the image size by approx 50%. By passing the PNG through this program, all the header information was stripped out and the texture now loads perfectly fine and is 16kb compared to the BMP version of 201kb.
Not sure what information was being stored in the BMP file and it is probably safer to resize these files in Windows as BMP is a native file format for windows systems.
I figured out what the issue was.
Depending on what software you use to resize the image, the software embeds specific header information into the file which is not filtered by the irrlicht engine.
I found this out by testing the image in PNG format. I created the image using photoshop and when trying to load the image a Fatal PNG error was given out by the app.
I ran a program called PNGenie (MAC OSX Software) that strips useless information out of PNGs and reduces the image size by approx 50%. By passing the PNG through this program, all the header information was stripped out and the texture now loads perfectly fine and is 16kb compared to the BMP version of 201kb.
Not sure what information was being stored in the BMP file and it is probably safer to resize these files in Windows as BMP is a native file format for windows systems.