Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Fri Jul 10, 2020 12:45 am

All times are UTC

Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Jan 15, 2009 9:21 pm 

Joined: Tue Jul 08, 2008 2:37 am
Posts: 181

Some days ago, I've found some time to begin a Raydium port for the iPhone OS.


This add-on, to the files included within the Raydium Mac OS X SDK, requires an installed iPhone SDK from Apple. You should also be able to use another cross-compilation build environment. It supports iPhone OS 2.0 or higher and was tested in the iPhone simulator, on an iPhone 2G, 3G and 4G ... errr no, not yet on 4G. ;)

The initial idea is to create a complete Raydium SDK for the iPhone OS or perhaps to merge with the Mac OS X SDK to an all-round Apple SDK.

The graphics hardware behind the iPhone and iPod Touch is a PowerVR MBX Lite:
  • There is no stencil or accumulation buffer.
  • There are only two texture units.
  • The maximum texture size is 1024×1024 (use power of two only).
  • The maximum space for textures and surfaces is 24MB.
  • Only 2D textures are supported.
  • There is no software rendering fallback.
iPhone 2G debug session wrote:
Raydium: Raydium 3D Game Engine
Raydium: version 0.800
Raydium: command line args: OK
Raydium: chdir to './': OK
Raydium: using '/var/root/.raydium' as home dir
Raydium: Requesting 480x320:32 mode
Raydium: (my)glut: -> pwInit
Raydium: (my)glut: UIApplication
Raydium: (my)glut: UIWindow
Raydium: (my)glut: UIView
Raydium: (my)glut: <- pwInit
Raydium: using PowerVR MBXLite with VGPLite, from Imagination Technologies (version OpenGL ES-CM 1.1 (30.7))
Raydium: Signal Handlers: OK
Raydium: OpenGL extensions: OK
Raydium: Platform "4xfloat" vector size is: 16 byte(s) long
Raydium: OpenGL implementation maximum texture size: 1024x1024
Raydium: OpenGL hardware providing 2 texture unit(s), Raydium deals with 2
Raydium: OpenGL anisotropy max level is 2.00
Raydium: vertex arrays memory: OK
Raydium: path: OK
Raydium: keyboard: OK
Raydium: mouse: OK
Raydium: sound: Buffer creation successfull
Raydium: sound: OK, using 'default device'
Raydium: PHP R3S Scripts: rayphp
Raydium: PHP support: OK
Raydium: atexit functions: OK
Raydium: lights: OK
Raydium: fog: OK
Raydium: Sky: OK
Raydium: objects: OK
Raydium: network: OK
Raydium: timer: detection: 1 iterations: diff: 5 steps (1000000/sec)
Raydium: timecall: method accuracy = 0.5 ms (200000.00 Hz)
Raydium: timecall: Using basic gettimeofday() method
Raydium: timecall: OK (200000 Hz)
Raydium: timecall: softcall 0: 1 Hz (1000000 clocks interval)
Raydium: particle: OK
Raydium: gui: OK
Raydium: video (live): OK
Raydium: shadow: OK
Raydium: HDR: OK
Raydium: shaders: FAILED (GLSL 1.0 not found)
Raydium: webserver: OK
Raydium: Raydium engine reseted to original state
Raydium: timecall: callback 1: 400 Hz (2500 clocks interval)
Raydium: physics: ODE Net: 10 element(s)/packet
Raydium: physics: OK
Raydium: RegAPI: OK
Raydium: Engine is now ready.
Raydium: Tex. num 1 (BOXfront.tga) loaded: 512x512, 3 Bpp (b0 lm0 hdr0 fx0 fy0)
Raydium: Tex. num 2 (BOXback.tga) loaded: 512x512, 3 Bpp (b0 lm0 hdr0 fx0 fy0)
Raydium: Tex. num 3 (BOXleft.tga) loaded: 512x512, 3 Bpp (b0 lm0 hdr0 fx0 fy0)
Raydium: Tex. num 4 (BOXright.tga) loaded: 512x512, 3 Bpp (b0 lm0 hdr0 fx0 fy0)
Raydium: Tex. num 5 (BOXbottom.tga) loaded: 512x512, 3 Bpp (b0 lm0 hdr0 fx0 fy0)
Raydium: Tex. num 6 (BOXtop.tga) loaded: 512x512, 3 Bpp (b0 lm0 hdr0 fx0 fy0)
Raydium: WARNING: timecall's too long
Raydium: (my)glut: -> glutSwapBuffers
Raydium: (my)glut: UIView
Raydium: (my)glut: UIWindow
Raydium: (my)glut: <- glutSwapBuffers

