Assignment5Discussion

Assignment 5 FAQ and Student Discussion Page

The course staff will post answers to frequently asked questions about assignment 5 here. Feel free to add to this page yourself if you've got information to share with the rest of the class. Remember, the quickest way to get a response from a TA is to post to cs148-win0607-staff@lists.stanford.edu

My recovered HDR image looks like it has the correct red color, but the green and blue are wrong.

When you do logf(dt) it gives you back a float. If you then use this directly in an expression with an STColor, such as color - logf(dt), it will cast the result of logf(dt) to an STColor automatically using the constructor STColor(float,float,float). However, the default values for that constructor cause the red component to get the right value, but the green and blue to be set to 0. Instead, construct an STColor explicitly and then use it in the expression.

The sample images don't display properly but if I scale them down they do.

We believe this is just an OpenGL limitation that varies from graphics card to graphics card. As long as it works on the smaller versions we'll accept it. Just note in your write up if you had this problem.

Images don't display correctly in my program, I just get a gray screen (or something similar).

Your graphics card probably doesn't support non-power-of-2 textures. You can change the drawing code easily to draw the STImage directly by adding it to the scene graph and removing the code that adds the textured quad to the scene graph. Simply replace setup() with the following code

static void setup() {
        image.Resize(1,1);

        STSceneNode* root = scene.GetRoot();
        root->PlaceObj(&image);
        STShape* square = STShape::CreateRect(1.f, 1.f);
        square->SetColor(STColor(1.f, 1.f, 1.f));

        square_tex = new STTexture();
        square_tex->Upload(image, false);
        square->SetTexture(square_tex);
}

We leave the code for the texture since its referenced elsewhere, but you could remove it and update the rest of the code.

Recent