In P2, we tried to do a variant of these to determine if removing the if for the snow scene in shadePixel was worth it (as hinted that it might be in the starter code). We did this by commenting out the if in the snow code and only doing the normal color stuff. Turned out performance wasn't effected that much, so we didn't go through with hoisting up the if statement and making the code convoluted and repetitive.
In P2, we tried to do a variant of these to determine if removing the
if
for the snow scene inshadePixel
was worth it (as hinted that it might be in the starter code). We did this by commenting out theif
in the snow code and only doing the normal color stuff. Turned out performance wasn't effected that much, so we didn't go through with hoisting up theif
statement and making the code convoluted and repetitive.Very good ideas here!