But don't expect to much from the current state of the port. The good thing is, that I've figured out all needed dependencies and they are ready to use now. That wasn't a really pleasant job to do, but here's a list of the ARM architecture based appended dependency package: [1]
iPhone OS dependency list wrote:
FreeALUT 1.1.0 http://openal.org/
Build options: --disable-shared

Cal3D 0.11.0 http://home.gna.org/cal3d/
Build options: --disable-shared --enable-static

cURL 7.16.3 http://curl.haxx.se/
Build options: --disable-shared --disable-crypto-auth --without-gnutls --without-ssl --without-zlib --without-libssh2 --disable-ipv6 --disable-manual --disable-telnet --disable-tftp --disable-ldap --disable-file --disable-ftp

GLEW 1.5.0 http://glew.sf.net/
Build options: default

iGLU 1.0.0 http://code.google.com/p/iphone-glu/
Build options: default

libIntl from GetText 0.17 http://gnu.org/
Build options: --disable-shared --disable-java --disable-native-java --disable-csharp --without-emacs

JPEG 6b http://ijg.org/
Build options: --disable-shared

ODE 0.10.0 http://ode.org/
Build options: --disable-shared --disable-double-precision --disable-demos

libOgg 1.1.3 http://xiph.org/
Build options: --disable-shared

PHP 5.2.6 http://php.net/
Build options: --disable-shared --enable-embed=static --with-zlib --enable-ftp --enable-static=zlib --with-curl --disable-simplexml --disable-xmlreader --disable-xmlwriter --enable-soap --without-iconv

libVorbis 1.2.0 http://xiph.org/
Build options: --disable-shared --disable-docs --disable-oggtest
All other needed things are included in the iPhone SDK, like e. g. the OpenGL ES framework.

The bad thing is the overall status. When you build and run ManiaDrive for instance, you will get not more as a really heavy sized OGG/Vorbis player for now. Year, you can really hear music from that little Apple devices, no joke! ;)
This means that the Raydium application starts up in fullscreen mode, the screen is rotated to landscape, where the home button is right, the engine will then be started and is ready to use. The problem is, that I've "#ifndef __arm__ #endif" all positions with undefined symbols. All these positions were marked with this message as a comment in the source code: "// Not available in OpenGL ES (...).". Here is a list, which includes the symbols that have to be replaced with OpenGL ES specific functions:
Undefined symbols for OpenGL ES wrote:

There is also one GLU function missing in iGLU for now, which is not supported yet:
Undefined symbol for iGLU wrote:

I'm posting here at this incomplete state of the port, because I currently haven't much time to get this fully completed. I'm appending files of the current state, so anybody interested is pleased to play with this to get this hopefully done. I'll continue on this, when the time allows me to, for sure! :D
All modifications on the engine are included in a Raydium patch for Subversion revision 824. [2]
I've also created some helper scripts, which will assist you on building and running the application on your environment. The package also includes a ready to use application template with information and image files. [3]

[1] Raydium-R824-iPhoneOS-Dependencies-ARM.tar.gz (12MB)
[2] Raydium-R824-iPhoneOS-Patch.gz (9KB)
[3] Raydium-R824-iPhoneOS-Additions.tar.gz (56KB)

Best regards,

Last edited by st on Wed Feb 15, 2012 6:40 pm, edited 1 time in total.

PostPosted: Fri Jan 16, 2009 12:27 pm 

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759

