5

I have very large number of planes in my scene and each needs to be assigned a color, and to do that, I am assigning a material to each plane. Blender is allowing 2^15, i.e. 32768 materials. But the number of planes in the scene are on the order of millions.

How can I make blender handle more materials so that I can color all the planes?

Garrett
  • 6,596
  • 6
  • 47
  • 75
ZeroGravity
  • 365
  • 2
  • 13

2 Answers2

5

Use the same material for every object but have different colors for it.

I assume you will generate this dynamically. Some methods I can think of:

  • Generate a 4096x4096 texture and assign that. Use nearest interpolation (like in minecraft). Have each planes UV-coordinates point out what pixel to use.
  • Use vertex colors for each plane. Have the material use the the vertex colors. Use the attribute node: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Attribute
  • If you don't need exact colors, if you are content with a random color, use the object info node to get a random value for each node, insert it into a color ramp node.
Gunslinger
  • 6,392
  • 2
  • 28
  • 40
2

Blender Internal

In Blender Internal you can set object colors independent of the material.

  1. Set the object color in Properties > Object > Display (or with object.color)

    enter image description here

  2. Enable Object color for the material in Properties > Material settings > Options:

    enter image description here

All these cubes have the same material, but are colored individually via object color:

enter image description here

Cycles

For Cycles, see this post.

gandalf3
  • 157,169
  • 58
  • 601
  • 1,133