limited number of materials?

Hi,

I just tried a brute force way of coloring my objects, that is by setting a
color per face.
I know I know... probably that is *the* way of getting my radiance license
revoked ;')
I ran into something curious though: is there a limited number of materials
that rview / rpict can grok?
Right now I'm dealing with a few hundreds of thousand of faces, so I can
well imagine this limitation.

-jelle

Right now I'm dealing with a few hundreds of thousand of faces, so I can
well imagine this limitation.

While I cannot answer the max number of materials question, there should be actually no problem if you define a limited "palette" - I guess not EVERY of the faces needs a different color? What about a 256- or 512-color "palette", thus 256 or 512 materials? Or are you subdividing the faces to get a smooth transition to work around the interpolation?

CU Lars.

The palette is certainly an interesting suggestion Lars.
Probably that would be a nice workaround for my problem.
Its probably the thing that will make my brute-force approach actually work!
Thanks for the suggestion.

-jelle

While I cannot answer the max number of materials question, there should

···

be actually no problem if you define a limited "palette" - I guess not
EVERY of the faces needs a different color? What about a 256- or
512-color "palette", thus 256 or 512 materials? Or are you subdividing
the faces to get a smooth transition to work around the interpolation?

For the record, there is no fixed limit to the number of materials, but if you are defining a different material per face, you'll save a bit of time and memory by reusing the same material name. This is what gensurf does when it defines a texture per face. It avoids having a lot of names inserted into the hash table, and is more efficient.

Setting a palette is an excellent suggestion if that works for you.

-G

···

From: "jelle feringa" <[email protected]>
Date: November 15, 2007 4:12:45 AM PST

The palette is certainly an interesting suggestion Lars.
Probably that would be a nice workaround for my problem.
Its probably the thing that will make my brute-force approach actually work!
Thanks for the suggestion.

-jelle

While I cannot answer the max number of materials question, there should
be actually no problem if you define a limited "palette" - I guess not
EVERY of the faces needs a different color? What about a 256- or
512-color "palette", thus 256 or 512 materials? Or are you subdividing
the faces to get a smooth transition to work around the interpolation?

if you are defining a different material per face, you'll save a bit of time and memory by reusing the same material name.

Isn't there a limit how many times I could define a material using the same name?

CU Lars.

There is no limit on name reuse in Radiance. Why would there be? A material/texture/pattern/mixture name only refers to that modifier until it's redefined later in the scene description stream, however. This is how Radiance avoids the problem of name reuse in multiple files, or the same file transformed multiple times and containing material definitions.

For example, if I used ies2rad to create a light fixture with a distribution, then made 100 copies of that fixture using an xform array, that would be 100 materials in the scene, all with the same name but different definitions since they would have different associated transformations. This is an essential facility, though perhaps one not many people are aware of.

I hope this makes sense.
-Greg

···

From: "Lars O. Grobe" <[email protected]>
Date: November 15, 2007 8:00:19 AM PST

if you are defining a different material per face, you'll save a bit of time and memory by reusing the same material name.

Isn't there a limit how many times I could define a material using the same name?

CU Lars.

There is no limit on name reuse in Radiance. Why would there be?

I remember having had problems (rvu: too many modifiers in ambient list) because I had redefined materials too often and excluded them from ambient calculation later. I thought it was a problem of material definitions / name, not the total number of definitions, as even if there is only one material name, every definitions adds an modifier id to the lists. Had I been wrong, was it the total number (2047) of material definitions than?

Thank you & CU, Lars.

Hi Lars,

You are correct about this. There is a limit to the number of materials that may be included in the ambient exclude list (2047 in this case) or the trace set of rtrace (8192). I could raise these limits in the distribution, or you could yourself by adding:

  -DMAXASET=N -DMAXTSET=M

to the build options in the makeall "rmake" script and recompiling.

All I was saying is that there is no fundamental limit to the number of times a material may be redefined. You can say there is a limit with respect to the include/exclude settings, but this is not the same as a basic limit. If Jelle wants to exclude his reused material name, then he may have a problem.

-Greg

···

From: "Lars O. Grobe" <[email protected]>
Date: November 15, 2007 8:39:26 AM PST

There is no limit on name reuse in Radiance. Why would there be?

I remember having had problems (rvu: too many modifiers in ambient list) because I had redefined materials too often and excluded them from ambient calculation later. I thought it was a problem of material definitions / name, not the total number of definitions, as even if there is only one material name, every definitions adds an modifier id to the lists. Had I been wrong, was it the total number (2047) of material definitions than?

Thank you & CU, Lars.