1. Homepage
  2. Programming
  3. Computer Graphics, Spring 2023 Assignment 3 Shape Shifters

Computer Graphics, Spring 2023 Assignment 3 Shape Shifters

Engage in a Conversation
C++Computer GraphicsShape ShiftersPBRTUKThe University Of Edinburgh

Overleaf Example

Computer Graphics, Spring 2023 Assignment 3 Shape Shifters

You have gained skills in using existing tools (CW1) and developing your own tool (CW2). This final assignment develops your ability to extend the capabilities of an existing tool (PBRT). CourseNana.COM

Goal Expand PBRT’s functionality by implementing a new shape called ”DisplacementSphere”. Do this by extending PBRT’s sphere so that each point on the sphere is displaced along the normal at that point. The amount of displacement should be the product of two parameters: the value corresponding to that point on the sphere (specified by a displacement map supplied as a texture) and a constant parameter for each sphere (float) that controls strength of the map. The main challenge will be in implementing the intersection test correctly for this displacement-mapped sphere. CourseNana.COM

1 Workflow

It is recommended that you adopt the following workflow1 to achieve the above goal: CourseNana.COM

  1. Add a shape called ”DisplacementSphere” to PBRT’s API by creating the header/implementation files required and add it to the set of possible shapes. e.g. you may copy its existing sphere;
  2. Read any parameters that you wish to specify for this shape. e.g. the displacement map, a global scale factor that controls how much displacement (as a percentage of the radius) the map should apply;
  3. Work out the relevant formulae for testing occlusion;
  4. Implement an intersection method using these formulae;
  5. Work out the maths to determine the normals at displaced points;
  6. Implement plausible2 normals ;
  7. Perform qualitative comparisons;
  8. Perform quantitative comparisons (e.g. timing comparisons for any optimisations);
  9. And finally, you will write a report summarising your methodology and findings. It is strongly recommended that you utilize an IDE with a debugger to help you understand the PBRT code. Instructions for how to set up a debugger with visual studio code (available for free on Mac, Windows, and Linux distributions) are available here.

What to submit

Please name your submission file as UUN.A3.zip, and upload it on the Learn platform as the third assignment for the course. The submitted .zip file should contain: CourseNana.COM

• DisplacedSphere.h and DisplacedSphere.cpp. If these are copied into the src/shapes directory, pbrt should compile (we will add these to the makefile) ; • Any other pbrt source file that you have modified (with instructions on where it should be copied within the PBRT source code structure and how the makefile/rules need to be modified), if at all; • An example .pbrt (scene) file that produces the result which you show in your report (unless you used the one provided here); • A report (.pdf) containing implementation details, how-to-use manual (pbrt input file parameter description), documentation of implemented functions, and the experimental results (required for “Evaluation” in the marking scheme) on various scenes and displacement maps; • One example rendered image, in .exr format corresponding to the above .pbrt input files. Copying your implementation files, rebuilding pbrt and executing it on the supplied .pbrt should produce the same result (up to randomness due to sampling) as in the provided .exr; • A compressed video sequence (See item 4 in the marking scheme). CourseNana.COM

You may not use code from other sources for the intersection test (including correct silhouette as well as for determining normals) itself but you may borrow snippets for adjunct functionality (reading images, any required data structures, etc.). Plagiarism is considered a serious offence, so please make sure that you supply original code, or clearly reference the sources for parts of your code that you might have used. CourseNana.COM

2.1 Marking

Unlike in CW2, your submissions for CW3 will be marked based on the report and your code. In your report, you will need to show the design of your intersection routine (maths) and list the steps taken to add the required functionality to PBRT (with a brief justification). Also report any edge cases you may have considered during your implementation. A total of 100 points are assigned for this project, which will then be halved, i.e. its final contribution to your grade will be at most 50 percent, depending on the marks on your CW2. See “course information” on Learn for clarification. CourseNana.COM

