Author Topic: Any way to randomise gamma within texture tiling?  (Read 4189 times)

2021-09-14, 11:23:31

Jpjapers

  • Active Users
  • **
  • Posts: 1644
    • View Profile
I want to add a bit pf patchy variation across a fabric surface to simulate panels stitched together. Im looking for a way either with corona or some OSL shaders that would let me randomise the gamma of a single tiling bitmap so every time it tiles its slightly different. Has anyone got any ideas on how this might be achieved?

2021-09-14, 11:38:10
Reply #1

aaouviz

  • Active Users
  • **
  • Posts: 882
    • View Profile
    • Another Angle 3D
I wouldn't over-complicate it with gamma?

That being said: Some combination of MultiMap plugged into the UVW?

Or do a floor-gen on the object (so long as it's a flat surface, probably isn't?) and do a multimap onto that?
Nicolas Pratt
Another Angle 3D
https://www.instagram.com/anotherangle3d/

2021-09-15, 13:41:30
Reply #2

Jpjapers

  • Active Users
  • **
  • Posts: 1644
    • View Profile
I wouldn't over-complicate it with gamma?

That being said: Some combination of MultiMap plugged into the UVW?

Or do a floor-gen on the object (so long as it's a flat surface, probably isn't?) and do a multimap onto that?

Its swagged fabric for large canvas tents like circus tents so im trying to get it to look slightly patchy so floorgen just wouldnt work.
I cant see a way that multimap would be able to provide randomisation to normal tiling as there isnt a mode for it which is why i wonder about the OSL route but i have no idea how much of OSL corona supports.

2021-09-17, 19:58:59
Reply #3

Avi

  • Corona Team
  • Active Users
  • ****
  • Posts: 476
    • View Profile
Is it possible for you to attach a scene file or a reference Image showcasing what exactly you are trying to achieve?

Looking forward to it.

Regards,
Avi
Arpit Pandey | chaos-corona.com
3D Support Specialist - Corona | contact us

2021-09-19, 15:38:18
Reply #4

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12708
  • Marcin
    • View Profile
Multimap has gamma randomization which you can use even with a single item.
If you are using the UVW Randomizer for the tiling randomization, you can plug this UVW Randomizer into Multimap, enable the gamma variation, profit!
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2021-09-19, 17:16:26
Reply #5

PROH

  • Active Users
  • **
  • Posts: 1219
    • View Profile
@Maru - This will only work on instances, primitives or mesh elements. NOT on a surface.

I believe OP is asking for a slight color-variance on every repeated bitmap/tile, based on the map-size/UV-size rather than geometry. Would be usefull to give more natural variation on f.ex. grass, dirt and fabric.

I think there is an OSL map dooing this - but I'm not sure.

Regards

2021-09-20, 09:07:32
Reply #6

Frood

  • Active Users
  • **
  • Posts: 1903
    • View Profile
    • Rakete GmbH
Would be cool if there would be a simple OSL solution. Currently I would still do that kind of variation (and more) using BerconTile + MultiMap.


Good Luck



Never underestimate the power of a well placed level one spell.

2021-09-20, 10:04:47
Reply #7

pokoy

  • Active Users
  • **
  • Posts: 1850
    • View Profile
While it's probably doable with OSL - not sure if any map shipping with Max currently can do this - a Per-Tile mode, where each tile gets handled differently would be a neat addition to the MultiMap. It could be used to add some variance in any regularly tiling map like fabric, grids etc with ease.

2021-09-20, 11:08:51
Reply #8

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8779
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Maybe you should apply KISS principle here? You can randomize everything that way, gamma, hue, saturation, etc. Imagination is the limit :]
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2021-09-20, 11:18:45
Reply #9

PROH

  • Active Users
  • **
  • Posts: 1219
    • View Profile
Hi romullus. Looks great. How is this set up?

2021-09-20, 11:43:50
Reply #10

pokoy

  • Active Users
  • **
  • Posts: 1850
    • View Profile
Yeah, thought about this as well, but you need the bitmap to be bigger than what you'll show because this one will tile as well. Might work depending on the case, but it's probably really easy to setup.

2021-09-20, 11:58:54
Reply #11

PROH

  • Active Users
  • **
  • Posts: 1219
    • View Profile
Okay - figured it out. But this will not work with the UVW-Randomnizer on top.

Personally I would love a solution where one could patch and randomnize sveral different bitmaps on one surface.

Regards

2021-09-20, 12:05:09
Reply #12

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8779
  • Let's move this topic, shall we?
    • View Profile
    • My Models
How is this set up?

There's nothing to it, really. Bitmap is tiled 10 times, so to match this i set tiles count to 10 by 10 (note that tiling in coordinates rollout needs to be left at default in order to get proper randomisation), then it's up to you how you want it to mix it with bitmap, in this case i used Corona mix in softlight blend mode, but you can use native mix, composite, or even RGB multiply, mask and any combination of them.

Yeah, thought about this as well, but you need the bitmap to be bigger than what you'll show because this one will tile as well. Might work depending on the case, but it's probably really easy to setup.

The bitmap is tiling the same number of times as the tiles map in this case, but it's not crucial, since the bitmap is seamless so you don't have to match their tiling. One can be tiled 5 times and the other 7 times and you won't notice anything strange.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2021-09-20, 12:08:36
Reply #13

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8779
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Okay - figured it out. But this will not work with the UVW-Randomnizer on top.

Personally I would love a solution where one could patch and randomnize sveral different bitmaps on one surface.

Regards

Why would you need UVW randomizer in this example? You can't randomize transformation of fabric texture and get sensible result anyway.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2021-09-20, 13:12:14
Reply #14

PROH

  • Active Users
  • **
  • Posts: 1219
    • View Profile
no, I don't need it in this example. But with other things like f.ex. ground materials that would be neet :)