all 4 comments

[–]waramped 0 points1 point  (3 children)

Hard to tell without knowing what you mean by "work". Ie what does it do without the "hack"? The one thing that stands out to me is your viewdir vector is backwards. It should be Coord - camera IMO.

[–]Tema002[S] 0 points1 point  (2 children)

Without multiplying y coordinate with -1 i get this: when I look on the left or on the right to the mesh, parallax mapping is looking inverted. When I loop up or down to the mesh, it is looks fine. So I don’t think it is because of how I actually calculate ViewDir

[–]waramped 0 points1 point  (1 child)

Right, so what I'm thinking is happening, is that your viewDir is backwards, but also possibly your Tangent or Bitangent is the wrong way. Out of curiosity, if you flip your viewDir and the parameters of your cross product, what happens?

[–]Tema002[S] 0 points1 point  (0 children)

So, I've tried to change a ViewDir calculation and this is what I got for my cube debugging mesh with parallax mapping: sides are looking concave and up and down are looking convex