Author Topic: Any way to get luminance variation in a bitmap?  (Read 19523 times)

Is there any method for adding luminance to a black and white bitmap? For example, I have made a solid black and white image (not like a height map with gray values but more like a mask) that I am basing much of my substance on. What I'd like to be able to do is to add the luminance variation that nodes like Tile Generator are able to do, except using my custom mask. Basically take the white values and give them variety.

I hope that makes sense. :) Thanks for any help that's offered!

Hey Deimos,

the first method that comes to my mind would be to try that out with the pixel processor.
But there is no 'easy' node or something to use.

Best regards
Environment Artist - Twitter

Thanks for the reply Fabian. I'm new to SD and even more new to the pixel processor so hopefully someone can shed some light on how I can get started with what I need. :)

You want a solid value for each enclosed area right? I wanted to do this too but couldn't come up with a way to select each 'island'...

Yes, that is correct Eggz. The best example I can think of is if I wanted to make a stained glass window but instead of using the tile generator I wanted to supply my own mask and have SD "read" that each white area is different. This way I could apply either gradients or solid colors to each pane of glass.

Another example would be if I wanted to make a brick generator that I could always feed a black and white mask into so that I could get some really crazy shapes easily. Having something like what I've asked for in this thread would allow me to give each brick different depths, colors, or slopes because SD would now recognize them as individual shapes.

maybe I misunderstand what you want to do, but is it like the image below ? :

Not quite that simple I'm afraid Vincent. What I'm after is each completely enclosed white area to be a solid random grey value. Imagine doing a flood fill on the image. So it would look more like this (mocked up in photoshop)

mmm ok... don't know if it's feasible but I'll think about it  ;)

I know, it's tricky isn't it? I been puzzling it for a while now and can't come up with a solution.

I know, it's tricky isn't it? I been puzzling it for a while now and can't come up with a solution.
Yes it's a bit tricky : it would be easier to define the mask and the "patchwork" with Substance at the same time :-)

Eggz gave a perfect example of what I meant, so he and I are looking for the same thing. :)

Vincent - I definitely agree it would be easier to Substance it all. The benefit of doing it this way is if you need something that is either too precise for SD randomness, or if you need to keep to a specific design (in the case of my stained glass example).

I'm currently looking for a way to do this exact thing, has there been anything in recent updates that might make it possible?
Texture Artist | Visceral Games

I posed exactly this question about 2 weeks ago to no avail. My current hypothesis on how to accomplish this is pretty tricky, and frankly speaking I lack the technical prowess to do it.

Here's how I think it could be achieved, if someone knows if it's possible I'm all ears:

- Shrink the island masks untill each one is a 1 pixel dot in the middle of every island. I know how to shrink masks, the trouble would be to stop when it's 1x1 pixel and not keep going and end up with a black mask.
-Then you'd sample a value on some kind of cloud noise map or something to grab a random value in the same spot as those pixel dots.
- Then you would expand those randomly lit pixels back up until they hit the borders of the original mask islands.

Whoa. How coincidental; I'm also looking to try to do achieve this effect too.

I tried using the pure black and white mask as a mask map input for a tile sampler, then putting little squares in with luminance variation. Then using distance on the result with the B&W mask as the mask. No luck.

Yea, this would be a really awesome node to have.
Check out my Substance Blog!

Check this out, guys:

Too bad it's only .sbsar :( I'm very curious in seeing how it was actually done.