scieee AI-readable full text Open interactive document viewer

Mobile graphics: SIGGRAPH Asia 2017 course

Agus, Marco,Gobbetti, Enrico,Marton, Fabio,Pintore, Giovanni,Vázquez Alcocer, Pere Pau

Full text

Visual Computing Group Mobile Graphics Siggraph Asia 2017 course Marco Agus, KAUST & CRS4 Enrico Gobbetti, CRS4 Fabio Marton, CRS4 Giovanni Pintore, CRS4 Pere-Pau Vázquez, UPC November 2017 1 Mobile Graphics Course – Siggraph Asia 2017 WELCOME TO THIS HALF-DAY COURSE! 2 Mobile Graphics Course – Siggraph Asia 2017 Subject: Mobile Graphics •All you need to know to get an introduction to the field of mobile graphics: –Scope and definition of “mobile graphics” –Brief overview of current trends in terms of available hardware architectures and research apps built of top of them –Quick overview of development environments –Rendering, with focus on rendering massive/complex surface and volume models –Capture, with focus on data fusion techniques 3 Mobile Graphics Course – Siggraph Asia 2017 Speakers (in alphabetical order) •Marco Agus (1,2) –Research Engineer at KAUST (Saudi Arabia) –Researcher at CRS4 (Italy) •Enrico Gobbetti (1) - Organizer –Director of Visual Computing at CRS4 (Italy) •Fabio Marton (1) –Researcher at CRS4 •Giovanni Pintore (1) –Researcher at CRS4 •Pere-Pau Vázquez (3) –Professor at UPC, Spain 4 (1) www.crs4.it/vic/ (2) https://vcc.kaust.edu.sa (3) http://www.virvig.eu/ Mobile Graphics Course – Siggraph Asia 2017 Funding 5 Projects VIGEC / VIDEOLAB Project TDM RAS - POR FESR 2014-2020 Spanish MINECO Ministry FEDER funds Grant No. TIN2014-52211-C2-1-R Center for Research, Development, and Advanced Studies in Sardinia, Italy King Abdullah University of Science & Technology, Saudi Arabia Polytechnic University of Catalonia, Spain Mobile Graphics Course – Siggraph Asia 2017 Schedule 5’ 0. Introduction and outline Enrico 15’ 1. Evolution of Mobile Graphics Marco 20’ 2.1 Mobile Graphics Trends / Hardware Pere -Pau 15’ 2.2 Mobile Graphics Trends / Applications Marco 15’ 3. Graphics Development for Mobile Systems Marco 5’ 4.1 Scalable Mobile Visualization / Introduction Enrico 30’ 4.2 Scalable Mobile Visualization / Massive Meshes Fabio 15’ BREAK - 5’ 4.3 Scalable Mobile Visualization / Intro to complex lighting Enrico 10’ 4.4 Scalable Mobile Visualization / Lighting Precomputation Fabio 20’ 4.5 Scalable Mobile Visualization / Smart Shading Pere -Pau 15’ 4.6 Scalable Mobile Visualization / Volumes Pere -Pau 10’ 5.1 Mobile Metric Capture and Reconstruction / Introduction Enrico 30’ 5.2 Mobile Metric Capture and Reconstruction / Case studies Gianni 15’ 6. Closing and Q&A ALL 6 Mobile Graphics Course – Siggraph Asia 2017 EVOLUTION OF MOBILE GRAPHICS Next Session 7 Visual Computing Group Part 1 Evolution of the mobile graphics world Marco Agus, KAUST & CRS4 1 Mobile Graphics Course – Siggraph Asia 2017 Mobile evolution (1/3) 2 Infographic designed by LEWIS PR for Mobile World Barcelona Mobile Graphics Course – Siggraph Asia 2017 Mobile connectivity evolution •Bandwidth is doubling every 18 months •Mobile internet users overcame desktop internet users •2017 smartphone traffic expected at 2.7 GB per person per month 9 © www.statista.com Mobile Graphics Course – Siggraph Asia 2017 Displays and User Interface •Before 2007 – old days –PDA → Palm OS/ Windows Pocket / Windows CE –Stylus interaction (touch screens at early stages) •Touch era –2007 – iOS /iPhone –2008 – Android / HTC Dream or G1 –Touch-enabled devices (no stylus required) •Nowadays –Wearables → <2” –Smartphones → 3-6” –Tablets → >7-10” –DLP projectors integrated 10 Mobile Graphics Course – Siggraph Asia 2017 Display characteristics 11 500 ppi 5.1”/5.5” 2560x1440 (>500 PPI) 10.1” 3840x2160 (438 PPI) Mobile Graphics Course – Siggraph Asia 2017 Chip evolution (1/2) 12 © ARM Mobile Graphics Course – Siggraph Asia 2017 Chip evolution (2/2) © Rajovic, N., Carpenter, P., Gelado, I., Puzovic, N., & Ramirez, A. (2013). Are mobile processors ready for HPC?. In Supercomput. 13 Mobile Graphics Course – Siggraph Asia 2017 Scenario •Modern smartphones (tablets) are compact visual computing powerhouses •DIFFUSION: more than 4.6 billion mobile phone subscriptions –[Ellison 2010] •NETWORKING: High speed internet connection (typical 1GB/month plan) –3G - < 0.6-3Mbps ~ 100KB/s - 400KB/s (latency ~ 100-125ms) –4G – < 3-10Mbps ~ 400KB/s - 1MB/s (latency ~ 60-70ms) –5G - 1Gbps (from 2016?) •MEMORY: Increasing RAM and storage space –RAM 1-3GB –Storage 8-64GB •COMPUTING: Increasing processing power –CPU 4-8 core @ 2.5Ghz –GPU 72-192 cores (~ALUs) 14 Mobile Graphics Course – Siggraph Asia 2017 Scenario •More than 4.6 billion mobile phone subscriptions –[Ellison 2010] •High speed internet connection (typical 1GB/month plan) –3G - < 0.6-3Mbps ~ 100KB/s - 400KB/s –4G – < 3-10Mbps ~ 400KB/s - 1MB/s •Increasing RAM and storage space –RAM 1-3GB –Storage 8-64GB •Increasing processing power –CPU 4-8 core @ 2.5Ghz –GPU 72-192 cores (~ALUs) 15 Mobile Graphics Course – Siggraph Asia 2017 Where are we going? •Powerful devices for acquiring, processing and visualizing information •Accessibility of information (anybody, any time, anywhere) •Immense potential (integration of acquisition, processing, visualization, cloud computing, and collaborative tasks) 16 Mobile Graphics Course – Siggraph Asia 2017 MOBILE GRAPHICS TRENDS: HARDWARE ARCHITECTURES & APPLICATIONS Next Session 17 Visual Computing Group Part 2.1 Mobile Graphics Trends: Hardware Architectures Pere-Pau Vázquez, UPC 1 Mobile Graphics Course – Siggraph Asia 2017 Architectures – ARM… •Suppported on –Android, iOS, Win Phone, Tizen, Firefox OS, BlackBerry, Ubuntu Phone, … •Biggest mobile market share •Typically paired with mobile GPUs. Existing brands: –Adreno 4x0/5x0 – Qualcomm –PowerVR 8XE (Rogue) – Imagination –Mali T8x0/G51/G71 – ARM •General strategies: –Cache coherence – week sequential code guarantees on multithreading!! –Heavy dependence on compiler  optimize instruction scheduling •Operation dependencies , loop unrolling, etc… –Use SIMD extensions 8 Mobile Graphics Course – Siggraph Asia 2017 Architecture types •High performance –Premium smartphones & tablets •High area efficiency –Medium-to-low smartphones •Ultra-low power –Smartwatches 9 Mobile Graphics Course – Siggraph Asia 2017 Architectures Mobile GPU architecture trends 10 Mobile Graphics Course – Siggraph Asia 2017 Graphics pipeline trends •Tiled rendering •Data (texture) compression •Other optimizations 11 Mobile Graphics Course – Siggraph Asia 2017 Tiled Rendering •Immediate Mode Rendering (IMR) •Tile-Based Rendering (TBR) •Tile-Based Deferred Rendering (TBDR) 12 Mobile Graphics Course – Siggraph Asia 2017 Architectures – GPU •Inmediate Mode Rendering (IMR) –Geometry is processed in submission order •High overdraw (shaded pixels can be overwritten) –Buffers are kept in System Memory •High bandwidth / power / latency –Early-Z helps depending on geometry sorting •Depth buffer value closer than fragment  discard 13 http://blog.imgtec.com/powervr/understanding-powervr-series5xt-powervr-tbdr-and-architecture-efficiency-part-4 VS FS Mobile Graphics Course – Siggraph Asia 2017 Architectures – GPU •Tile Based Rendering (TBR) –Rasterizing per-tile (triangles in bins per tile) 16x16, 32x32 •Buffers are kept on-chip memory (GPU) – fast!  geometry limit? –Triangles processed in submission order (TB-IMR) •Overdraw (front-to-back -> early z cull) –Early-Z helps depending on geometry sorting 14 http://blog.imgtec.com/powervr/understanding-powervr-series5xt-powervr-tbdr-and-architecture-efficiency-part-4 (1,1) (2,1) (3,1) (1,2) (3,2) … … … … … (2,2) Screen Mobile Graphics Course – Siggraph Asia 2017 Architectures – GPU •Tile Based Deferred Rendering (TBDR) –Fragment processing (tex + shade) ~waits for Hidden Surface Removal •Micro Depth Buffer – depth test before fragment submission –whole tile  1 frag/pixel  •iPAD 2X slower than Desktop GeForce at HSR (FastMobileShaders_siggraph2011) –Possible to prefetch textures before shading/texturing –Hard to profile!!! ~~~Timing? 15 http://blog.imgtec.com/powervr/understanding-powervr-series5xt-powervr-tbdr-and-architecture-efficiency-part-4 Limit: ~100Ktri + complex shader (1,1) (2,1) (3,1) (1,2) (3,2) … … … … … (2,2) Screen (1,1) (1,2) (2,2) (3,2) … Parameter buffer Mobile Graphics Course – Siggraph Asia 2017 Data/texture compression •ARM’s Adaptive Scalable Texture Compression (ASTC) supported by most mobile GPU vendors •ETC2/EAC standard compression OpenGL ES 3.0 •Compression hardware also present in display hardware –Rendered images stored and transferred to the display in a compressed •Saving bandwidth 16 Mobile Graphics Course – Siggraph Asia 2017 Other optimizations •Deferred shading •Primitive elimination •Skipping updates to pixels that do not change –ARM memory transaction elimination 17 Mobile Graphics Course – Siggraph Asia 2017 MOBILE DEVICE SERVER Mixed Mobile/Remote rendering •As mobile GPUs progress... 6 DATA ACCESS RENDERING DISPLAY INTERACTION Scene NETWORK Mobile Graphics Course – Siggraph Asia 2017 Mixed Mobile/Remote rendering •Model based versus Image based methods •Model based methods –Original models –Partial models –Simplified models •Couple of lines •Point clouds Eisert and Fechteler. Low delay streaming of computer graphics (ICIP 2008) Gobbetti et al. Adaptive Quad Patches: an Adaptive Regular Structure for Web Distribution and Adaptive Rendering of 3D Models. (Web3D 2012) Balsa et al.,. Compression-domain Seamless Multiresolution Visualization of Gigantic Meshes on Mobile Devices (Web3D 2013) Diepstraten et al., 2004. Remote Line Rendering for Mobile Devices (CGI 2004) Duguet and Drettakis. Flexible point-based rendering on mobile devices (IEEE Trans. on CG & Appl, 2004) 7 Mobile Graphics Course – Siggraph Asia 2017 Mixed Mobile/Remote rendering •Model based versus Image based methods •Model based methods –Original models –Partial models –Simplified models •Couple of lines •Point clouds Eisert and Fechteler. Low delay streaming of computer graphics (ICIP 2008) Gobbetti et al. Adaptive Quad Patches: an Adaptive Regular Structure for Web Distribution and Adaptive Rendering of 3D Models. (Web3D 2012) Balsa et al.,. Compression-domain Seamless Multiresolution Visualization of Gigantic Meshes on Mobile Devices (Web3D 2013) Diepstraten et al., 2004. Remote Line Rendering for Mobile Devices (CGI 2004) Duguet and Drettakis. Flexible point-based rendering on mobile devices (IEEE Trans. on CG & Appl, 2004) Point clouds organized as hierarchical grids. Tested on PDAs 8 Mobile Graphics Course – Siggraph Asia 2017 Mixed Mobile/Remote rendering •Model based versus Image based methods •Model based methods –Original models –Partial models –Simplified models •Couple of lines •Point clouds Eisert and Fechteler. Low delay streaming of computer graphics (ICIP 2008) Gobbetti et al. Adaptive Quad Patches: an Adaptive Regular Structure for Web Distribution and Adaptive Rendering of 3D Models. (Web3D 2012) Balsa et al.,. Compression-domain Seamless Multiresolution Visualization of Gigantic Meshes on Mobile Devices (Web3D 2013) Diepstraten et al., 2004. Remote Line Rendering for Mobile Devices (CGI 2004) Duguet and Drettakis. Flexible point-based rendering on mobile devices (IEEE Trans. on CG & Appl, 2004) Transfer couple of 2D line primitives over the network, which are rendered locally by the mobile device 9 Mobile Graphics Course – Siggraph Asia 2017 Gobbetti et al. Adaptive Quad Patches: an Adaptive Regular Structure for Web Distribution and Adaptive Rendering of 3D Models. (Web3D 2012) Balsa et al.,. Compression-domain Seamless Multiresolution Visualization of Gigantic Meshes on Mobile Devices (Web3D 2013) Diepstraten et al., 2004. Remote Line Rendering for Mobile Devices (CGI 2004) Duguet and Drettakis. Flexible point-based rendering on mobile devices (IEEE Trans. on CG & Appl, 2004) •Model based versus Image based methods •Model based methods –Original models –Partial models –Simplified models •Couple of lines •Point clouds Mixed Mobile/Remote rendering Eisert and Fechteler. Low delay streaming of computer graphics (ICIP 2008) Intercept and stream OpenGL commands Better performances with respect to video streaming Limitation: clients need powerful GPU 10 Mobile Graphics Course – Siggraph Asia 2017 Mixed Mobile/Remote rendering •Model based versus Image based methods •Model based methods –Original models –Partial models –Simplified models •Couple of lines •Point clouds Eisert and Fechteler. Low delay streaming of computer graphics (ICIP 2008) Gobbetti et al. Adaptive Quad Patches: an Adaptive Regular Structure for Web Distribution and Adaptive Rendering of 3D Models. (Web3D 2012) Balsa et al.,. Compression-domain Seamless Multiresolution Visualization of Gigantic Meshes on Mobile Devices (Web3D 2013) Diepstraten et al., 2004. Remote Line Rendering for Mobile Devices (CGI 2004) Duguet and Drettakis. Flexible point-based rendering on mobile devices (IEEE Trans. on CG & Appl, 2004) More details in Part 4 11 Mobile Graphics Course – Siggraph Asia 2017 Mixed Mobile/Remote rendering •Image based methods –Image impostors –Environment maps –Depth images Noimark and Cohen-Or. Streaming scenes to mpeg-4 video-enabled devices (IEEE, CG&A 2003) Lamberti and Sanna. A streaming-based solution for remote visualization of 3D graphics on mobile devices (IEEE, Trans. VCG, 2007) Bouquerche and Pazzi. Remote rendering and streaming of progressive panoramas for mobile devices (ACM Multimedia 2006) Zhu et al. Towards peer-assisted rendering in networked virtual environments (ACM Multimedia 2011) Shi et al. A Real-Time Remote Rendering System for Interactive Mobile Graphics (ACM Trans. On Multimedia, 2012) Doellner et al. Server-based rendering of large 3D scenes for mobile devices using G- buffer cube maps ( ACM Web3D, 2012) 12 Mobile Graphics Course – Siggraph Asia 2017 Mixed Mobile/Remote rendering •Image based methods –Image impostors –Environment maps –Depth images Noimark and Cohen-Or. Streaming scenes to mpeg-4 video-enabled devices (IEEE, CG&A 2003) Lamberti and Sanna. A streaming-based solution for remote visualization of 3D graphics on mobile devices (IEEE, Trans. VCG, 2007) Bouquerche and Pazzi. Remote rendering and streaming of progressive panoramas for mobile devices (ACM Multimedia 2006) Zhu et al. Towards peer-assisted rendering in networked virtual environments (ACM Multimedia 2011) Shi et al. A Real-Time Remote Rendering System for Interactive Mobile Graphics (ACM Trans. On Multimedia, 2012) Doellner et al. Server-based rendering of large 3D scenes for mobile devices using G- buffer cube maps ( ACM Web3D, 2012) Image representations are created by the server, and warped in real time by the client to account for user interaction 13 Mobile Graphics Course – Siggraph Asia 2017 Mixed Mobile/Remote rendering •Model based vs Image based methods –Constraints: rendering quality, bandwidth, interactivity Model based Image based Network bandwidth Client computation Rendering quality Occlusion warping limitations Image impostors Environment maps Depth images Simplified models Partial models Original models 14 Mobile Graphics Course – Siggraph Asia 2017 Mobile visualization systems •Volume rendering •Point cloud rendering Moser and Weiskopf. Interactive volume rendering on mobile devices. Vision, Modeling, and Visualization VMV. Vol. 8. 2008. Noguerat al. Volume Rendering Strategies on Mobile Devices. GRAPP/IVAPP. 2012. Campoalegre, Brunet, and Navazo. Interactive visualization of medical volume models in mobile devices. Personal and ubiquitous computing 17.7 (2013): 1503-1514. Balsa et al. Interactive exploration of gigantic point clouds on mobile devices. ( VAST 2012) He et al. A multiresolution object space point-based rendering approach for mobile devices (AFRIGRAPH, 2007) Rodríguez, Marcos Balsa, and Pere Pau Vázquez Alcocer. Practical Volume Rendering in Mobile Devices. Advances in Visual Computing. Springer, 2012. 708-718. 15 Mobile Graphics Course – Siggraph Asia 2017 MOBILE DEVICE Mobile rendering with capture •Exploiting mobile device sensors... DATA ACCESS RENDERING DISPLAY INTERACTION Scene CAPTURE Environment Example: Google Tango https://www.google.com/ata p/projecttango/#project 22 Mobile Graphics Course – Siggraph Asia 2017 MOBILE DEVICE Mobile rendering with capture •Exploiting mobile device sensors... DATA ACCESS RENDERING DISPLAY INTERACTION Scene CAPTURE Environment see section 5 for more applications of sensor integration 23 Mobile Graphics Course – Siggraph Asia 2017 Trends in mobile graphics •Hardware acceleration for improving frame rates, resolutions and rendering quality –Parallel pipelines –Real-time ray tracing –Multi-rate approaches 24 Mobile Graphics Course – Siggraph Asia 2017 SGRT: Real-time ray tracing •Samsung reconfigurable GPU based on Ray Tracing •Main key features: – an area-efficient parallel pipelined traversal unit –flexible and high-performance kernels for shading and ray generation 25 Lee, Won-Jong, et al. SGRT: A mobile GPU architecture for real-time ray tracing. Proceedings of the 5th High-Performance Graphics Conference, 2013. Shin et al., Full-stream architecture for ray tracing with efficient data transmission, 2014 IEEE ISCAS Mobile Graphics Course – Siggraph Asia 2017 Adaptive shading •Triangles rasterized into coarse fragments that correspond to multiple pixels of coverage •Coarse fragments are shaded, then partitioned into fine fragments for subsequent per-pixel shading 26 He et al. Extending the graphics pipeline with adaptive, multi-rate shading. ACM Transactions on Graphics (TOG) 33.4 , 2014. Clarberg, Petrik, et al. AMFS: adaptive multi-frequency shading for future graphics processors. ACM Transactions on Graphics (TOG) 33.4 , 2014. Won-Jong Lee, et al. Adaptive multi-rate ray sampling on mobile ray tracing GPU. In SIGGRAPH ASIA 2016 Mobile Graphics and Interactive Applications (SA '16). Mobile Graphics Course – Siggraph Asia 2017 MOBILE DEVICE Mobile rendering with capture •Exploiting mobile device sensors... DATA ACCESS RENDERING DISPLAY INTERACTION Scene CAPTURE Environment 27 Mobile Graphics Course – Siggraph Asia 2017 Examples: Physical simulations •Framework for physically and chemically-based simulations of analog alternative photographic processes •Efficient fluid simulation and manual process running on iPad 28 Echevarria et al. Computational simulation of alternative photographic processes. Computer Graphics Forum. Vol. 32. 2013. Mobile Graphics Course – Siggraph Asia 2017 Examples: Correcting visual aberrations •Computational display technology that predistorts the presented content for an observer, so that the target image is perceived without the need for eyewear •Demonstrated in low-cost prototype mobile devices 29 Huang, Fu-Chung, et al. Eyeglasses-free display: towards correcting visual aberrations with computational light field displays.ACM Transactions on Graphics (TOG) 33.4, 2014. Mobile Graphics Course – Siggraph Asia 2017 Conclusions •Heterogeneous applications –driven by bandwidth and processing power •Trends –desktop software solutions tend to be ported to the mobile world •gaming •modelling and 3D animation •complex illumination models •Sensor integration open new scenarios –examples: live acquisition, mHealth (using sensors and cameras for tracking and processing signals) • 30 Mobile Graphics Course – Siggraph Asia 2017 GRAPHICS DEVELOPMENT FOR MOBILE SYSTEMS Next Session 31 Mobile Graphics Course – Siggraph Asia 2017 Development trends •Hard to follow the trends –software does not follow hardware evolution –strong market oriented field where finance has strong impact on evolution •In general, for –Mobile phones •Market drive towards Android, iOS –Tablets •Android, iOS, Windows 10 –Embedded devices •Heterogenous (beyond the scopes of this course) •Here we focus on mobile phones and tablets 7 Mobile Graphics Course – Siggraph Asia 2017 8 Operating Systems •Windows 10 –Windows development – Visual Studio 2017 •Good debugging / compiler / integration –Great integration and deployment •Universal Windows Platform (UWP) –API access •C#, VB.NET, and C++ –3D API •D3D •OpenGL access through ANGLE –Advantages •Visual Studio, interoperability with iOS •HW is quite selected/homogeneous –Disadvantages •~OpenGL wrapper just recently! Mobile Graphics Course – Siggraph Asia 2017 9 Operating Systems •iOS –Development under MacOS •Xcode – good IDE/debug •Clang compiler! –API access •Objective-C, swift –Library programming •C++ support –Advantages: •Homogeneous hardware (biggest issues are resolution related) •State-of-the-art CPU/GPU (PowerVR SGX 54X/554, G6400) •Good dev tools (Xcode + Clang) –Inconvenients: •Closed platform •Requires iDevice for development/shipment (mostly) Mobile Graphics Course – Siggraph Asia 2017 10 Operating Systems •Android –Development in Eclipse / AndroidStudio •Java-based – integrated debugging (non-trivial for NDK) •GCC / clang compilers –Advantages •Wide variety of hardware configurations (CPU/GPU) •Java based + C++ as dynamic library (JNI or NDK+NativeActivity) •Open source •Toolchain provided for Windows/Linux/MacOS (GCC + Clang) •Faster access to new hardware / functionality! –Inconvenients •Heterogeneous device base (hard to target all configurations) •Not so integrated IDE -- ~mixed pieces Mobile Graphics Course – Siggraph Asia 2017 11 Operating Systems (comparison) •App development -- publishing –WinPhone & iOS requires less effort for distribution •Easy to reach the whole user base –Android has a wide variety of configuration that require tuning •User base is typically reached in an incremental way (supporting more configs) •Many HW configurations (CPU/GPU) give more options to explore ☺ –Windows has not yet the same market share •Variety of configurations Mobile Graphics Course – Siggraph Asia 2017 12 Programming Languages •C/C++ –Classic, performance, codebase, control •Objective C –Bit different style (message based), well-documented API for iOS, mainly COCOA/iOS •Java –Android is VM/JIT based, ~portability (API), well-known, extended, codebase •C# –VM based, ~Java evolution, (Win, Android, iOS) •Swift –Apple new language, simplicity, performance, easy, LLVM-based compilers •HTML5/JS –Web technologies, extended, compatibility •Perl, Python, Ruby, D, GO (Google), Hack (facebook), … –More options, not so popular ? Mobile Graphics Course – Siggraph Asia 2017 13 3D APIs Mobile Graphics Course – Siggraph Asia 2017 14 3D APIs Mantle Direct3D Metal OpenGL Next 5.0 Mobile Graphics Course – Siggraph Asia 2017 15 •Direct 3D –3D API from MS for Win OS (XBOX) –ANGLE library provides GL support on top of D3D •Mantle –AMD 3D API with Low-level access → D3D12 | GL_NG •Metal –Apple 3D API with low-level access •OpenGL Desktop/ES/WebGL –GL for embedded systems, now in version 3.2 •GLES3.2 ~ GL4.5 •GL Next Generation → Vulkan –redesign to unify OpenGL and OpenGL ES into one common API (no backward compatibility) 3D APIs Mobile Graphics Course – Siggraph Asia 2017 16 3D APIs •Direct 3D –Games on Windows (mostly) / XBOX –Define 3D functionality state-of-the-art •OpenGL typically following •3D graphic cards highly collaborative •Multithread programming –Proprietary – closed source – M$ –Tested & stable – good support + tools •Metal –Apple 3D API with low-level access –Much in the way of Mantle? •buffer & image, command buffers, sync… –Lean & mean → simple + ~flexible Win & Game research Mac/iOS future ? Mobile Graphics Course – Siggraph Asia 2017 Cross platform •Unity Mobile (for gaming and VR) –iOS/Android, integration with Tango •Unreal Engine 4 (for gaming and VR) –iOS/Android –former Unreal Development Kit –free usage, payment only for shipping •Corona SDK –iOS /Android –uses integrated Lua layered on top of C++/OpenGL to build graphic application –audio and graphics, cryptography, networking, device information and user input 23 Mobile Graphics Course – Siggraph Asia 2017 Cross platform •Marmalade –iOS/Android/Windows –two main layers • low level C API for memory management, file access, timers, networking, input methods (e.g. accelerometer, keyboard, touch screen) and sound and video output. •C++ API for higher level functionality for 2D (e.g. bitmap handling, fonts) 3D graphics rendering (e.g. 3D mesh rendering, boned animation), resource management system and HTTP networking. –Very successful but dismissing by March 2017 •EdgeLib –iOS/Android/Windows –high performance graphics engine in C++ –support for 2D graphics, 3D graphics (OpenGL ES), input and sound 24 Mobile Graphics Course – Siggraph Asia 2017 Cross platform •JMonkey Engine –Android –written in Java and using shader technology extensively –uses LWJGL as its default renderer (another renderer based on JOGL is available, supporting OpenGL 4) •PowerVR –iOS/Android/Windows –a cross-platform OS and API abstraction layer, a library of helper tools for maths and resource loading –optimized for PowerVR GPUs, with Vulkan support •ARM Developer Center –Plenty of tools (computer vision and machine learning, OpenGL ES emulator, texture compression) 25 Mobile Graphics Course – Siggraph Asia 2017 26 Cross-development •C++ use case: QtCreator –Qt (~supports android, iOS, windows phone, linux, windows, mac) –Provides API abstraction for UI, in-app purchases, ~touch input –HOWTO (i.e. android): •Android SDK •Android NDK (native C++ support, toolchain, libraries, GL, CL…) •Point environment variables ANDROID_SDK, ANDROID_NDK to folders •Create new android project •Play! –Notes: •Go for Qt > 5.4 (touch events were tricky in previous versions) •Use QOpenGLWidget instead of QGLWidget •Enable touch events on each widget: –QWidget::setAttribute(Qt::WA_AcceptTouchEvents); Mobile Graphics Course – Siggraph Asia 2017 Mobile Graphics – Development •Conclusions –1) Native + platform UI … •C++ [any language] → LLVM compiler → target platform •Platform Framework front-end → 1 for each platform •Performance + flexibility •Call native code from platform code (JNI, Object C, …) –2) Native through framework … •Qt | Marmalade … •C++ code uses framework API –Framework API abstracts platform API [N platforms] –BUT less flexible integration ? –3) Go web → HTML5/JS … •JS code + WebGL •~Free portability (chrome / firefox / IE … ?) •BUT performance is 0.5X at most with asm.js 27 Mobile Graphics Course – Siggraph Asia 2017 SCALABLE MOBILE VISUALIZATION Next Session 28 Visual Computing Group Part 4.1 Scalable Mobile Visualization: Introduction Enrico Gobbetti, CRS4 1 Mobile Graphics Course – Siggraph Asia 2017 Scalable mobile visualization •Goal is high quality interactive rendering of complex scenes… –Large data, shading, complex illumation, … •… on mobile platforms … –Mostly smartphones or tablets –Similar considerations can apply to other settings (e.g., embedded systems) •Wide variety of applications –Gaming, visualization, cultural heritage… 2 Mobile Graphics Course – Siggraph Asia 2017 Mobile platforms scenario •Typical scalable rendering problem, but with some specific constraints wrt standard (desktop settings) •… screen resolutions are often extremely large (2 – 6 Mpix) –Lots of pixels to generate! •… mobile 3D graphics hardware is powerful but still constrained –Reduced computing powers, memory bandwidths, and amounts of memory wrt desktop graphics systems –Limited power supply! 3 Mobile Graphics Course – Siggraph Asia 2017 Mobile rendering scenario •No brute force method applicable –Need for “smart methods” to perform interactive rendering –Exploit at best reduced rendering power •Proposed solutions –Render only necessary data: adaptive multiresolution –Limit required CPU/GPU work: full or partial precomputation –Limit data requirements: streaming approaches –Exploit at best available bandwidth: data compression 4 Mobile Graphics Course – Siggraph Asia 2017 Scalable Mobile Visualization 11 Itty bitty living space! Mobile Graphics Course – Siggraph Asia 2017 A real-time data filtering problem! •Models of unbounded complexity on limited computers –Need for output-sensitive techniques (O(N), not O(K)) •We assume less data on screen (N) than in model (K ) I/O Storage Screen 10-100 Hz O(N=1M-100M) pixels O(K=unbounded) bytes (triangles, points, …) Limited bandwidth (network/disk/RAM/CPU/PCIe/GPU/…) View parameters Projection + Visibility + Shading 12 Mobile Graphics Course – Siggraph Asia 2017 A real-time data filtering problem! •Models of unbounded complexity on limited computers –Need for output-sensitive techniques (O(N), not O(K)) •We assume less data on screen (N) than in model (K ) I/O Storage Screen 10-100 Hz O(N=1M-100M) pixels O(K=unbounded) bytes (triangles, points, …) Limited bandwidth (network/disk/RAM/CPU/PCIe/GPU/…) View parameters Projection + Visibility + Shading Small Working Set 13 Mobile Graphics Course – Siggraph Asia 2017 Output-sensitive techniques •At preprocessing time: build MR structure –Data prefiltering! –Visibility + simplification –Compression •At run-time: selective view-dependent refinement from out-of-core data –Must be output sensitive –Access to prefiltered data under real-time constraints –Visibility + LOD Occluded / Out-of-view Inaccurate Accurate FRONT 14 Mobile Graphics Course – Siggraph Asia 2017 Related work •Long history, starting with general solutions –View dependent LOD and progressive streaming [Hoppe 1997] •Compute view dependent triangulation each frame -> CPU bound –Surface patches [CRS4+ISTI CNR, SIGGRAPH’04] •Effective in terms of speed •Require non-trivial data structures and techniques for decompression –General solutions available for Desktop environments [Cignoni et al, 2005, Yoon et al. 2008] •Mesh compression – MPEG-4 [Jovanova et al. 2008] •Light 3D model rendering [MeshPad, PCL] •Gigantic point clouds on mobile devices [Balsa et al. 2012] •… and much more 15 Mobile Graphics Course – Siggraph Asia 2017 Our Contributions: chunked multiresolution structures •Efficient view-dependent meshes –Approximate original surface –Seamless •Mix and match chunks –Amortize CPU work! •Two approaches –Fixed coarse subdivision •Adaptive QuadPatches –Adaptive coarse subdivision •Compact Adaptive TetraPuzzles 16 Mobile Graphics Course – Siggraph Asia 2017 Adaptive Quad Patches Simplified Streaming and Rendering for Mobile & Web •Represent models as fixed number of multiresolution quad patches –Image representation allows component reuse! –Natural multiresolution model inside each patch –Adaptive rendering handled totally within shaders! •Works with topologically simple models Best paper, WEB3D2012 Javascript! 17 Mobile Graphics Course – Siggraph Asia 2017 Related work Adaptive Quad Patches •Geometry images [Gu et al. 2002] –Exploit current GPU capabilities / optimized libraries for compression and streaming of images •Quad remeshing –Single-disk parametrization [Floater and Hormann 2005] –Base mesh to parametrize the model [Petroni et al. 2010] •Detail rendering –GPU raycasting [Oliveira et al. 2000] –Displacement mapping in GPU [Shiue et al. 2005] 18 Mobile Graphics Course – Siggraph Asia 2017 AQP Approach •Models partitioned into fixed number of quad patches –Geometry encoded as detail with respect to the 4 corners interpolation •For each quad: 3 multiresolution pyramids –Detail geometry –Normals –Colors •Data encoded as images –Exploit .png (lossless compression) •Ensure connectivity –Duplicated boundary information 19 Mobile Graphics Course – Siggraph Asia 2017 Pre-processing (Reparameterization) •Generate clean manifold triangle mesh –Poisson reconstruction [Kazhdan et al. 2006] –Remove topological noise •Discard connected components with too few triangles •Parameterize the mesh on a quad-based domain –Isometric triangle mesh parameterization •Abstract domains [Pietroni et al. 2010] –Remap into a collection of 2D square regions •Resample each quad from original geometry –Associates to each quad a regular grid of samples (position, color and normal) 20 Mobile Graphics Course – Siggraph Asia 2017 Compact Adaptive TetraPuzzles Adaptive multiresolution solution with compression-domain rendering •Represent models as variable number of multiresolution surface patches embedded in a hierarchy of tetrahedra –Regular conformal hierarchy of tetrahedra spatially partitions input mesh •Mesh fragments at different resolutions associated to implicit diamonds –Fully adaptive and seamless 3D mesh structure with local quantization •Geometry clipped against containing tetrahedra •Barycentric coordinates used for local tetrahedra geometry reparameterization –GPU friendly compact data representation •Works with general surface models 27 Mobile Graphics Course – Siggraph Asia 2017 Compact Adaptive Tetra Puzzles 28 Triangle soup Partitioning Database Merging & Simplification Tetrahedra hierarchy Encoding & Compression Simplified representations Tetrahedra hierarchy Partitioned input model Mobile Graphics Course – Siggraph Asia 2017 Related work (Compression) •Topology coding –Theoretical minimum [Rossignac 2001] •1.62 bits/triangle, 3.24 bits/vertex –8 bpt/16 bpv [Chhugani et al. 2007] • HW-implementation –5 bpt/10 bpv [Meyer et al. 2012] •CUDA implementation •Attribute quantization –Global position quantization [Lee et al. 2009] –Local quantization techniques [Lee et al. 2010] –Normal compression using octahedral parametrization [Meyer et al. 2010] •Our goal is to balance compression rate and decoding+rendering performance by using a GPU-friendly compact representation 29 Mobile Graphics Course – Siggraph Asia 2017 Overview •Construction –Start with hires triangle soup –Partition model –Construct non-leaf cells by bottom-up recombination and simplification of lower level cells –Assign model space errors to cells •Rendering –Refine graph –Render selected precomputed cells 30 Adaptive rendering On-line GPU Cache Ensure continuity  Shared information on borders Mobile Graphics Course – Siggraph Asia 2017 P2 P1 P3 P4 Preprocessing •Geometry clipped against containing tetrahedra •Vertices: tetrahedra barycentric coordinates –Pbarycentric = λ1*P1+λ2*P2+λ3*P3+λ4*P4 •Seamless local quantization –Inner vertices (I): 4 corners –Face vertices (F): 3 corners –Edge vertices (E): 2 corners •GPU friendly compact data representation –8 bytes = position (3 bytes) + color (3 bytes)+ normal(2 bytes) –Normals encoded with the octahedron approach [Meyer et al. 2012] •Further compression with entropy coding –exploiting local data coherence – – 31 Mobile Graphics Course – Siggraph Asia 2017 Rendering process •Extract view dependent diamond cut (CPU) •Request required patches to server –Asynchronous multithread client –Apache 2 based server (data repository, no processing) •CPU entropy decoding of each patch •For each node (GPU Vertex Shader): –VBO with barycentric coordinates, normals and colors (64 bpv) –Decode position : P = MV * [C0 C1 C2 C3] * [Vb] •Vb is the vector with the 4 barycentric coords •C0..C3 are tetrahedra corners –Decode normal from 2 bytes encoding [Meyers et al. 2012] –Use color coded in RGB24 32 FRONT Apache 2 Mobile Graphics Course – Siggraph Asia 2017 Results •Input Models –St. Matthew 374 MTri –David 1GTri •Compression: –40 to 50 bits/vertex •Streaming full screen view –30s on wireless, –45s on 3G –David 14.5MB (1.1 Mtri) –St. Matthew 19.9MB (1.8 Mtri) 33 Rendering iPad gen3 iPhone 4 Pixel tolerance 3 3 Triangle throughput 30 Mtri/s 2.8 Mtri/s FPS avg 35 10 FPS refined views 15 2.8 Triangle Budget 2 M 1 M Mobile Graphics Course – Siggraph Asia 2017 Conclusions: Compact ATP •Generic gigantic 3D triangle meshes on common handheld devices –Compact, GPU friendly, adaptive data structure •Exploiting the properties of conformal hierarchies of tetrahedra •Seamless local quantization using barycentric coordinates –Two-stage CPU and GPU compression •Integrated into a multiresolution data representation •Limitations –Requires coding non-trivial data structures –Hard to implement on scripting environments 34 Mobile Graphics Course – Siggraph Asia 2017 Conclusions: large meshes •Various solutions for large meshes •Constrained solution: Adaptive Quad Patches –Simple and fast –Good compression –Works on topologically simple models •General solution: Compact Adaptive Tetra Puzzles –Compact data representation –More complex code 35 Visual Computing Group Part 4.3 Scalable Mobile Visualization: Introduction to complex lighting Enrico Gobbetti, CRS4 36 Mobile Graphics Course – Siggraph Asia 2017 Best path computation •Connect probes which have a common visible region –Creates a graph of probes •For each pair of mutually visible probe –Create first path going through the closest point in the mutually visible region –Optimize and smooth the path using a mass-spring system 43 Mobile Graphics Course – Siggraph Asia 2017 Precomputation of probe images •Compute panoramic views for probes and frames of transition arcs –Photorealistic rendering (using Blender 2.68a) •panoramic views both for probes and transition arcs –1024^2 probe panoramas –256^2 transition video panoramas –32 8-core PCs, –Rendering times ranging from 40 minutes to 7 hours/model 44 Explore Map Mobile Graphics Course – Siggraph Asia 2017 Explore Maps – Processing Results 45 Mobile Graphics Course – Siggraph Asia 2017 Interactive Exploration •UI for Explore Maps –WebGL implementation + JPEG + MP4 –Panoramic images: probes + transition path •Closest probe selection •Path alignment with current view •Thumbnail goto –Non-fixed orientation 46 Mobile Graphics Course – Siggraph Asia 2017 Conclusion: Interactive Exploration •Interactive exploration of complex scenes –Web/mobile enabled –Pre-computed rendering •state-of-the-art Global Illumination –Graph-based navigation  guided exploration •Limitations –Constrained navigation •Fixed set of camera positions –Limited interaction •Exploit panoramic views on paths  less constrained navigation •Next part of the talk: –A dynamic solution for complex illumination with smart computation 47 Visual Computing Group Part 4.5 Scalable Mobile Visualization: Smart precomputation for complex lighting Pere-Pau Vázquez, UPC 1 Mobile Graphics Course – Siggraph Asia 2017 High quality illumination •Consistent illumination for AR •Soft shadows •Deferred shading •Ambient Occlusion 2 Mobile Graphics Course – Siggraph Asia 2017 Consistent illumination for AR •High-Quality Consistent Illumination in Mobile Augmented Reality by Radiance Convolution on the GPU [Kán, Unterguggenberger & Kaufmann, 2015] •Goal –Achieve realistic (and consistent) illumination for synthetic objects in Augmented Reality environments 3 Mobile Graphics Course – Siggraph Asia 2017 Consistent illumination for AR •Overview –Capture the environment with the mobile –Create an HDR environment map –Convolve the HDR with the BRDF’s of the materials –Calculate radiance in realtime –Add AO from an offline rendering as lightmaps –Multiply with the AO from the synthetic object 4 Mobile Graphics Course – Siggraph Asia 2017 Consistent illumination for AR •Capture the environment with the mobile –Rotational motion of the mobile •In yaw and pitch angles to cover all sphere directions –Images accumulated to a spherical environment map •HDR environment map constructed while scanning –Projecting each camera image •According to the orientation and inertial measurement of the mobile –Low dynamic range imaging is transformed to HDR •Camera uses auto-exposure –Two overlapping images will have slightly different exposure –Alignment correction based on feature matching –All in the device 5 Mobile Graphics Course – Siggraph Asia 2017 Contacts (in alphabetical order) •Marco Agus (1,2) –Research Engineer at KAUST (Saudi Arabia) –Researcher at CRS4 (Italy) •Enrico Gobbetti (1) - organizer –Director of Visual Computing at CRS4 (Italy) •Fabio Marton (1) –Researcher at CRS4 •Giovanni Pintore (1) –Researcher at CRS4 •Pere-Pau Vázquez (3) –Professor at UPC, Spain 3 (1) www.crs4.it/vic/ (2) https://vcc.kaust.edu.sa (3) http://www.virvig.eu/ Mobile Graphics Course – Siggraph Asia 2017 Funding… 4 Projects VIGEC / VIDEOLAB Project TDM RAS - POR FESR 2014-2020 Spanish MINECO Ministry FEDER funds Grant No. TIN2014-52211-C2-1-R Center for Research, Development, and Advanced Studies in Sardinia, Italy King Abdullah University of Science & Technology, Saudi Arabia Polytechnic University of Catalonia, Spain Mobile Graphics Course – Siggraph Asia 2017 Q&A NOW (TIME PERMITTING…) Thanks for your attention! 5 Mobile Graphics Course – Siggraph Asia 2017 More information… 6 Center for Research, Development, and Advanced Studies in Sardinia, Italy King Abdullah University of Science & Technology, Saudi Arabia Polytechnic University of Catalonia, Spain www.crs4.it/vic/ vcc.kaust.edu.sa www.virvig.eu