Planetside Software Forums

General => Terragen Discussion => Topic started by: reck on October 18, 2009, 03:11:19 PM

Title: Controlling the grass
Post by: reck on October 18, 2009, 03:11:19 PM
I'm controlling the placement of grass through a distance shader which is working ok. However the grass is growing through all the fake stones in the scene. How can I continue to keep the grass placement through the distance shader but on top of this tell it not to show grass where there are fake stones?

Thanks
Title: Re: Controlling the grass
Post by: reck on October 18, 2009, 03:24:14 PM
Here is the node network.

I've highlighted the 2 nodes that should control the grass placement along with the grass population itself. As you can see at the moment the grass is controlled just via the distance shader. I also somehow need to tell the grass population to not grow where the Fake stones are (fake stones shader 01).
Title: Re: Controlling the grass
Post by: dandelO on October 18, 2009, 03:48:56 PM
I'd think you could make your distance shader the colour function(or possibly child layer) of a surface layer(delete fractal breakup, it's not required for this), then use the invert of the fake stones as its blending shader. So the surface layer is now only going to appear where the distance shader says but not where there are stones. I can't make anything to describe it just now but something like that should work.
Title: Re: Controlling the grass
Post by: aymenk2003 on October 18, 2009, 07:04:59 PM
As dandelO said ...I want to add something ...
when you duplicate the fake stone shader give it a white color...


N.KAID
Title: Re: Controlling the grass
Post by: reck on October 19, 2009, 04:31:38 PM
dandelO I just tried your suggestion but the grass is still coming out the fake stones. As you can see from the screengrab I created a surface shader (deleted the fractal breakup) and connected up the existing Distance shader 02 to the colour function. Then I connected up the fake stones shader as the Blend shader and inverted it. I also tried connecting up the distance shader as a child layer of the surface layer but it didn't make any difference, it looks like it's ignoring the blend shader all together. Can you see where I might have gone wrong?

aymenk what do you mean duplicate of the fake stone shader? I'm using the single fake stone shader is already used in the node network earlier, not a duplicate.
Title: Re: Controlling the grass
Post by: dandelO on October 19, 2009, 05:17:51 PM
Yes, I'm sure Njeneb is right. I should have said to duplicate the stone shader so it isn't plugged into a previous chain. If you use the same one it will take data from all previous shaders, too(in this case, te entire surface of the planet).
That should help.
Title: Re: Controlling the grass
Post by: reck on October 22, 2009, 03:48:51 PM
Well i'm still not getting this to work, even after following the instructions from dandelO and aymenk2003. This time,as suggested, I made a copy of the fake stone shader, made the colour pure white and attached it as a blend shader to the surface layer. This has no effect and the grass continues to grow through the rock exactly as before.

Can you see where i'm going wrong?

Title: Re: Controlling the grass
Post by: Henry Blewer on October 22, 2009, 04:57:30 PM
I use the distance shader in the Blend by Shader of the Surface layer. Connect the fake stones into the distance shader in its own Blend by Shader. You may still have to invert the fake stones.
So, it flows like this:                              Surface Layer-> Blend by Shader [distance shader]
Now open the distance shader:                Distance Shader -> Blender by Shader [fake stone shader]                       
Title: Re: Controlling the grass
Post by: reck on October 23, 2009, 03:59:29 PM
But njeneb the Distance shader doesn't have a "Blend by shader" option!

Title: Re: Controlling the grass
Post by: Henry Blewer on October 23, 2009, 04:33:42 PM
Sorry, I have some flu or something. I meant distribution shader. My brain took a vacation....
Title: Re: Controlling the grass
Post by: reck on October 24, 2009, 04:36:10 AM
Sorry njeneb I don't understand. Are you saying I need to add a distribution shader now? If so what am I doing with it?
Title: Re: Controlling the grass
Post by: littlecannon on October 24, 2009, 05:52:14 AM
Are you inverting the stones shader you're using as a mask? If not the the stones you have made white would tell the grass to grow on the stones and not around them. You would need to invert the mask to make the stones black and the surrounding areas white. Hope this helps a bit. You could also make the stones in the mask a fraction bigger, so you could get a "bald spot" around where the stone is lying... maybe.

Cheers,
Simon.
Title: Re: Controlling the grass
Post by: Henry Blewer on October 24, 2009, 08:32:06 AM
If I have fake stones, I use the slope function of the distribution shader to keep the grass off the stones. It won't work for the small scale stones, but if you have large scale stones it works fine. I give the distribution shader a maximum slope of around 10. The smaller scale stones won't have enough slope to stop the grass, but the large ones will. For really huge stones, the grass will grow on the top of the stones. This is ok with me, larger stones often get covered by soil. I wish I could run a task of T2, but the computer is already running two instances of the program. I will make a demo tgd file for you so you can see what I do in use.
Title: Re: Controlling the grass
Post by: reck on October 25, 2009, 08:57:53 AM
HI litttlecannon, yeah I inverted the stone shader.

njeneb I like the sound of this, especially as no other method of keeping the grass off the stones is working. It doesn't really matter about the small stones, it's the bigger ones that are causing the problems. An example would be nice.

I wish there were a simple way to stop objects, grass, flowers, trees whatever from growing on fake stones. Just a checkbox within the fake stones shader object saying something like "prevent objects appearing" would be cool.
Title: Re: Controlling the grass
Post by: Henry Blewer on October 25, 2009, 09:03:49 AM
There is this way also. Make a new Surface Layer for just the fake stones. Turn off the color of the Surface Layer. Now use the Blend by Shader input to cause the grass to 'grow' on the previous layer (I usually name one layer 'Grasses' even if the color is not green)
The fake stones should cover/mask the grass objects out.
Title: Re: Controlling the grass
Post by: Dune on October 25, 2009, 12:55:24 PM
I think the problem may be that the fake stones are 'grown' from one tiny position. So even if you blend your grasses by them, they will still grow just besides these tiny positions, hence through the stones. If you get my point. Perhaps if you use a PF to distribute your fake stones that (inverted) would be the ideal blender for the grasses? Perhaps slightly change the color to get more black (=less grass).

---Dune