TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

Similar documents
TDA361/DIT220 Computer Graphics, January 15 th 2016

CS 130 Final. Fall 2015

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

Spring 2012 Final. CS184 - Foundations of Computer Graphics. University of California at Berkeley

The Traditional Graphics Pipeline

CHAPTER 1 Graphics Systems and Models 3

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Speeding up your game

The Traditional Graphics Pipeline

Pipeline Operations. CS 4620 Lecture 14

CS 130 Exam I. Fall 2015

Interpolation using scanline algorithm

CSE 167: Introduction to Computer Graphics Lecture #9: Visibility. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018

CS451Real-time Rendering Pipeline

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

RASTERISED RENDERING

Deferred Rendering Due: Wednesday November 15 at 10pm

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

CS 465 Program 5: Ray II

Topics and things to know about them:

The Traditional Graphics Pipeline

Spatial Data Structures and Speed-Up Techniques. Ulf Assarsson Department of Computer Science and Engineering Chalmers University of Technology

Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Pipeline Operations. CS 4620 Lecture 10

Mach band effect. The Mach band effect increases the visual unpleasant representation of curved surface using flat shading.

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

CS 498 VR. Lecture 18-4/4/18. go.illinois.edu/vrlect18

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Scene Management. Video Game Technologies 11498: MSc in Computer Science and Engineering 11156: MSc in Game Design and Development

CSE 167: Introduction to Computer Graphics Lecture #11: Visibility Culling

Computergrafik. Matthias Zwicker. Herbst 2010

CSE 167: Introduction to Computer Graphics Lecture #18: More Effects. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

CSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling

CS452/552; EE465/505. Clipping & Scan Conversion

CS4620/5620: Lecture 14 Pipeline

Computer Graphics Shadow Algorithms

Computer Graphics Ray Casting. Matthias Teschner

Visibility and Occlusion Culling

Lecture 11: Ray tracing (cont.)

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

CEng 477 Introduction to Computer Graphics Fall 2007

Shadow Algorithms. CSE 781 Winter Han-Wei Shen

CS 4620 Program 4: Ray II

CS 464 Review. Review of Computer Graphics for Final Exam

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Introduction to Visualization and Computer Graphics

TSBK03 Screen-Space Ambient Occlusion

Shadow Rendering EDA101 Advanced Shading and Rendering

Real-Time Shadows. Last Time? Textures can Alias. Schedule. Questions? Quiz 1: Tuesday October 26 th, in class (1 week from today!

Adaptive Point Cloud Rendering

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Institutionen för systemteknik

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

Chapter 7 - Light, Materials, Appearance

Robust Stencil Shadow Volumes. CEDEC 2001 Tokyo, Japan

Computer Graphics I Lecture 11

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

Culling. Computer Graphics CSE 167 Lecture 12

Today. Acceleration Data Structures for Ray Tracing. Cool results from Assignment 2. Last Week: Questions? Schedule

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

Homework #2. Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves

Ray Tracer Due date: April 27, 2011

Graphics Hardware and Display Devices

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

Computer Graphics. Bing-Yu Chen National Taiwan University

The exam begins at 2:40pm and ends at 4:00pm. You must turn your exam in when time is announced or risk not having it accepted.

The University of Calgary

Rasterization Overview


Visibility: Z Buffering

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Lecture 17: Shadows. Projects. Why Shadows? Shadows. Using the Shadow Map. Shadow Maps. Proposals due today. I will mail out comments

Real-Time Voxelization for Global Illumination

Sung-Eui Yoon ( 윤성의 )

Hidden surface removal. Computer Graphics

CS 130 Exam I. Fall 2015

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

CS 4620 Midterm, March 21, 2017

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Motivation. Culling Don t draw what you can t see! What can t we see? Low-level Culling

6.837 Introduction to Computer Graphics Final Exam Tuesday, December 20, :05-12pm Two hand-written sheet of notes (4 pages) allowed 1 SSD [ /17]

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

Spatial Data Structures

Lecture 11. More Ray Casting/Tracing

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

Advanced Ray Tracing

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

CMSC427 Final Practice v2 Fall 2017

Computer Graphics Lecture 11

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

Logistics. CS 586/480 Computer Graphics II. Questions from Last Week? Slide Credits

Spatial Data Structures

Sign up for crits! Announcments

Transcription:

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students) Saturday, January 13 th, 2018, 08:30-12:30 Examiner Ulf Assarsson, tel. 031-772 1775 Permitted Technical Aids None, except English dictionary General Information Numbers within parentheses states the maximum given credit points for the task. Solutions shall be clear and readable. Too complex solutions can cause reductions in the provided number of points Questions to examiner during exam will be possible approximately one hour after the start of the exam. If anything is unclear remember what has been mentioned on the lectures, in the slides and course book and do your best. Grades In order to pass the course, passed exam + exercises (or exam + project) are required. The final grade is calculated from the exam grade. The exam is graded as follows CTH: 24p grade 3 < 36p grade 4 < 48p grade 5 GU: 24p G < 45p VG Max 60p Grades are announced by the LADOK system ~3 weeks after the exam Solutions will be announced on the course home page. Review Review date (granskningsdatum) is announced on the course home page.

