Itoo Software Forum

Author Topic: How does Forest handle Material IDs ? Can i use VRayMultiSubTex with Forest ?  (Read 1809 times)

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3076
    • iToo Software
What does Forest modify the material IDs of the geometry ?

In Forest, there is a big difference in comparison with the standard assignment of materials in 3DS. The material is NOT applied to the object, using the Material Editor, but selected as a parameter in the Geometry rollout, using the "Material" pick button.

Since Max handles Forest as a single object, it only can have an unique material assigned. In order to apply correctly all materials defined in the Geometry list, Forest collects all of them and creates internally a Multi-sub material, which is assigned to itself (named as "forest_automaterial"). This process is automatic and transparent to the user, but as side effect the Material IDs of the items doesn't match with the original geometry.

We use this approach for materials because is compatible with all render engines and Max modes.

Then, is there some way to use VRayMultiSubTex or other plugins based on Material ID ?

Partially, if we can predict how the auto-material is built, and using the following workaround: use a Multi-sub material for each of your Custom Objects, even if it uses a single material.

In this way, Forest creates the auto-material sequentially, adding each one of the single materials of the multi-subs in order. Also, the IDs of the custom objects are modified to match the position of these materials.

You can find an example of this technique in the attached scene: it includes two objects, one of them with a VRayMultiSubTex using IDs 1 to 5. We used a Multi-sub to repeat the material in the first 5 slots, so IDs 1 to 5 are preserved for this object in the auto-material. Take note it's necessary to add the items to the Geometry List in order, so the object with VrayMultiSubTex go first. In this way, the instanced materials are placed in the slots 1-5 of the auto-material.

If the number total of items is not huge, there is a different approach for this issue: use Forest Tools to create instances of the source objects. Since the IDs are not modified, you can apply VRayMultiSubTex without changes.
« Last Edit: July 27, 2014, 11:16:33 AM by iToo »
Carlos Quintero
iToo Software