3D on the Web : Understanding the basics

Slides:



Advertisements
Similar presentations
Real-Time Rendering 靜宜大學資工研究所 蔡奇偉副教授 2010©.
Advertisements

Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
3D Graphics Rendering and Terrain Modeling
CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t.
X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
The Graphics Pipeline CS2150 Anthony Jones. Introduction What is this lecture about? – The graphics pipeline as a whole – With examples from the video.
Game Engine Design ITCS 4010/5010 Spring 2006 Kalpathi Subramanian Department of Computer Science UNC Charlotte.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Week 2 - Wednesday CS361.
CSE 381 – Advanced Game Programming Code Setup.
1 The Rendering Pipeline. CS788 Topic of HCI 2 Outline  Introduction  The Graphics Rendering Pipeline  Three functional stages  Example  Bottleneck.
Microsoft Virtual Academy Stacey Mulcahy | Technical Evangelist Christopher Harrison | Content Developer.
Texture Mapping CAP4730: Computational Structures in Computer Graphics.
Mark Nelson 3d projections Fall 2013
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
High detail models, depth of field, soft shadows, reflective surfaces. (Image created by Toxic Studios using Brazil R/S)
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
Advanced Windows Store App Development using C# Jump Start Jerry Nixon | Microsoft Developer Evangelist Daren May | President & Co-founder, Crank211.
Build your own 2D Game Engine and Create Great Web Games using HTML5, JavaScript, and WebGL. Sung, Pavleas, Arnez, and Pace, Chapter 5 Examples 1.
Applications and Rendering pipeline
Introduction to Computer Graphics
Porting your Unity Game to the Windows Store Jump Start
Introduction to Programming using Python
- Introduction - Graphics Pipeline
Porting your Unity Game to the Windows Store Jump Start
Photorealistic Rendering vs. Interactive 3D Graphics
ICG Syllabus 1. Introduction 2. Viewing in 3D and Graphics Programming
Week 2 - Friday CS361.
Introducing Blender.
Web API Design Jeremy Likness | Principal Architect
Graphics Processing Unit
3D Graphics Rendering PPT By Ricardo Veguilla.
Introduction to WebGL 3D with HTML5 and Babylon.js
The Graphics Rendering Pipeline
Les nouveautés autour de WebGL Pour Windows 8.1 et Windows Phone 8.1
CS451Real-time Rendering Pipeline
Programming Robotic Systems using Visual Studio
Office 365 Admin Support Skills: Service Management
Join the MVA Community! Microsoft Virtual Academy—Free online training! Tailored for IT Pros and Developers Over 1M registered users Earn while you learn!
Introduction to Computer Graphics with WebGL
Introduction to AngularJS
Introduction to jQuery
Graphics Processing Unit
Introduction to WebGL 3D with HTML5 and Babylon.js
Join the MVA Community! Microsoft Virtual Academy—Free online training! Tailored for IT Pros and Developers Over 2M registered users Earn while you learn!
Lecture 13 Clipping & Scan Conversion
Game Production Basics
Game Engines Non-game specific technology Game: Engine
A Lap Around Azure Websites Introduction
DevOps - Visual Studio Release Management Jump Start
Computer Graphics Introduction to Shaders
Single Page Applications with jQuery or AngularJS
Game Programming Algorithms and Techniques
Chapter 14 Shading Models.
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Developing Universal Windows Apps with HTML and JavaScript
Gaming Engines for Windows 8
Using Babylon.js for beginner
Quick Start Challenge: Universal Projects to Build a Game
Quick Start Challenge: Microsoft Advertising SDK
OpenGL-Rendering Pipeline
Lighting Up Real-time Web Communications with SignalR Introduction
Introduction to WebGL 3D with HTML5 and Babylon.js
Getting Started with PowerShell Jump Start
Git Jump Start Steven Borg | Co-founder & Strategist, Northwest Cadence James Tupper| ALM Consultant, Northwest Cadence.
Getting Started with Microsoft Azure Machine Learning
Adding Style with CSS Helen Zeng | Developer Evangelist
Presentation transcript:

3D on the Web : Understanding the basics Introduction to WebGL 3D with HTML5 and Babylon.js

WHO ARE WE? DAVID ROUSSET DAVID CATUHE Geeks, web developers, 3D addicts DAVID ROUSSET DAVID CATUHE TECHNICAL EVANGELIST PRINCIPAL PROGRAM MANAGER Twitter: @davrous http://blogs.msdn.com/davrous Twitter: @deltakosh http://blogs.msdn.com/eternalcoding Do not try to tune your speakers, the weird sound is due to French accent…

Setting Expectations Target Audience JavaScript developer Game developer Suggested Prerequisites/Supporting Material Visual Studio 2013 Express for Web

