OpenGL in PHP
Neophytus writes "Submitted as an entry into the .geek PHP5 tournament a proof of concept openGL implementation in PHP has been released by Peter 'iridium' Waller. The demonstration (download) shows four items being rendered in realtime by PHP at a not unreasonable 59FPS. The author welcomes feedback with practical uses for this technology."
Update: 06/09 01:10 GMT by T : iridiumz0r, author of this entry, adds a link to this informative page responding to a number of comments in the discussion below.
...Is truly a lost art.
Of course, we already knew this.
Well, it's not a port or an implementation; it's a wrapper to a DLL. That's the fun of dynamically loaded libraries: you can call opengl, gtk, qt, COM, CORBA, $WHATEVER_YOU_WANT from $WHATEVER_LANGUAGE_YOU_WANT as long as you take the time and effort to write a wrapper label, which this guy did, and he wasn't the first.
All's true that is mistrusted
So why not have 5 of them?
Here's the slightly altered code. (right click, save)
- Cary
I get ~113 frames per second...double the "official" number.
I also wonder what the FPS depends more on..CPU, to interpret the PHP, or graphic card, to render textures...hum..
-------
FM Clan
At least it let me know about the useful ffi extension. If it wasn't for this cute demo, I'd have never come across this.
First I would like to point out that it is still making calls to OpenGL functions which were written in C (and asm most likely). Since PHP is a scripting language and in this case it is calling the OpenGL functions most of the work is being done in the OpenGL calls. Therefore it should run pretty well because most of the delay will be resulting from the C function calls. Scripting languages and all interpreter languages should do well even for simple scenes. They do slow down when you have a lot of logic going on however, such as updating a world model graph.
Reserved Word.
I don't know what submitter of story's problem is with his computer only getting "59FPS." but I seem to get 120. Weird.
When's your next Slashdot Meetup??
This process is still young, but the eventual direction this will take is 3d apps over PHP and the web.
No, for the simple fact that this project is not headed in that direction. It does not provide for 3D apps over the web.
It's bound to go that way.
No, because in order for it to go that way, a terrible amount of work would need to be done, and the end result wouldn't provide anything that doesn't already exist.
I think it's extremely viable for a plugin to be designed that will use this, and many will adopt it for websites as a result. Why the hell wouldn't they?
Because PHP is not very well suited to the task, and better solutions exist. This hack is on the order of building a toilet out of LEGO's. Possible, but neither viable nor a harbringer of things to come.
It's not a totally bad idea, just one that scares me somewhat, if it's used maliciously.
I don't know that you know what the idea is here.
There are systemic misuses and outright exploits. I am sure that any new system has both.
There is nothing new about this "system". It's just another computer program.