The Making of Seemore WebGL. Will Eastcott, CEO, PlayCanvas

Similar documents
Physically Based Shading in Unity. Aras Pranckevičius Rendering Dude

GUERRILLA DEVELOP CONFERENCE JULY 07 BRIGHTON

Wednesday, July 24, 13

Computer Graphics (CS 543) Lecture 10: Normal Maps, Parametrization, Tone Mapping

Mental Ray for BK5100

Lighting Killzone : Shadow Fall

Property of: Entrada Interactive. PBR Workflow. Working within a PBR-based environment

Dominic Filion, Senior Engineer Blizzard Entertainment. Rob McNaughton, Lead Technical Artist Blizzard Entertainment

Deferred Rendering Due: Wednesday November 15 at 10pm

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Graphics Performance Optimisation. John Spitzer Director of European Developer Technology

Optimizing and Profiling Unity Games for Mobile Platforms. Angelo Theodorou Senior Software Engineer, MPG Gamelab 2014, 25 th -27 th June

Render-To-Texture Caching. D. Sim Dietrich Jr.

CS354R: Computer Game Technology

Render all data necessary into textures Process textures to calculate final image

SAMPLING AND NOISE. Increasing the number of samples per pixel gives an anti-aliased image which better represents the actual scene.

Occlusion tutorial. Document version 1.0 April 27th, 2005

PROFESSIONAL. WebGL Programming DEVELOPING 3D GRAPHICS FOR THE WEB. Andreas Anyuru WILEY. John Wiley & Sons, Ltd.

Point based global illumination is now a standard tool for film quality renderers. Since it started out as a real time technique it is only natural

DEFERRED RENDERING STEFAN MÜLLER ARISONA, ETH ZURICH SMA/

VAO++: Practical Volumetric Ambient Occlusion for Games

The Shadow Rendering Technique Based on Local Cubemaps

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

Game Technology. Lecture Physically Based Rendering. Dipl-Inform. Robert Konrad Polona Caserman, M.Sc.

The Rasterization Pipeline

Vulkan Multipass mobile deferred done right

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

Mali Demos: Behind the Pixels. Stacy Smith

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

Drawing a Crowd. David Gosselin Pedro V. Sander Jason L. Mitchell. 3D Application Research Group ATI Research

What for? Shadows tell us about the relative locations. Vienna University of Technology 2

Turn your movie file into the homework folder on the server called Lights, Camera, Action.

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

A guide on how to use the real-time CgFX shader KoddeShader v2.0 for Maya.

Lighting and Materials

Rendering 13 Deferred Shading

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

9. Illumination and Shading

CS 354R: Computer Game Technology

After the release of Maxwell in September last year, a number of press articles appeared that describe VXGI simply as a technology to improve

CocoVR - Spherical Multiprojection

Radeon ProRender and Radeon Rays in a Gaming Rendering Workflow. Takahiro Harada, AMD 2017/3

Optimal Shaders Using High-Level Languages

Canonical Shaders for Optimal Performance. Sébastien Dominé Manager of Developer Technology Tools

I ll be speaking today about BC6H compression, how it works, how to compress it in realtime and what s the motivation behind doing that.

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Normal Maps and Cube Maps. What are they and what do they mean?

Models and Architectures

rendering rasterization based rendering pipelined architecture, parallel mostly triangles (lines and points possible too)

Texture Mapping II. Light maps Environment Maps Projective Textures Bump Maps Displacement Maps Solid Textures Mipmaps Shadows 1. 7.

Introduction to Visualization and Computer Graphics

AWE Shading Kit 1.0. General Notes. Overview. Light Sets

CHAPTER 1 Graphics Systems and Models 3

Complex Shading Algorithms

CS 498 VR. Lecture 19-4/9/18. go.illinois.edu/vrlect19

Lighting and Shading

CS 418: Interactive Computer Graphics. Basic Shading in WebGL. Eric Shaffer

