Itoo Software Forum

Author Topic: Randomizing materials in RC?  (Read 3425 times)

MN4869

  • Jr. Member
  • **
  • Posts: 79
Randomizing materials in RC?
« on: December 11, 2014, 09:25:17 AM »
I have a simple RC curtain wall glazing system

1x start/end piece, which includes the end of the glass (glass can't just butt up to end as this causes flickering)

1x default glass piece

1x mullion (with two glass ends either side)

If I add a material ID randomizer node in RC to each component then the end parts of my glass have different IDs to the main glass piece.

Also if I use 'tile' for the default glass piece then the verts are not welded so I can't add a material by element ID. I have to collapse, weld etc...

Any ideas? :)

satoer

  • Newbie
  • *
  • Posts: 23
Re: Randomizing materials in RC?
« Reply #1 on: December 11, 2014, 10:16:18 AM »
Have you seen the randomize materials part in this tutorial?:
http://www.itoosoft.com/tutorials/tutorial_stadium4.php
(It's in the video and halfway down the page)

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Randomizing materials in RC?
« Reply #2 on: December 11, 2014, 11:03:37 AM »
Hi,

I think I see the problem. You need the same randomised material on the 3 segments that make up the glass panel, but the Material operator assigns a new random id for each individual segment. Unfortunately this is a limitation of this operator but there are a few workarounds.

In the attached file I've included a style that uses the Random Number parameter to generate a new material id only on each x spline section. This is then attached to the Material operator's exported From and To values.

As all segments in a compose operator attached to an evenly input will take the ID of the preceding spline section, there's also a Conditional operator that places a glass end as the first segment in each section.

As for using element IDs, if your polycount is not too high and you don't mind losing instancing support, then you can force welding by turning on Vertex Weld in the Style rollout, and then turning off Use Instancing Engine, from the Display rollout. I've attached an example to illustrate this as well.



I hope that helps, please let me know if you have further questions.

Cheers,

Paul
Paul Roberts
iToo Software