Author Topic: Multiply UVW-randomised tile by its scale  (Read 1296 times)

2022-12-12, 19:36:11

Sphere

  • Active Users
  • **
  • Posts: 15
    • View Profile
This is a pretty simple one that I think could go a long way.

Essentially, the UVW Randomiser would have an option to multiply the output values of a given tile by its scale.
This would mean that displacement maps keep a Z level proportionate to their XY scale.

Using widely-varying scale values, this would allow a single displacement map to produce natural variation across the surface of an object.

Would love to see this implemented!

2022-12-13, 16:33:04
Reply #1

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 13675
  • Marcin
    • View Profile
So a large tile would produce proportionally tall displacement, right?

Do you think it would have some other usage than displacement?
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2022-12-13, 17:23:40
Reply #2

Sphere

  • Active Users
  • **
  • Posts: 15
    • View Profile
So a large tile would produce proportionally tall displacement, right?

Do you think it would have some other usage than displacement?

Pretty much, yep! I imagine the amplitude = wavelength harmonic relationship could also work well for normal maps for the same reason.

Plus, you might want the inverse amplitude = frequency relationship where for example, a water normal might have lower amplitudes for larger tiles.

This could also go for regular textures too. Perhaps you'd want a cavity map or tint to be stronger based on tile scale. I suppose it just creates room for creative adjustment in general.

2022-12-14, 14:36:49
Reply #3

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 13675
  • Marcin
    • View Profile
Thanks, it's logged. As usual, when/if it will be implemented depends on many things including how useful it is and how hard it is to do.

(Internal ID=1022211097)
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2022-12-14, 17:50:54
Reply #4

Sphere

  • Active Users
  • **
  • Posts: 15
    • View Profile
Legend, cheers Maru :)

2022-12-16, 06:12:38
Reply #5

Sphere

  • Active Users
  • **
  • Posts: 15
    • View Profile
Thanks, it's logged. As usual, when/if it will be implemented depends on many things including how useful it is and how hard it is to do.

(Internal ID=1022211097)

Ok so I couldn't wait and ended up making the function myself in OSL by modifying the RandomTilingBitmap.osl shader. I had to fix the edge fuzz algorithm, which uses stochastic, binary noise to blend between tiles, and turns displacement maps into an absolute mess. Then I added functions to multiply a tile's value by its scale, plus adjust the the ratio of small to large tiles. It can be used on any other map and has a special scaling function for normal maps.

I've attached an image showing the difference between the old version, with the edge fuzz fixed, and with the scaling feature added.

I think the results look pretty cool and were straightforward to implement. Hopefully this might serve as inspiration to add it!
I'd be happy to share the code if the team wanted a reference.
« Last Edit: 2022-12-22, 02:31:41 by Sphere »