How To Use Unity Free

boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

How To Use Unity Free

Post 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!
You do not have the required permissions to view the files attached to this post.
Thom Yorkes Wobbly Eye
One Eyed Hopeful
Posts: 9
Joined: Wed May 01, 2013 4:11 pm

Re: How To Use Unity Free

Post 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!
Ziggurat
Cross Eyed!
Posts: 189
Joined: Fri May 03, 2013 12:48 am

Re: How To Use Unity Free

Post by Ziggurat »

Thanks, I can finally think about actually making a game when I get the rift! :D
dr4ch
One Eyed Hopeful
Posts: 28
Joined: Wed Dec 12, 2012 12:27 pm

Re: How To Use Unity Free

Post by dr4ch »

Wow, thank you this is great stuff! Care to explain how you achieved this?
anon84
One Eyed Hopeful
Posts: 25
Joined: Wed Dec 05, 2012 5:42 am

Re: How To Use Unity Free

Post 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
Pingles
Certif-Eyed!
Posts: 555
Joined: Sun Jan 27, 2013 6:15 pm

Re: How To Use Unity Free

Post 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.
virror
Sharp Eyed Eagle!
Posts: 427
Joined: Fri Jan 18, 2013 7:13 am
Location: Gothenburg, Sweden

Re: How To Use Unity Free

Post by virror »

Distributing should be no problems i think, just try! Faster to try that then to move the rest of your project : D
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: How To Use Unity Free

Post 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.
dr4ch
One Eyed Hopeful
Posts: 28
Joined: Wed Dec 12, 2012 12:27 pm

Re: How To Use Unity Free

Post 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 ;)
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: How To Use Unity Free

Post 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.
virror
Sharp Eyed Eagle!
Posts: 427
Joined: Fri Jan 18, 2013 7:13 am
Location: Gothenburg, Sweden

Re: How To Use Unity Free

Post 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.
dr4ch
One Eyed Hopeful
Posts: 28
Joined: Wed Dec 12, 2012 12:27 pm

Re: How To Use Unity Free

Post 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?
virror
Sharp Eyed Eagle!
Posts: 427
Joined: Fri Jan 18, 2013 7:13 am
Location: Gothenburg, Sweden

Re: How To Use Unity Free

Post 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.
User avatar
V8Griff
Sharp Eyed Eagle!
Posts: 450
Joined: Fri Mar 01, 2013 11:22 am
Location: UK

Re: How To Use Unity Free

Post 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?
virror
Sharp Eyed Eagle!
Posts: 427
Joined: Fri Jan 18, 2013 7:13 am
Location: Gothenburg, Sweden

Re: How To Use Unity Free

Post 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?
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: How To Use Unity Free

Post 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.
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: How To Use Unity Free

Post 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.
User avatar
V8Griff
Sharp Eyed Eagle!
Posts: 450
Joined: Fri Mar 01, 2013 11:22 am
Location: UK

Re: How To Use Unity Free

Post 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?
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: How To Use Unity Free

Post 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.
theriftreport
One Eyed Hopeful
Posts: 12
Joined: Wed May 15, 2013 2:00 am

Re: How To Use Unity Free

Post 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.
anon84
One Eyed Hopeful
Posts: 25
Joined: Wed Dec 05, 2012 5:42 am

Re: How To Use Unity Free

Post 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 :)
virror
Sharp Eyed Eagle!
Posts: 427
Joined: Fri Jan 18, 2013 7:13 am
Location: Gothenburg, Sweden

Re: How To Use Unity Free

Post by virror »

Btw, do this support chromatic aberration correction?
Just curious : )
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: How To Use Unity Free

Post 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.
User avatar
V8Griff
Sharp Eyed Eagle!
Posts: 450
Joined: Fri Mar 01, 2013 11:22 am
Location: UK

Re: How To Use Unity Free

Post 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. :(
virror
Sharp Eyed Eagle!
Posts: 427
Joined: Fri Jan 18, 2013 7:13 am
Location: Gothenburg, Sweden

Re: How To Use Unity Free

Post 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.
anon84
One Eyed Hopeful
Posts: 25
Joined: Wed Dec 05, 2012 5:42 am

Re: How To Use Unity Free

Post 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
realyst2k
Two Eyed Hopeful
Posts: 69
Joined: Mon Mar 25, 2013 3:55 pm

Re: How To Use Unity Free

Post by realyst2k »

I so aim to try this. Thanks!!!
User avatar
V8Griff
Sharp Eyed Eagle!
Posts: 450
Joined: Fri Mar 01, 2013 11:22 am
Location: UK

Re: How To Use Unity Free

Post 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.
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: How To Use Unity Free

Post 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.
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: How To Use Unity Free

Post 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.
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: How To Use Unity Free

Post 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!
realyst2k
Two Eyed Hopeful
Posts: 69
Joined: Mon Mar 25, 2013 3:55 pm

Re: How To Use Unity Free

Post by realyst2k »

[No Rift yet, though shipping]

Off how?
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: How To Use Unity Free

Post 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.
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: How To Use Unity Free

Post by boone188 »

Here is the updated warp injector. It looks much better.
You do not have the required permissions to view the files attached to this post.
Linkage1992
Two Eyed Hopeful
Posts: 77
Joined: Tue Jan 15, 2013 8:54 pm

Re: How To Use Unity Free

Post 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.
Fluke
One Eyed Hopeful
Posts: 28
Joined: Tue Jan 22, 2013 10:07 pm

Re: How To Use Unity Free

Post 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.
boone188
Cross Eyed!
Posts: 184
Joined: Tue Apr 02, 2013 12:36 pm
Location: Seattle, WA

Re: How To Use Unity Free

Post 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:
User avatar
Fredrum
One Eyed Hopeful
Posts: 30
Joined: Sat Dec 01, 2012 9:25 am

Re: How To Use Unity Free

Post by Fredrum »

Publish and be damned!
User avatar
V8Griff
Sharp Eyed Eagle!
Posts: 450
Joined: Fri Mar 01, 2013 11:22 am
Location: UK

Re: How To Use Unity Free

Post 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 ;)
SumRandomGuy
One Eyed Hopeful
Posts: 1
Joined: Tue Jul 09, 2013 6:24 pm

Re: How To Use Unity Free

Post 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.
Post Reply

Return to “Oculus VR”