What's the deal with those math nodes in material in City sample project?

I’m looking at materials in the Matrix Awaken city sample.

I wonder what those magic numbers and seemly random math nodes do when calculating UVs.

For example, the following is the material for sidewalks. Judging from the switch param, it’s rotating the UVs, but what’s the deal with the complexity? why not just rotate it with the built-in rotate material function?

Thanks

Just looks like a randomish number generator. If I’m reading it correctly it should output a number between 0-1 in 0.25 increments, given they’re going to a RotateAboutAxis node, that would be “random” quarter turns for each sidewalk tile. At the end its also adding the same “random” offset to the texture coordinates for additional variation I guess.

The magic numbers were probably not chosen for any reason in particular, they just needed two very different scales and probably just dragged the numbers until it looked good enough.

Edit: Maybe more accurate to call it a “variation selector” than an RNG

2 Likes

Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.