Global distance field sample in Custom node problems
1599560114 A03536c575109b08ea0732050823fc9489ff81fb 2 1024x284.png

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;
return DistanceToSurface;

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.


Please enter your comment!
Please enter your name here