HELP ~ How do I mask a Function Group?

Started by cyphyr, April 27, 2008, 06:49:57 AM

Previous topic - Next topic

cyphyr

Hi Gang
I just made the cracked earth tutorial from the http://en.tgblog.de/ site but I want to restrict it to a road.

I can use a surface layer to restrict it by slope or height but this is not what I want. I have a path as illustrated by the proxy jpg below that I want to use as the "mask" or "blend shader" but I can see no way of implementing it.

Is there any way of masking off a function group via an image map?

If you could jump in Matt or Jo and let me know if I'm just trying the imposible here or if not could someone give me a clue as to how this should be done.

Thanks in advance

Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Tangled-Universe

Hi Richard,

This should be it I guess :)
Activate the color in the 'cracks base' node to see the masking.
Good luck!

Martin

cyphyr

Cheers mate, I'll give it a go when I get home.
Thanks
Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

cyphyr

Well I tried your file and it works "ok". It would seem that the Fraclal Breakup shader on a Surface layer performs in a similar way to a blend shader channel but not exactly the same. I had to set the Fraclal Breakup to 0.25 as at the default setting (0.5) it was still bleeding into the "masked" areas.

I really would like to work out a fool proof masking solution. The "Blend Channel" works ok with BW/Grayscale images and well (although somewhat unpredictable) with power/cloud fractels etc However the Surface Layer seems to have no such functionality (or I just cant get the logic of how it should work). In my example it would be easy to make the road/river bed with a couple of image maps (mask, colour and bump/displacement) but I would like to be able to use the function method as it would be more detailed.

Thanks again

Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Tangled-Universe

I think I do not really understand what you mean?
As far as I can tell the settings in the crack base node are 0.5 for coverage and 1 for fractal breakup. This is the 'default' way of using an imagemask onto a surfacelayer and results in max coverage within full control of the fractal breakup. The bleeding into masked areas is minimal. Those blurry edges always exist when using imagebased masking because of internal processing by TG self if I'm correct.

Oshyan

Blurry edges would be due to interpolation of the original image size. This can be turned off in the Image Map Shader under the Colour tab, Smooth Interpolation option.

For Fractal Breakup, 0.5 coverage and 1.0 Fractal Breakup should give you "full" coverage, but I believe it handles input values above and below 1 and 0 respectively such that you might get some "bleeding". Hopefully Matt will correct me if I'm wrong on this one. ;)

- Oshyan

cyphyr

THanks
I found a solution that works much better using a merge shader set to (Multiply input a difuse colour)
I'll post a tgc when I get the chance.
Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

rcallicotte

Please post your solution.  Seeing the multiple ways to do what we can with this is amazing.


Quote from: cyphyr on April 29, 2008, 08:38:13 AM
THanks
I found a solution that works much better using a merge shader set to (Multiply input a difuse colour)
I'll post a tgc when I get the chance.
Richard
So this is Disney World.  Can we live here?

bigben

#8
Quote from: Oshyan on April 28, 2008, 11:11:51 PM
Blurry edges would be due to interpolation of the original image size. This can be turned off in the Image Map Shader under the Colour tab, Smooth Interpolation option.

For Fractal Breakup, 0.5 coverage and 1.0 Fractal Breakup should give you "full" coverage, but I believe it handles input values above and below 1 and 0 respectively such that you might get some "bleeding". Hopefully Matt will correct me if I'm wrong on this one. ;)

- Oshyan

Leaving antialiasing on keeps the edges smooth. Another approach is to increase the contrast of the antialiased image. Feed the image node into a colour adjust node and set black point = white point Adjusting the actual value used will control the width of the edge. Still not sharp enough? Feed it into another colour adust node and set both values to 0.5, or adjust the gamma in the first colour adjust.

Then think black = 0, white = 1. Function X 0 = 0, Function x 1 = Function. Connect with function via multiply scalar, use as a blending shader, fractal breakup etc...

The blending shader (and possibly the fractal breakup) handle values outside of the 0-1 range. In the colour adjust node, also clamp black and white (ie clamp 0 1). I discovered this the hard way when creating my TER masking function but once you're aware of it it's not a problem.

cyphyr

Sorry I will post my solution but I have no internet connection other than the public one at the local cafe so its difficult (read hassell!) to get files from my main pc to the laptop.
Richard

Quote from: calico on April 29, 2008, 09:18:56 AM
Please post your solution.  Seeing the multiple ways to do what we can with this is amazing.


Quote from: cyphyr on April 29, 2008, 08:38:13 AM
THanks
I found a solution that works much better using a merge shader set to (Multiply input a diffuse colour)
I'll post a tgc when I get the chance.
Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)