Page 1 of 2

How To Use Unity Free

Posted: Thu May 16, 2013 2:20 am
by boone188
So I haven't done my good deed for the day, and I've noticed a lot of people complaining about not being able to use Unity Free to develop for the Rift. The good news is that it is totally possible to develop for the Rift using Unity Free. The bad news is that it isn't quite as easy as with Pro (although it's still pretty freakin easy) and there isn't a guide to doing it yet.

Here is what I did to get the Rift working with Unity Free:
  • - Download the latest Unity 4 Integration (ovr_unity_0.2.1_lib.zip)
  • - Copy everything inside "ovr_unity_0.2.1_lib\OculusUnityIntegration\Win_OculusUnityDemoScene_Data\Plugins" into your "C:\Program Files (x86)\Unity\Editor" folder
  • - Open your Project in Unity
  • - Double click on "ovr_unity_0.2.1_lib\OculusUnityIntegration.unitypackage" to import OVR into your project
  • - Drag an OVRPlayerController prefab into your level
  • - Build your project
  • - If you try playing at this point, you will get side-by-side and head tracking, but no warp
  • - Download and extract the attached UnityRiftWarp_v0_1b.zip
  • - Copy "d3d9.dll' and "WarpRift.fx" into your built unity project directory
  • - If you play now, it should have warping
Hopefully this will help someone who's Pro trial runs out!

Re: How To Use Unity Free

Posted: Thu May 16, 2013 2:50 am
by Thom Yorkes Wobbly Eye
That's excellent - I'll be trying this later. I'd much rather be using Unity for my project than UDK but the license fee meant it wasn't really an option. Thanks!

Re: How To Use Unity Free

Posted: Thu May 16, 2013 3:22 am
by Ziggurat
Thanks, I can finally think about actually making a game when I get the rift! :D

Re: How To Use Unity Free

Posted: Thu May 16, 2013 3:24 am
by dr4ch
Wow, thank you this is great stuff! Care to explain how you achieved this?

Re: How To Use Unity Free

Posted: Thu May 16, 2013 9:49 am
by anon84
it's originally from here http://www.mtbs3d.com/phpbb/viewtopic.p ... 80#p111900 v0.1
oh I see that was already mentioned

very useful :)

it is an injector dll like vireo, except all it adds is the warping code, without the stereo camera etc because you are doing that yourself in unity

Re: How To Use Unity Free

Posted: Thu May 16, 2013 11:05 am
by Pingles
Will this export out? Can I distribute a demo with it? Or is this just for prototyping?

My Unity project was actually pretty far into development but I want to release it as a demo. So I'm transferring it over to UDK (painful, but getting there) so I can distribute my demo without paying $1,500.

Re: How To Use Unity Free

Posted: Thu May 16, 2013 11:26 am
by virror
Distributing should be no problems i think, just try! Faster to try that then to move the rest of your project : D

Re: How To Use Unity Free

Posted: Thu May 16, 2013 11:34 am
by boone188
Pingles wrote:Will this export out? Can I distribute a demo with it? Or is this just for prototyping?

My Unity project was actually pretty far into development but I want to release it as a demo. So I'm transferring it over to UDK (painful, but getting there) so I can distribute my demo without paying $1,500.
Yes you should have no problem exporting it. Just zip up your build folder and ship it out. Should be much less painful than having to port everything to another engine.

Re: How To Use Unity Free

Posted: Thu May 16, 2013 1:42 pm
by dr4ch
Yeah nice and all, but is it legal to publish something with it? If its a dumb question :arrow: hit me, i am tired anyway ;)

Re: How To Use Unity Free

Posted: Thu May 16, 2013 2:09 pm
by boone188
dr4ch wrote:Yeah nice and all, but is it legal to publish something with it? If its a dumb question :arrow: hit me, i am tired anyway ;)
I've looked through the Unity license, and didn't see any red flags. It's not like we're doing anything wrong here.

Re: How To Use Unity Free

Posted: Fri May 17, 2013 1:22 am
by virror
Should be no problems, its not like he is modifying anything in any way, injecting stuff or things like that.
But a heads up might be that they do something about this in a future release and it won't work anymore.

Re: How To Use Unity Free

Posted: Fri May 17, 2013 5:31 am
by dr4ch
virror wrote:Should be no problems, its not like he is modifying anything in any way, injecting stuff or things like that.
But a heads up might be that they do something about this in a future release and it won't work anymore.
anon84 wrote:it's originally from here http://www.mtbs3d.com/phpbb/viewtopic.p ... 80#p111900 v0.1
oh I see that was already mentioned

very useful :)