Amazing, raydium on iphone !!!!

Nice work !!!

Have a nice day

PostPosted: Sat Jan 17, 2009 8:05 pm 
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Great work! :D

PostPosted: Sun Jan 18, 2009 11:20 pm 
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Amazing work, st !

Sadly, it's where we see that Raydium is not designed for "modularity". The engine is an OpenGL engine, and that's it. A rendering interface would have been a good idea for such situations, so we could have an OpenGL render, an OpenGL ES one, DirectX or even software.

But regarding your missing symbol list, it's probably not that impossible to find a rendering path into Raydium for OpenGL ES. The list is quiet short, and it's probably possible to reduce again this list if we get rid of some "non vital" feature of Raydium.

And I must admit that the iPhone is a quiet appealing target for Raydium ...

PostPosted: Tue Feb 17, 2009 1:46 pm 

Joined: Tue Jul 08, 2008 2:37 am
Posts: 181
I'm writing here to say that I'm on it. :D

Going onwards on porting the engine, the list of problems will become longer and longer. But I don't give up! :)

For example, I'll have to replace all places with OpenGL ES equivalents using triangles, where GL_QUADS is used, because quads aren't directly supported.
Texture generation is not working yet, I'll want to emulate the missing relevant functions using Mesa 3D as a cheat sheet. ;)
When I fake the textures using random generated RGB values, I'm able to see some parts like the console with blocky font for now.

Replacement list for OpenGL ES wrote:
glLightModeli => glLightModelf
glTexCoord2f => Using texture coord arrays.
glBegin => glEnableClientState
glGenLists => No replacement yet.
glEnd => glDisableClientState
glPolygonMode => No replacement yet.
glVertex3f => Using vertex arrays.
glCallList => No replacement yet.
glGetTexLevelParameteriv => No replacement yet.
glTexGeni => No replacement yet.
glColor4fv => Using color arrays.
glEndList => No replacement yet.
glOrtho => glOrthof
glFogi => glFogf
glTexGenfv => No replacement yet.
glNewList => No replacement yet.
glGetDoublev => glGetFloatv
Replacement list for iGLU wrote:
gluBuild2DMipmaps => No direct replacement yet. Can't use trilinear and anisotropic filtering, so filter is set to bilinear in these cases.

The source code is now free from the "__arm__" directives, it's now splitted up into "IPHONEOS" and "OPENGLES" specific ones, to give the possibility to use the new rendering pipeline apart of that for possible other ports using OpenGL ES.

Here's the new "full" patch for Raydium revision R826: Raydium-R826-iPhoneOS-Patch.gz (12KB)

Some days ago, our new forum user iworld67 has written a private message to me. He's very interested on this port and he'd a question regarding the build procedure for the ODE dependency. I hopefully send him what he want, but here are my current build configurations for the dependencies in the hope that someone else find this useful, too: Raydium-R826-iPhoneOS-Dependencies-ARM-Build-Configurations.gz (1KB)

PostPosted: Tue Feb 17, 2009 10:07 pm 
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Impressive patch :)

I'm very curious to see the first WIP captures of this new (I hope !) upcoming port :)

PS: Just wondering; what was the trouble with the __APPLE__ define ?

PostPosted: Sat Feb 21, 2009 12:22 am 

Joined: Tue Jul 08, 2008 2:37 am
Posts: 181
Status reporting ...

Xfennec wrote:
I'm very curious to see the first WIP captures ...
Your wish is my command. ;)
Xfennec wrote:
What was the trouble with the __APPLE__ define?
There wasn't any problem with it, probably just for cosmetic and uniformity reasons.

As you can hopefully see in this video (flash embedding is disabled) and on the following images, I've finally managed to get the textures working. And yes, I know the video quality is a peace of s***, I'll try to do it better next time, sorry. ;)

ImageImageImageNote: First one shows the Springboard with some lovely Raydium apps. On the second picture you can see my "Test" sample. Yeah and on the last one, hmm, this should be the ManiaDrive intro screen main menu? It is, really! :lol: Of course it uses just some faked textures...

