iPhone support?

Return to Panda Features in Development

Postby RPGKHFan » Mon Apr 27, 2009 12:17 am

Will you use the IPhone SDK 3.0?
RPGKHFan
 
Posts: 6
Joined: Sat Apr 11, 2009 8:44 am

Postby drwr » Mon Apr 27, 2009 12:39 am

Huh, I don't know that it matters that much. The particular version of SDK used to compile the engine is surely the smallest part of this whole porting effort. Most of the stuff that Panda brings to the table is outside of the realm of the SDK, anyway--Panda is a 3-D graphics engine, while the SDK and its Frameworks provide fundamentally 2-D operations. If you're programming in Panda, you probably won't be using most of the UIKit operations, unless you go out of your way to call them directly (for instance, by using PyObjC or some such).

You could, of course, write your own Objective-C app using the full SDK and all of its interfaces, and also link with Panda to use Panda's operations only when it suited you. Then you would largely be writing your own app using Apple's SDK, and using Panda incidentally; and it would be completely up to you which version of the SDK you used.

But, if you wrote an app entirely in Python and Panda, you wouldn't really see any of the SDK directly.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby rdb » Mon Apr 27, 2009 12:42 am

Hmm, it doesn't seem like the Cg Toolkit supports the iPhone. We should get GLSL support working. :)
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby drwr » Mon Apr 27, 2009 1:07 am

GLSL not supported on the IPhone either. :)

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby rdb » Mon Apr 27, 2009 1:21 am

Oh, darn. I thought iPhone supported OpenGL ES 2.0 (which supports shaders) but it seems like they only support 1.1.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby Mindblighter » Tue Jun 09, 2009 3:03 am

A bit of news:
the new iPhone 3GS supports OpenGL ES 2.0
:arrow: http://www.pocketgamer.biz/r/PG.Biz/iPhone+3GS/feature.asp?c=13744
Mindblighter
 
Posts: 98
Joined: Thu Aug 02, 2007 7:33 am
Location: Finland

Postby littlejim84 » Sun Jun 14, 2009 11:28 am

Hi, I'm new here... This is fantastic news...

Dare I ask, when do you reckon this capability will be available?
littlejim84
 
Posts: 11
Joined: Sun Jun 14, 2009 11:27 am

Postby drwr » Sun Jun 14, 2009 12:03 pm

Depends on how intrepid you are, I suppose. You could actually download Panda from the cvs tree and build it yourself (using a special iPhone build configuration), and run Panda3D apps on your phone today. But for a fully-supported turnkey solution, you'll need to wait at least for the 1.7 release, which is not yet scheduled but will hopefully happen within a few months.

(In addition to the publish itself, there's also a little more work that still needs to be done in the codebase to make it a complete iPhone solution. Some of this work will overlap with the web plugin effort I'm also working on, so I've put the iPhone development temporarily on hold while I continue the web plugin effort full-speed. But the claimed timeframe of a few months still applies.)

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby littlejim84 » Sun Jun 14, 2009 12:39 pm

Quick reply! ...wow, didn't realise it was that developed? A few months? That's nothing!

I'm a total noob to all this stuff really, I've just been looking for a way of making simple 3D games with my mate who is studying 3D modelling and animation. I looked at Blender but can't import his 3dsmax models (with animation) properly it seems. I'm learning Python for my web development job, so I looked around and came across Panda! ...looks great, and then read this about iPhone deployment, even better!

Nice one! Certainly appreciate all the hard work.
littlejim84
 
Posts: 11
Joined: Sun Jun 14, 2009 11:27 am

Postby jhocking » Sun Jun 14, 2009 9:55 pm

Sweet, looking forward to it. I've already started developing 2D games on iphone, but I already have a couple game concepts I'd really love 3D graphics for.
-Joe Hocking
www.newarteest.com
User avatar
jhocking
 
Posts: 206
Joined: Sun Dec 21, 2008 10:22 am
Location: Second City

Postby rdb » Thu Jul 02, 2009 11:36 am

Mindblighter wrote:A bit of news:
the new iPhone 3GS supports OpenGL ES 2.0


I've just checked in OpenGL ES 2.x support to CVS, including GLSL support of course.
It's highly experimental, but functional (I can apply shaders to objects). Since the fixed-function pipeline is no longer there, we do need a shader generator with GLSL support though.

I don't own an iPhone, but it seems to work on my PowerVR SGX 530 card of my OMAP 3530-based SoC. =) The iPhone 3GS uses the SGX 520, I believe, which is almost the same thing, but just 2x as slow.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby treeform » Thu Jul 02, 2009 11:49 pm

your avatar makes my computer feel 2x as slow.

Can we get more updates from David regarding this? I heard that its stopped do to browser plug in. Can we get update on the plugin as well?
User avatar
treeform
 
Posts: 2106
Joined: Sat May 05, 2007 5:15 pm
Location: SF, CA

Postby rdb » Fri Jul 03, 2009 12:46 am

I've just changed my avatar. 8)

I can see he's checking in loads of new stuff to the web plugin every day- most of it even compiles fine on my Linux box.
Too bad there's no npapi plugin support for Linux yet, I'd love to try it already. :)

