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"

is material instance cost as same as its parent?

is material instance cost as same as its parent?

Product Version: UE 4.12
Tags:
more ▼

asked Jul 26 '16 at 04:39 PM in Rendering

avatar image

Shkuk
63 10 11 20

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

1 answer: sort voted first

yes. The thing is, if you use parameters for textures, scalar values, vector 3's, booleans etc.. any calculation that stays the same compared to the master material (parent) doesnt need to be recalculated. this results in instanced materials being more optimal.

Even more advanced stuff can result in master instanced materials that control instanced materials :p I actually made a tutorial about that a few weeks back: https://www.youtube.com/watch?v=_gBilg1cILE

more ▼

answered Jul 27 '16 at 09:09 AM

avatar image

Luos
9.1k 283 62 328

avatar image Shkuk Jul 27 '16 at 09:58 AM

lets say master costs 100. And we have master + 3 instances. Here is the scenarios

a) 100 ( instances free ) b) 400 ( 100 for each material ) c) 160 ( 100 for master and cheap value for instances )

What is the correct answer.

avatar image Luos Jul 27 '16 at 12:04 PM

thats not exactly whats going on.

This will be just an example, but the ideology should be the same. Lets say a material has four textures (costing 25 each), and a lot of material functions that cost 100 as well. Also a scalar parameter costing 10. thats a total of 210 in the master material.

Now in the material instance, you only change one texture. that means 185 of the master is just passed trough, and the texture is a unique new 25. 185 old, 25 new.

if you now change the scalar, its 175 old, 35 new.

now if you make an instance of that instance and change another texture. its 150 older, 35 old, 25 new.

also instances arent entirely free, obviously using them also costs a little, but less than an entirely new master.

also using multiple instances on one mesh doesnt help performance that much, as each additional material/matinstance will add a drawcall.

avatar image Shkuk Jul 27 '16 at 03:00 PM

Let me check .i have 2 master materials. first one costs 100 and second one costs 1000.i created an instance for each one and i changed the base color for both. finally instances costs same?

avatar image Luos Jul 27 '16 at 04:43 PM

yes. :)

avatar image TorQueMoD Jul 27 '18 at 10:34 AM

Just to clarify, if I'm not changing any of the values other than material parameters to swap out the albedo, normal, RMAO etc. then an instance isn't any cheaper. IE for character materials.

It's only cheaper when the materials are sharing calculations - For example a flag material with panners and textures feeding into a world position offset to simulate wind - The initial cost is calculating the first flag's math but every material instance that simply changes a color parameter will incur a slight cost for the color change but will get a free ride for the math that's handling the world position offset?

(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