A bit more Deferred - CryEngine 3. Triangle Game Conference 2009 Martin Mittring Lead Graphics Programmer

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Opaque. Flowmap Generator 3

INFOGR Computer Graphics. Jacco Bikker - April-July Lecture 14: Grand Recap. Welcome!

Ambient Occlusion. Ambient Occlusion (AO) "shadowing of ambient light "darkening of the ambient shading contribution

Game Graphics Programmers

Shadow Techniques. Sim Dietrich NVIDIA Corporation

GLOBAL ILLUMINATION IN UNITY 5

Getting fancy with texture mapping (Part 2) CS559 Spring Apr 2017

Computergrafik. Matthias Zwicker. Herbst 2010

Optimizing Mobile Games with Gameloft and ARM

Me Again! Peter Chapman. if it s important / time-sensitive

Real-Time Hair Rendering on the GPU NVIDIA

Optimized Rendering Techniques Based on Local Cubemaps

Real-Time Universal Capture Facial Animation with GPU Skin Rendering

Rendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker

GeForce4. John Montrym Henry Moreton

AMD Radeon ProRender plug-in for PTC Creo. User Guide

Surface Detail Maps with Soft Self- Shadowing. Chris Green, VALVE

CS GPU and GPGPU Programming Lecture 12: GPU Texturing 1. Markus Hadwiger, KAUST

#Short presentation of the guys

Here I ll present a brief summary of the important aspects and then dive into improvements we made on Black Ops II.

Bringing AAA graphics to mobile platforms. Niklas Smedberg Senior Engine Programmer, Epic Games

#Short presentation of the guys

Shading 1: basics Christian Miller CS Fall 2011

Game Graphics Programmers

Scalable mobile visualization

THEA RENDER ADAPTIVE BSD ENGINE

Advanced Shading and Texturing

TSBK03 Screen-Space Ambient Occlusion

Rendering 17 Mixed Lighting

CS452/552; EE465/505. Lighting & Shading

Lab 9 - Metal and Glass

Evolution of GPUs Chris Seitz

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

Rendering Structures Analyzing modern rendering on mobile

Lecture 9: Deferred Shading. Visual Computing Systems CMU , Fall 2013

Illumination & Shading: Part 1

Game Graphics Programmers

Radeon ProRender plug-in for Maya. User Guide v2.1

Dynamic Ambient Occlusion and Indirect Lighting. Michael Bunnell NVIDIA Corporation

LIGHTING - 1. Note. Lights. Ambient occlusion

Transcription:

The Making of Seemore WebGL Will Eastcott, CEO, PlayCanvas 1

What is Seemore WebGL? A mobile-first, physically rendered game environment powered by HTML5 and WebGL 2

PlayCanvas: Powering Seemore WebGL Open-source, WebGL game engine with cloud-based visual tools 3

Did I Mention PlayCanvas is Open Source? https://github.com/playcanvas/engine 4

Updating a Classic The original C++ Seemore demo was significantly upgraded in terms of visuals 5

So How Did We Do It? Physically Based Rendering (PBR) Lightmapping Ambient occlusion Dynamic shadow mapping Box projected cube map reflection mapping and a serious amount of optimization 6

Physically Based Rendering: The Basics Energy Conservation Meaningful maps HDR data Tonemapping Gamma Correction 7

Physically Based Rendering: Material Input Data Material Albedo (color information) Normal (surface information) Gloss (microsurface information) Metalness (optional) Opacity (optional) 8

Physically Based Rendering: Environmental Input Data IBL probes prefiltered, box projected cubemaps Used custom filtering tool PlayCanvas editor users will soon be able to generate these cubemaps in the interface Analytical lights (point/directional, energy conserving Blinn-Phong) Lightmaps Everything must be HDR! Encode HDR to RGBM 9

Physically Based Rendering: Materials Schlick s Fresnel approximation Toksvig s factor for specular anti-aliasing 10