List of additions wrote:
  • Logging: A Raydium.log file will be saved on the finalization part of the application in the users home directory.
  • OpenGL ES wrapper, so we don't have to modify every source code file directly for the missing functions.
  • Acceleration support (X, Y, Z axis - when you rotate the device): Should be useful for the joystick API.

TODO list wrote:
  • Create low resolution texture pack, perhaps usage of OpenGL ES texture compression extensions.
  • Set a default frame limiter!?
  • Multi touch support will provide support for the mouse and keyboard API (1 touch will be a mouse click, double tap or two touches at a time toggles console etc.).
  • Ability to show and hide the keyboard could be useful for the console and GUI elements.
  • Vibration as a rumble pack to emulate force feedback.
  • Camera for Live API?!

Test results wrote:
  • Anim: Crashes after a long loading time with a black screen, perhaps a reason of the huge sized model.
  • Camplay: Works only with the sky enabled, so when all other things are commented out.
  • Explo: Nope.
  • ManiaDrive: Viewable intro screen with faked RGB textures like on the screenshot. You can hear about the first 10 seconds of the song while watching the intro screen before the sound will be stopped (OpenAL issue it seems). Crashes like most other samples, when we use "real" textures.
  • MD Editor: Not yet compilable.
  • Kinghill2: Nope.
  • KH2 Server: Works with a nice black screen and also on command line. Lets play KH2 together, I can host a server on my mobile phone! 8)
  • Shaman: Not yet compilable.
  • Square: This works, but it only uses some Raydium relevant things like raydium_init_args and raydium_callback. ;)
  • Test: Works. (Hint: Frame limiter is set to 24 FPS and I haven't tested the sample without it, yet.)
  • Test8: Crashes.
  • Volcano: Crashes.
Or with other words, no official example is working correctly with unmodified sample source code right now. :)

Here's the source code of the "Square" and "Test" samples if you want to have a look.

Second new "full" patch for Raydium revision R826: Raydium-R826-iPhoneOS-Patch2.gz (8KB)

PostPosted: Sat Feb 28, 2009 6:08 pm 

Joined: Tue Jul 08, 2008 2:37 am
Posts: 181
Quick status update, trying to keep my post as short as possible. ;)

Another video has been uploaded, please read the video description for more information, this time it should be hopefully worth to view.

There is one big pending problem, OpenAL, that's because I've defined NO_SOUND_DEBUG by default for now.

Disabled functionalities are also:
  • Display lists, they're not supported at all, that's because I've defined DEBUG_RENDER_DISABLE_DISPLAYLISTS and the related functions are only dummies.
  • Multi-texturing, because it causes the application to terminate, I've no clue what's going on here yet.

Summarizing all samples from my last post, that have been crashed, are now working. Some of them run slow like hell, but they're working! :)
I think that it is possible to get e. g. ManiaDrive fully playable, creating and using a low poly and low resolution texture package, because the iPhone's processor and graphics capability should be able to handle a vertex number around 5000 to 6000 without a serious frame decrease. It's also a good idea to use a frame limiter, because if we exceed the available capabilities the operating system won't fire input events and the only thing the user can do is to press the home button, that will carefully shut down the engine.

I want to commit the changes to the trunk, so I can create a SDK and some application packages based on the new revision, what do you think, is everything Raydium confirm? Raydium-R828-iPhoneOS-Patch.gz

PostPosted: Sun Mar 01, 2009 1:15 am 
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
I've just a few minutes, but ... AMAZING is the only word that can describe what I see in the last video ! I'm completely speechless !

I'll try to validate the patch ASAP, I'll be back Sunday, in the evening.

Just staggering ...

PostPosted: Sun Mar 01, 2009 10:54 am 

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759

Wawou !

The last part of the video, it's the iphone position that change point of view ?

Kinghill seem quite smooth !!

Nice work st !

Have a nice day