Join the MVA Community! Microsoft Virtual Academy Free online learning tailored for IT Pros and Developers Over 2M registered users Up-to-date, relevant training on variety of Microsoft products “Earn while you learn!” Get 50 MVA Points for this event! Visit http://aka.ms/MVA-Voucher Enter this code: WebGL3D1 (expires 21 Nov 14)

Introduction to WebGL 3D with HTML5 and Babylon.js Course topics Introduction to WebGL 3D with HTML5 and Babylon.js Day One 01 | 3D on the Web: Understanding the Basics 02 | WebGL Basics 03 | Using Babylon.js for Beginners 04 | Understanding materials and inputs Day Two 01 | Game Pipeline Integration with Babylon.js 02 | Loading Assets 03 | Babylon.js: Advanced Features 04 | Special Effects

DEMO Assassins Creed Pirates TEASER DEMO Assassins Creed Pirates Hill Valley double virtual joystick on Windows Phone Physics Espilit

AGENDA Understanding 3D Basics via a soft engine 1 Understanding 3D Basics via a soft engine Understanding the transformation pipeline 1 It’s all about triangles 2 Filling the triangles with the proper pixels 3 2 Moving from CPU to GPU

Understanding 3D Basics via a soft engine Section One Understanding 3D Basics via a soft engine

Wireframing

Rasterization

Flat Shading

Gouraud Shading

Texture mapping

SOFT ENGINE DEMO http://david.blob.core.windows.net/html5/SoftEngineProgression/wireframe/index.html

Understanding the transformation pipeline Step One Understanding the transformation pipeline

Some 3D engine vocabulary A point in the 3D world = a vertex Multiple vertex = vertices Vector3 (x,y,z) is used for a 3D position or a direction Triangle = face A 3D object = a mesh

Spaces Euclidean space using Cartesian coordinates : X, Y and Z Local/Model Space World Space View/Camera Space (Point-of-view) Screen space (2D) We are using some different spaces depending on where we looking from. Object space: Local to an object, an object being a set of polygons. If you want to have multiple instances of the same object, at different locations in the world, you need object space. World space: This coordinate system is the most important one. This is where all objects are positioned, where you do compute physics, movements and collisions detection. It is also here that lighting is computed. Think of the world space as your game world. View space: This coordinate system is relative to the camera. Objects in world space are transformed to view space to know what is visible on the screen. This space is also commonly called "eye space" or "camera space". Screen space (2D): Coordinates representation of the screen. Coordinates are not pixels though. The viewport maps view space to screen space, and the origin in screen space is in the middle of the screen (for perspective projections anyway). Extracted from: Einar Öberg work: http://www.inear.se/2011/04/a-brief-introduction-to-3d/

LET’S START SIMPLE: 8 VERTICES DEMO Comment the complete code in SublimeText

It’s all about triangles Step Two It’s all about triangles

Drawing triangles for a cube A cube is made of 8 vertices Each face is made of 3 vertices A cube is made of 12 faces /

DEMO Show the square code and run it DRAWING TRIANGLES DEMO Show the square code and run it Opening SoftEngine.js in SublimeText Modify the code to build the complete cube

Generating geometries from a 3D modeler Once you know how to load a cube, you know how to load everything But you don’t want to hard code every vertex/face yourself right? So, let’s export them from Blender!

LOADING A JSON FORMAT FROM BLENDER DEMO Open Blender Show how to install the plug-in (link from the blog) Remove the cube and add a torus instead Open the generated .babylon file to explain it’s a JSON format Create a VS Web solution, drag’n’drop the part 3 files Show the JSON loader part Modify the web.config file to add a mime type and explain why Return to blender and export Suzanne

Filling the triangles with the proper pixels Step Three Filling the triangles with the proper pixels

Rasterization Algorithm to fill the triangle with lines Pay attention to Z-order via a depth buffer To add lights & shadows we need normals There are different kinds of shading algorithms like: Flat Shading: 1 normal per face, on its center Gouraud Shading: 3 normals per face on each vertex, using interpolation to compute the color via gradients

Flat & Gouraud Shading explained

RASTERIZATION, FLAT & GOURAUD SHADING DEMO Demo rasterization without z-buffering Demo with z-buffering Demo Flat Shading Demo Gouraud Shading

Texture mapping – basic concepts

Texture mapping – unwrapping & UV mapping

TEXTURE MAPPING DEMO

Section Two Moving from CPU to GPU

The rise of GPUs Hardware accelerated rendering: 2D Canvas, CSS3 animations Accelerated 3D with WebGL H264 & JPG hardware decoding

Going further Tutorial series: learning how to write a 3D soft engine from scratch in C#, TypeScript or JavaScript The detailed version of the 3D Software Engine we’ve studied together in this course Unleash the power of HTML 5 Canvas for gaming Where you’ll some interesting points around canvas 2D optimization tricks