Question 1 a) [2p] Explain what the z-buffer is used for and how it works. Use a buffer called the z or depth buffer to store the depth of the closest object at each pixel found so far. As we render each polygon, compare the depth of each pixel to depth in z buffer. If less, place shade of pixel in color buffer and update z buffer. b) [1p] What is the advantage of Bresenham's line drawing algorithm? uses only integers c) [2p] Why do we want to use double buffering? Explain what can happen without it. to avoid screen tearing. Also explain screen tearing - see lecture 1.

d) [5p] Consider a game where the model-matrix (the position and orientation) for a car is described by a translation matrix, T, and a rotation matrix, R, as given below. 1. (1p) When the user presses a key, the car should move 2.0 units in the world-space x direction. How would you modify the translation matrix? 2. (2p) How would you modify the rotation matrix for the car to turn slightly to the left? 3. (1p) When the user presses the "up-arrow" key, the car shall move forward in the direction it is facing. How do you modify the matrices? 4. (1p) We now want a camera from inside the car (at the car's position and facing in the r z direction). How can you calculate this matrix? 1. t x = t x + 2 2. You must show that you understand that r z and r x should be rotated around r y (E.g., from the labs): r z += 0.01 r x normalize r z r x = r z r y 3. (t x, t y, t z ) += 0.1 r z (0.1 is just an example) 4. V = (TR) -1

Question 2 a) [3p] Describe flat shading, Gouraud shading and Phong shading. Flat shading: illumination computed using the triangle-plane's normal. Gouraud-shading: illumination computed per triangle vertex and for each pixel, the color is interpolated. Phong Shading: For each pixel, the normal is interpolated from the 3 vertex-normals. Full illumination is done with this interpolated normal. b) [3p] How often are the vertex shader, geometry shader and fragment shader executed when one triangle is sent as input for drawing by the hardware? Explain your answer. Three, once, and once per non-occluded fragment (unless supersampling schemes are used, which executes the fragment shader per fragment sample). c) [2p] How much extra memory does it take to store a mipmap-hierarchy of a texture, compared to just the base texture itself? ~1/3 extra (or ~33%). d) [2p] What is the difference between bump mapping and displacement mapping? Bump mapping only computes lighting as if the surface is bumpy, while displacement mapping actually (geometrically) displaces the surface according to the map. Question 3 a) [2p] Assume that you have enabled backface culling. How does the hardware determine if a triangle will be backfacing or frontfacing? (Drawing an image can be useful.) The vertices v0, v1, v2, are projected onto the screen and if they appear in anticlockwise order (right-hand side rule), the triangle is (by default) assumed to be front facing. Otherwise, backfacing. (The order could be reversed by specifying CW-order.) b) [2p] To draw transparent objects using for instance OpenGL, you typically divide the triangles in two groups: the transparent ones and the opaque ones. 1) Which of these two groups needs to be sorted, 2) why, 3) and in which order? 1) the transparent triangles, 2) for correct blending, 3) back-to-front. c) [1p] Normally, you would want to draw all geometry that is in front of the camera. So, why is a near and far plane used for the view frustum? Near plane is used to avoid a degenerate projection plane. Far plane can be used to get better z-precision in the z buffer.