it is an injector dll like vireo, except all it adds is the warping code, without the stereo camera etc because you are doing that yourself in unity
Sounds to me like it is an injector. But it injects into d3d9.dll so Unity cant do anything about it. Is that right?

Re: How To Use Unity Free

Posted: Fri May 17, 2013 8:00 am
by virror
Ahh, yeah. The warp shader is an injector, but it does not inject anything into the actual Unity system, just in your own game, so that should be fine i guess.

Re: How To Use Unity Free

Posted: Fri May 17, 2013 9:16 am
by V8Griff
Unity newbie here.

I've imported a scene model from 3DS into Unity and I've been successful right up to building the project and getting the side by side views but no warp.

I've put the contents of the unzipped UnityRiftWrap into the same directory/folder as the built project.exe but no warp?

Am I putting the files in the wrong directory or do I need to do something else?

Re: How To Use Unity Free

Posted: Fri May 17, 2013 9:22 am
by virror
Should be in the same dir as your .exe file.
Btw, there is now way to get it working when playing in the editor this way right? Only when running the standalone build?

Re: How To Use Unity Free

Posted: Fri May 17, 2013 11:09 am
by boone188
virror wrote:Should be in the same dir as your .exe file.
Btw, there is now way to get it working when playing in the editor this way right? Only when running the standalone build?
I haven't gotten the warp working in the editor yet, but i haven't tried very hard.

Re: How To Use Unity Free

Posted: Fri May 17, 2013 11:11 am
by boone188
V8Griff wrote:Unity newbie here.

I've imported a scene model from 3DS into Unity and I've been successful right up to building the project and getting the side by side views but no warp.

I've put the contents of the unzipped UnityRiftWrap into the same directory/folder as the built project.exe but no warp?

Am I putting the files in the wrong directory or do I need to do something else?
If you've copied the files into the same dir as your exe then it should work. I'm not really sure what could be going wrong.

Re: How To Use Unity Free

Posted: Fri May 17, 2013 11:16 am
by V8Griff
boone188 wrote:If you've copied the files into the same dir as your exe then it should work. I'm not really sure what could be going wrong.
Ah just occured to me does the Rift have to be attached to see the warp?

Re: How To Use Unity Free

Posted: Sat May 18, 2013 12:52 am
by boone188
V8Griff wrote:
boone188 wrote:If you've copied the files into the same dir as your exe then it should work. I'm not really sure what could be going wrong.
Ah just occured to me does the Rift have to be attached to see the warp?
No the warping should work without the Rift. If the d3d9.dll and WarpRift.fx are in the same dir as your exe and you are launching the exe directly, then it really should work.

Re: How To Use Unity Free

Posted: Sat May 18, 2013 12:57 pm
by theriftreport
Many thanks for posting this. I'm having the same problem too, the warp isn't working....so close to being fantastic so not sure what is going wrong as if I could get this working that would be amazing.

Re: How To Use Unity Free

Posted: Sat May 18, 2013 1:37 pm
by anon84
are you saying you've gone into your project folder (eg for me it is G:\My Documents\New Unity Project 6)

extracted d3d9.dll & WarpRift.fx into that folder

double clicked the .exe in that folder

and it does not work?

it's one of those where it is harder to make it not work :)

Re: How To Use Unity Free

Posted: Mon May 20, 2013 2:13 am
by virror
Btw, do this support chromatic aberration correction?
Just curious : )

Re: How To Use Unity Free

Posted: Mon May 20, 2013 3:10 am
by boone188
virror wrote:Btw, do this support chromatic aberration correction?
Just curious : )
No it's just the plain 'ole barrel. You can definitely add that in the WarpRift.fx though.

Re: How To Use Unity Free

Posted: Mon May 20, 2013 3:23 am
by V8Griff
anon84 wrote:are you saying you've gone into your project folder (eg for me it is G:\My Documents\New Unity Project 6)

extracted d3d9.dll & WarpRift.fx into that folder

double clicked the .exe in that folder

and it does not work?

it's one of those where it is harder to make it not work :)
Yep, I agree.

Even more confusing why it doesn't work. :(

Re: How To Use Unity Free

Posted: Mon May 20, 2013 5:08 am
by virror
Thought i test this even if i don't need to just to see if i could get it to work : )
I only get a black screen and i cant see my menu when using the dll and shader, but maybe thats because i don't have a camera until i have started my game, this might be something to consider.

Re: How To Use Unity Free

Posted: Mon May 20, 2013 11:47 am
by anon84
ok Griff

so assuming you have done everything correctly it appears the d3d9 dll is not being referenced, so I wonder if you might have unity set to use DX11?

I did try this myself and was able to successfully break the warp, so that might be it

DX11 option at: edit -> project settings -> player -> other settings

