Tuesday, September 25, 2007

Week 3 Parallax


We had som troubles implementing the two shaders. Mainly because only one of our computers could use shaders and because the computers at daimi which did was taken most of the time, but also because we didn't have a guideline about the final result and about the shaders in general.


The parallax shaders was implemented with inspiration from the BumpMap shader and the information we got at the lecture.
The vert part of the parallax is almost identical with the one from BumpMap except we calculate a normal and sends it to the frag part.

In the frag, we used the height of the bumpmap, which is sent as a parameter in the alphachannel of the map, to shift the texture coordinates in the direction of the cam.
It works pretty much as the figure on the slides from the lecture. We multiply the height on the normalized eye vector and then use this as an indicator for the new coordinates along with an offset.

We used some time to tweak it so that we have a nice shader but we ended up with a result that looks pretty good (we think).

No comments: