Summary
[Bug] [UE5.8.1] => “DistanceToNearestSurface” Material Node doesn’t work if a [Blueprint] with a [Scene capture
component 2D] and a [TextureTarget] is present in the level.
What Type of Bug are you experiencing?
Level Design & Art Tools
Steps to Reproduce
There’s a video below explaining everything but you have the steps here too:
- Create a new project “Third Person” without variant and a new level with the template “Basic”
- Create a Material M_DistanceField with the following Setup
A “DistanceToNearestSurface” node into a “Divide” by 100 into the “BaseColor” output of the material - Add a cube, disable “Affect distance field” on it and Able “Affect distance field” on the terrain
then Put the material on the cube. A gradient from the ground should appear on the cube - Create a [Blueprint Actor Class] named “BP_Capture”, add a [SceneCaptureComponent2D]
- Create a [Render Target] Texture named “RT_Capture” and add it in the blueprint’s SceneCaptureComponent2D “Texture Target”
- After compiling, the cube has now turn black, but appeared normally when RightClicking ; Moving a viewport Window or in Unlit Mode
but not BaseColor
Expected Result
“DistanceToNearestSurface” Material Node should work weather or not a [Blueprint] with a [Scene capture component 2D] and a [TextureTarget] is present in the level.
In this example shown in the video, the distancefield gradient should appear on the cube
Observed Result
“DistanceToNearestSurface” Material Node doesn’t work if a [Blueprint] with a [Scene capture
component 2D] and a [TextureTarget] is present in the level.
The cube with a distancefield gradient is black instead unless when I RightClick ; Move a windows of the engine or go in Unlit Mode
Affects Versions
5.8
Platform(s)
Windows
