Original Post
Hi! im on it to writing a shader for my water. now i got stuck. I want to transform the normals from the normalmap to tangentspace. problem is, that i do all of the calculations in a post process shader. In this shader i now got: The normal of the wave (calculated from a heightmap) The UV of the bumpmap The viewing vector (from the camera to the pixel). now i need to compute a matrix from these parameters. I know it should somehow work, but i just got no idea how..
thats what i want to archive.. the red vector is the Normal of the water, i computed from the heightmap. the green one is the normal i read from the bumpmap. now i want to align this green normal to the red one, so i get nice waves.
thats what i want to archive.. the red vector is the Normal of the water, i computed from the heightmap. the green one is the normal i read from the bumpmap. now i want to align this green normal to the red one, so i get nice waves.