PS. p3dPythonRun.cxx references a "runp3d_frozen.pyd", how do I make that?
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby drwr » Fri Jul 03, 2009 10:56 am

The plugin effort is indeed going well. I've got a webpage running Airblade and Roaming Ralph in a little embedded applet window. Right now I'm working on adding scriptability, so that Panda can control the web document; or JavaScript on the web page can control Panda. Still to come are automatic Panda version selection and patching, and security features. And, of course, support for Mac (partially complete so far) and Linux (not yet started).

The iPhone support is on hold for now, but it will eventually take advantage of the same .p3d packaged application we'll be using for web distribution, so it does make sense to wait a little bit for that to be finished. Still, as it is right now, Panda does run just fine on the iPhone, with Python and everything. It does take a bit of an effort to compile for the iPhone, and this is one reason why it will be advantageous to have a p3d-runner already precompiled for the device. (Of course, installing this p3d-runner program on your iPhone will require a jailbroken phone, because Apple doesn't want you to have apps that run other apps. For those who'd rather not go there, we can still provide the straight-and-narrow path to iPhone development, which will just be a little clumsier.)

PS. p3dPythonRun.cxx references a "runp3d_frozen.pyd", how do I make that?

I have the following script on my Mac box:
Code: Select all
python $DIRECT/src/showutil/pfreeze.py -i direct.directbase.DirectStart -i direct.actor.Actor -i direct.fsm.FSM -i direct.directutil.Mopath -o runp3d_frozen.so direct.showutil.runp3d

.pyd is just the extension on Windows, other platforms will use .so.

Having the runp3d_frozen file isn't enough, though; you'll next need the Python/Panda package that it will want to download. I also have this script:
Code: Select all
#! /bin/sh

