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?
Solved! Go to Solution.
Solved by AD_ADeCastro. Go to Solution.
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
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.
Edit. I have attached the revealnt C# scripts with how the RIft implents it two camera into scene if this prehaps may help.
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!
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
AD_ADeCastro - Is Autodesk haveing discussions about supporting the Oculus SDK? Do you have Oculus Rifts to test?
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.
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
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.
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??