2016/07/08

Making VR app for iOS with Metal framework

VR glass

↑A few weeks ago, I bought one VR glass for my iPhone 6 and enjoyed some apps like this 'VR Roller Coaster' :

VR app


And finally I became to wish I would make a VR app for iOS, so I have been trying many code.

Anyway I have to show two images at first in Metal, but how?

I tried to use two UIView objects and put them right and left, but it did not work… and also tried many other ways and my final result is …

I made two MTLRenderPassDescriptor objects for both view, and it outputs to a each texture (MTLTexture). Of course the camera position should be a little different.
Finally I draw two rectangles which had the texture.

drawing two textures

↑I showed two images like this in Metal framework.

Now my code has wasteful calculation though, anyway my iPhone 6 shows this at 60 FPS.
Develop | Comments(0) | Trackback(0)
Comment

管理者のみに表示