PostPosted: Mon Mar 02, 2009 9:59 am 
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
st, the patch is OK for me so far. I've only seen a small typo with "mylgutCloseWindow" that is, in facts, an error I made myself when writing myGlut. I'll fix that after your commit.

I'm -quiet- excited* to see what Raydium can do on this platform...

* I do NOT mean sexually excited.

PostPosted: Mon Mar 02, 2009 2:15 pm 

Joined: Tue Jul 08, 2008 2:37 am
Posts: 181
Gladly to read that you enjoy it! :D

ouille wrote:
The last part of the video, it's the iphone position that change point of view?
Right! The last application that you can see on the second video is test-iphoneos.c.
It uses the internal multi-axis accelerometer motion sensor as a joystick. It feels like you have an object on top of a glass table or an object hang down from the ceiling with a cord and you are able to view the object from different view points regarding from your position. If you watch from the bottom to the top through the iPhone's display you can see the object's underside. If you rotate the device clockwise the object will rotate relative degrees to the right, and so on ... that works for all available axes: X-, Y- and Z-axis.

The next things on my to do list on this topic are the creation of an iPhone OS SDK, get a working OpenAL solution, creation of a low resolution texture and low poly package, creation of ready to use packages of various Raydium applications for Installer, Cydia repositories and perhaps for the App Store, implementation of the Live API using the camera and force feedback support using the vibration of the device ... and of course I'll write an official news post about this, perhaps the best time to post it is after the application package creation to get all information at one go.

PostPosted: Mon Mar 02, 2009 10:51 pm 

Joined: Tue Jul 08, 2008 2:37 am
Posts: 181
Finally, here it is. The first Raydium SDK for the iPhone OS.

- iPhone SDK for iPhone OS 2.0 or higher.

- Latest Raydium Subversion revision R831.
- All dependencies for the ARM architecture.
- iCompile-iphoneos script to easily build and test applications using a terminal.
- Application template including the Springboard icon and loading screen image.

1. Drag & drop the Raydium folder wherever you like to install the SDK (e. g. /Library/Raydium or ~/Library/Raydium). You are also able to merge with the Raydium 3D Game Engine SDK for Mac OS X.
2. If you want the iCompile-iphoneos script to automagically transfer your application to the device, please edit the script and assign the target address to the IP variable.
3. Open a terminal and use the iCompile-iphoneos script to build the samples.

You have the possibility to merge the Raydium SDK for the iPhone OS with the Raydium SDK for Mac OS X and the other way round, but you don't have to, each SDK will also work on its own.

Raydium SDK for the iPhone OS: Raydium-R831-iPhoneOS-SDK.dmg (15MB)

Regarding to the news post, I've seen some uploaded pictures on the FTP server. They were uploaded at 12:38 today, so perhaps someone has prepared a news post meanwhile I've written about my idea about when to report about this topic. When this is the case, please don't hesitate to post it, I'll be really happy with it! Perhaps it's also a good idea to post more news entries regularly. :)

PostPosted: Tue Mar 03, 2009 4:52 am 

Joined: Thu Oct 09, 2008 5:49 pm
Posts: 69

I have serious issue installing this to work? :roll:
Please include newbie instructions? :mrgreen:
I'm running windows XP, I have no idea what to do with the .dmg file??


EDIT: I see I need Iphone SDK.. hmmm. :D (How did I miss that? :shock:)

PostPosted: Tue Mar 03, 2009 8:53 am 
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Pictures were stolen to you, by me :)
Used for a short post on my blog about all this iPhone thing: http://blogs.wefrag.com/Xfennec/2009/03 ... t-raydium/
There's nothing really interesting in this post, but it's part of my giant marketing plan to conquer the world and/or port ManiaDrive to the iPhone.

More seriously, as a total Mac newbie, I've a question: what do I need to create applications on the iPhone ? (apart from the iPhone itself, of course)
MacOS X ? Did the iPhone SDK exists for win32 or something like this ? Can I use your SDK then ? Or any Linux cross-compilation tools perhaps ?

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC

Who is online

Users browsing this forum: No registered users and 8 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group