Argent: A web based augmented reality framework for dynamic content generation / Argent: Web tabanlı dinamik içerik destekli artırılmış gerçeklik geliştirme altyapısı
Özet
Günümüzün dünyasında insanlar interaktif teknolojilere daha fazla ilgi duyuyor. İnsanların öğrenme, araştırma ve çalışma gibi davranışları da bu değişimden etkileniyor ve interaktif teknolojiler ile yapıldığında daha verimli hale gelebiliyor. İnteraktif teknolojilerin en yenilikçi örneklerinden biri olan artırılmış gerçeklik teknolojisi bu hususta öne çıkıyor. Artırılmış gerçeklik sayesinde insanlar kendilerini ilgili deneyime daha derin bir şekilde dahil edebiliyorlar ve daha kolay bir şekilde etkileşim gerçekleştirebiliyorlar. Artırılmış gerçeklik (AG) her ne kadar işe yarasa da, AG uygulamaları geliştirmek masraf bakımından buna değecek kadar kolay olmayabiliyor. AG geliştirmek hala belirli araçları kullanmakta deneyimli olmayı gerektiriyor. Bu tür araçlar genellikle programcılara ve oyun geliştiricilere yönelik oluyor ve uzun eğitimler sonucunda kazanılan programlama ve diğer teknik bilgileri gerektiriyor. Tasarımcılık veya içerik üreticiliği gibi tecrübelere sahip insanlar ise AG uygulamaları geliştirmekten ve gelişimine müdahele etmekten mahrum kalabiliyor. Günümüzde Unity, Vuforia, ARKit ve ARCore gibi araçlar, AG teknolojisini gerçek kılan düşük seviye hesaplamalar ve programlamaya ihtiyaç duymadan AG uygulamaları geliştirilebilmesini sağlıyor. Normalde ancak uzun yıllar sürecek ve büyük ekipler gerektirecek araştırma ve geliştirme çalışmaları sonucunda üretilebilecek AG uygulamaları, bu araçların sunduğu SDK ve API'ler sayesinde küçük ekipler tarafından da yapılabiliyor. Fakat AG henüz bu tür uygulamaları geliştirmek isteyecek her insan tarafından kolayca ulaşılabilir bir durumda değil. AG uygulamalarının büyük çoğunluğu Unity kullanılarak geliştiriliyor. Unity, görsel programlama seçenekleri sunsa da, bunlar AG uygulamalarına uygun yöntemler değil. Programlama bilgisi olmayan insanların da geliştirme yapabileceği bir Unity eklentisi bu hususta çok işe yarayacaktır. Böyle bir eklenti, programlama yapmadan uygulama geliştirebilme, isteğe bağlı olarak programlama yapabilme, uygulamanın herhangi bir paketleme aşamasına ihtiyaç duymaması ve gerçek zamanda güncellenmesi, 3 boyutlu obje, resim, video gibi objeleri desteklemesi, objeleri gerçek zamanda değiştirme ve canlı olarak önizleme yapabilme ve uygulamaya arayüz geliştirebilme gibi özelliklere sahip olmalıdır. Aynı zamanda bu uygulama kullanıcı dostu bir arayüz ve deneyim sunmalıdır. Alışılagelmiş iş akışlarının dışına çıkmadan, yeni özellikleri mümkün kılan değişikliklere yer vermelidir. Bu tezde Unity üzerinde geliştirilen bir altyapı tartışılacaktır. Bu altyapı sunucu, web arayüzü ve mobil uygulama gibi çeşitli platformlar gerektiren iş akışının tamamını karşılayacak nitelikte olacaktır. Sunucu tarafında objelerin paketlenmesi, veritabanı işlemleri ve verinin Web arayüzü ve mobil uygulamaya sunulması gibi işlemler yapılacaktır. Kullanım kolaylığı ve erişilebilirlik açısından, içerik yönetimi için Web arayüzü kullanılacaktır. Mobil uygulama ise son kullanıcının kullanacağı AG uygulaması olacaktır. Ayrıca oluşturulan mobil uygulama altyapısı başka uygulamaların içine gömülebilecek bir kütüphane olacaktır. Bu altyapı ile oluşturulan bir AG uygulaması sahnelerden oluşacaktır. Her bir sahnenin altında objeler olacaktır ve her bir objeye bir görsel atanacaktır. Bu görsel bir 3D obje, resim veya video olabilir. Ayrıca her bir objeye animasyon tanımlanabilir. Bir animasyon objenin zaman çizelgesi boyunca bulunduğu pozisyonları belirterek tanımlanır. Böylece zaman ilerledikçe obje bu pozisyonlar arasında hareket eder ve bu bir animasyon gibi gözükür. Sunucu kısmında Web arayüzünden gelen veriler işlenip kaydedilir ve gerektiğinde mobil uygulamaya aktarılır. Web arayüzünden gelen görseller, daha yüksek yükleme ve görselleştirme hızı sağlamak için bir paketleme adımından geçer. Bu adım sayesinde görseller mobil uygulama veya Web arayüzünde hızlıca tekrar kullanılabilir. Sahneler ve görseller önbelleğe alınır. Böylece üzerlerinde bir değişim olmadığı sürece hızlıca tekrar servis edilir. Web arayüzünde sahne oluşturulabilir, sahneye objeler koyulabilir, objelerin pozisyonu ve animasyonu ayarlanabilir. Oluşturulan sahneler hiçbir paketleme adımına ihtiyaç duymadan Web arayüzü üzerinde önizlenebilir. Böylece kullanıcılar mobil uygulamaya ve cihaza ihtiyaç duymadan sahnelerini test edebilir. Ayrıca Web arayüzünde bulunan içerik yönetim sistemi ile görseller kütüphanesindeki görseller yönetilebilir. Yeni obje görselleri eklenebilir ve varolan görseller değiştirilebilir veya silinilebilir. Mobil uygulama son kullanıcının kullanabileceği bir AG uygulamasıdır. Normal bir AG uygulaması gibi cihaz kamerasını kullanarak artırabileceği bir hedef arar. Hedef bulunduğunda daha önce Web arayüzünden tanımlanan sahneyi, artırılmış görüntü olarak hedefin üstüne ekler. Bu hedef önceden tanımlanmış bir resim, QR kodu veya zemin düzlemi olabilir. Mobil uygulama bir sahneyi ilk görüntüleyişinde sahnenin bilgilerini sunucudan alır. Bunun için internet bağlantısına ihtiyaç duyar. Fakat sonraki görüntülemelerde sahne önbelleklendiği için sunucuya tekrar erişmeye ihtiyaç duyulmaz. Böyle bir altyapının geliştirilmesinde bazı zorluklar vardır. Bu zorluklardan en belirgin olanı performans problemleridir. Bu performans problemleri, objelerin görselleri dinamik olarak belirlendiği için ortaya çıkar. Normal şartlarda bu görseller son kullanıcıya sunulmadan önce paketlenip, optimize edilerek servis edilir. Fakat kullanıcıdan yüklediği objeleri bu optimizasyon adımlarından geçirmesini beklemek kullanıcı deneyimini düşürecektir. Bunun için bulunan bir yöntem `asset bundling' yöntemidir ve Unity'nin paketleme altyapısını sunucu tarafında kullanarak nesnelerin optimize edilmesiyle çalışır. Yapılan testlerde bu yöntemin performansa büyük katkı sağladığı gözlemlenmiştir. Kullanıcılar kimi zaman varolan programlamaya ek olarak kendi yazdıkları betikleri eklemek isteyebilir. Bu da aşılması gereken bir diğer zorluktur. Bu problemi çözmek için altyapıya bir Javascript motoru eklenmiştir ve kullanıcılar bu motoru kullanarak kendi betiklerini uygulamaya gömebilir. Bu motor ayrıca kullanıcıların kendi arayüzlerini yazmalarına ve programlamalarına imkan tanır. Yapılan testlerde performansa çok zarar vermeden böyle bir altyapının oluşturulabildiği görmüştür. Yapılan değişiklikler hiçbir paketleme ve dağıtma adımına gerek duymadan canlı olarak mobil uygulamada görülebiliyor. Kullanıcı testlerinde, dağıtılan mobil uygulamanın tekrar dağıtılmasına ihtiyaç duymadan içeriğinin değiştirilebilmesinin, değerli bir özellik olduğu anlaşılmıştır.
In the modern world, people are more and more interested in interactive technologies. Education, research and business habits are effected by this change and humans can be more efficient using interactive technologies. Augmented reality (AR), which is a novel addition to those interactive technologies, is especially effective in this matter. Through augmented reality, people can immerse more deeply with the subject experience and they can have enhanced interaction. Despite the usefulness of augmented reality, it may not always be efficient develop an AR application in terms of development cost. AR development still requires knowledge and experience with certain tools and frameworks. Such tools are usually programming and game development tools and they require programming and technical skills that is gained by long-term education and training. People experienced in design and content creation can be deprived of the ability to create and maintain AR applications. Nowadays, tools like Unity, Vuforia, ARKit and ARCore provide ways to develop AR applications without the need to have knowledge of low-level calculation and programming that is required for AR technology. Normally, developing an AR application would have taken years of research and development by large teams, but thanks to SDK and APIs provided by these tools, AR applications can be developed by small development teams easily and quickly. However, AR is still not easily accessible by all the tech-savvy people that may be interested in developing such applications. Majority of AR applications are developed using Unity. There are visual programming solutions in Unity, but they are not suitable to be used in AR applications. A Unity-based tool that allows people without programming skills to create AR applications, will be utmost useful. Such a tool would require features such as, creating an application without programming, optional support to do programming and scripting, real time updates and ability to ship without any build and packaging step, support for 3D object, image and video, the ability to modify objects and preview them in real time, and the ability to create user interfaces. The tool should also have a user friendly interface and experience. It should introduce the innovative features without changing the conventional workflows. Existing tools do not provide these features which are crucial for an ordinary person to create AR applications. In this thesis, a framework developed in Unity will be introduced. This framework will supply the whole workflow pipeline which involves modules targeting the tree fronts: the server, the web interface and mobile application. The server will be responsible for packaging and optimizing objects, doing database processes and serving the data to the web interface and mobile application. The web interface will be used for content management as web applications are easy to use and easily accessible. The mobile application is the application that will be used by the end user. It will be possible to integrate the mobile application's core library to any other mobile application as a library. An AR application created by this framework consists of scenes. Every scene is comprised of objects and every object is assigned a visual asset. A visual asset can be a 3D object, image or video. Also it is possible to assign animation to every object. An animation is defined by sequence of positions in a timeline. By transitioning the object through these positions as time passes, it gives the impression of an animation. In the web interface, a scene can be created, objects can be put into scene, and position and animation of an object can be defined. Generated scenes are able to be previewed on the web interface without any need to build and package. Thus, users can test the generated scenes without needing a mobile device or emulator. Also, using the content management system in the web interface, users are able to modify visual assets. New assets can be added and existing assets can be modified or deleted. In the server side, the data coming from the web interface is processed and stored to be served to the mobile application when needed. Visual assets coming from the web interface undergo a packaging step in order to provide faster loading and rendering speed. Thus, the web interface and mobile application can quickly reuse these assets. Scenes and assets are cached, so that they are served quickly without extra calculation steps if there are no changes on them. The mobile application is an AR application to be used by the end-user. Just like a normal AR application, it searches for a target to augment. When it finds a target, it augments the display with the scene defined in the web application. The target can be an image marker, QR code, or ground plane. Mobile application gets the scene data from the server when it visualizes the scene first time. Although, it needs internet connection for this, for subsequent renderings, it does not require access to the server, because the scene will be pre-cached already. There are challenges when developing such a framework. The most prominent challenge is performance issues. Performance issues arise because the visual assets of objects are defined dynamically. Under normal circumstances, the assets are optimized and packaged before serving them to the end-user. However, expecting the user to undergo these optimization steps will hinder the user experience. A remedy for this issue is the novel `asset bundling' method. It works by using Unity's internal optimization pipeline on visual assets in the server side. Experiments show that this method provides benefits in terms of performance. Users ocassionally want to do extra programming and scripting on top of existing program. This is another challenge that needs to be addressed. To remedy this, a Javascript engine is added to the framework and users can use this to write their own scripts. This engine can also enable users to create custom user interfaces and assign behaviors to them. Experiments show that developing this framework can be possible without hindering performance significantly. Changes made by users can be seen in the mobile application without the need of any build or release steps. User experience tests show that the feature to update the content of the mobile application without the need to reinstall is beneficial.