Is there a way to get pixel position of back face in material editor

I want to create a semi-transparent material. I did this in OpenGL as follows:
Rendered the positions of the front pixels of mesh into a texture, the back pixels into another texture, and calculated the length of the difference between the back and front pixels. This gave me information about the depth that the ray goes through to get through the mesh. I want to do something similar in Unreal. If it isn’t clear from description, hope the image will help

I think a multi line trace will give you these intersection points

How can I use it in my material editor?

I’m assuming you want to make a line trace at runtime, and make the spots appear on the mesh? Maybe you could describe a bit more…

In the material editor you can get pixel’s(or fragment’s) world position using Absolute World Position node. But it returns a position of the pixel on the front face being rendered. I want to be able to get the pixel position of the inner face on the other side and use it in my material editor to create semi-transparent material. I don’t think that line trace can help since it will be very costly to call it per every pixel on material.

The world position node is simultaneously the position of all pixels in world space, it doesn’t differentiate between faces.

If you make a cube with a two-sided material, the world position node is talking about all points on the outside and inside of the cube.

Wouldn’t it be easy to just use a transparent material?