cp -v $DTOOL/built/lib/*.dylib ~/p3drun/  || exit
cp -v $PANDA/built/lib/*.dylib ~/p3drun/  || exit
cp -v $DIRECT/built/lib/*.dylib ~/p3drun/  || exit
cp -v $DIRECT/built/bin/p3dpython ~/p3drun/  || exit

mkdir -p ~/p3dstage/coreapi/dev/osx.i386
cp -v $DIRECT/built/lib/p3d_plugin.dylib ~/p3dstage/coreapi/dev/osx.i386/ || exit

python $DIRECT/src/plugin/make_package.py -d ~/p3dstage -s ~/p3drun -p panda3d_dev_osx.i386  || exit
python $DIRECT/src/plugin/make_contents.py -d ~/p3dstage  || exit

And then I compile with:
Code: Select all
#define P3D_PLUGIN_DOWNLOAD file:///Users/drose/p3dstage


As you can see, there's a bit of setup work you'll need to do to play with this locally. :) Still, I don't see any reason why you wouldn't be able to get the panda3d standalone application to compile and run on a Linux box or anywhere else. It might not even be far to get the npapi part compiled on Linux, though I'll get there eventually, I promise. :)

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby rdb » Mon Jul 06, 2009 2:39 pm

Thanks - I was able to run p3dpython with your instructions. No idea how it works, though - does it communicate with the plugin via sockets? How is the XML stuff piped to p3dpython?

After a lot of hacking I was also able to get pfreeze, packp3d and runp3d working. Really neat stuff =)

I recently installed WinXP on VirtualBox (Panda works with 3D acceleration on it) so I'm sorely tempted to try building the plugin. :)
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby drwr » Mon Jul 06, 2009 3:17 pm

p3dpython communicates with the browser via anonymous pipes, as created via the standard Posix pipe() call. This, of course, requires p3dpython to be launched as a subordinate process to the browser itself; it can't be run from the command line. The XML data is streamed in both directions along these anonymous pipes; it's just a quick-and-easy way to stream arbitrary data between separate processes.

Having Panda run in a separate process is quite a pain, but it really is necessary in order to support more than one instance of a Panda window running in the browser at once, especially unrelated instances. It's also necessary to support different versions of Panda in different instances; and it has other nice advantages like keeping Panda's frame rate independent of the browser, and helping to keep the browser from crashing in case the Panda app crashes.

I'm surprised it took hacking to get packp3d and runp3d running. Those should have worked out the box. pfreeze was a mess, though, and will definitely require some cleanup to make it more world-friendly. Are your changes safe enough to commit back in, to save me the work of re-doing your efforts when I visit Linux? :)

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby rdb » Tue Jul 07, 2009 2:19 am

drwr wrote:I'm surprised it took hacking to get packp3d and runp3d running.


Packp3d and runp3d worked well, but first I couldn't get my models to load. I just found out I just had to omit the '.egg' when loading models in my game, and runp3d would change the default model extension. Clever!
Maybe there should be a config var to force models to be loaded as .bam, even if .egg was explicitly requested, so any game given to packp3d would work. Then again, this would be a bit hacky.

Also, I think there should be a commandline option to specify custom extensions to be included (xml, etc) instead of just .egg and images.

drwr wrote:pfreeze was a mess, though, and will definitely require some cleanup to make it more world-friendly. Are your changes safe enough to commit back in, to save me the work of re-doing your efforts when I visit Linux? :)


First, I had to alter it to add the include and link directories of Python to the compile/link commands and "-lpython2.6". (Is it a good idea to link to Python at link-time this way, or should we link to pystub or so.)
Also, it didn't chew names with dashes (like Tut-Roaming-Ralph) because it would convert that into a C variable name. Maybe we should hash that or make pfreeze remove special symbols.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby drwr » Tue Jul 07, 2009 9:27 am

Maybe there should be a config var to force models to be loaded as .bam, even if .egg was explicitly requested, so any game given to packp3d would work.

Hmm, this is not a bad idea. It is hacky, but probably not so bad.

Also, I think there should be a commandline option to specify custom extensions to be included (xml, etc) instead of just .egg and images.

Also a good suggestion. I think eventually we'll need some kind of spec file for fully customized builds, something akin to Python's disttools, since many games will have highly customized needs.

Is it a good idea to link to Python at link-time this way, or should we link to pystub or so.

We actually do need to link to Python here, since we are building a Python runtime. Linking with pystub would break things horribly. Eventually, pfreeze will have to be a lot more like makepanda, and do a better job of automatically figuring out the appropriate compile and link lines.

Also, it didn't chew names with dashes (like Tut-Roaming-Ralph) because it would convert that into a C variable name. Maybe we should hash that or make pfreeze remove special symbols.

Ah, a good point. Of course, these filenames are not legitimate Python module names anyway, for a similar reason (because they're not valid as Python symbol names). They can only be loaded from the command line, where their name gets changed to "__main__" anyway. Unless Python has a trick here I'm not aware of.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby MistaED » Sat Jan 23, 2010 8:25 am

Hi all,

Just curious, how hard would it be to build panda with EGL/X11/OpenGL ES 2.0 and GLSL shaders? I can't seem to see their entries in the makepanda python script but would it just require adapting this file to point to those parts?

Thanks!
MistaED
 
Posts: 5
Joined: Sat Jan 23, 2010 8:20 am

Postby rdb » Sat Jan 23, 2010 9:15 am

Although makepanda builds with GLSL support out of the box, it does not support building the EGL/GLES(2) part of Panda. You'll need to use the ppremake build system for that, or add the proper instructions to makepanda.

Beware that I haven't tested the OpenGL ES support in while, so you may encounter build issues. I'd be happy to help you through those, though.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby MistaED » Sat Jan 23, 2010 9:35 pm

Thanks for the reply rdb, my plan was to compile it for the nokia n900 platform seeing as I've got a scratchbox system set up and the actual device. I'll compile the dependencies missing first and then tackle panda, like ODE & openal-soft which haven't been ported to Maemo yet. http://www.maemo.org/ essentially it is nokia's debian-based linux for internet tablets and smartphones.

The hardware is identical to the beagle board (OMAP3/PowerVR SGX) so I'm hoping it shouldn't be too difficult to port. Thanks again rdb.
MistaED
 
Posts: 5
Joined: Sat Jan 23, 2010 8:20 am

Postby rdb » Sun Jan 24, 2010 3:45 am

Ah, okay. If the hardware is similar indeed it shouldn't be too much effort. I cross-compile Panda3D myself with the codesourcery toolchain. I started without much thirdparty packages, and when I got it working, added those other libraries. If you want, email me and I'll send you my Config.pp file that I used for cross-compilation.
rdb
 
Posts: 9458
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby csimon » Tue Mar 30, 2010 8:33 pm

drwr wrote:Still, as it is right now, Panda does run just fine on the iPhone, with Python and everything. It does take a bit of an effort to compile for the iPhone, and this is one reason why it will be advantageous to have a p3d-runner already precompiled for the device. (Of course, installing this p3d-runner program on your iPhone will require a jailbroken phone, because Apple doesn't want you to have apps that run other apps. For those who'd rather not go there, we can still provide the straight-and-narrow path to iPhone development, which will just be a little clumsier.)


I'm considering using Panda3D for iPhone development, but I'm not clear on how difficult that will be. What is the general process required to create an iPhone app using Panda? I would prefer to take the straight-and-narrow (non-jailbroken) path.

If possible, I'm planning to load Collada files, use OpenGLES 2.0, and develop in C++.

Thanks for any help,
Cory
csimon
 
Posts: 1
Joined: Tue Mar 30, 2010 7:44 pm

Postby drwr » Wed Mar 31, 2010 12:05 pm

We haven't actually made a lot of forward progress on the fully-productized iPhone app development process yet. That is to say, we're in the same state today that we were when this was discussed in this thread: the code is there, and I do have a Panda app running on my (non-jailbroken) iPod touch, but it's not easy to develop for yet.

We hope to get this finished within the next few months.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby ShinjiHiko » Thu May 27, 2010 6:02 pm

What needs to be done before you can officially release the iPhone version?
ShinjiHiko
 
Posts: 16
Joined: Fri Jan 19, 2007 12:52 am

Postby drwr » Thu May 27, 2010 6:46 pm

There's been a delay due to Apple's new iPhone Developer License, which explicitly forbids the use of any language other than C, C++, or Objective-C (which presumably includes Python).

Feel free to write a nasty letter to Steve Jobs.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby ShinjiHiko » Thu May 27, 2010 7:28 pm

Do you have confirmation on that? Because I thought Apple simply did not want other languages to be compiled into native iPhone code. Since the Panda3D engine is written in C++ and the Python is interpreted it should be fine.

I don't know, I'm no expert on Apple's user agreements.
ShinjiHiko
 
Posts: 16
Joined: Fri Jan 19, 2007 12:52 am

Postby drwr » Thu May 27, 2010 11:15 pm

There's a lot of speculation on the net as to what Apple really and truly has in mind, but this phrase is hard to get around:

"Applications must be originally written in Objective-C, C, C++"

There are no clarifications forthcoming from Apple, so I guess any doubts will be resolved when the new license goes into effect and we can see what they actually do forbid and what they don't.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Question/couple points

Postby SomeCallMeTim » Mon May 31, 2010 2:07 pm

I agree that the new Apple license is very strict. But the truth is that it's so strict that they can't possibly enforce it as written--or nearly half of the top games on iPhone would need to be kicked out of the store.

Also, since C++ is a permitted language, could you potentially release Panda3d as a C++-only engine? Or is it too tightly integrated with Python to be able to disable that integration?

Technically even that would be against the rules ("no compatibility layer"). But that part of the rules is simply insane, and frankly impossible to enforce entirely.

Yes you could pick a particular engine and exclude it (using "anti-virus"-like signature techniques, for example), but you're not going to get every developer to completely rewrite every game for iPhone that exists on other platforms. So everyone will have a compatibility layer for their own games.

But if the Python integration is too tightly bound in with the rest, then I guess you're right--in that I personally wouldn't want the extra overhead of a Python interpreter in my iPhone game (or on Android).

Too bad Panda 3d doesn't use Lua instead. Much lower overhead, and faster to boot.
SomeCallMeTim
 
Posts: 3
Joined: Mon May 31, 2010 1:57 pm

Postby drwr » Mon May 31, 2010 2:15 pm

There's no marriage of Panda3D and Python. It should be possible to write a C++ iPhone app using Panda3D. It's not entirely clear to me whether this falls under the definition of using a "compatibility layer" (since Panda is open source, you can copy the entire library into your application source code folder--and then it becomes part of your application itself, not a separate layer).

That said, I've used Python to develop experimental apps for the iPhone, and it works fine, from a technical standpoint. But this has been hashed to death: Apple's license is not about technical restrictions, it's about market share.

Whether it's realistic for Apple to eliminate nearly half of the top games in the App store is also kind of beside the point. It appears that Apple thinks this is a worthwhile sacrifice for their own business needs, and they might well be right.

Whether this new agreement is enforceable in practice or not is irrelevant for the purposes of declaring Panda3D's iPhone support. If developing for iPhone using Panda3D would violate Apple's developer agreement, then Panda3D cannot provide (legitimate) iPhone support.

Of course, we can continue to provide illegitimate iPhone support. That's less exciting to developers, of course.

David
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

PreviousNext

Return to Panda Features in Development

Who is online

Users browsing this forum: No registered users and 0 guests