Author Topic: Merge shader, or something else?  (Read 921 times)

Offline N-drju

  • Member
  • *
  • Posts: 861
  • Changes, changes, changes...
Merge shader, or something else?
« on: June 23, 2017, 10:58:50 AM »
So I've got two painted shaders named ROADS and TOWN.

TOWN is a painted area where building populations are to be "planted", while ROADS... yeah, you guessed it.

Question: How can I use the TOWN shader to mask the building population and at the same time exclude the ROADS shader from its coverage? Obviously, you don't want houses popping up in the middle of the main street...

I tried to merge both painted shaders via merge shader but, believe it or not, regardless of what option I chose and how I arranged both shaders I ended up with populations limited to the streets only... The TOWN shader was completely disregarded, whether it was difference, subtract or screen mixes...
"I don't know what 'pokygon' is but I like it."

Offline Hannes

  • Member
  • *
  • Posts: 3575
Re: Merge shader, or something else?
« Reply #1 on: June 23, 2017, 11:53:58 AM »
You can use a distribution shader or a simple surface layer with color turned off.
Use your first painted shader as breakup shader, set coverage to 0.5, and fractal breakup (the value below) to 1. Then use the other painted shader as mask shader. Maybe you'll have to invert one of them.

Offline Dune

  • Member
  • *
  • Posts: 12735
  • Corkscrew Bird
    • www.ulco-art.nl
Re: Merge shader, or something else?
« Reply #2 on: June 23, 2017, 12:05:52 PM »
Or use a (blue node) subtract node, and subtract the road mask from the town mask. Or add the town mask as child to an empty surface shader, inversely masked by road shader. Plenty ways.
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline René

  • Member
  • *
  • Posts: 300
Re: Merge shader, or something else?
« Reply #3 on: June 23, 2017, 01:05:40 PM »
So I've got two painted shaders named ROADS and TOWN.



I tried to merge both painted shaders via merge shader but, believe it or not, regardless of what option I chose and how I arranged both shaders I ended up with populations limited to the streets only... The TOWN shader was completely disregarded, whether it was difference, subtract or screen mixes...


Maybe this is a silly remark, but I assume you merged the color and NOT the displacement. It happens to me occasionally... :)

Offline bobbystahr

  • Member
  • *
  • Posts: 8082
  • Turn, and face the Strange Ch Ch Changes...D Bowie
Re: Merge shader, or something else?
« Reply #4 on: June 23, 2017, 01:06:58 PM »
They got the ones I have used
something borrowed,
something Blue.
Ring out the Old.
Bring in the New

bobbystahr

Offline N-drju

  • Member
  • *
  • Posts: 861
  • Changes, changes, changes...
Re: Merge shader, or something else?
« Reply #5 on: June 23, 2017, 01:23:35 PM »
Wow, thanks for a reliable and quick support guys!

@ René - Does it make a difference? I must admit I did uncheck the displacement, since I understood the object masking is a black-and-white color business...? :)
"I don't know what 'pokygon' is but I like it."

Offline René

  • Member
  • *
  • Posts: 300
Re: Merge shader, or something else?
« Reply #6 on: June 23, 2017, 01:50:57 PM »
No, if the color is checked it doesn't make a difference wether you check or uncheck the displacement tab. It has happened to me that I was accidentally mixing the displacements and wondered why the heck the masking didn't work. ;)

Offline N-drju

  • Member
  • *
  • Posts: 861
  • Changes, changes, changes...
Re: Merge shader, or something else?
« Reply #7 on: June 27, 2017, 12:50:21 PM »
You won't believe it... :-\

None of the solutions worked because... the painted shader was navy-blue in color! Apparently TG was reading it as a black "no effect" area. I had no idea the color of a painted shader has any meaning!
"I don't know what 'pokygon' is but I like it."

Offline bobbystahr

  • Member
  • *
  • Posts: 8082
  • Turn, and face the Strange Ch Ch Changes...D Bowie
Re: Merge shader, or something else?
« Reply #8 on: June 27, 2017, 03:40:26 PM »
You won't believe it... :-\

None of the solutions worked because... the painted shader was navy-blue in color! Apparently TG was reading it as a black "no effect" area. I had no idea the color of a painted shader has any meaning!


Live and Learn eh!
something borrowed,
something Blue.
Ring out the Old.
Bring in the New

bobbystahr

Offline bobbystahr

  • Member
  • *
  • Posts: 8082
  • Turn, and face the Strange Ch Ch Changes...D Bowie
Re: Merge shader, or something else?
« Reply #9 on: June 27, 2017, 04:26:32 PM »
You won't believe it... :-\

None of the solutions worked because... the painted shader was navy-blue in color! Apparently TG was reading it as a black "no effect" area. I had no idea the color of a painted shader has any meaning!


Check this out, when painting the shader I changed colours for the 2nd shape. I also loaded this as the colour map and the mask, play around with inverting those to see what happened. The Painted shader can do many more things than suspected
« Last Edit: June 27, 2017, 04:28:03 PM by bobbystahr »
something borrowed,
something Blue.
Ring out the Old.
Bring in the New

bobbystahr

Offline N-drju

  • Member
  • *
  • Posts: 861
  • Changes, changes, changes...
Re: Merge shader, or something else?
« Reply #10 on: June 28, 2017, 06:46:06 AM »
Live and Learn eh!

Right on.

Yeah, I mean I find it very useful at numerous occasions. Even painting (masking) clouds with it occasionally.

The color setting in Paint Shader though is just a gimmick if you ask me. Since it can make so much difference, there is really no reason why you should be using it... Unless you use it as a texture or surface color, sure. Maybe then.
"I don't know what 'pokygon' is but I like it."

Offline Oshyan

  • Planetside Staff
  • *
  • Posts: 11746
  • Holy snagging ducks!
Re: Merge shader, or something else?
« Reply #11 on: June 28, 2017, 09:03:44 PM »
The color options in the Painted Shader can actually be quite useful. People think of it just as a mask, but you can use it to directly paint color, texture tint, population tint, and other things. It's really no different than how the Power Fractal can output color (other than just black or white). Just something to be aware of so you use it correctly.

- Oshyan

Offline bigben

  • Member
  • *
  • Posts: 2129
  • The Long Stranger rides again
    • Tinkering with Terragen
Re: Merge shader, or something else?
« Reply #12 on: July 14, 2017, 12:57:28 PM »
You can also use colour to draw combined/overlapping masks e.g. red, green and yellow...  Use function nodes to pull out the red and green to scalars and use yellow (or white) wherever you want to draw overlaps without having to use extra functions. In some situations this can be an easier way to visualise the mask as you draw it.

Offline bobbystahr

  • Member
  • *
  • Posts: 8082
  • Turn, and face the Strange Ch Ch Changes...D Bowie
Re: Merge shader, or something else?
« Reply #13 on: July 14, 2017, 02:00:29 PM »
You can also use colour to draw combined/overlapping masks e.g. red, green and yellow...  Use function nodes to pull out the red and green to scalars and use yellow (or white) wherever you want to draw overlaps without having to use extra functions. In some situations this can be an easier way to visualise the mask as you draw it.

Good one Ben, never thought of the function nodes as I'm BlueNodeAdverse as I'm, math disabled due to a crappy educational system.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New

bobbystahr

Offline ajcgi

  • Member
  • *
  • Posts: 377
    • My little blogsite
Re: Merge shader, or something else?
« Reply #14 on: July 14, 2017, 05:28:38 PM »
Good lord! After all these TG projects I've worked on... never thought to use coloured painted shaders like this.