Laborations

Important: Every lab 1-4 starts with a “dugga”, a short written test which takes about 15 minutes. This test is part of the grading system in order to make a larger part of the course material relevant for the grades. The alternative would be a full-scale exam but this is IMHO better in many ways. The fifth lab, lab 5, has an “omdugga” opportunity where you can try all the tests (with different but similar questions) again, giving you a second chance. There is no “fail” limit on the duggas, they are part of the total score and will be added to the score for the project.

The tests with cover both subjects relevant to the lab and other subjects covered in the recent lectures. I am aware that you will deepen your understanding on some parts during the lab, but you are expected to have gained some knowledge about that before the lab.

Concering the second chance: You can not lower the result. A failed second chance will not ruin a better earlier result.

1. Generating procedural images on CPU and in GLSL

2. Using Open Shading Language in Blender or 3DSMAX

3. Fractals, terrains

4. Generating and modifying 3D shapes using geometry and tesselation shades

R1, R2: Two extra lab sessions if you havn’t finished.

The lab material for most labs is originally designed for Linux but also runs under MacOSX and Windows. I started out using Embarcadero Dev/C++ version 6.3, but now switch to Codeblocks since it was already installed in the lab (see below). Any other platform using MinGW may work. For lab 2, we will either use Blender, which is available for all three platforms, or 3DSMAX, which only works on Windows.


Using Codeblocks

Codeblocks is installed in the lab. Gabriel, my lab assistant, had the great idea to try it, and he found that he could mostly use my instructions, and it worked!

I have now went through the process while writing down how it works:

Create a new project

Select “OpenGL project”, name it suitably.

This creates a new folder. Best location: Side-by-side with the “common” folder.

Unpack the lab files. Put them in the folder you just created.

Right-click the project name

  Add files

    .c from lab files

    .c from common

    .c from common/WIndows

Go to Project->Build options

  Select “Search directories”

  Add common and common/WIndows

This will make the compiler find your .h files.

Build and run!

Problems? Shaders/models/textures not found? Are they located in the same folder as the project? Are you using my project file and “common” are not found? Is it located as specified, beside the new project folder?


Using DevC++ (now obsolete for the lab computers)

If you use Windows (which we must do in the lab) my main target was originally Embarcadero DevC++ (former Bloodshed DevC++). 

NOTE: Since DevC++ is not in the lab and Codeblocks seems to be working reasonably well, I am shifting towards Codeblocks as the new default.

This is a rather comfortable IDE which is easy to set up. It does have its issues, but I find it adequate for lab use. Any development system based on MinGW should work. However, Microsoft Visual Studio will not, because it has problems with error reporting.

In order to set up a project (e.g. a lab) for DevC++, do this:

Download Embarcadero DevC++ 6.3 if you don’t already have it.

Select File->New->Project (can also be done by clicking the left toolbar icon)

Select Multimedia, OpenGL, C project

Fill in a suitable name, e.g. Lab1

Save in the lab folder.

Right-click the project name in the Project area (left)

Add to project

Do this for all needed files, the main program, C files in common and also in common/Windows.

Note that you can ctrl-click to select several.

Remove “main.c”

Go to Tools -> Compiler options. You need to tell the compiler about search paths:

-I../common -I../common/Windows -I noise

This assumes that the common folder is located besides the lab folder, which I think is sensible.

Now you can compile with F9, run with F10… Sadly, you need to select the main program before compiing or the IDE will try to compile your shader.

© Ingemar Ragnemalm 2021