cancel
Showing results for 
Search instead for 
Did you mean: 

A Native mini demo at 60 fps

Anonymous
Not applicable
Ok guys this is so far "all my messing" with the VRTemplate and Eclipse ( that is still giving me some grief ), it's still a WIP of porting/adjusting "my universe" (engine) for the Moonlight stuff.

There are still quite a number of things I miss to understand fully about the VR Template like how to use sounds ( I've seen it initialises something already ) and how to bypass certain things ( pressing left/right triggers and some other keys like "start" on the gamepad seems to try to launch stuff ).

Anyway "baby steps" I am getting to where I want to get.

This is a little "math playground" where there are a number of animated functions that you can move around and look and go inside and see how they look, the light shader is intentionally "facet" and not "ppl" , functions and normals are computed in real time so the fact it holds 60 fps tells quite a bit about the potential of the machine :!:

By using the LEFT analog stick you can move the function on the XZ plane and by using the RIGHT analog stick you can rotate it around the X or Y plane.

By using the keys '1' and '2' you can switch between functions that are :

- "classic" sin() "pudding"
- sin(x)
- Klein bottle
- Triaxial tritorus
- Enneper minimal
- y = 0 plane
- wavy sin(x)sin(z)

Functions are a bit fiddled to give then a bit of animation, the fun is "going inside them and look around".

Some captures here followed by the .APK file, the easier way I found to install the APK is :

- connect the thing to the PC
- open it from the file explorer
- find the "Download" folder
- copy the .APK file in it
- tap on it and select to install, it will ask you to allow install from "unknown sources" as this is not a Google signed PKG

You can tell on the last step to "do it only for this one".

Some snaps:

demo1.png

demo2.png

And here is the .PKG file.

Ah yes, you have to unzip it to get the .APK, it was not allowing me to upload an .APK here.

Please run it and tell me if it work for you / what you think 🙂

One "big question" is "is there any EASY way to embed/add a program like this into the VR Swipe launch ? I'd love to be able to add stuff in there for a reason of praticity to launch/stop it.

Enjoy !
9 REPLIES 9

JonOlick
Honored Guest
neat 🙂 Perspective looks right, but looking around in the headset doesn't appear to be working?

VrSwipeLaunch is still pretty beta. There isn't currently any automatic discovery of other apps.

You can add your app to swipe launch by modifying /sdcard/oculus/launcher.txt

A warning though that Its pretty finicky.

Anonymous
Not applicable
"JonOlick" wrote:
neat 🙂 Perspective looks right, but looking around in the headset doesn't appear to be working?

VrSwipeLaunch is still pretty beta. There isn't currently any automatic discovery of other apps.

You can add your app to swipe launch by modifying /sdcard/oculus/launcher.txt

A warning though that Its pretty finicky.


You sure ?

I found sometime as you have to launch the program first and connect it to the device later sometime it does not get the tracking, you simply have to relaunch the appl.

That is why I was asking if there was a way to launch it from the Swipe so when you are in you already have the tracking working.

Anonymous
Not applicable
I can re-confirm you that I just uninstalled the appl from my phone, dowloaded this one in the link here, done all the steps and the head tracking works perfectly.

As I said SOMETIME you launch the appl, you connect it to the headset the tracking does not work, sometime just disconnecting/reconnecting the thing does the trick, sometime you just have to disconnect, relaunch, connect and it will work.

I have no idea why, but that happens as well even with the pre-installed demo appls at times.

JohnCarmack
Explorer
We have fixed the sensor-sometimes-not-working problem for the next SDK.

The only audio solution that is part of the core framework right now is the app::PlaySound() functionality to play simple wav files through the java sound pool.

// Plays a sound located in the application package's assets/ directory
// through a Java SoundPool. This is mostly for UI, there is no 3D spatialization.
// "select.wav" would load <project>/assets/select.wav.
virtual void PlaySound( const char * name ) = 0;

If you want to use your own sound engine, you can use the audio code in VrArcade as an example of setting up OpenSL for best performance.

Anonymous
Not applicable
Ah right I vaguely remember something .. the Java sound pool ..

VRArcade ? .. am I missing something ? There's no such source(s) in the SDK I downloaded, I'll look around.

Yes time ago I made all my stuff using OpenSL I remember a really hard battle with a nasty bug that was happening in some phones and turned out I HAD to use a mutex for a critical thing in a critical point.

JohnCarmack
Explorer
Sorry, I thought we shipped the VrArcade source code with the SDK. Voip.cpp also has OpenSL setup code that you can copy / paste / modify.

I'm sorry you have had such a frustrating time with this -- I wanted to get some native developers on the first SDK release, before the Unity integration was really functional enough to use, but now, as you can see, development is dominated by Unity work.

VrTemplate should still be the right way to go for a new native application, but I am also working to make it easier to avoid the framework entirely if you want to do everything but head tracking and time warp yourself.

Anonymous
Not applicable
Look .. the thing is, this device and the Timewarp is truly :

*LOVELY*

"It just works" and better than anything else I've seen so far 🙂

So yeah bit of a hard start maybe but definitely worth it 😉

I love the fact I've been someway able to put some of my stuff in and what I see is a solid "60/59 fps" all over the place, not getting 60 fps was my main concern but I am now very confident "there should be no problems" 🙂

What makes me feel a bit frustrated/sad in all this is that really "there's not much CPP love" but hey .. "so it is" .. as you say Unity seems to dominate ..

Anyway for those into CPP I think yes the stuff should be "simplified at max" because all you just want is "the very basic structure" and be able to drop code in, you don't really want "a half engine" on the top of/to deal with.

What I think it's very very good done in this VRTemplate is the "app" class that handles all the "nasty Android stuff", being able to just/mainly focus on the OGLES/cpp code and not "the system quirks" it's very good.

For example now I am trying to "extract" from it ( I am sure I've seen some functions around ) stuff to load a file from the APKarchive ( the same way it loads the functions ) so I can avoid to have to recompile/re-use the ZIPLIB for that, I can easily drop my sound code in it as soon as I'll manage to rework the part that was reading the .wav files/headers from the archive.

If it would have been not for NDK and the fact it IS possible to work with CPP even in Android I think I would never been here 😄

So yes "better hard but still CPP" .. :mrgreen:

Anonymous
Not applicable
Also the reason I did ask about the 3D audio was because while I was looking through sources there and there I found some "strange stuff" ( that to be honest I did not quite understand what it was for, was looking like some test of something ) that was looking like someone was doing something or testing something with 3D sound ..

So that made me tought "ah maybe there's some 3D audio support already in ?".

That's why I asked about it, on our "demo" thing we did use once FMOD but that because it was a free non-commercial demo, should it be a different thing in effect it's not a trivial problem to find a correct solution about what to use.

Anonymous
Not applicable
And I just found out this is precisely what I wanted :


void App::ReadFileFromApplicationPackage( const char * nameInZip, int &length, void * & buffer )


🙂