2.2 Marking scheme

  1. Design and implementation [40]

(a) Adding a new shape to PBRT and reading the required parameters for the new shape (5) (b) Design/derivation of the intersection test (10) (c) Implementation of the main intersection routine i. Implementation of correct occlusion handling (5) ii. Implementation of correct silhouette handling (5) iii. Plausible shading normals (5) iv. Correct shadows (silhouettes) (5) v. Support displacement map texture as input (filename) in the pbrt file (5) CourseNana.COM

  1. Coding style (slightly stricter marking criteria than in CW2) (a) Basic code optimisation (5) (b) Error handling (6) (c) Appropriate comments in the code (4) (d) Optimisation/improvement of intersection test (10) CourseNana.COM

  2. Evaluation (a) Rendered image with correct occlusions and normals (3) (b) Rendered image with correct silhouette (4) (c) Textured (rather than the analytical one provided) displacement map (5) (d) Demonstration using a creatively modelled scene (3) (e) Comparison with displacement mapped rendering (5) (f) Evaluation of optimised intersections (10) CourseNana.COM

  3. Animated sequence. Render 48 frames with the same geometry but textures that are animated smoothly (e.g. a blob moving around in the texture) and combine the rendered images into a movie (.ogg, .mp4 or .mov). CourseNana.COM

2.3 Clarification

1b For this step, please list assumptions (in the report) and any maths that you have used. If you find help/tips for this online, please cite your source. Depending on how similar your derivation is to the cited source you will receive (partial) credit. Although we have seen some difficult maths in this course, you should be reassured that this part of the coursework only relies on basic (high school) geometry and trigonometry. 2b This includes detecting and reporting (logging) errors in the input file (.pbrt) with respect to parameters in DisplacedSphere, checking that memory accesses are within bounds, etc. 2a Examples of this are: avoiding unnecessary normalisations, using const references instead of copies, remembering to delete allocated memory, etc. CourseNana.COM

Figure 1: (a) Sphere without any displacement. (b) Sphere with correct displacement and occlusion but no modification to the normal (i.e. sphere’s normal as in a.) (c) Increased displacement via the maxdispl parameter (still without modified normals) shows some occlusion near the highlights. (d) Correct occlusion and plausible normals but incorrect silhouette. (e) Final output, with correct shadow. 2d Evidence of designing your intersection test so that it is efficient or results in images of higher quality. If you do adopt such optimisations/improvements, please list and justify them in your report under the heading ”Optimisation of Intersection Test”. 3d As in CW2, this refers to a scene that you created yourself. This should demonstrate all features. i.e. a sphere with an independent texture and displacement map, with correct occlusion, silhouette and plausible normals. 3e Here you will compare your rendering of the displacement mapped sphere (A) to PBRT’s rendering of the displacement mapped geometry (B). i.e. for B, you will create a sphere model (say in Blender) and apply the same displacement map to it (in Blender) as you have in A. Then, export the displaced sphere’s geometry from Blender as a mesh. In your .pbrt for A, replace your DisplacedSphere shape with the mesh exported from Blender and render. Compare the two rendered images. CourseNana.COM

3 Reference and examples

Displacement mapping involves applying perturbations to the vertices of a mesh based on an input image called a displacement map (like a texture map). Here is a short video explaining the idea at a high level. Vertices are assigned UV coordinates (just as in texture mapping) and their positions are displaced according to the values in the displacement map. For this assignment: 1) displacement will only be applied to a sphere; 2) the displacement map will be grayscale; and c) the displacement will only be applied outwards in the direction of the normal. Displacement mapping is different from bump mapping which only modifies the normal. Since the latter does not alter the positions of the vertices, it does not affect the silhouettes of objects. A few images (Fig. 1) are shown (the input .pbrt is listed below) to give you an example of what to expect at each stage. Please do not be concerned if you are not able to match this pixel-to-pixel. They are meant as guidance. The displacement map used in the example was not imported from a texture map. It was analytically generated using the following formula d(u, v) =γ1 + cos (απu) sin (βπv)) ,2 CourseNana.COM

