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"

Why is my simple material compiling hundreds of shaders?

I'm working on a project with 4 fairly simple Materials and 10 MaterialInstanceConstants. When I make a change to a material and hit Apply, sometimes it begins compiling hundreds of shaders which takes a painful amount of time to compile. I believe this is a bug, but has anyone heard of a scenario that can lead to wildly multiplying shaders being made in the background?

I have an Intel Core i5 CPU

Product Version: Not Selected
Tags:
more ▼

asked Apr 23 '14 at 04:33 PM in Using UE4

avatar image

lackthereof0
277 11 24 27

avatar image pyropace Apr 23 '14 at 04:35 PM

it is really hard to mark something as a bug, if you cant provide steps to reproduce it, can you give us some reproduce able steps ? i can try it on my machine as well

avatar image lackthereof0 Apr 23 '14 at 08:30 PM

I will attempt to create a repro case. But to be clear, since I have 4 materials, should I see a maximum of 4 shaders to compile, or are number of shaders independent of number of materials?

avatar image Tom Shannon Apr 23 '14 at 08:44 PM

Yeah, you'll see far more shaders than you have materials. The shading pipeline for UE4 is very complex and increases in complexity as you use your material in different ways. The engine compiles your node graph into highly optimized shader code for each use case. For example: Being lit only by dynamic lights, only being lit by static lights, being used on terrain, being used on static meshes, being used on skeletal meshes, and all the combinations of each as needed. UDK/UE never showed you how many shaders were being compiled, however it was a similar system and each material would produce a ton of shaders.

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

0 answers: sort voted first
Be the first one to answer this question
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