Mask by a colour

Started by N-drju, April 24, 2020, 10:46:28 AM

Previous topic - Next topic

N-drju

Let's say that I have a .jpg image - a mix of blue and white tiles.

Is it possible to apply, for example, a power fractal to said image but only to the blue tiles? This would, consequently, involve masking by colour rather than a shader... Have anyone tried something like this before?
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

N-drju

Ok, got it. Seems like all you need to do is to manipulate the transparency colour in the effects tab and make sure it is used for blending. Then, you can apply a power fractal (or whatever else you prefer) as a "mask". Technically, it will not be a mask anymore, just another layer, but this is what I was after.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

WAS

Red to Scalr
Green to Scalar
Blue to Scalar

And a colour adjust to isolate depending on colour bleed.

WAS

This method is great for painting a multi-data mask map for your scene. For example on a black background, you can use red, green and blue to create 3 masks in a project in PS or w/e.

For example, lets say we use "green" to paint where we want buildings, or their surface shaders to go, red where dikes/ditches go, and blue where roads go. And in another project you could use RGB to create different farm patches based on your first map as an overlay. In terragen, you now have two images with 6 masks for your scene.

N-drju

Clever method for a multiple mask like you describe. But it seems like going to great lengths when a very trivial thing is needed. Which is the case here - adding just a little bit definition to one of the colours.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

WAS

You could probably say the same for making a manual adjustment to transparency per image map just to use that as a mask, and that transparency being driven by the buggy hardstep of alpha.

N-drju

Didn't really notice anything "buggy" about it. Whatever works, as they say...
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Matt

What is "the buggy hardstep of alpha"? There was a bug in the RTP but it was a bug in the RTP, not the shaders, and it it was fixed a while ago.
Just because milk is white doesn't mean that clouds are made of milk.

WAS

#8
I always have to explain this every time it's brought up. Alpha is hard. Create a Cloud map in PS. Load it up, create transparency from colour... This is why was having issues using PFs and alpha with caustics based on water, or default shader and transparent materials (with transition).

Even with the hard shape tool in PS the blue squares have a blue border when using blue as a key, when you up tolerance it doesn't effect it until it bounces PAST this blue by a pixel it seems, and any further starts intersecting brown and red, with no blue in the channels (in my example file above)

Also quick edit is posting to a 404.

Dune

I used an RGB dots map to spread the pops of reindeer. I think it's possible to make RGB maps by fractal in TG itself, but it depends on how blue blue is, and how red red and how green green. Never did that actually.

WAS

#10
Quote from: Dune on April 25, 2020, 01:54:56 AMI used an RGB dots map to spread the pops of reindeer. I think it's possible to make RGB maps by fractal in TG itself, but it depends on how blue blue is, and how red red and how green green. Never did that actually.
This is why I love the new constant colour with the RGB sliders. I have a new dense population mixer using them and works much better than my original setup using PFs and guessing true RGB colours off the wheel (though there is a slider mode I never use, go figure).

Creates nice naturalization for dense forests or fields.

N-drju

Why would you need to "guess" RGB colours, when you can just use a greyscale image or function and shades of it? I don't get it. I mean, if pop masks is what is being discussed...
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

WAS

#12
Because a not true red, green, blue, will not be 1 in scalar form. And you only get that grayscale value from the colour. Just like if the masks aren't hard (contrast) they will create mixed tones.

Additionally, getting 100% coverage map out of random gray scale masks is a chore when you can use RGB comprising a 100% map at 1, and pull each channel out.

WAS

Here is an example I did awhile back. There are 6 populations, controls by 1 RGB map. It's translated for the forest to "randomize it" from POO used for the field. But that isn't really needed when using such a dramatically different species (a tree), I just did it for sake of example.  The result is full coverage, and randomization between objects.

Matt

Quote from: WAS on April 24, 2020, 11:33:29 PMI always have to explain this every time it's brought up. Alpha is hard. Create a Cloud map in PS. Load it up, create transparency from colour... This is why was having issues using PFs and alpha with caustics based on water, or default shader and transparent materials (with transition).

Even with the hard shape tool in PS the blue squares have a blue border when using blue as a key, when you up tolerance it doesn't effect it until it bounces PAST this blue by a pixel it seems, and any further starts intersecting brown and red, with no blue in the channels (in my example file above)

Also quick edit is posting to a 404.

Ah yes, there are two places where this happens.

1) At the moment (v4.4) the renderer takes continuous opacity values and turns them into either 0 or 1 when they are rendered. (This doesn't happen for shadows, they can be continuous. And the RTP doesn't do this either, and it represents what I want the full render to do in future.)

2) The Image Map Shader's "transparency key" feature creates an opacity of either 0 or 1.
Just because milk is white doesn't mean that clouds are made of milk.