x


Do materials with same texture yet different shaders share the texture?

I'm doing render optimization for iOS but i'm new (first time game making) so unsure about this one detail.

If I have the same texture asset assigned to 2 or 3 materials with different shaders (for example a simple unlit, an alphablend, and an alphatest), will they truly share that texture? or is it going to now load that texture 3 times?

more ▼

asked Apr 10 '12 at 05:36 AM

citycrusher gravatar image

citycrusher
105 4 6 8

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

1 answer: sort voted first

I would think it's one place in memory and the various shaders would share it

more ▼

answered Apr 10 '12 at 06:10 AM

DaveA gravatar image

DaveA
26.8k 153 171 257

has anyone verified that is is the case? Specifically, has anyone tested this hypothesis on a mobile device, iOS and/or Android? The ability to have a single texture loaded only once for multiple shaders that reference it would be most beneficial if this is in fact definitely the manner in which Unity handles such a case.

Aug 16 '12 at 09:11 AM 3Duaun
(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:

x2275
x1740
x841
x491
x275

asked: Apr 10 '12 at 05:36 AM

Seen: 856 times

Last Updated: Aug 16 '12 at 09:11 AM