#Too many colors?
15 messages in this thread
Today I got a call from someone who loaded an object into 3D Studio, but after
a while, it locked up after displaying the message "You already have 255 colors
on screen" or "… more than 255 …" Does anyone have any idea where this
comes from? I tried loading the same object into my system, but it worked
fine.
Hi John,
Sounds like it could be that the object had (or what 3DS is considering) more
than 255 materials. I believe there is a limit like this, although it seems
unlikely that many files would have this kind of complexity! Maybe a funny
thing happened in a format transformation?…Can't imagine why it would fail in
his and not yours though…
-Alan Iglesias
The message said colors, not materials. There's no indication of a limit on
the number of materials in the documentation of the file format. Well, the
limit is 64K. My best guess is this message came from his video driver.
John,
Uh, colors ARE materials. And yes, 3D Studio does have a limit of 256
materials in a scene. Gary has documented that on the forum, recently, if it's
not in the standard or developer docs.
Kevin Krell – Computer Support Associates
I'm sorry, I have a head-ful of 3D programs. Offhand, I wouldn't call a
"color" a "material". Color is RGB, material includes all the other nice
things in the materials editor, no? It looks like I'll need to adjust our
Converter accordingly; it's a shame because the file format uses a 16-bit int
to store the material index.
John,
According to 3DS, you go to the Material Editor and set up material
properties, which include the Ambient, Diffuse & Specular "colors",
transparency, decal/2-sided/Self-illuminated/Phong, etc. Certainly you can
then apply texture, bump, opacity, reflection. Didn't mean to seem to jump on
you, though, but the 256 limit does apply.
Kevin Krell – Computer Support Associates
Given together, those values for ambient color, diffuse color, specular color,
etc. are a "material". Writing more than 256 colors into a single object is
certainly possible in the file format. Is this limit the "number of colors in
the current material library plus the number of materials in the object you're
loading"? (Ex. you start with a blank material list, you can load a 255
material object OK, but when you've got a 128 material library loaded, you can
only load 127 materials from an object?) Or is the limit simply "per mesh"?
Or "per element", what I try to call a "sub-object"?
John,
Right now, the functional limit is # active of materials per scene (not
object), and is not related to any limitation of choices in the materials
library. Gary seems a bit busy, or I'd expect he could jump in on this.
Kevin Krell – Computer Support Associates
Am I overreacting, or isn't that a serious limitation? 256 divided by even
small numbers means only a few numbers of materials per object. What is
supposed to happen when you bump against this limit? I'd think it would be
easy to encounter – after loading a few multi-colored objects, you'd load
another and cross the limit, and what happens? It remaps the colors in the
last object? Can you load subsequent objects? I feel like someone just told
me there's only 64 crayons in the box, and there aren't any others. 🙂
If a project is extremely large, and warrants more than 256 materials, it is
always possible to create the animation in segments designed for compositing.
I know this is more complicated than just a straightforward single file/render,
but there are advantages to creating a huge project in modules, too. Naturally
not all animations lend themselves to seamless compositing, and in that case I
would be SOL <g>.
John Tissavary (La Luna cie)
Although you're limited to 256 materials per scene, each object can contain all
of those materials.
In practice, this is not a serious constraint. I think it's come up once in
the last three years here on the forum.
– G
Well, twice now, and it's going to come up more often, I suspect. 🙂 What
happens when you bump against this limit? How are the overflow material
assignments handled? Are they re-mapped to the full list of 256? And why
exactly is someone using a byte in memory when there's a USHORT in the file
format? 1/2 🙂
John,
You're not over-reacting. It is actually pretty unusual to have that
many different materials in use in the scene. Since Release 2 only has 1
material per object, that means at least 256 objects to keep track of, and
there tend to be a lot of material duplications. Now I admit that an object
can be broken up a lot by detaching faces, and assigning different materials to
the results.
Kevin Krell – Computer Support Associates
Actually, Kevin, as far back as Version 1, you could have a different material
assigned to each face of an object without breaking up the object. Now, mapping
coordinates — that's a different issue.
– Jack
I'm sure you can imagine why I lose sleep over things like this. I write 3D
translators for a living, so I want to know exactly what happens because I can
bet that a customer will discover what happens and blame the bugs on my
conversion. 🙂 Within my translators, there is a list of materials, and each
face can have one of those materials.
I know how some of these multi-material objects were created by my translators.
There's a program called Imagine. It uses triangles for everything, too. It
doesn't have material lists, each face has its own set of material info. It
even has a feature that randomly assigns colors to faces, so it quickly creates
zillions of materials. So in this sense, my translator is always detaching
faces and reassigning materials.
Other situations could easily create more than 256 materials. For example,
let's say my DXF translator could give each inserted BLOCK's entities a unique
material. Each block might use three-four different pen numbers, and I'd
create a unique material for each one: "DESK 1 RED" "DESK 2 RED" "DESK 3 RED",
etc. Someone might want to be able to re-assign different materials to each
block, right? The alternative is that all the blocks get mapped to the same
three or four materials, and it's much harder to change the materials for a few
of the blocks.
And then there's that guy who's making 10,000 tree scenes… 🙂