d) [2p] Show how to compute the intersection between a ray and a sphere (in 3D). See slides from lecture 6. Sphere center: c, and radius r Ray: r(t)=o+td Sphere formula: p-c =r Replace p by r(t): r(t)-c =r and solve for t. Return r(t). e) [3p] Explain an efficient method for determining intersection between a ray and a box (in 3D). Find t min and t max for the intersections against each of the three slabs. Keep max of the three t min and min of the three t max. If t min < t max, there is an intersection. (Check for degenerate case when ray parallel to slab.) Question 4 a) [4p] Draw a simple scene and visually divide it into an Axis-Aligned Bounding Box hierarchy a Sphere hierarchy an OBB hierarchy an Octree or Quadtree an Axis-Aligned Binary Space-Partitioning Tree a Polygon-Aligned Binary Space-Partitioning Tree a grid a recursive and a hierarchical grid You can do all your drawings in 2D for simplicity and you may use different scenes for the different hierarchies. (You don't need to show the corresponding tree structures). The differences in the spatial divisions between all the types of data structures must be clear from your examples, for any score. b) [1p] Why can't we use ray tracing to do an exact object-object collision detection test? Only tests a discrete subset of surface points and directions. A finite set of rays may miss small intersections. c) [1p] What is a shadow cache? Explain what it is good for and how it works. pointer to previous intersected triangle (primitive) by the shadow rays. Null, if last shadow ray had no intersection. Reason: speedup, potentially avoiding tree traversal. d) [4p] What is Constructive Solid Geometry and how does it work? Boolean operations between objects. Find overlap for each object and ray. Apply the Boolean operator on each interval and use the closest interval point.

Question 5 a) [3p] This is the rendering equation. Explain the equation and all of its components. You can include a figure in your answer. f r is the BRDF, ω' is incoming direction, n is normal at point x, Ω is hemisphere around x and n, L i is incoming radiance, x is position on surface, ω is outgoing direction vector. L o (x,ω)=l e (x, ω)+l r (x, ω) (slightly different terminology than Kajiya). I.e., outgoing radiance =emitted + reflected radiance. Integral represents reflected radiance. b) [2p] Describe the Fresnell effect for dielectric materials and metals, respectively. (You may draw graphs or describe with words.) dielectrics: High transmittance/low reflectivity for low angles. Low transmittance/high reflectivity for high angles. Metals: high reflectivity for all angles (there can be a slight dip e.g. around 85 degrees) c) [2p] Why do you need to use a bias in the shadow map algorithm? What is the cause of the problem? We compare two different discretizations - one from the eye and one from the camera. (To avoid z-fighting (incorrect self shadowing) and light leaking.) The view sample can lie further from the light than the shadow map sample (due to discrete sampling). d) [3p] Describe how the z-fail algorithm works. Create shadow quads from the silhouettes of the shadow caster (as seen from light source). Capping planes are necessary. Render ambient occlusion to color buffer. Turn off updating of z-buffer and rendering to color buffer. Invert z test, i.e., use GL_GREATER. Render front facing (as seen from camera) shadow volume polygons to stencil buffer, decrementing stencil values. Render back facing shadow volume polygons to stencil buffer, incrementing stencil values. Render diff+spec lighting contribution to color buffer where stencil buffer = 0. Question 6 a) [1p] Sketch one non-continuous curve and one C 0 -continuous curve (and mark which is which).

b) [2p] In which ways are NURBS more general than B-Splines? control points can be set at non-uniform intervals and they can have different weights. c) [1p] Assume p=(6,0,1,3). Perform the homogenisation step on p. d) [1p] Given two vectors ω i and ω o, how does one calculate the half angle vector ω h? ω h = normalize(ω i + ω o ). e) [5p] Postprocessing: You have a scene of a spaceship which you render with a shader called FancyShader, to a texture, OffScreenTexture. To the rendered result, you want to apply a post-processing effect that generates a gray-scale image. 1. (3p) Order all of the following steps such that you would end up with a grayscale image of the spaceship in your window: A. Draw Spaceship B. Bind GrayScaleShader C. Draw fullscreen quad D. Clear rendertarget E. Bind OffScreenTexture to texture unit 0 F. Bind OffScreenTexture as rendertarget G. Bind Window (default framebuffer) as rendertarget H. Bind FancyShader 2. (1p) This is an effect that could instead be implemented directly in FancyShader. Why could there be a performance advantage of doing it as a post-processing pass (especially for more computationally heavy effects)? 3. (1p) Most/Many post-processing effects, like blur, can not be implemented in FancyShader. Why not? 1: E.g.: F, D, H, A, G, E, B, C Actually any of these orders work: ((F D)/H) A (G/E/B) C, where means strict order and / means any order. 2: The performance then scales with pixels, not fragments (or geometry). 3: Need to know result of neighbouring pixels.