Given the top-part sampled value `sampled` and its position `sampled_position`, returns the next (respectively previous) vertex top-part sampled value, and Set a Float2 variable `next_sampled_pos` to the position (in the top-part) of this neighbor (i.e. <returned value> = SampleColor(next_sampled_pos, image0)). `input0PixSize`must be equal to the path's pixel size (top[(0,0)].YZ).
If the current pixel (`sampled`) is a Start vertex, sample_prev will return the next sibling of this vertex; likewise if it is an End vertex, sample_next will return the next sibling of this vertex (i.e. maybe not what you want). See `sample_next_advanced` and `sample_prev_advanced` below to solve this.
Please note that for simplicity, Paths info are assumed to be stored in input0! Also, unlike what the function's doc states, you don't need to pre-declare `next_sampled_pos`. `[out]next_sampled_pos` is a dummy parameter to remind you that this second "return value" exists.
You can check the `paths_trace` Fx-Map, in the Iterations parameter of the 3rd Iterate node, for an example of how to use it.