Announcements
The Scaleform forum is now read-only. Please head to the Gamedev site for product support.
Scaleform Forum (Read Only)
Scaleform enables developers to leverage the power of the Adobe® Flash® tool set to create powerful user interface environments for video games.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

using the Scaleform plugin with the oculus rift

14 REPLIES 14
SOLVED
Reply
Message 1 of 15
leoevans
1992 Views, 14 Replies

using the Scaleform plugin with the oculus rift

I am in the beginning stages of working on a proof of conceps for a project I am currently designing in Unity using the Oculus Rift and Scaleform plugin.  In order to get the Images to display correctly in Rift I have had to resort to Rending to texture my movies ,and then  manutipluing it with a shader.  This appoach works fine , but it will become hard to manage the various movies if I have to attached a rtt script to every gameobject the needs to be able to RTT. Is their another way of going about this that I may be missing?

14 REPLIES 14
Message 2 of 15
leoevans
in reply to: leoevans

bump

Message 3 of 15
AD_ADeCastro
in reply to: leoevans

Hello,

 

Sorry for the late response. Are you having problems only with images in Flash content, or problems with all images (Flash and Unity)?

 

Also, are you being forced to use RTT and shaders only on the Oculus, or is your Unity project having this same issue when you run the game on your computer/monitor?

 

Thanks!

Angela

Message 4 of 15
leoevans
in reply to: leoevans

Sorry that my first post was not clear.   My issue is that I needed to be able to apply the Rift distortion to the scaleform content in order to to get it to display properly on the rift. I am am able to do this With RTT , but I am not seeing exactly where I can update the rendering for non RTT's. If I could do this I would not have a need to use RTT.

Message 5 of 15
leoevans
in reply to: leoevans

Edit. I have attached the revealnt C# scripts with how the RIft implents it two camera  into scene if this prehaps may help.

Message 6 of 15
AD_ADeCastro
in reply to: leoevans

Hello!

 

We discussed your issue and what we recommend is that for Oculus support, you're going to want to distort the entire view, after both the scene and the UI have rendered. That being the case, you will want to attach a RenderTexture to the camera that you use for your main scene, have the Scaleform plugin render to a separate RenderTexture, and then have one final pass to layer the UI on top of the scene before you apply the distortion shader for Oculus.This should not require you to attach an RTT script to every GameObject, as you'll want to render the entire scene to one Unity RenderTexture, and the RTT script is only used when you want to render the Scaleform UI into a texture to be used Unity object, not the other way around.
For the most part, Scaleform UI is just alpha-blended against the rest of the scene's contents in all of the games we use, so it stands to reason that you can render the UI to a single RenderTexture and then composite it on top of the rest of your scene before applying the distortion pass to a texture containing everything that's just been rendered.

Hope that helps!

Message 7 of 15
leoevans
in reply to: AD_ADeCastro

I was able to get scaleform to render correctly with the above solution. remaining issue are non scaleform related Thanks.
Message 8 of 15
mr12fingers
in reply to: leoevans

Example code or a scene would be very nice to have as I'm not 100% understanding the explanation.  I've been having to use multiple RTTs on planes parented to the right camera.

I've fairly certain this is not the best way to go about creating a scaleform ui with the Rift.

 

Any further help would be appreciated.

 

Regards,

 

Mr12

Message 9 of 15
KWKnoll
in reply to: AD_ADeCastro

AD_ADeCastro - Is Autodesk haveing discussions about supporting the Oculus SDK? Do you have Oculus Rifts to test?

Message 10 of 15
leoevans
in reply to: KWKnoll

Scaleform works fine on Rift using solution they advised above. If you are unsure of how to implement this I can explain it further but  if you use OvrMain menu script  Oculus provides you just need to alter it , and create  a function in SFCamera to call

PumpPluginRender() when your UI Render is active.

 

Message 11 of 15
OPtoss
in reply to: leoevans

Hey leoevans,

 

Can you please elaborate on how you got this working?

 

My current solution involves using the RTT feature of Scaleform to render the full-res swf to a RenderTexture, and display it on a card floating in front of the camera... I'm wary mostly of the performance repercussions of rendering to a 1K texture every frame, but in theory this should work. What you propose seems to bypass the RenderTexture and might be cleaner. If you'd be so kind as to provide detailed instructions I'd very much appreciate it.

 

I should note that I'm trying this with the newest July 4.2 Scaleform, on Unity 4.5.2, and let's just say the unreleased Oculus SDK.

 

Thanks,

-OPtoss

Message 12 of 15
clarencedadson
in reply to: OPtoss

Hello Guys,

i am not a hardcore programmer and therefore i amm not so much into changing the scaleform cs files. It would be nice if you could  just provide the cs code that i can put in the file for scaleform to work with the oculus That would be great.

 

 

 

Message 13 of 15

As asked before. Can anyone provide a sample file please.

 

thanks

Message 14 of 15

Hello,

i know this has been asked before but the answer on how to get scaleform working is kind of cryptic to me. I don't want to use the rtt solution. sorry i am no hardcore programmer. can you elaborate waht to change where in the code

 

thanks??

Message 15 of 15
clarencedadson
in reply to: leoevans

that's great. Thanks a lot

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report