Computer Graphics Seminar
MTAT.03.305 Spring 2020
Raimond Tunnel
Computer Graphics Seminar MTAT.03.305 Spring 2020 Raimond Tunnel - - PowerPoint PPT Presentation
Computer Graphics Seminar MTAT.03.305 Spring 2020 Raimond Tunnel Previously... v 2 M = M 1 M 2 M 3 ... Data v 0 v 1 v 2 ( v w ) v x , v y , v z P V M v Vertex v w v w v 0 v 1 transformations v 2 v 2 Vertex shader
Raimond Tunnel
Vertex transformations Culling & Clipping Rasterization Fragment shading Visibility tests & Blending Data
v0 v 2 v1
v1 v0 v 2 v1 v0 v 2 vs
vx vw , v y vw , v z vw)
v1 v0 v 2 Vertex shader
= When is this true?
http://cgdemos.tume-maailm.pri.ee/
http://cgdemos.tume-maailm.pri.ee/
*not to scale
Nice post: https://physics.stackexchange.com/a/240848
All of these feathers are actually brown. https://en.wikipedia.org/wiki/Pollia_condensata
More correct is: direction towards the light
Hint?
Pixel
Geometric definition
Algebraic definition
Geometric definition Algebraic definition
This should be quite easy for the computer to calculate...
T⋅surfaceNormal
T⋅n What is the visual result of that?
T⋅
T⋅l⋅LG⋅M G
T⋅l⋅LB⋅M B Light that material reflects Light that light source emits
Far away Close
2 U s u a l l y 1 ( w h y ? ) T h i s i s p h y s i c a l l y c
r e c t
https://threejs.org/docs/#api/en/lights/PointLight
PointLight(hex, intensity, distance) Distance - If non-zero, light will attenuate linearly from maximum intensity at light position down to zero at distance.
T⋅l⋅LD R⋅M DR
T⋅l⋅LDG⋅M DG
T⋅l⋅LDB⋅M DB
Red channel Green channel Blue channel Ambient term Diffuse term What could go wrong?
T⋅
T⋅v⋅LS R
T⋅
T⋅
Is there something missing? S
e p r
e r t i e s a r e u s u a l l y t h e s a m e i n t h e s a m e c h a n n e l . Any errors on the slide?
T⋅
T⋅v⋅LS R
T⋅
T⋅v⋅LSG⋅M SG
T⋅
T⋅
MS LS
β ~cos(β)
~I
0.25 1 10° 0.98 0,25 0.25 1 20° 0.94 0,24 0.25 1 30° 0.87 0,22 0.25 1 40° 0.77 0,19 0.25 1 50° 0.64 0,16 0.25 1 60° 0.5 0,12 0.25 1 70° 0.34 0,09 0.25 1 80° 0.17 0,04 0.25 1 90° Assume we are dealing with one channel (e.g. red) Assume the channel values are between [0, 1] (mapped later to [0, 255]) This is actually too little change in the result for such a big change from 10° to 20°. This is too much for such big angles.
β ~cos2(β) ~I ~cos3(β) ~I ~cos4(β) ~I ~cos5(β) ~I 10° 0.97 0,24 0.96 0.24 0.94 0.23 0.92 0.23 20° 0.88 0,22 0.83 0.21 0.78 0.20 0.73 0.18 30° 0.75 0.19 0.65 0.16 0.56 0.14 0.49 0.12 40° 0.59 0.15 0.45 0.11 0.34 0.09 0.26 0.07 50° 0.41 0.10 0.27 0.07 0.17 0.04 0.11 0.03 60° 0.25 0.06 0.13 0.03 0.06 0.02 0.03 0.01 70° 0.12 0.04 0.04 0.01 0.01 0.00 0.00 0.00 80° 0.03 0.01 0.01 0.00 0.00 0.00 0.00 0.00 90° 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Values above 0.25 are in red
T⋅
T⋅v) c⋅LS R
T⋅
T⋅v) c⋅LSG⋅M S G
T⋅
T⋅v) c⋅LS B
c=0 c=30 c=90 c=300
T⋅
T⋅v) c⋅LS R
T⋅
T⋅v) c⋅LSG⋅M S G
T⋅
T⋅v) c⋅LS B
T⋅
T⋅v) c⋅LS R
T⋅
T⋅v) c⋅LSG⋅M S G
T⋅
T⋅v) c⋅LS B
T⋅
T⋅v) c⋅LS R
T⋅
T⋅v) c⋅LSG⋅M S G
T⋅
T⋅v) c⋅LS B
T⋅
T⋅v) c⋅LS R
T⋅
T⋅v) c⋅LSG⋅M S G
T⋅
T⋅v) c⋅LS B
DEMO 2: http://cgdemos.tume-maailm.pri.ee/
vs Vertex transformations Culling & Clipping Rasterization Fragment shading Visibility tests & Blending Data Vertex shader Fragment shader M amb M diff M spec Lamb Ldiff Lspec n
vs Rasterization Fragment shading Visibility tests & Blending Data Fragment shader M amb M diff M spec Lamb Ldiff Lspec n Vertex transformations Culling & Clipping
M =M 1 ⋅M 2⋅ ...
v0 v 2 v1
v1 v0 v 2 v1 v0 v 2 vs
vx vw , v y vw , v z vw)
v1 v0 v 2 Vertex shader
Reality Mathematical description Replication Approximation Approximation Computer
T⋅l⋅LD⋅M D+ (r T⋅v) c⋅LS⋅M S