[Verse-dev] Representing objects with multiple materials
Samuel Siltanen
saasilta at cc.hut.fi
Fri Sep 16 14:06:55 CEST 2005
The geometry reduction software I have implemented produces objects with
several different materials. In the worst case, when the material blending
is enabled, every polygon might have a different material. Representing
such objects in Verse has been difficult, and after discussing with Emil
it appeared that I had not done it correctly. Because this is a topic
which affects also all others usign such models, I decided the write about
it.
Basically I have one object node which is linked to one geometry node. The
geometry node contains "vertex" and "polygon" layers containing the vertex
and polygon data respectively. Then I have a bunch of material nodes,
which contain the material trees representing both visual and acoustical
materials. Then I have a layer called "material" attached to the geometry
node. It has 32-bit unsigned integers representing the material numbers of
each polygon. Then every material node should be linked to the object
node with a link called "material". The target IDs of these linkes form
the indexing scheme of the materials. These are the values which are
referred to in the "material" layer in the geometry node.
I managed to mess up things by writing the material node IDs to the
"material" layer. These IDs change over Verse sessions and thus I
noticed that the materials were assigned incorrectly after the VML saving
and loading operations. So, at least I learned how not to do it.
Emil also mentioned that Eskil had suggested still another way. It would
be nice to hear if there is a more simple way to do this.
Samuel Siltanen
saasilta at cc.hut.fi
More information about the Verse-dev
mailing list