x


SetMaterialBlock - anyone use this or know where documentation is?

One of the features in Unity 3.5 I read about in the "What's New" page was about SetMaterialBlock. It's implications seems very beneficial for not having to instance materials and change settings per instance.

Here's the description from the What's New page:

Added renderer.SetMaterialBlock for a lightweight way of adding per-instance material parameters without duplicating the materials. Also, the MaterialPropertyBlock does not have fixed small capacity any longer.

I can't find any documentation or any reference using Google to anyone who has used this. I saw someone mention it in one post on http://forum.unity3d.com, but beyond that, nothing.

Has anyone used this and could provide documentation on how to use it? I'm sure someone will mention use of it sooner or later, but I'd rather do things correctly the first time around.

Thanks so much.

more ▼

asked Mar 18 '12 at 10:30 PM

addo gravatar image

addo
51 2 6 8

Just wanted to note that there are no results returned when you search in the current documentation. http://unity3d.com/support/documentation/ScriptReference/30_search.html?q=SetMaterialBlock

There is also no code hinting for the function in Monodevelop-Unity 2.8.2

Mar 18 '12 at 10:32 PM addo
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Thanks for pointing it out. There's a mistake in the What's New page, the function is called SetPropertyBlock(). We will add documentation.

more ▼

answered Apr 18 '12 at 09:44 AM

kaspar_unity gravatar image

kaspar_unity
31

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

The function is called SetPropertyBlock.

You can find it when you look into the Renderer docs.

(MaterialPropertyBlock)

more ▼

answered Apr 18 '12 at 10:00 AM

Bunny83 gravatar image

Bunny83
45k 11 48 206

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

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Topics:

x807
x470
x275
x202
x42

asked: Mar 18 '12 at 10:30 PM

Seen: 654 times

Last Updated: Apr 18 '12 at 10:00 AM