So there is this really simple setup to just read the distance field and write it in the emission color.
Not a custom node
I want to access the same information in a custom node.
float3 GlobalUV = ComputeGlobalUV (WorldPosition, 0);
float DistanceToSurface = 0;
DistanceToSurface = Texture3DSampleLevel (GlobalDistanceFieldTexture0, SharedGlobalDistanceFieldSampler0, GlobalUV, 0) .x;
But that only works partially.
Results are displayed in preview viewports and in global distance field and mesh distance field visualization mode, but not in the main viewport.
Standard view mode
SDF visualization mode
If anyone has any ideas, that would be very grateful.