How do I access vertex positions in the material editor?

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?

image

I used Absolute World Position.

I can record a video later that shows the artifacts. If you’re interested, of course