Are you trying to apply a texture map to a 2D plane with a normal map such that the texture map follows the distorted 2D plane from the normal map?
If so, then I don't think there is a simple solution.
The sketch of the solution above is to compute the displacement of the 2D plane based on the normal map (by integrating), and then perform the texture map based on the resulting displacement (both these steps can be done in a pixel shader). The second step is similar to the parallax mapping technique.
could you maybe provide some sample code? (or at least a rough layout)
thanks for the reply.
I am not aware of any public codes relating to the solution of your problem. You might have to piece several parts together and conduct your own experiment.
For the first part, computing the displacement from a normal map, his is typically done by integrating the normal map. You might be able to find some codes online. If you assume your normal map is a normal map of half a sphere, you can do some simple calculations. Basically the normal vector at each texel can be used as the displacement (you just need to scale it appropriately).
For the second part, you need to adjust the texture coordinates of each pixel in the 2D plane according to the displacement. For this, you can study the parallax mapping codes in the Microsoft DX9 SDK samples (or any parallax mapping codes you can find online).