Computer Graphics Seminar MTAT.03.296 Spring 2014 Raimond Tunnel
Conclusion!
Geometry & Algebra ( cos ( 0.6 ) ) cos ( 0.6 ) − sin ( 0.6 ) 0 = ? 0 1 0 sin ( 0.6 ) 0
Geometry & Algebra ( cos ( 0.6 ) ) cos ( 0.6 ) − sin ( 0.6 ) 0 0 1 0 = sin ( 0.6 ) 0 =
Geometry & Trigonometry
Geometry & Trigonometry
Lighting Models ? T ⋅ v ) c ⋅ L Specular ⋅ M Specular ( r ( n ∣ v + r ∣ ) c T ⋅ v + r ? ⋅ L Specular ⋅ M Specular ?
Lighting Models Phong T ⋅ v ) c ⋅ L Specular ⋅ M Specular ( r c ⋅ L Specular ⋅ M Specular ( n T ⋅ h ) Blinn h = v + r ∣ v + r ∣
Lighting Models I = L A ⋅ M A + 1 2 ⋅ ( n c ⋅ L S ⋅ M S ) T ⋅ l ⋅ L D ⋅ M D +( r T ⋅ v ) Phong's model d light c = 0 c = 30 c = 300 Sharp and narrow specular Soft and wide specular No specular, Only diffuse
Physically Based Shading Distribution function Geometry function Fresnel effect f microfacet ( l ,v )= F ( l ,h )⋅ G ( l ,v ,h )⋅ D ( h ) 4 ⋅ ( n ⋅ l )⋅ ( n ⋅ v ) Returns how much light reflects
Physically Based Shading G ( l ,v ,h ,n ) Shadowing Masking ● How much light is not blocked? ● How much surface is not blocked from a viewer? ● How much points are visible from both a viewer and a light source?
Physically Based Shading D ( h ) ● How much microsurface normals point towards the macrosurface normal?
Particle Systems
Particle Systems
Particle Systems ● Particles can have more interesting logic (e.g. the Boids algorithm) ● Many particles may cause performance issues. http://chrisp.gr/projects/boids/ Unreal Engine 4
Procedural Generation ● Let the computer generate our content via procedures (methods, functions, rulesets etc). ● Particles are also procedurally generated. ● Other things can be generated, like worlds, houses, weapons, NPCs, trees. Procedurally generated Terraria map
Procedural Generation Terraria
Procedural Generation ● Lindenmayer systems (1968). ● The Algorithmic Beauty of Plants (1990) http://algorithmicbotany.org/papers/abop/abop.pdf ● Aristid Lindenmayer (1925 – 1989) ● L-system – Parallel rewriting system, formal grammar ● Deterministic 0-context L-systems ● Stochastic L-systems ● Context sensitive L-systems
Procedural Generation Procedure Ruleset Starting axiom F → FG F F G → GF FG Iteration 1 Iteration 1 Iteration 1 FGGF ● Parallel rewriting Iteration 2 system ● Formal grammar FGGFGFFG Iteration 3
Procedural Generation Symbol Interpretation Draw a segment F Push current state into [ stack Pop state from stack ] Turn 30 degrees left around + z-axis Turn 30 degrees right - around z-axis Turtle graphics http://en.wikipedia.org/wiki/Turtle_graphics
Procedural Generation S t o c h a s t i c s y s Ruleset t e m 0.5 → F [ ^ F [+ F ][− F ]] F 0.5 → F [ & F [+ F ][− F ]] F Starting axiom F Iterations: 3
3D Scan Data ● Large amount of points ● Model filled with holes and noise
3D Scan Data ● Remove outliers ● Surface Reconstruction (e.g. Poisson) ● Reconstruct parts of the surface individually with different parameters
3D Scan Data ● Lower the vertex count (decimation).
3D Scan Data ● Export from Geomagic Studio, MeshLab, ... ● Import into Blender
Realtime Realistic Rendering R e f l e c t Depth of Field i o n s s c i s y h P Motion Blur OctaneRender 2.0
Realtime Realistic Rendering ● Voxel Octree Cone Tracing ● NVIDIA, 2011 https://research.nvidia.com/sites/default/files/publications/GIVoxels-pg2011-authors.pdf ● Algorithm for indirect illumination Glossy reflections, color bleeding Indirect diffuse lighting
Realtime Realistic Rendering ● Voxel Octree Cone Tracing Maybe?? ● Distribute radiance from light sources ● Distribute radiance inside octree ● For a viewed point, cone-trace indirect illumination Images taken from the article...
Non-(photo)realistic Rendering ● Cel-shading / toon shading
Non-(photo)realistic Rendering ● Cel-shading / toon shading ● Quantize the colors, illumination, pixel values ● Black border F float binCount = 6.0; r a g ( m + 4 e n l i t n frag_color.x = floor(frag_color.x * binCount) / binCount; s e h s a o frag_color.y = floor(frag_color.y * binCount) / binCount; d f e c r o frag_color.z = floor(frag_color.z * binCount) / binCount; d e ) gl_FragColor = frag_color;
Non-(photo)realistic Rendering ● Black border ● Any edge detection algorithm on the depth texture and on the normal texture Quantized render Depth texture (z-buffer) Normal vector texture Detected edges Result with black border
Non-(photo)realistic Rendering ● Black border Butterworth √ 1 ● Any edge detection algorithm... 10 ) ( 1 + x – Sobel (first order derivative) – Laplacian (second order derivative) Convolution of an image with a kernel ( d x d ) d d ( f ∗ g )[ x , y ]= ∑ ∑ f ( x + i , y + j ) ⋅ g ( x + i , y + j ) i =− d j =− d Laplacian kernels Sobel kernels for x and y 1 1 1 0 1 0 -1 0 1 -1 -2 -1 1 -8 1 1 -4 1 -2 0 2 0 0 0 1 1 1 0 1 0 -1 0 1 1 2 1 Use only one Use both and sum absolute values from results
Non-(photo)realistic Rendering ● Jot, FreeStyle, ...
Computing on the GPU http://www.mathworks.se/company/newsletters/articles/gpu-programming-in-matlab.html
Computing on the GPU ● Use frame-buffer object (FBO) and do dummy rendering ● OpenCL ● CUDA (for NVIDIA cards) Platform Device 1 Device 2 CPU GPU Data: [0.0, 1.0, 2.0, 3.0, ...] Data: [0.0, 1.0, 4.0, 9.0, ...]
Computing on the GPU
Other activities ● Martti Savolainen (3D Technologies) ● Fille Mazendacus (Tartu Art School) ● 3D scanning (Institute of Technology)
The End
The End ● How was the seminar? ● Did it correspond to your expectations? ● What should we do differently? ● Was there anything you would have like to have done that we didn't have time for? ● Are you joining us again next semester?
Recommend
More recommend