ParallaxOcclusionMapping Vector3 instead of textureObject

Good day. Please help me with the problem of using ParallaxOcclusionMaping.
How to make this node to accepted Vector3, instead of TextureObject.
I need to do a lot of shader operations to mix and edit different height maps for further use in ParallaxOcclusionMapping.
With BumpOffset, everything works fine, because Vector3 is used there, I want to make ParallaxOcclusionMapping also work with vector3.
I tried to change the code inside “Parallax Only Mapping”, but two days of searching did not lead to anything. I can not solve the problem myself, I hope for your help.

Source code of “Parallax Only Mapping” inside ParallaxOcclusionMapping:



float rayheight=1;
float oldray=1;
float2 offset=0;
float oldtex=1;
float texatray;
float yintersect;
int i=0;

while (i<MaxSteps+2)
{
texatray=dot(HeightMapChannel, Tex.SampleLevel(TexSampler,UV+offset,0));

if (rayheight < texatray)
{
float xintersect = (oldray-oldtex)+(texatray-rayheight);
xintersect=(texatray-rayheight)/xintersect;
yintersect=(oldray*(xintersect))+(rayheight*(1-xintersect));
offset-=(xintersect*UVDist);
break;
}

oldray=rayheight;
rayheight-=stepsize;
offset+=UVDist;
oldtex=texatray;


i++;
}

float3 output;
output.xy=offset;
output.z=yintersect;
return output;


I guess texatray calculation in while loop should be modified somehow.
Screenshot of what I need: