COS344  Computer Graphics
Announcements
No Current Announcements
Perusal
Posted By : on 8 Jul 2014, 11:37
You may peruse your third examination opportunity scripts on Thursday, 20140710, from 10:00  11:00 in my office.
The rules are as follows:
* No arguing with me  you are only allowed to decide whether or not you want to pay for a remark.
* You may ask for clarification as to how marks were allocated.
* You may not bring anything into the venue.
* No communication with your fellow students.
* One person at a time.
The rules are as follows:
* No arguing with me  you are only allowed to decide whether or not you want to pay for a remark.
* You may ask for clarification as to how marks were allocated.
* You may not bring anything into the venue.
* No communication with your fellow students.
* One person at a time.
Extra Notes on Wang Tiles & Instancing
Posted By : on 13 Jun 2014, 17:38
I've posted an extra set of practical notes that you can use to prepare for Wang Tiles & Instancing.
Tessellation Shaders
Posted By : on 10 Jun 2014, 13:04
Here is an interesting discussion on the (lack of) usefulness of Tesselation Shaders in the real world. It seems that many people avoid using them since they use more processing time than they save, and because they significantly bump the required API version for your program.
Food for thought!
https://twitter.com/Jonathan_Blow/status/476033283780644864
PS: If you're interested in these kinds of discussions, Twitter is a surprisingly good source, specifically: @rygorous, @Jonathan_Blow and @cmuratori.
Food for thought!
https://twitter.com/Jonathan_Blow/status/476033283780644864
PS: If you're interested in these kinds of discussions, Twitter is a surprisingly good source, specifically: @rygorous, @Jonathan_Blow and @cmuratori.
Picking Practical: Memo
Posted By : on 4 Jun 2014, 12:18
I've posted the memo for the picking practical.
EO3: Additional Sources to Be Studied
Posted By : on 4 Jun 2014, 12:14
Hi everyone.
I have added a link to the GPU Gems article entitled "Rendering countless blades of waving grass." It is the source for my lecture on Wang tiles and terrain. It is required that you study this for EO3.
You can find it under "Links."
I have added a link to the GPU Gems article entitled "Rendering countless blades of waving grass." It is the source for my lecture on Wang tiles and terrain. It is required that you study this for EO3.
You can find it under "Links."
EO3 Demarcation
Posted By : on 29 May 2014, 13:44
Your exam is now with the internal moderator for quality control, and will soon be sent to the external moderator to be assessed for fairness. The demarcation for the test will essentially include all the lectures that covered content after EO2. As usual, you should study all the notes, practicals, external sources I gave you, as well as any notes you made during class. Everything we discussed is examinable.
The test will be two hours in length, and will consist of 70 marks. Each topic will have a roughly equal mark distribution.
Here is the provisional demarcation:
* Lighting / Shading Models
* Wang Tiles and Instancing
* Model Loading
* Picking
* Anti Aliasing
* Particle Systems
* Pipeline Performance & Debugging
The test will be two hours in length, and will consist of 70 marks. Each topic will have a roughly equal mark distribution.
Here is the provisional demarcation:
* Lighting / Shading Models
* Wang Tiles and Instancing
* Model Loading
* Picking
* Anti Aliasing
* Particle Systems
* Pipeline Performance & Debugging
Missing Notes / Extra Information
Posted By : on 29 May 2014, 13:37
If there are still notes outstanding, or if you'd like extra information about any of the topics we have covered for EO3, please send me an email with your request.
Consultation Hours During Exam Time
Posted By : on 29 May 2014, 13:36
Since COS344 classes are at an end, I won't be coming in to work /that/ early anymore. For the remainder of the semester, my consultation hours will be by appointment only. Please send me an email if you'd like to come see me.
Exam Entry and Subminima
Posted By : on 29 May 2014, 13:17
Your study guide states that there is a subminimum for the COS 344 examination. This is incorrect.
The course is continuous evaluation and therefore does not have a distinct final exam. That means that if you have 50% or more for the "progress mark" on the mark sheet, then you have passed the course (assuming there are no corrections to be made). You don't even have to write EO3.
I would encourage you to write EO3 anyway. For Honours you need an average of 60%. Even though you might not want to do Honours next year, you might want to in the future.
For the same reason, there is no requirement for entry to the exam. Anyone (enrolled in the course!) may write EO3.
However, if your current mark is < 30% passing is impossible. So please save me the marking time ;) I would say that if your current mark is >= 40% you have a good chance of passing. Lower than that you will have to study very hard.
I will *not* be adjusting final marks, due to departmental policy. That means if you have 49.9% you still fail the course. If you have 74.9% I will not adjust it such that you have a distinction.
Glancing at the marks, I'm looking forward to a good pass rate this semester.
Thank you for all the hard work, and study hard for the exams!
gl hf
The course is continuous evaluation and therefore does not have a distinct final exam. That means that if you have 50% or more for the "progress mark" on the mark sheet, then you have passed the course (assuming there are no corrections to be made). You don't even have to write EO3.
I would encourage you to write EO3 anyway. For Honours you need an average of 60%. Even though you might not want to do Honours next year, you might want to in the future.
For the same reason, there is no requirement for entry to the exam. Anyone (enrolled in the course!) may write EO3.
However, if your current mark is < 30% passing is impossible. So please save me the marking time ;) I would say that if your current mark is >= 40% you have a good chance of passing. Lower than that you will have to study very hard.
I will *not* be adjusting final marks, due to departmental policy. That means if you have 49.9% you still fail the course. If you have 74.9% I will not adjust it such that you have a distinction.
Glancing at the marks, I'm looking forward to a good pass rate this semester.
Thank you for all the hard work, and study hard for the exams!
gl hf
Marks
Posted By : on 29 May 2014, 13:09
The marksheet is now available from COSI team. Please have a look and make sure that the marks are correct. You have until 18 June 2014 to query your marks.
Picking Spec
Posted By : on 26 May 2014, 13:40 (last modified on 29 May 2014, 13:08)
Hi all.
Nico asked me to post the spec for the picking practical. I have done so. Please let me know if you'd like anything else.
Nico asked me to post the spec for the picking practical. I have done so. Please let me know if you'd like anything else.
Assignment 3 Deadline
Posted By : on 3 Mar 2014, 10:05 (last modified on 29 May 2014, 13:08)
The deadline for assignment three is 14:00 the 28th of May, since that's the last practical we have. Unfortunately, all of June and July is exams, so you have a little less time than we thought. To compensate for that, I'll release your assignment three specification earlier so you have more leeway with time management.
Booking Slots for Assignment 3
Posted By : on 27 May 2014, 11:49
Please book a slot for your assignment 3 demo.
I have also posted notes about antialiasing and model loading.
I have also posted notes about antialiasing and model loading.
Wunused, Heartbleed and Valhalla Rampages
Posted By : on 14 May 2014, 15:02
Here's a good motivation for leaving Wunused switched on in your Makefile:
http://opensslrampage.org/post/85680787548/sometimesbadtestscanbemoreharmfulthannotests
http://opensslrampage.org/post/85680787548/sometimesbadtestscanbemoreharmfulthannotests
Practical 9
Posted By : on 13 May 2014, 16:29
Hi guys.
You have until the 21st for this. I didn't realize you haven't done the practical class for it yet.
You have until the 21st for this. I didn't realize you haven't done the practical class for it yet.
Discussion Board
Posted By : on 12 May 2014, 20:54
Hi guys.
Please use the discussion board to get help. Also please frequently check it to see if you can help your fellow students.
This is one of the best ways to learn...
Please use the discussion board to get help. Also please frequently check it to see if you can help your fellow students.
This is one of the best ways to learn...
EO2 Scope and Fragment Shader
Posted By : on 2 May 2014, 13:58
Hey guys, looks like I forgot all about the poor old fragment shader for EO2. Your test has already been moderated, so there's no changing it. So we'll skip it for EO2 and add it to EO3.
Additional Notes
Posted By : on 29 Apr 2014, 15:46
I have posted more notes for the recent classes. They are examinable.
I have also decided to post your shadow mapping practical ahead of time, so you have more information for the test on Monday.
The shape of this semester is really difficult to work with. Anyway, good luck with your preparations, and please let me know if I missed anything, or if you need help!
I have also decided to post your shadow mapping practical ahead of time, so you have more information for the test on Monday.
The shape of this semester is really difficult to work with. Anyway, good luck with your preparations, and please let me know if I missed anything, or if you need help!
Topics for EO2
Posted By : on 28 Apr 2014, 17:18
Hi all.
Here is a list of the topics that will specifically be covered in EO2. Please make sure that you can remember everything else for background information.
* Output merger.
* Textures.
* Environment mapping.
* Bump mapping.
* Shadow mapping.
* Terrain (the stuff we discussed on Friday).
Here is a list of the topics that will specifically be covered in EO2. Please make sure that you can remember everything else for background information.
* Output merger.
* Textures.
* Environment mapping.
* Bump mapping.
* Shadow mapping.
* Terrain (the stuff we discussed on Friday).
Re: question at the end of today's class.
Posted By : on 25 Apr 2014, 09:33
Someone asked if there is a way to quickly render grass using 3D objects instead of imposters that won't kill the GPU. I said no (provisionally) at the time, but I've been thinking about it...
So you have two problems: the first is the transfer of the geometry. There's going to be a *lot* of it. But we can address this using a thing called 'instancing' where we reuse some geometry to generate copies of it around the scene. We can maybe talk about it on Monday.
The second problem is the triangle fill rate. The rasterizer is about O(log n) in the amount of triangles, so you might be able to fit in enough grass before hitting your fill rate limit. Might be an interesting experiment to conduct...
So you have two problems: the first is the transfer of the geometry. There's going to be a *lot* of it. But we can address this using a thing called 'instancing' where we reuse some geometry to generate copies of it around the scene. We can maybe talk about it on Monday.
The second problem is the triangle fill rate. The rasterizer is about O(log n) in the amount of triangles, so you might be able to fit in enough grass before hitting your fill rate limit. Might be an interesting experiment to conduct...
Assignment 2 Memo
Posted By : on 23 Apr 2014, 09:35
Hi all.
I've posted the memo for assignment 2. Please note that it's substandard in my opinion. There are many things I would change if I could, but I just don't have the time. Anyway, it's a good start.
I've posted the memo for assignment 2. Please note that it's substandard in my opinion. There are many things I would change if I could, but I just don't have the time. Anyway, it's a good start.
GL_MAX Blending Function
Posted By : on 8 Apr 2014, 17:00
Hi guys.
Check this out: http://www.andersriggelsen.dk/glblendfunc.php
If you play around with the GL_MAX blending function on that site, you'll see that it creates a kind of ghostly image of the foreground picture over the background picture.
(So we have skellingtons and ghosts. Maybe this week is turning out 2spooky4me.)
In any case, I suspect this might be useful for fog textures, where you want bright colours to shine through; but dull ones should stay in the background. I'll have to play around with that though!
Check this out: http://www.andersriggelsen.dk/glblendfunc.php
If you play around with the GL_MAX blending function on that site, you'll see that it creates a kind of ghostly image of the foreground picture over the background picture.
(So we have skellingtons and ghosts. Maybe this week is turning out 2spooky4me.)
In any case, I suspect this might be useful for fog textures, where you want bright colours to shine through; but dull ones should stay in the background. I'll have to play around with that though!
Skellingtons
Posted By : on 8 Apr 2014, 10:51
As discussed in class, skeletons are scary: https://www.youtube.com/watch?v=K2rwxs1gH9w
Practical This Week
Posted By : on 8 Apr 2014, 10:40
Hi guys.
For the practical this week, please just get the practical part of assignment two marked and start working on assignment three. We'll return to our regularly scheduled programming next week.
For the practical this week, please just get the practical part of assignment two marked and start working on assignment three. We'll return to our regularly scheduled programming next week.
Practical 6  Memo
Posted By : on 28 Mar 2014, 11:28 (last modified on 30 Mar 2014, 12:53)
Hi all.
I've uploaded a memo for practical six (the one about shading). I've added some stuff to it: press 'v' to reduce the shininess and press 'b' to increase it. You can change the camera location and the location of the light source in Main.h to see how these variables affect the shading. There's lots of comments in the shaders that explain exactly what's going on. Go take a look!
PS: let me know how the assignment is going, whether you need extension etc.
I've uploaded a memo for practical six (the one about shading). I've added some stuff to it: press 'v' to reduce the shininess and press 'b' to increase it. You can change the camera location and the location of the light source in Main.h to see how these variables affect the shading. There's lots of comments in the shaders that explain exactly what's going on. Go take a look!
PS: let me know how the assignment is going, whether you need extension etc.
Assignment 2  Extension
Posted By : on 30 Mar 2014, 00:45 (last modified on 30 Mar 2014, 12:52)
Hi all.
I've decided to give you extension till the first Wednesday after the recess. That's so you can have enough time to fix everything and also have time to test in the labs. That doesn't mean you shouldn't start on assignment three though!
I've decided to give you extension till the first Wednesday after the recess. That's so you can have enough time to fix everything and also have time to test in the labs. That doesn't mean you shouldn't start on assignment three though!
Generating sphere geometry without a tesselation shader.
Posted By : on 30 Mar 2014, 12:52 (last modified on 30 Mar 2014, 12:52)
In case you need it:
https://gist.github.com/fluffels/9870944#filespherec
https://gist.github.com/fluffels/9870944#filespherec
Today's Practical
Posted By : on 26 Mar 2014, 10:26
Hi all.
In today's practical session, Nico will assist you with your second assignment. So there will be no practical due for next week.
In today's practical session, Nico will assist you with your second assignment. So there will be no practical due for next week.
Practical 6  Small Addendum
Posted By : on 25 Mar 2014, 13:06
Be sure you make the sphere in this practical a solid and *not* a wire frame. Otherwise Nico won't be able to see your shading.
It should look like the demo I showed you in class.
It should look like the demo I showed you in class.
Practical 6  Spec
Posted By : on 19 Mar 2014, 15:02 (last modified on 25 Mar 2014, 12:52)
Hi everyone.
Your spec for practical 6 is simply to apply the Phong light model to the sphere from the previous prac. You may use a flat shading model.
Put the light source at (5, 5, 5).
Nico will give you a mark out of 4 according to the quality of your solution.
Your spec for practical 6 is simply to apply the Phong light model to the sphere from the previous prac. You may use a flat shading model.
Put the light source at (5, 5, 5).
Nico will give you a mark out of 4 according to the quality of your solution.
Reminder
Posted By : on 16 Mar 2014, 18:51
Tomorrow follows a Friday roster to make up for the fact that Friday is a vacation day. Therefore, tomorrow's class will be at 7:30 in IT 43 like we normally have on Fridays.
Memory Safety
Posted By : on 15 Mar 2014, 16:46
Here's a quick and dirty way to check if you're leaking any OpenGL objects at the end of your program after they should all have been freed:
https://gist.github./rygorous/9559632
https://gist.github./rygorous/9559632
The bleeding edge...
Posted By : on 13 Mar 2014, 07:26 (last modified on 13 Mar 2014, 07:29)
Valve's open source OpenGL debugger has been released [1] on GitHub [2]. It doesn't support OpenGL 4.x yet, so it might not be very useful for you, but it's definitely something to go star and maybe even watch.
PS: It's super alpha at the moment. The README says it's alpha^2. If we assume that 0 <= alpha < 1 then that means it is more alpha than a normal alpha. Pain will ensue. Use at your own risk, make sure you have backups [3], make sure you can reconfigure your system / graphics card(s) /when/ things go awry, etc. If you've used Steam or play DOTA 2, you'll know how buggy Valve's software can be.
[1] http://richg42.blogspot.com/2014/03/voglgldebuggersourceisongithub.html
[2] https://github.com/ValveSoftware/vogl
[3] Why isn't everything in a cloudbased Git repo yet?
PS: It's super alpha at the moment. The README says it's alpha^2. If we assume that 0 <= alpha < 1 then that means it is more alpha than a normal alpha. Pain will ensue. Use at your own risk, make sure you have backups [3], make sure you can reconfigure your system / graphics card(s) /when/ things go awry, etc. If you've used Steam or play DOTA 2, you'll know how buggy Valve's software can be.
[1] http://richg42.blogspot.com/2014/03/voglgldebuggersourceisongithub.html
[2] https://github.com/ValveSoftware/vogl
[3] Why isn't everything in a cloudbased Git repo yet?
Practical 04 (Vertex Shader)  Updates
Posted By : on 12 Mar 2014, 11:23
Hi all.
I have updated the practical spec for the fourth practical to a new version. This new version specifies how to get the colour cube to rotate about its center, and is more explicit about the order of operations.
This basically incorporates our discussions about this topic over the last couple of days.
I have also updated the memo to reflect this update.
Have a look at section 4.8.5 to see what I've changed.
I have updated the practical spec for the fourth practical to a new version. This new version specifies how to get the colour cube to rotate about its center, and is more explicit about the order of operations.
This basically incorporates our discussions about this topic over the last couple of days.
I have also updated the memo to reflect this update.
Have a look at section 4.8.5 to see what I've changed.
Interesting page on 2D shadows and line of sight.
Posted By : on 12 Mar 2014, 09:12
@codinghorror  This is how I think textbooks should always have worked: http://ncase.github.io/sightandlight/
Take a look, if I had the time this is what your course material would look like.
The author of the page cited above is essentially ray tracing the scene, but in two dimensions which isn't as expensive as the 3D version.
We'll be looking at 3D shadows (and by extension line of sight) later in the course.
However, The algorithm we'll be using is different. We'll be using a projection matrix to project the shadows cast by an object on the objects behind it.
Therefore reading this page is not in any way important for the course, but it's really really cool.
Take a look, if I had the time this is what your course material would look like.
The author of the page cited above is essentially ray tracing the scene, but in two dimensions which isn't as expensive as the 3D version.
We'll be looking at 3D shadows (and by extension line of sight) later in the course.
However, The algorithm we'll be using is different. We'll be using a projection matrix to project the shadows cast by an object on the objects behind it.
Therefore reading this page is not in any way important for the course, but it's really really cool.
Interesting question about inverting the modelview transformation.
Posted By : on 11 Mar 2014, 14:29
Hi all.
I received the question below from an anonymous student today:
"Say we have a vector V in world space with its matrix representation and we do the following...
Move to Camera space(view space)
How would we go about going back two steps to the model space?"
Here is my answer:
"Let's say your point is p, your world matrix is W and your view matrix is V.
You get to view space using p' = VWp.
The inverse of this is p' multiplied by some matrix M that is the inverse of the above: p = Mp'
The question is what is M?
p = Mp'
p = MVWp
Due to the order of operations, M must be W'P', since that works out to:
p = W'V'VWp
Which has order
p = (W'(V'(V(Wp)))
...which will apply the inverses in the correct order.
Intuitively we can also see that since V gets us from world space to view space, if we apply V' we get from view space back to world space. If we then apply W' then we get back from world space to model space.
So, tl;dr: you apply the inverse of the matrices in inverse order."
The question is prescient. We will be using the same kind of transformation when we get to the lecture on "shadow mapping." It is therefore important to understand this.
I received the question below from an anonymous student today:
"Say we have a vector V in world space with its matrix representation and we do the following...
Move to Camera space(view space)
How would we go about going back two steps to the model space?"
Here is my answer:
"Let's say your point is p, your world matrix is W and your view matrix is V.
You get to view space using p' = VWp.
The inverse of this is p' multiplied by some matrix M that is the inverse of the above: p = Mp'
The question is what is M?
p = Mp'
p = MVWp
Due to the order of operations, M must be W'P', since that works out to:
p = W'V'VWp
Which has order
p = (W'(V'(V(Wp)))
...which will apply the inverses in the correct order.
Intuitively we can also see that since V gets us from world space to view space, if we apply V' we get from view space back to world space. If we then apply W' then we get back from world space to model space.
So, tl;dr: you apply the inverse of the matrices in inverse order."
The question is prescient. We will be using the same kind of transformation when we get to the lecture on "shadow mapping." It is therefore important to understand this.
Order of rotations and translations  a clarification.
Posted By : on 11 Mar 2014, 14:21 (last modified on 11 Mar 2014, 14:22)
Hi guys, just a clarification before the test.
Someone asked me in class about the order of rotations and such. Section 4.8.5 of practical 4 *is* correct, however there is a subtle caveat that you should note.
If we want to rotate the object about its own axis and /then/ translate it somewhere else, then we need to multiply by the rotation matrix first and then by the translation matrix.
What I mean by 'first' is that we need to multiply the *point* by the rotation matrix first.
I.e., we want this: p' = TRp; not this: p' = RTp.
This means that when we're multiplying out our matrices in the C++ code, we need to multiply by R *last*. The reason for this is that we're putting TR together in the world matrix W, like so:
p' = TRp
Let W := TR
p' = Wp
So when constructing W, we need to postmultiply T by R.
Convince yourself of this using some sample matrices, scrap paper and a pen / pencil.
I have posted an example variation on practical 4 that shows how this works.
(Note that I also changed the cube's coordinates to be centered around the origin to make the effect clearer.)
Someone asked me in class about the order of rotations and such. Section 4.8.5 of practical 4 *is* correct, however there is a subtle caveat that you should note.
If we want to rotate the object about its own axis and /then/ translate it somewhere else, then we need to multiply by the rotation matrix first and then by the translation matrix.
What I mean by 'first' is that we need to multiply the *point* by the rotation matrix first.
I.e., we want this: p' = TRp; not this: p' = RTp.
This means that when we're multiplying out our matrices in the C++ code, we need to multiply by R *last*. The reason for this is that we're putting TR together in the world matrix W, like so:
p' = TRp
Let W := TR
p' = Wp
So when constructing W, we need to postmultiply T by R.
Convince yourself of this using some sample matrices, scrap paper and a pen / pencil.
I have posted an example variation on practical 4 that shows how this works.
(Note that I also changed the cube's coordinates to be centered around the origin to make the effect clearer.)
Practical 04  Marks
Posted By : on 7 Mar 2014, 09:54
Hi all.
Nico said that he marked some of you down for moving the cube along the Z axis instead of towards the viewer, or vice versa.
I've told him that both are acceptable, so he adjusted the marks.
Nico said that he marked some of you down for moving the cube along the Z axis instead of towards the viewer, or vice versa.
I've told him that both are acceptable, so he adjusted the marks.
Assignment 03  Specification
Posted By : on 3 Mar 2014, 14:36
I have posted the specification for assignment three. You can begin to plan for it by identifying parts of the practicals you have already completed and starting to integrate them in a way that will be useful for the project. Keep in mind that assignment two is intended to prepare you for the project, so don't start fullscale implementation until you have a solid framework in terms of its specification.
At some point during the semester, I will devote a lecture to all the points in the project specification. I will briefly explain how to implement it.
Last but not least, I am required to test whether this is your own work. So the specification I posted will only be a part of the mark you receive for the assignment, another part will be some sort of formal test on the assignment.
At some point during the semester, I will devote a lecture to all the points in the project specification. I will briefly explain how to implement it.
Last but not least, I am required to test whether this is your own work. So the specification I posted will only be a part of the mark you receive for the assignment, another part will be some sort of formal test on the assignment.
Assignment 2  Specification
Posted By : on 3 Mar 2014, 14:23
I have posted the specification for assignment two. However, it is not marked as visible yet. The reason for this is that it builds on top of practical six, which we will only get to next week. Therefore, your assignment two specification will be released next week Wednesday at 17:30.
Assignment 1  Specification
Posted By : on 3 Mar 2014, 11:23
The specification for your first assignment has been released.
Assignment 1 & 2  Deadlines
Posted By : on 3 Mar 2014, 10:22 (last modified on 3 Mar 2014, 10:22)
I've set the deadlines for assignment one and two for Sunday the 16th and Sunday the 30th, respectively. This is so you can work a bit over the weekends, to ease your time management. The deadlines are at 17:00 so that you don't have any excuses not to come to class.
Examination Opportunity 02
Posted By : on 3 Mar 2014, 09:53
Here is the logistic information for your second examination opportunity:
Date: 5th of May
Time: 17:30  19:30
Venue: HSB 314
Date: 5th of May
Time: 17:30  19:30
Venue: HSB 314
Examination Opportunity 01
Posted By : on 3 Mar 2014, 09:44
Here is the logistic information for your first examination opportunity:
Date: 12th of March
Time: 17:30  19:30
Venue: HSB 314
Date: 12th of March
Time: 17:30  19:30
Venue: HSB 314
glm version
Posted By : on 26 Feb 2014, 13:04
I've uploaded glm version 0.9.3.2, which is the version that I have on my laptop. You should probably use the same one. There is a newer one on SourceForge for the adventurous.
Practical 04
Posted By : on 26 Feb 2014, 12:53 (last modified on 26 Feb 2014, 13:02)
Hi all.
Since the labs are unbearable, I've decided your practical will be take home. The deadline is next week Wednesday (the 5th) at noon. You still need to come in and have your last practical marked. Nico will be in the labs to help you.
Since the labs are unbearable, I've decided your practical will be take home. The deadline is next week Wednesday (the 5th) at noon. You still need to come in and have your last practical marked. Nico will be in the labs to help you.
Practical 3  Upload Slot
Posted By : on 21 Feb 2014, 11:40
For the people who are emailing projects to myself and / or Nico. I've reopened the upload slot for practical three, due to the extension I granted you. Please upload there as well.
It's not like I was going to leave it closed though, and then tell you that I'm not going to accept your submission because it's `late.'
However, I like the paranoia you're applying to the situation. Paranoia keeps you out of trouble ;)
It's not like I was going to leave it closed though, and then tell you that I'm not going to accept your submission because it's `late.'
However, I like the paranoia you're applying to the situation. Paranoia keeps you out of trouble ;)
Practical 3 Spec  Version 2
Posted By : on 21 Feb 2014, 11:34
I have posted version two of the spec for practical three.
GCC 4.8.2
Posted By : on 21 Feb 2014, 11:29 (last modified on 21 Feb 2014, 11:32)
Hi again.
GCC 4.8.2 actually didn't take too long to compile, which is great, so here's my findings:
Main.C:142:46: error: conversion to ‘GLsizeiptr {aka long int}’ from
‘long unsigned int’ may change the sign of the result
[Werror=signconversion]
glBufferData(GL_ARRAY_BUFFER, (ARRAY_SIZE * sizeof(GLfloat)),
I'm getting the same error now, so the erratum in the practical spec is due to changes made between GCC 4.7.2 and GCC 4.8.2 [1].
The error does make sense, since we're converting from a `long unsigned' to a `long int'. Since unsigned types can store larger positive numbers than their signed counterparts it is possible that during this conversion we are introducing an overflow, which is why GCC is complaining. However, we know that we'll be fine, since the number is just the array size (which we know is 15) multiplied by 4 (probably, on most systems, etc.) Since 60 is never going to overflow a long int we tell GCC that we know what we're doing and to shut up please, so we just make the cast explicit by prepending `(GLsizeiptr).'
So the line should look like this: `(GLsizeiptr)(ARRAY_SIZE * sizeof(GLfloat)).' Note that the number is in brackets. This is to ensure the correct order of operations, since casts enjoy a very high priority  they are applied before multiplication [2].
There is a similar problem for glAttribPointer, but that needs to be cast to a `GLsizei,' not `GLsizeiptr.' I'll post the updated spec now with details [3].
I'm now on the same version of GCC as the lab PCs. So I *should* pick up future issues like this. You guys should probably make sure that your home PCs and / or laptops [4] are on the same version of the compiler just so we can avoid (a) confusion; and (b) embarrassing project demo issues.
[1] I can't find any documentation for this change :(
[2] http://en.cppreference.com/w/cpp/language/operator_precedence
[3] If you got confused at any point during the practical or after, I recommend starting from scratch and completing the practical in a calm setting. Maybe next to a reflecting pool.
[4] Since you're computer science students, I'm assuming a minimum of three computers per person, and a median of five.
GCC 4.8.2 actually didn't take too long to compile, which is great, so here's my findings:
Main.C:142:46: error: conversion to ‘GLsizeiptr {aka long int}’ from
‘long unsigned int’ may change the sign of the result
[Werror=signconversion]
glBufferData(GL_ARRAY_BUFFER, (ARRAY_SIZE * sizeof(GLfloat)),
I'm getting the same error now, so the erratum in the practical spec is due to changes made between GCC 4.7.2 and GCC 4.8.2 [1].
The error does make sense, since we're converting from a `long unsigned' to a `long int'. Since unsigned types can store larger positive numbers than their signed counterparts it is possible that during this conversion we are introducing an overflow, which is why GCC is complaining. However, we know that we'll be fine, since the number is just the array size (which we know is 15) multiplied by 4 (probably, on most systems, etc.) Since 60 is never going to overflow a long int we tell GCC that we know what we're doing and to shut up please, so we just make the cast explicit by prepending `(GLsizeiptr).'
So the line should look like this: `(GLsizeiptr)(ARRAY_SIZE * sizeof(GLfloat)).' Note that the number is in brackets. This is to ensure the correct order of operations, since casts enjoy a very high priority  they are applied before multiplication [2].
There is a similar problem for glAttribPointer, but that needs to be cast to a `GLsizei,' not `GLsizeiptr.' I'll post the updated spec now with details [3].
I'm now on the same version of GCC as the lab PCs. So I *should* pick up future issues like this. You guys should probably make sure that your home PCs and / or laptops [4] are on the same version of the compiler just so we can avoid (a) confusion; and (b) embarrassing project demo issues.
[1] I can't find any documentation for this change :(
[2] http://en.cppreference.com/w/cpp/language/operator_precedence
[3] If you got confused at any point during the practical or after, I recommend starting from scratch and completing the practical in a calm setting. Maybe next to a reflecting pool.
[4] Since you're computer science students, I'm assuming a minimum of three computers per person, and a median of five.
Extra Stuff About Drivers / Course Content etc.
Posted By : on 21 Feb 2014, 10:44
I posted a long reply to Mr. Pretorius's recent thread [1]. I provide some hints on fixing drivers, talk about which OpenGL versions you'll need and talk about what we'll be doing later on in the course.
You should read it.
[1] http://www.cs.up.ac.za/discussions/topic/COS344/1265
You should read it.
[1] http://www.cs.up.ac.za/discussions/topic/COS344/1265
Practical 3 Spec Errata So Far
Posted By : on 21 Feb 2014, 10:14
Hi guys. The new version is on its way. I just want to check some of the things against GCC 4.8.2 and make sure that it is indeed the problem before I post it. This means that GCC has to compile GCC which will take a while. I'm going to try and post it today.
Errata so far: when checking the return value of glAttribLocation, 1 means an error, *not* 0. Again, 0 is a valid attribute location, 1 indicates an error. This shouldn't be a problem for this practical though.
Casts *may* be necessary in glBufferData and glAttribPointer to GLsizeiptr and GLsizei respectively, will confirm.
Remember to use glUseProgram()! I stated that you had to set the program as the current one, but didn't give you code.
When nullterminating a string, use '\0' rather than NULL. NULL is not typesafe.
If you are running into trouble with the OpenGL version, try to remove the block that starts with the line 'if (!GLEW_VERSION_X)', it is definitely misbehaving. GLEW_VERSION_4_2 /should/ work for newer versions as well, but it seems that on some PCs it's not. In this case you need to manually check your GL version using 'glxinfo'. You need at least OpenGL 3.0 for these practicals, and OpenGL 4.1 for the tesselation shader practical.
Please email me if I forgot something.
Errata so far: when checking the return value of glAttribLocation, 1 means an error, *not* 0. Again, 0 is a valid attribute location, 1 indicates an error. This shouldn't be a problem for this practical though.
Casts *may* be necessary in glBufferData and glAttribPointer to GLsizeiptr and GLsizei respectively, will confirm.
Remember to use glUseProgram()! I stated that you had to set the program as the current one, but didn't give you code.
When nullterminating a string, use '\0' rather than NULL. NULL is not typesafe.
If you are running into trouble with the OpenGL version, try to remove the block that starts with the line 'if (!GLEW_VERSION_X)', it is definitely misbehaving. GLEW_VERSION_4_2 /should/ work for newer versions as well, but it seems that on some PCs it's not. In this case you need to manually check your GL version using 'glxinfo'. You need at least OpenGL 3.0 for these practicals, and OpenGL 4.1 for the tesselation shader practical.
Please email me if I forgot something.
Practical 2
Posted By : on 11 Feb 2014, 17:02
Hi all.
Since practical 2 is about events it does not depend on the lecture about the input assembly stage.
Therefore, there *will* be a practical tomorrow.
Since practical 2 is about events it does not depend on the lecture about the input assembly stage.
Therefore, there *will* be a practical tomorrow.
Practical 1
Posted By : on 5 Feb 2014, 12:21
Don't forget about your first practical today at 14:30 in the Red lab of the Informatorium. The spec will autorelease at that time, along with the upload slot (magic!)
In order to get marks you must:
1. Upload before the deadline at 17:30.
2. Sprinkle salt in a circle around your keyboard.
3. Show your (working) program to Nico so he can mark it before or right after the deadline.
I will pop in to make sure everything is running smoothly.
Hide Announcement History
In order to get marks you must:
1. Upload before the deadline at 17:30.
2. Sprinkle salt in a circle around your keyboard.
3. Show your (working) program to Nico so he can mark it before or right after the deadline.
I will pop in to make sure everything is running smoothly.
Module Content
study_guide.pdf
(221KB) 
glm0.9.3.2.zip
(6301KB) 
Active Discussions

Last Updated: 14 June 2014, 20:44

Last Updated: 13 June 2014, 17:40

Last Updated: 27 May 2014, 16:22

Last Updated: 23 May 2014, 10:07

Last Updated: 15 May 2014, 22:59
View All Topics
Module Links
Randomness, blue noise, problem solving strategies, foliage cover, etc.
To be studied for EO3.
Login
Module Description
The aim of this module is to acquire a sound knowledge of the basic theory of interactive
computer graphics and basic computer graphics programming techniques. The theory will cover graphics...
The aim of this module is to acquire a sound knowledge of the basic theory of interactive
computer graphics and basic computer graphics programming techniques. The theory will cover graphics systems and models, graphics programming, input and interaction, geometric objects and transformations, viewing in 3D, shading and rendering techniques. The module includes a practical component that enables students to apply and test their knowledge in computer graphics.
Lecturer Information
Class Representatives
English Representatives
There are no English class representatives.
Afrikaans Representatives
There are no Afrikaans class representatives.
Active Assignments
No currently active assignments
Active Bookings
Active Polls
There are no polls available.