Re: How To Use Unity Free

Posted: Mon May 20, 2013 1:07 pm
by realyst2k
I so aim to try this. Thanks!!!

Re: How To Use Unity Free

Posted: Mon May 20, 2013 1:55 pm
by V8Griff
anon84 wrote:ok Griff

so assuming you have done everything correctly it appears the d3d9 dll is not being referenced, so I wonder if you might have unity set to use DX11?

I did try this myself and was able to successfully break the warp, so that might be it

DX11 option at: edit -> project settings -> player -> other settings
That will probably sort the issue as those options were not selected however it's GPU upgrade time my GTS250 (Yes I know old card) doesn't support DX11.

Re: How To Use Unity Free

Posted: Mon May 20, 2013 2:13 pm
by boone188
V8Griff wrote:
anon84 wrote:ok Griff

so assuming you have done everything correctly it appears the d3d9 dll is not being referenced, so I wonder if you might have unity set to use DX11?

I did try this myself and was able to successfully break the warp, so that might be it

DX11 option at: edit -> project settings -> player -> other settings
That will probably sort the issue as those options were not selected however it's GPU upgrade time my GTS250 (Yes I know old card) doesn't support DX11.
You actually should NOT have the DX11 option selected. You want it to use DX9.

If you don't mind sending me your project, I can try to get it working and send it back.

Re: How To Use Unity Free

Posted: Mon May 20, 2013 2:16 pm
by boone188
virror wrote:Thought i test this even if i don't need to just to see if i could get it to work : )
I only get a black screen and i cant see my menu when using the dll and shader, but maybe thats because i don't have a camera until i have started my game, this might be something to consider.
Yeah you will need to use a OVR camera for your menus as well. This is the preferred method for menus with the Rift anyways. You make your menu an object in the 3D world.

Re: How To Use Unity Free

Posted: Wed May 22, 2013 1:16 am
by boone188
Unfortunately the warping seems to be a bit off. I didn't notice at first, but it became pretty obvious in the new demo I'm working on. I'm guessing its just the parameters that are off. If anyone gets it working better, please let me know!

Re: How To Use Unity Free

Posted: Wed May 22, 2013 7:09 pm
by realyst2k
[No Rift yet, though shipping]

Off how?

Re: How To Use Unity Free

Posted: Wed May 22, 2013 7:33 pm
by boone188
realyst2k wrote:[No Rift yet, though shipping]

Off how?
Off as in, when you use it, the world looks a little warped.

I managed to fix it last night by capturing the warp parameters from the Rift. I'll post the updated shader when I get home.

Re: How To Use Unity Free

Posted: Wed May 22, 2013 9:16 pm
by boone188
Here is the updated warp injector. It looks much better.

Re: How To Use Unity Free

Posted: Sat Jun 01, 2013 7:54 am
by Linkage1992
Hey guys I've done all the above but when I try to run the exe it gives an error and stops working. It's a problem with d3d9.dll for sure. dx11 isn't turned on, so I don't know why it isn't working.

Re: How To Use Unity Free

Posted: Wed Jun 19, 2013 10:21 pm
by Fluke
Hi,

Just tried giving this a shot, but it doesn't work for me. Can anyone confirm if this works with current builds of Unity/the latest Rift SDK? When I try to launch my exe, I just get a blank screen before it crashes (it doesn't even display the "powered by Unity" splash screen).

If I remove the .dll and .fx files from my folder, my project loads fine by itself.

Re: How To Use Unity Free

Posted: Thu Jun 20, 2013 1:07 am
by boone188
Since I'm using a pro trial right now, I can't test with the free edition. I would have to install free on a virtual machine to test it. Too lazy :oops:

Re: How To Use Unity Free

Posted: Thu Jun 20, 2013 1:43 am
by Fredrum
Publish and be damned!

Re: How To Use Unity Free

Posted: Thu Jun 20, 2013 1:55 am
by V8Griff
Fluke wrote:Hi,

Just tried giving this a shot, but it doesn't work for me. Can anyone confirm if this works with current builds of Unity/the latest Rift SDK? When I try to launch my exe, I just get a blank screen before it crashes (it doesn't even display the "powered by Unity" splash screen).

If I remove the .dll and .fx files from my folder, my project loads fine by itself.
That's what was happening to me.

I'm baffled by Unity anyway so I'm more likely to use Unreal in future unless my programming resource is available and he can sort the Unity integration ;)

Re: How To Use Unity Free

Posted: Tue Jul 09, 2013 6:52 pm
by SumRandomGuy
Can't get this to work, the left camera turns black after a few seconds but the corners are fine. The right camera works too. I have the warping and everything, just the left camera isn't working.