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 very costly?

Hi, I posted this in the forum earlier but figured it would be better to post here.

I recently built a material function that would add dirt on meshes based on distance fields using the Distance to Nearest Surface node. I added it to my master material that is used for the majority of our assets and added a static switch parameter for turning it on. It worked great and I applied it to a few instances and made sure it worked in our whole level.

Today, two days later I try opening the main level again and keep getting "Our of video memory" errors despite using a GTX 980TI (6gb vram). I loaded up a backup and that worked fine, I replaced the maps in the current version of our project with the ones in the backup and that didn't help. After that I turned the function off in every material instance, saved, restarted and loaded up the map again and got the same error. Then I reverted to the older version and only copied the master material and the function over from the newest version to see if it was caused by something else but that didn't help either. Even with the function off in every instance and no meshes in the level that have used it I get the error.

Our level is very big and It always uses quite a lot of vram. Streaming pool is set to 1800mb without any errors and with the whole map loaded in editor my VRAM usage is at just below 5gb (yeah I don't know why it's so high). With the function in the material but turned off it uses all 6gb and crashes. I was under the impression that turning it off would ensure it didn't affect the scene (much) but I'm apparently wrong.

This might be the wrong way to go about it, I couldn't really find much documentation on using DFAO in materials. If anyone have some ideas or help to lend I would really appreciate it.

Product Version: UE 4.14
Tags:
more ▼

asked Feb 02 '17 at 02:13 PM in Rendering

avatar image

Sitrec
313 21 23 22

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

There isn't a lot of documentation.

Since the error didn't disappeared after you removed the functions from your materials and instances, I'm inclined to believe that the "Out of video memory" is due to another problem. You can try opening up an stable version and running the command "MemReport -full" to dump a full memory report of your frame. Although it doesn't give you a complete list of what is on your VRam, at least you can know how much each stat group takes on the memory.

Distance to Nearest Surface isn't costly per se. At least not enough to fill up 1 gb of memory like that, if you don't have a big scene and using the function on every material. But they usually add a lot of instructions and the performance tends to be noticeable if you abuse of it. Personally I've only used it to create water planes.

If absolutely in need of doing something like this, a nice alternative to this is baking the AO and recovering it with "Precomputed AO" node on the material. Takes as much memory but costs only a texture sample - besides the after work with the mask.

Hope it helps!

Cheers

João

more ▼

answered Feb 09 '17 at 01:35 PM

avatar image

johnyc90
56 2 4 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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