Figure 2: The sphere on the left has been rendered (source) by modifying the normals at each intersection point using a map. The sphere on the right has been rendered using a displacement map – that is each intersection point was displaced. Although they produce similar effects in shading, there are differences in occlusion (some folds of the sphere block our view of other parts of the sphere) as well as in the silhouettes (modifying the normals leave the boundary of the sphere unaffected). CourseNana.COM

where γ is the maximum displacement parameter specified via maxdispl in the .pbrt file (below). The images shown were rendered using α = 50, β = 25. The radius of the displaced sphere at each point (u, v) is obtained as the sum of its radius and d. CourseNana.COM

1 LookAt 0 -4 0 # eye
2 .5 .5 0 # look at point
3 0 0 1 # up vector
4 Camera " perspective " " float fov " 45
5
6 Film " image " " string filename " " shapeshifter . png "
7 " integer xresolution " [800] " integer yresolution " [800]
8
9 Sampler " halton " " integer pixelsamples " 1
10 Integrator " path " " integer maxdepth " 1
11
12 WorldBegin
13 # uniform illumination from all directions
14 LightSource " infinite " " rgb L" [.26 .26 .2] " integer samples " 10
15
16 # point light source
17 AttributeBegin
18 Translate -1 -2 2
19 LightSource " point " " color I" [10 10 10]
20 AttributeEnd
21
22 AttributeBegin
23 Material " metal "
24 Shape " dsphere " " float radius " 1 " float maxdispl " .1
25 # Although the above was used for examples shown here ,
26 # you are expected to support the following
27 # Shape " dsphere " " float radius " 1 " string displacementmap " " dmap2 . ppm " " float
maxdispl " .1
28 AttributeEnd
29
30 AttributeBegin
31 Texture " checks " " spectrum " " checkerboard "
32 " float uscale " [8] " float vscale " [8]
33 " rgb tex1 " [.1 .1 .1] " rgb tex2 " [.8 .8 .8]
34 Material " matte " " texture Kd" " checks "
35 Translate 0 0 -1
36 Shape " trianglemesh "
37 " integer indices " [0 1 2 0 2 3]
38 " point P" [ -20 -20 0 20 -20 0 20 20 0 -20 20 0 ]
39 " float st" [ 0 0 1 0 1 1 0 1 ]
40 AttributeEnd
41
42 WorldEnd

Listing 1: PBRT Input File example CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
C++代写,Computer Graphics代写,Shape Shifters代写,PBRT代写,UK代写,The University Of Edinburgh代写,C++代编,Computer Graphics代编,Shape Shifters代编,PBRT代编,UK代编,The University Of Edinburgh代编,C++代考,Computer Graphics代考,Shape Shifters代考,PBRT代考,UK代考,The University Of Edinburgh代考,C++help,Computer Graphicshelp,Shape Shiftershelp,PBRThelp,UKhelp,The University Of Edinburghhelp,C++作业代写,Computer Graphics作业代写,Shape Shifters作业代写,PBRT作业代写,UK作业代写,The University Of Edinburgh作业代写,C++编程代写,Computer Graphics编程代写,Shape Shifters编程代写,PBRT编程代写,UK编程代写,The University Of Edinburgh编程代写,C++programming help,Computer Graphicsprogramming help,Shape Shiftersprogramming help,PBRTprogramming help,UKprogramming help,The University Of Edinburghprogramming help,C++assignment help,Computer Graphicsassignment help,Shape Shiftersassignment help,PBRTassignment help,UKassignment help,The University Of Edinburghassignment help,C++solution,Computer Graphicssolution,Shape Shifterssolution,PBRTsolution,UKsolution,The University Of Edinburghsolution,