首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代做program程序、代写c/c++,Python编程
项目预算:
开发周期:
发布时间:
要求地区:
2023/2024, 4th period
Practical 2: Rasterization
Author: Peter Vangorp, based on a previous version by Jacco Bikker
The assignment:
The purpose of this assignment is to create a small OpenGL-based 3D engine, starting with the
provided template. The renderer should be able to visualize a scene graph, with (potentially) a
unique texture and shader per scene graph node. The shaders should at least support the full
Phong illumination model. For a full list of required functionality, see section “Minimum
Requirements”.
As with the first assignment, the following rules for submission apply:
▪ Your code has to compile and run on other machines than just your own. If this
requirement isn’t met, we may not be able to grade your work, in which case
your grade will default to 0. Common reasons for this to fail are hardcoded
paths to files on your machine.
▪ Please clean your solution before submitting (i.e. remove all the compiled
files and intermediate output). This can easily be achieved by running
clean.bat (included with the template). After this you can zip the solution
directories and submit them on Blackboard. If your zip-file is multiple
megabytes in size you’ve included large assets or something went wrong (not
cleaned properly).
▪ We want to see a consistent and readable coding style: formatting;
descriptive names for variables, methods, and classes; and comments. Most
code editors have tools to help with formatting and indentation, and with
renaming things (“refactoring”) if necessary.
“Programs are meant to be read by humans
and only incidentally for computers to execute.”
– Structure and Interpretation of Computer Programs
Grading:
If you implement the minimum requirements, and stick to the above rules, you score a 6.
We deduct points for: a missing readme.txt file, a solution that was not cleaned, a solution
that does not compile, a solution that crashes, inconsistent coding style, insufficient
comments to explain the code, or incorrectly implemented features.
Implement additional features to earn additional points (up to a 10).
Deliverables:
A ZIP-file containing:
1. The contents of your (cleaned) solution directory
2. The readme.txt file
The contents of the solution directory should contain:
(a) Your solution file (.sln)
(b) All your source code
(c) All your project and content files (including shaders, models, and textures).
The readme file should contain:
(a) The names and student IDs of your team members.
[1–3 students – the team does not have to be the same as for P1]
(b) A statement about what minimum requirements and bonus assignments
you have implemented (if any) and information that is needed to grade
them, including detailed information on your implementation.
[We will not search for features in your code. If we can’t find and understand
them easily, they may not be graded, so make sure your description and/or
comments are clear.]
(c) A list of materials you used to implement the 3D engine. If you borrowed
code or ideas from websites or books, make sure you provide a full and
accurate overview of this.
Considering the large number of OpenGL rasterizers available on the internet,
we will carefully check for original work.
Put the solution directories and the readme.txt file directly in the root of the zip file.
Teamwork: If you use the Git version control system for teamwork, for example on GitHub or
GitLab, be aware that by default it doesn’t put .obj files in the repository because it assumes
.obj files are intermediate outputs generated by the compiler. But the template uses the .obj
file format for meshes in the assets folder. Edit your .gitignore file if you want to put those
assets in the repository.
Mode of submission:
• Upload your zip file before the deadline via Blackboard. The Blackboard
software allows you to upload without submitting: please do not forget to hit
‘submit’ once you are sure we should see the final result. Please do not forget
the final submit!
• Re-download your submission from Blackboard, unzip it into a different folder,
and check that it runs and looks like the version you intended to submit. This
catches most mistakes like missing files or submitting the wrong version. You
can correct these mistakes and re-submit until the deadline.
Note that we only grade the last submitted version of your assignment.
Deadline:
Friday, June 28, 2024, 17:00h
This is a hard deadline. If you miss this deadline, your work will not be graded.
Time management: Don’t postpone working on this assignment. It only increases the pressure
and stress, and you may run out of time.
Fraud & plagiarism:
▪ Never look at other students’ code. Don’t discuss implementation in detail. Reference
every source in your readme.txt and/or in code comments.
▪ We use automated content similarity detection tools to compare all submissions of this
year and previous years, and online sources. All suspected cases of fraud or plagiarism
must be reported to the Board of Examiners.
High-level Outline
For this assignment you will implement a basic OpenGL-based 3D engine. The 3D engine is a
tool to visualize a scene graph: a hierarchy of meshes, each of which can have a unique local
transform. Each mesh will have a texture and a shader. The input for the shader includes a set
of light sources. The shading model implemented in the fragment shader determines the
response of the materials to these lights.
The main concepts you will apply in this assignment are matrix transforms and shading models.
Matrix transforms: objects are defined in local space (also known as object space). An object
can have an orientation and position relative to its parent in the scene graph. This way, the
wheel of a car can spin, while it moves with the car. In the real world, many moving objects
move relative to other objects, which may also move relative to some other object. In a 3D
engine, we have an extra complication: after we transform our vertices to world space, we need
to transform them to camera space, and then to screen space for final display. A correct
implementation and full understanding of this pipeline is an important aspect of both theory
and practice in the second half of the course.
Shading: using interpolated normals and a set of point lights we can get fairly realistic materials
by applying the Phong lighting model. This model combines ambient lighting, diffuse reflection
and glossy reflection. Optionally, this can be combined with texturing and normal mapping for
detailed surfaces. A good understanding of concepts from ray tracing will also be useful here.
The remainder of this document describes the C# template, the minimum requirements for the
assignment and bonus challenges.
Finally, you may work on post processing. In the screenshot at the top of the page you see the
effect of a dummy post processing shader, which you can find in shaders/fs_post.glsl. Its main
functionality is the following line:
outputColor *= sin( dist * 50 ) * 0.25f + 0.75f;
Disable this line to get rid of the ripples. Replace it by something more interesting to get extra
points: see the last page of this document for details.
You’re not expected to re-implement any features that are already provided by OpenTK, GLSL,
or the template. Such features include basic vector and matrix math, and loading texture images
and meshes.
Template
For this assignment, a fresh template has been prepared for you.
When you start the template, you will notice that quite some work has been done for you:
▪ Two 3D models are loaded. The models are stored in the text-based OBJ file format,
which stores vertex positions, vertex normals and texture coordinates.
▪ A mesh class is provided that stores this data for individual meshes.
▪ A texture and shader class is also provided.
▪ Dummy shaders are provided that use all data: the texture, vertex normals, and vertex
coordinates.
In short, the whole data pipeline is in place, and you can focus on the functionality for this
assignment. Let’s have a closer look at the provided functionality:
class Texture: this class loads common image file formats (.png, .jpg, .bmp etc.) and converts
them to an OpenGL texture. Like all resources in OpenGL, a texture simply gets an integer
identifier, which is stored in the public member variable ‘id’.
class Shader: this class encapsulates the shader loading and compilation functionality. It is
programmed to work with the included shaders: e.g., it expects certain variables to exist in the
shader, such as per-vertex data (position, normal, texture coordinates), and “uniform”
transformation matrices. You may need to add more variables in the shaders and
correspondingly in this class.
class Mesh: this class contains the functionality to render a mesh. This includes Vertex Buffer
Object (VBO) creation and all the function calls needed to feed this data to the GPU. The render
method takes a shader, transformation matrices, and a texture, which is all you need to draw
the mesh. Note that this means that each mesh can use only a single texture.
class MeshLoader: this is a helper class that loads meshes from OBJ files. It is slow and only
supports a subset of the OBJ file format. The meshes included in the template are small and
only use supported features. Feel free to replace this loader with something better if necessary.
class MyApplication: you will find some ready-made functionality here. To demonstrate how to
use the other classes, a texture, a shader and two meshes are loaded and displayed with a
dummy transform. This definitely needs some work (just like the dummy shaders).
The template will produce informative OpenGL error messages to help with debugging.
Parts of the template are implemented in two functionally equivalent versions. You can
choose which version should be used by setting the constant
OpenTKApp.allowPrehistoricOpenGL:
- true: Use deprecated code that is usually shorter and easier to understand but that is
not supported anymore on Apple devices and should only be used in legacy
codebases. If you choose this version, also your code may use deprecated code
(“Compatibility profile”).
- false: Use Modern OpenGL code that is usually longer and more difficult to
understand but that is supported everywhere and should be used in new codebases. If
you choose this version, also your code must use Modern OpenGL (“Core profile”).
Your Task
You should first familiarize yourself with all the provided functionality and code.
You then have two main tasks for this assignment:
1. Implement a scene graph;
2. Implement a proper shader;
Demonstrate all the functionality you add with a demo scene and screenshots.
Scene graph: currently, the application renders two objects, but this is entirely hardcoded. Your
task is to add a new class SceneGraph, which stores a hierarchy of meshes. The mesh class needs
to be expanded a bit as well; each mesh should have a local transform. The SceneGraph class
should implement a Render method, which takes a camera matrix as input. This method then
renders all meshes in the hierarchy. To determine the final transform for each mesh, matrix
concatenation should be used to combine all matrices, starting with the camera matrix, all the
way down to each individual mesh.
Task list for the scene graph:
1. Add a model matrix to the Mesh class.
2. Add the Scene Graph: a data structure for storing a tree-structured hierarchy of meshes,
where the position of each mesh in the scene will also be affected by the model matrices
of all its ancestors.
3. Add a Render method for the Scene Graph that recursively processes the nodes in the
tree, while combining matrices so that each mesh is drawn using the correct combined
matrix.
4. Call the Render method of the Scene Graph from the Game class, using a camera matrix
that is updated based on user input.
Shader: the dummy shaders combine the texture with the normal. As you may have noticed,
the normal is directly converted to an RGB color (a useful debug visualization to inspect the 3
component values of the normal vector, but of course this is not a realistic material). Your task
is to replace this dummy shader with a full implementation of the Phong lighting model. This
means that you need to combine an ambient color with the summed contribution of one or
more light sources.
Task list for the shader:
1. Add a uniform variable to the fragment shader to pass the ambient light color.
2. Add a Light class. Perhaps it would be nice if lights could also be in the scene graph.
3. Either add a hardcoded static light source to the shader, or (for extra points) add uniform
variables to the fragment shader to pass light positions and colors. Don’t over-engineer
this; if your shader can handle 4 lights using four sets of uniform variables, you meet the
requirements to obtain the bonus points.
4. Implement the Phong lighting model.
Demonstration: once the basic 3D engine is complete, it is time to showcase its capabilities.
Build a small demo that shows the scene graph and shader functionality.
Minimum Requirements
To pass this assignment, we need to see:
Camera:
▪ The camera must be interactive with keyboard and/or mouse control. It must at least
support translation and rotation.
Scene graph:
▪ Your demo must show a hierarchy of objects. The scene graph must be able to hold any
number of meshes, and may not put any restrictions on the maximum depth of the
scene graph.
Shaders:
▪ You must provide at least one correct shader that implements the Phong shading model.
This includes ambient light, diffuse reflection and glossy reflection of the point lights in
the scene. To pass, you may use a single hardcoded light.
Demonstration scene:
▪ All engine functionality you implement must be visible in the demo. A high quality demo
will increase your grade.
Documentation:
▪ Describe which features you implemented. Describe the controls for your demo.
Bonus Assignments
Meeting the minimum requirements earns you a 6 (assuming practical details are all in order).
An additional four points can be earned by implementing bonus features. An incomplete list
of options, with an indication of the difficulty level:
▪ [EASY] Multiple lights (at least 4), which can be modified at run-time (0.5 pt)
▪ [EASY] Spotlights (0.5 pt)
▪ [EASY] Environment mapping to show a cube map or sphere map texture
in the background and/or in mirror reflections (0.5 pt)
NOTE: this must be implemented without a mesh
▪ [MEDIUM] Frustum culling to the scene graph render method (1 pt)
▪ [MEDIUM] Normal mapping (1 pt)
▪ [HARD] Shadows using shadow mapping (1.5 pt)
Additional challenges related to post processing:
▪ [EASY] Vignetting and chromatic aberration (0.5 pt)
▪ [MEDIUM] Generic color grading using a color look-up table (1 pt)
▪ [MEDIUM] A separable blur filter with variable kernel width (1 pt)
▪ [MEDIUM] HDR glow (requires blur filter and HDR render target) (1pt)
▪ [HARD] Depth of field (requires blur filter) (1.5 pt)
▪ [HARD] Ambient occlusion (1.5 pt)
Important: many of these features require that you investigate these yourself, i.e., they are
not necessarily covered in the lectures or in the book. You may of course discuss these on
Teams to get some help.
Obviously, there are many other things that could be implemented in a 3D engine. Make sure
you clearly describe functionality in your report, and if you want to be sure, consult the
lecturer for reward details.
And Finally…
Don’t forget to have fun; make something beautiful!
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
代做ece5550: applied kalman ...
2024-12-24
代做cp1402 assignment - netw...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!