Irrlicht for IPHONE

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
fluke9
Posts: 6
Joined: Sat Aug 04, 2012 12:13 pm

Re: Irrlicht for IPHONE

Post by fluke9 »

hendu wrote:Is that even legal (= compliant with GL ES standard)?
Did not bother to research long enough :wink:

Thats also why i called it a hack, hehe.
hendu wrote:The spec says _both_ "foo" and "foo[0]" refer to the first array element. And seems some mobile drivers only do one and some only the other. Sigh..
Hmm there are really drivers which export foo and not foo[0] ?

Logically i find exporting only foo[0] more plausible than exporting only foo.

Anyways, i fixed it, and my hack should cover both cases, im quite happy with it ;)


Regarding the performance issues i have, i found out that the fixed pipeline emulation shader used is terribly slow on the POWERVR SGX used in the iPhone.
It uses discard which is a big nono accoring to PowerVR specs, commenting out all discard instances and disabling lightning calculation puts me up to 25-30 fps.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Irrlicht for IPHONE

Post by hendu »

I'm not in charge of the GLES port, but my view is to code against the standard, and tell the vendors to fix their drivers or gtfo.

Adding hacks for broken drivers just decreases the code quality.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Irrlicht for IPHONE

Post by Nadro »

Currently the best solution for us is as said Hendu report this bug to a driver vendor. In built-in Irrlicht shaders we will just not use arrays I think.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
fluke9
Posts: 6
Joined: Sat Aug 04, 2012 12:13 pm

Re: Irrlicht for IPHONE

Post by fluke9 »

hendu wrote:I'm not in charge of the GLES port, but my view is to code against the standard, and tell the vendors to fix their drivers or gtfo.
Sure, but the code, as it currently is, does actually prefer one buggy driver over the other. ;)

Spec says one should return the correct array on "foo" and "foo[0]".

The iPhone (with the latest 5.1.1 loaded) returns it only on "foo[0]" which is incorrect.
I got an HTC here with Android and it returns only "foo" and does not work with "foo[0]" which is also incorrect.

However the driver will work with one incorrect implementation (the Android one) and not the other one.
If it would have used "foo[0]" ... you get what i mean.


Also telling Apple, HTC, Samsung to gtfo is not always an option which will work if you have to get things done.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Irrlicht for IPHONE

Post by hendu »

Report it to their devrel. If no response in a week, raise a public ruckus. Get it on slashdot and see them up the priority.
fluke9
Posts: 6
Joined: Sat Aug 04, 2012 12:13 pm

Re: Irrlicht for IPHONE

Post by fluke9 »

Another question, is there any way to load PVR Textures in the OpenGL-ES branch ?
fluke9
Posts: 6
Joined: Sat Aug 04, 2012 12:13 pm

Re: Irrlicht for IPHONE

Post by fluke9 »

Just finished a PVRTC loader and support for it in the ES1.1 Driver, will do ES2.0 soon.
Loading times are like a 1/4th now and the scene renders 2-10fps faster.

Anyone interested in it ? (If so i would clean it up and put it up for download somewhere)
James M.H. Lee
Posts: 1
Joined: Fri Jul 22, 2011 2:39 pm

Re: Irrlicht for IPHONE

Post by James M.H. Lee »

Image

Hi, I'm trying to use the Irrlicht open-gl es2.0 on iPhone4s, but some trouble.
Device init with es1 works fine everytime, but with es2 sometimes ok sometimes no texture or charactors. (see above picture)
It happens randomly on simulator and on real device.
- Xcode4.2, iPhone 5.1 simulator, iPhone4s(5.1.1)

I changed vsh, fsh files commenting out "if(uTexture[0])",
Enabled USE_SPECULAR, USE_LIGHT_CUTOFF
Changed "../../media/Shaders/" to "media/Shaders/" in IrrCompileConfig.h to load shaders properly.

Modified iPhoneTemplateApp.zip to work with latest svn.
( Curiously found out EAGLView is no longer needed. Am I correct ? )

In the code
createDevice(EDT_NULL)
changed to current working directory for the shaders which are loaded in createDeviceEx function.
...
createDeviceEx(..) with EDT_OGLES2

I spent 3 nights working with this. Deeply digging into Irrlicht source code with no success.

Any help will be appreciated !
Thanks.
flynks
Posts: 3
Joined: Wed Oct 24, 2012 12:00 pm

Re: Irrlicht for IPHONE

Post by flynks »

Hi,

I have tried fix the opengl es 2 but no luck also. Does anyone have a working build for es 2?
Does anyone tried this app on the ipad -> "http://apps.swaprose.com/ios/slingball3d/"? It says that it was build using irrlicht and bullet physics. It looks promising but don't know if it builds from irrlicht or an es 2 build. I would like to try this but I don't have an iPad. :(

If there's anyone that have a working build of es 2 for ios, if you can help we gladly appreciate it. Thanks.
beof
Posts: 8
Joined: Thu Nov 22, 2012 9:40 am

Re: Irrlicht for IPHONE

Post by beof »

Hello. I have changed the code as fluke9 described, however, the console still prints out the following error messages:
Loading shader:COGLES2FixedPipeline.vsh
Loading shader:COGLES2FixedPipeline.fsh

Unable to find uniform : uLightSpecular
Unable to find uniform : uLightDirection
Unable to find uniform : uLightExponent
Unable to find uniform : uLightCutoff

And the npot 2D image texture is also black.
Post Reply