CompuServe Thread

#Too many colors?

15 messages in this thread
#54630From: SyndesisAug 24, 1993 2:13 PM
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.
#54721From: ALAN IGLESIASAug 25, 1993 12:02 AM
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
#54743From: SyndesisAug 25, 1993 8:15 AM
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.
#54801From: CSA/CAAug 25, 1993 1:48 PM
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
#54825From: SyndesisAug 25, 1993 4:39 PM
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.
#54968From: CSA/CAAug 26, 1993 1:39 PM
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
#54983From: SyndesisAug 26, 1993 2:56 PM
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"?
#54991From: CSA/CAAug 26, 1993 4:05 PM
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
#55042From: SyndesisAug 26, 1993 9:28 PM
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. 🙂
#55047From: John TissavaryAug 26, 1993 10:29 PM
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)
#55099From: Yost GroupAug 27, 1993 10:38 AM
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
#55111From: SyndesisAug 27, 1993 11:19 AM
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 🙂
#55131From: CSA/CAAug 27, 1993 2:02 PM
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
#55145From: Yost GroupAug 27, 1993 4:58 PM
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
#55232From: SyndesisAug 28, 1993 12:06 PM
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… 🙂