# \[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.

**URL:** <https://forums.unrealengine.com/t/bug-ue5-8-1-distancetonearestsurface-material-node-doesnt-work-if-a-blueprint-with-a-scene-capture-component-2d-and-a-texturetarget-is-present-in-the-level/2745086>\
**Category:** Issues and Bug Reporting (Unreal Engine)\
**Tags:** unreal-engine, open\
**Created:** [August 19, 2026, 4:24pm UTC](https://forums.unrealengine.com/t/bug-ue5-8-1-distancetonearestsurface-material-node-doesnt-work-if-a-blueprint-with-a-scene-capture-component-2d-and-a-texturetarget-is-present-in-the-level/2745086 "2026-08-19T16:24:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArnaudClaudet](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ArnaudClaudet](https://forums.unrealengine.com/u/ArnaudClaudet)\
**Post date:** [August 19, 2026, 4:24pm UTC](https://forums.unrealengine.com/t/bug-ue5-8-1-distancetonearestsurface-material-node-doesnt-work-if-a-blueprint-with-a-scene-capture-component-2d-and-a-texturetarget-is-present-in-the-level/2745086/1 "2026-08-19T16:24:19Z")

</div>

### 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:

1. Create a new project “Third Person” without variant and a new level with the template “Basic”
2. Create a Material M\_DistanceField with the following Setup  
A “DistanceToNearestSurface” node into a “Divide” by 100 into the “BaseColor” output of the material
3. 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
4. Create a [Blueprint Actor Class] named “BP\_Capture”, add a [SceneCaptureComponent2D]
5. Create a [Render Target] Texture named “RT\_Capture” and add it in the blueprint’s SceneCaptureComponent2D “Texture Target”
6. 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

### Upload an image

 ![Capture d'écran 2026-08-19 164057.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/2/f/82f14c31a7991ade15e1359f9df27fb2408c2da0.png)

### Video

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/0/7/60788e7ef7f9cc1a7dd9dbc1e3eefc101a3ee71d.jpeg "[Bug] [UE5.8.1] "DistanceToNearestSurface" Material Node doesn't work") ](https://www.youtube.com/watch?v=kvbnk2sGGck)

---

<div class="post-metadata">

**Author:** ![KLGuyfiend](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KLGuyfiend](https://forums.unrealengine.com/u/KLGuyfiend)\
**Post date:** [October 22, 2026, 2:27pm UTC](https://forums.unrealengine.com/t/bug-ue5-8-1-distancetonearestsurface-material-node-doesnt-work-if-a-blueprint-with-a-scene-capture-component-2d-and-a-texturetarget-is-present-in-the-level/2745086/5 "2026-10-22T14:27:17Z")

</div>

The bug is related to distance fields not being updated for the main view, when a scene capture runs before it. A possible workaround is to set “r.AOGlobalDistanceField.DetailedNecessityCheck 0”. This does have a drawback of forcing distance field updates for views that may not need it, although these should be cheap for views that don’t move.

--Jason Hoerner

---

<div class="post-metadata">

**Author:** ![Bug-Reporter](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bug-reporter/32/1223650_2.png) [@Bug-Reporter](https://forums.unrealengine.com/u/Bug-Reporter)\
**Post date:** [October 28, 2026, 12:00am UTC](https://forums.unrealengine.com/t/bug-ue5-8-1-distancetonearestsurface-material-node-doesnt-work-if-a-blueprint-with-a-scene-capture-component-2d-and-a-texturetarget-is-present-in-the-level/2745086/7 "2026-10-28T00:00:37Z")

</div>

UE-392609’s status has changed to ‘Ready for QA’. A member of the QA department is investigating the issue.
