I have some classic texture coordinates and as a normal behaviour they follow the mesh's transformations.I am trying to use the same texture coordinates behaviour but without being affected by the mesh rotation transformation. The results would be a sort of texture coordinates projection.I don't know if my explanations are well explained but how could I achieve such effect.Thanks a lot.
Texture coordinates projection
shader;glsl;real time;hlsl;uv mapping
I think that I got a solution but I would gladly know if there are some optimizations possible.My UVs and local coordinates values are corresponding. I mean that they are in the same range value. That said, I can use my XY vertices values for sampling the occlusion texture. The main problem is that the local coordinates are dependent to the rotation of my object which doesn't solve anything...To solve that I am converting my local coordinates into world space using a objectToWorld matrix (inverse of current world matrix).Then I am converting it back into object space using the inverse TRS matrix but without taking into account the rotation of the object.It's a bit hacky and I think that I could avoid some steps but this is working.Any advice is welcome :)