I understand that JME’s inPosition means the position in model’s surface. Am I right?
I also understand that some values I need to pass from vertex to fragment shader.
What I need to do: having position I am able to move it a bit (with some vector I can calculate) and then I need to take the value from the texture. Now I need to translate the new position to texture coordinates (using UV).
I cant do that just by taking inTexCoord, moving it by some vector and taking texture2D(m_MyCustomMap, texCoord).r because of UV mapping.
I know how to write what I need in shader (it’s just a c++ like programming) but I dont’t know all names, variables and functions the GLSL/JME provides. I was trying the google, but no success.
I don’t think you’ve adequately explained what you are trying to do. For example, I still don’t know what you’d want to transfer the world view projection matrix to the frag shader. It doesn’t normally have any model coordinates that would need transforming into view space so I don’t know why you’d need it.
Take a step back and tell us at a higher level what you are trying to accomplish as it sounds like you may have already painted yourself into a strange corner.
Also since g_WorldViewProjectionMatrix is a global uniform you can directly declare in as an uniform in the frag shader and use it. You don’t have to pass it as a varying from the vert shader to the frag shader.
In the most simple words: I needa formula used to calculate inTexCoord. As fas as I understand, inTexCoord = f(somePosition)
I need f and somePosition to manually manipulate somePosition and calculate inTexCoordNew = f(someManipulatedPosition).
I cant manipulate inTexCoord because of UV mapping, must use it’s source.