I need to access vertex positions in order to calculate for each vertex separately how far and where to move it. I already have all the logic working, but I’m using Absolute World Position, which now gives artifacts when changing the camera location (the vertex position is constantly changing and feels like a bug, not a feature). Please advise, perhaps there is some code in HLSL that will help access the vertex positions?
This is the right way to do it.
Are you very far from the world origin? Might be a large world coordinates issue as its not supported for the GPU yet
I’m at the origin of the coordinates. Using Absolute World Position will not work, because artifacts appear when changing the camera position. I think that I should add colors to the mesh vertexes, use the object coordinates and when folding I will also have constantly changing values.
Are you sure you’re not using camera relative world position?
I used Absolute World Position.
I can record a video later that shows the artifacts. If you’re interested, of course
But documentation states that the AbsoluteWorldPosition node “…outputs the position of the current PIXEL in world space”, so it can’t be used in the vertex shader or to get the vertex position, right?
Yes it can be used in the vertex shader to return the vertex position. In the fragment shader, it returns the interpolated position of the pixel.
What @BananableOffense said, also you can force some things that would normally run in the fragment shader to run in the vertex shader by using the Vertex Interpolator node.