Top Banner
WebGL
35

Introduction to Webgl by Rachel Prudden

Feb 22, 2017

Download

Technology

TechExeter
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Webgl by Rachel Prudden

WebGL

Page 2: Introduction to Webgl by Rachel Prudden

Hardware accelerated

graphics

Page 3: Introduction to Webgl by Rachel Prudden

No additional software

Page 4: Introduction to Webgl by Rachel Prudden
Page 5: Introduction to Webgl by Rachel Prudden

GPU

Page 6: Introduction to Webgl by Rachel Prudden

“The WebGL API may be too tedious to use directly without some utility libraries” - Wikipedia

Page 7: Introduction to Webgl by Rachel Prudden
Page 8: Introduction to Webgl by Rachel Prudden

Three.js

Page 9: Introduction to Webgl by Rachel Prudden
Page 10: Introduction to Webgl by Rachel Prudden
Page 11: Introduction to Webgl by Rachel Prudden

Graphics Pipeline

Page 12: Introduction to Webgl by Rachel Prudden

(0,0)

(1,-2)

(2,1)

Page 13: Introduction to Webgl by Rachel Prudden

vertex shader

rasterise

fragment shaderblending

make shapes

Page 14: Introduction to Webgl by Rachel Prudden

vertex shader

rasterise

fragment shaderblending

make shapes

Page 15: Introduction to Webgl by Rachel Prudden

vertex shader

rasterise

fragment shaderblending

make shapes

Page 16: Introduction to Webgl by Rachel Prudden

world space

screen space

transformsmodel vertices

vertex shader

Page 17: Introduction to Webgl by Rachel Prudden

world space

screen space

vertex shader

Page 18: Introduction to Webgl by Rachel Prudden

world space

screen space

vertex shader

Page 19: Introduction to Webgl by Rachel Prudden

Screenshot: The Eight Thousanders

world space

screen space

vertex shader

Page 20: Introduction to Webgl by Rachel Prudden
Page 21: Introduction to Webgl by Rachel Prudden
Page 22: Introduction to Webgl by Rachel Prudden

vertex shader

rasterise

fragment shaderblending

make shapes

Page 23: Introduction to Webgl by Rachel Prudden

attributes

colour

fragment shader

Page 24: Introduction to Webgl by Rachel Prudden

vec4(1.0, 0.0, 0.0, 1.0);

attributes

colour

fragment shader

Page 25: Introduction to Webgl by Rachel Prudden

attributes

colour

fragment shader

vec4(1.0, 0.0, 0.0, 1.0);

Page 26: Introduction to Webgl by Rachel Prudden

coords

attributes

colour

fragment shader

vec4(coords.x, 0.0, 0.0, 1.0);

Page 27: Introduction to Webgl by Rachel Prudden

attributes

colour

fragment shader

coords

vec4(coords.x, 0.0, 0.0, 1.0);

Page 28: Introduction to Webgl by Rachel Prudden

attributes

colour

fragment shader

coords

vec4(coords.y, 0.0, 0.0, 1.0);

Page 29: Introduction to Webgl by Rachel Prudden

attributes

colour

fragment shader

coords

vec4(coords.z, 0.0, 0.0, 1.0);

Page 30: Introduction to Webgl by Rachel Prudden

attributes

colour

fragment shader

coords, texture, lightPos, normals

texture2D(texture, coords) + light

Page 31: Introduction to Webgl by Rachel Prudden
Page 32: Introduction to Webgl by Rachel Prudden
Page 33: Introduction to Webgl by Rachel Prudden

Three.js + Shaders

Page 34: Introduction to Webgl by Rachel Prudden
Page 35: Introduction to Webgl by Rachel Prudden

Thanks!