Tonemapping Important for getting rid of overly bright or dark spots Generally simulates how the eye or film perceives colors Seemore uses the well known Uncharted 2 tonemap. See: http://filmicgames.com/archives/75 11

Lightmapping Single map for scenes with static light sources 12

Lightmapping Direct and indirect lightmaps for scenes with slightly moving lights Use indirect lightmap as base ambient Store directional static shadows in a separate lightmap Can store multiple shadows in a texture s color channels for a slightly moving light Mask real-time diffuse/specular light with shadows Combine with real-time shadows 13

Lightmapping Indirect lightmap 14

Lightmapping Direct lightmap 15

Dynamic Shadows: Interpolated Lightmaps 16

Dynamic Shadows: Interpolated Lightmaps 17

Dynamic Shadows: Shadow Mapping Real-time shadow maps for dynamic objects Very costly on mobile devices (draw calls, projection, reads) Only update shadow map every 3 rd frame if objects are not moving Only use real self-shadowing with multiple taps on dynamic objects Just use bilinear lookup without depth comparison on static receivers Shadow is encoded as RGB (depth) and A (mask for bilinear lookup) in an 8-bit 1024x1024 texture Use Normal Offset bias to reduce self-shadowing artifacts See http://www.dissidentlogic.com/old/#normal%20offset%20gdc%20materials 18

Dynamic Shadows: Shadow Mapping 19

Ambient Occlusion Occluding IBL lighting (especially specular) is vital Specular occlusion should ideally be view-dependent but it s too expensive for mobile Baked AO maps (tweak attenuation for specular occlusion) Can store multiple AO maps in channels (the plant s mouth, for example) Last resort: derive some occlusion factor from single/indirect lightmaps Procedural AO for special cases (e.g. plant tentacles) 20

Ambient Occlusion 21

Box Projected Cube Map Reflections Widely used in games to make cube maps fit in a more correct way with the scene Used for both IBL reflections and refractions Excellent primer on the topic here: http://www.gamedev.net/topic/568829- box-projected-cubemap-environmentmapping/ 22

Box Projected Cube Map Reflections 23

Optimization ETC1 Texture Compression (WEBGL_compressed_texture_etc1) Compressing textures is vital for low memory mobile devices WebGL is limited in the formats it exposes but does provide ETC1 (and DXT) Good results for diffuse, specular, gloss and lightmaps Bad results for normal maps Compressed the majority of normal maps anyway Remainder were left uncompressed when the results were particularly bad Use lowp in fragment shaders where possible Only precision-critical shaders (shadow mapping) retained highp Avoid costly math ops (pow, sqrt) Cull draw calls Sort opaque draw calls front to back 24

Additional Tricks: Foliage Plants are translucent and pass light to the back side Seemore plants are in a hemispherically lit room Just use normal.y as a translucency factor Additional analytical per-vertex translucency occlusion for the main plant 25

Additional Tricks: Halos Avoid full-screen effects Incurs high fill rate costs You lose hardware antialiasing Although it is possible to implement AA as a post process, again, this is expensive Use a cheap alternative Transparent, camera aligned sprite 26

Additional Tricks: Dynamic Exposure We avoided an analytical approach Exposure controlled through script Dependent on location and view vector 27

Things That Didn t Make The Cut Instancing (ANGLE_instanced_arrays) Seemore was limited more on the GPU (fragment operations) The demo didn t render enough instances to make a significant difference Variance Shadow Mapping Works well on desktop machines but a bug in Chrome s float texture extension was problematic Encoding the shadow map to RGBA8 lost too much precision 28

Putting It All Together 29

Putting It All Together 30

Some Links The Open Source PlayCanvas project: https://github.com/playcanvas/engine The Cloud-Hosted PlayCanvas toolset: https://playcanvas.com The Seemore Demo: http://seemore.playcanvas.com ARM Mali Developer Center: http://malideveloper.arm.com 31

32 tanx.playcanvas.com