x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Distance To Nearest Surface Node not working, only returns 0. Need fix!

The mental pain is real.... I've been trying to get what I thought was a simple effect going in a material, but no matter what I do, nothing works. All I want to do is to use the distance-to-nearest-surface node in a water shader, but it only ever returns 0. I'm losing my mind as to why this isn't working.

My graph is literally just absolute world position -> distance to nearest surface -> divide by 100 -> lerp between red and blue -> base color output. I don't know what else I should be doing, as this is even what the documentation says should be working. Anyone know what I need to fix?

Goal: make some water that looks like this: http://i.imgur.com/SoW7H2n.gif

Product Version: UE 4.15
Tags:
more ▼

asked May 01 '17 at 01:49 AM in Rendering

avatar image

Knobbynobbes
161 28 45 43

avatar image DHelmsman May 21 '17 at 12:25 AM

Having a similar problem.

avatar image pete78clark Apr 13 '18 at 10:28 AM

Did you get anywhere with this? I've looking at something very similar just now and running into the same issues.

(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

Distance to nearest surfase is distance field function, so, to use it, make sure that "generate distance field" enabled in your project.

more ▼

answered May 21 '17 at 04:10 AM

avatar image

redbox
4.2k 79 16 101

(comments are locked)
10|2000 characters needed characters left

have you tried putting your engine scalability to "epic"? Distance to nearest surface only works on epic resolution.

more ▼

answered Jul 25 '17 at 07:38 PM

avatar image

LorenzHigman
6 1 3

(comments are locked)
10|2000 characters needed characters left

Distance Fields are disabled for computers with Intel Graphics Cards because it causes them to hang, I had trouble with this as well but I looked at the official documentation and there it said what I just told you. If you have an Intel Graphics Card then the problem is likely your computer and not your code or the software itself.

more ▼

answered Jun 08 '18 at 09:05 PM

avatar image

WolfHybrid23
3 1 1

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question