How can I Implement Simple Raymarching?

I’m trying to make simple raymarching in unreal engine but I have problem In projection matrix (Clipping Plane Pos)

http://acegikmo.com/shaderforge/wiki/index.php?title=Raymarching

this is my custom node for raymarching

My Code Is here:

 float3 initPos = CamPos + ViewDir + ClippingPlanePos;
    float3 sample = initPos;
    float3 sampleOffset = ViewDir * StepSize;
    float4 color = float4(0,0,0,0);
    
    for(int i = 0;i < StepMax;i++)
    {
    if(distance(sample,SpherePos) <= SphereRadius)
    {
    color = float4(sample,1.0);
    break;
    }
    sample += sampleOffset;
    }
    return color;

Bumping this, a year seems long enough and I have the same problem…

Hi dear friend don’t be despair I’m here to help you
this link will help you

1 Like

You, sir, are a genius! Thanks a lot!