Planetside Software Forums

General => Terragen Discussion => Topic started by: Aenea on April 12, 2007, 04:18:50 am

Title: how to....create a path on a surface layer?
Post by: Aenea on April 12, 2007, 04:18:50 am
Hi folks!

Hope someone can help me with this...

The question is...: I have a surface layer with an image shader (something like rocky ground or soil, or grass), now I want a path going through it (by using a texture of stones, gravel or so)...but how does that work?

First I thought by restricting a new surface layer to specific heights (using the alteration) could work, but when I have an almost plain surface this of course doesn´t work.....

I think maybe adding the surface layer with grass/soil etc, then adding a mask? But I have no clue at the moment how this should work....
I can imagine that when I´m able to add a mask or so, I can fill the part which shows the path with a second image map shader that is my path (like gravel or stones).

I hope this doesn´t sound too confusing....can anyone help me with a quick description how to achieve that, please???

Aenea

Title: Re: how to....create a path on a surface layer?
Post by: Will on April 12, 2007, 04:47:15 am
hmm well you could make a hite paths on a tart backround and use that as a kind of alpha that would restrict your stone texture to the area. you would need an image file shader with opacency as transparity and have that maybe leading into the texture node...I don't really know I would have to lay it out myself but I did somthing simular a while back using such a technqiue to give a planets continets with displacement and color but also making the water reflective.

Regards,

Will
Title: Re: how to....create a path on a surface layer?
Post by: RealUser on April 12, 2007, 04:51:54 am
This is a tutorial that may can help you.
http://www.ashundar.com/page.php?id=303 (http://www.ashundar.com/page.php?id=303)
Title: Re: how to....create a path on a surface layer?
Post by: Oshyan on April 12, 2007, 01:40:36 pm
It should be fairly simple to paint a black and white mask image in an image editor such as Photoshop and then use this as a Blend Shader, Fractal Breakup or Density Shader for an Image Map Shader, Surface Layer, or Fake Stones node (respectively).

- Oshyan
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 13, 2007, 03:18:55 pm
So far so good....but how do I make it appear in the right position?

The path doesn´t appear anywhere???? I want it at the left side, on the green.....any ideas what I made wrong?

edit: I tried it with position, but nothing happened...btw....you can see the picture clearly if you zoom.....

Aenea
Title: Re: how to....create a path on a surface layer?
Post by: child@play on April 13, 2007, 03:23:05 pm
have you tried projection through camera yet?
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 13, 2007, 04:48:46 pm
yeah....same effect....nothing appears....
Title: Re: how to....create a path on a surface layer?
Post by: child@play on April 13, 2007, 04:50:10 pm
hm, try to make the black path white then, when you think of clouds, black is where nothing appears :)
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 13, 2007, 05:18:07 pm
problem is....when I make the path white....the grass/rock surface appears in it.....
Title: Re: how to....create a path on a surface layer?
Post by: child@play on April 13, 2007, 05:27:46 pm
which image map is the path-mask? make sure it's the second one, and, you have to set up your nodes different i think, take a fake stone layer for example, make it child of the surface layer and the image mask has to be the fake stones blending shader. just a wild guess since i'm rendering atm


edit: have a look here, think bigben has been doing the same thing  http://forums.planetside.co.uk/index.php?topic=1285.0 (http://forums.planetside.co.uk/index.php?topic=1285.0)
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 13, 2007, 05:33:47 pm
okay....I attached the tgd without textures and the lighthouse isn´t in it, deleted the obj, so there would be no probs with any objects....

I hope someone can figure out what´s wrong there....I really don´t have a clue...  ???

Aenea
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 13, 2007, 05:44:50 pm
Well....I got my mask working now.

I added the image mask as second image map shader to my surface layer.
So the mask appeared correctly now....but the grass/rock layer doesn´t appear on the white of the mask...hmmmm
jesuuusss....this has to work I know it..... :P

Aenea


Title: Re: how to....create a path on a surface layer?
Post by: bigben on April 13, 2007, 09:27:54 pm
Have a look at http://forums.planetside.co.uk/index.php?topic=864.msg8415#msg8415 (http://forums.planetside.co.uk/index.php?topic=864.msg8415#msg8415). The sample file there may help. I haven't downloaded your file 'cos I'm just passing by.  ;)
Title: Re: how to....create a path on a surface layer?
Post by: child@play on April 13, 2007, 10:54:24 pm
you forgot to put the terrain file in the archive, so i just created a heightfield. is this the look you're after?



Title: Re: how to....create a path on a surface layer?
Post by: Oshyan on April 16, 2007, 01:40:30 am
Aenea, you're 99% of the way there. All you need to do now is turn off "Fit Blend Shader To This" in your texture Image Map Shader (the one that loads b14galenslater035.jpg) and then in the Image Map Shader that uses the path.jpg simply specify a position and size (on the Projection, location tab). The size should be the size that you want the path/masked area to be *in meters*. The position should of course correspond to where you want it to show up in your scene. Use the 3d preview mouseover coordinate info to help in positioning your mask image.

Post again if you have further problems.

- Oshyan
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 16, 2007, 04:58:30 am
geeez....thanks a lot guys....
I wasn´t home this weekend so aI hadn´t the chance to take a try... will do that tonight when I´m home....but I think I´ll get there with all your help...

@child@play

this looks exactly the way I wanted it.....I´ll give it a try....

@Oshyan

Thanks I give it a try this evenin´


sorry for forgetting the terrain.....argh....I knew I forgot something to add *lol*


Aenea
Title: Re: how to....create a path on a surface layer?
Post by: child@play on April 16, 2007, 05:37:32 am
what oshyan said sounds easier then what i did  ;D, though i didn't have to do much aswell, here's the tgd in case you need it
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 16, 2007, 06:29:08 am
ahhh, thanks a lot child@play...incase one doesn´t work I have a second chance to try *lol* ;D

Thanks for the tgd!

Aenea
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 16, 2007, 03:20:49 pm
I got it now....

okay....now I have the path....and how can I put another, different shader on it so I have a path (made of stones)?
Do I have to change the image mask that way then?
Cause the problem is.....the path is black, so it appears on the green, but changing it to white would make the green appear...not another image.....
I hope you understand what I mean?!?!?

Aenea

edit: I´m trying to change the base colour by blending it with another image shader so it appears as path now....looks like it works on the first sight....I´m rendering it to get a better view.....
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 16, 2007, 04:17:28 pm
nope----


there are some strange effects in the picture now....
If I mask the image shader galenslater.jpg with the image shader path jpg....the path image shader size restricts the galenslater image shader as well....having the effect that on the right side, next to the path the galenslater image shader appears to be "cut".
just take a look on the screenshot and the rendered picture....
I don´t now what´s wrong now....

The path appears, but as well there are different "shadows", assumingly from another surface layer (the base color maybe, cause it´s the same grey color)
Title: Re: how to....create a path on a surface layer?
Post by: Oshyan on April 16, 2007, 04:37:54 pm
Use the Image Map Shader *only* on the surface layer (or Fake Stones) that you want to represent the path. In other words that layer should not be the child of another layer. If that doesn't address the problem I'm not sure quite what's going on but it seems like a simple error in one of the settings. I would suggest gaining more familiarity with masks in general in a simpler scene, start with the basics.

- Oshyan
Title: Re: how to....create a path on a surface layer?
Post by: duff on April 16, 2007, 05:22:27 pm
It looks like places people have strayed off the path to take photos though - more realistic
Title: Re: how to....create a path on a surface layer?
Post by: bigben on April 17, 2007, 02:07:51 am
Here's a tgd that simplifies things a bit.

If you think about the layers in TG then you should also think about when you actually need a mask, and when your overlying surface will cover the unwanted areas anyway.



Trying to create a gap in the green layer wasn't necessary because it would be replaced by the overlying surface anyway.

I added a shader to displace the path downwards and an overlying fake stones shader. The colour adjust shader on the mask image is thrown in partly out of habit, but also because it can make a difference to the rendered output with some types of shaders.  It's also handy for tweaking the edges of masks, although you don't really need it for this in this case.

The path-side patches of grey may also be due to the fractal breakup shader on the green layer creating small gaps, revealing the base colour below.
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 17, 2007, 04:24:57 pm
thanks guys for your help.....I´ll keep myself busy with it during the next days....think I have to learn a lot more about the functionality of the shaders and surface layers and and and.....

I´ll let you know about the progress.... ;)

Aenea
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 18, 2007, 04:21:38 pm
Okay guys!

Here we go! There´s only one problem left.....but I´ll talk about it in the end....
I got this damn path working INCLUDING a texture for the path itself YAY!!!!!!!!

okay, I describe quickly how I did it, you can also see it in the tgd attachment. I used a simple terrain for practise, but it´s 1:1 adaptable to my lighttower tgd....*lol*

Okay:

1. Created a Surface layer 01: -got a child layer named image shader map 01 (texture is galenslater.jpg)
2. Created a Surface layer 02: -checked fractal breakup and used an image map shader 02 as breakup shader (this is my path
                                           mask, the white-black mask, where the path is BLACK)
3. Created a Surface layer 03: -again checked fractal breakup and used an image map shader 03 as breakup shader (this time
                                           it the other path mask, the reversed path mask where the path is WHITE)
4. Checked "blend by shader" in the image map shader 03 and added an image map shader 04 with the texture for the path
   (path2.jpg)

Then I connected image map shader 04 to the input node of the image map shader 01 and VOILÁ....it´s done.

I´m almost sure that there´s surely another way to get the same results...but after fighting several evenings with this stuff I´m really happy that this part has worked for me now.

Okay, I talked about this "little problem".
As you see in the attached picture, the path is wonderful in the middle of the picture (meaning that the size is at 1 in the settings).
Well, for my special lighthouse tgd, I need the path smaller and down the left corner, so I scaled it down to 0.43....yeah, with the effect that not only the path went smaller....everything else went smaller too, meaning my surface layer 01 with the galenslater image texture as well....it is only one quarter of the former size, the rest is all black....and I´m sure that´s the reason why in the preview these black parts appeared as path.jpg....
So my question is: What can I do to scale the size of the image mask down so my path has the right size but doesn´t cut off the image textures? There are pictures in the attachment to show you what I´m referring to. Maybe someone has an idea?
It´s the same problem I already had before....but I think these pictures are much clearer showing what I mean....(I kept the textures a bit unrealistic huge, but so you can see it more clearly)

I hope my little instruction can help others to avoid these troubles *lol*
Otherwise...if there´s an alternative way....I´m listening *lol*

Hope someone can help me to overcome this last problem

Thanks for all your help....all your advises lead me finally into the right direction....but sometimes you have to sit down and try like hell what every little checker, addition etc does to your picture....it´s a real challenge to figure some things out.....puhhhh

Aenea


Title: Re: how to....create a path on a surface layer?
Post by: bigben on April 18, 2007, 07:06:26 pm
You're still over-complicating things ;)  (Masking too many things)

The *only* thing you need to mask is your path texture. Here's a modified TGD from my previous sample with the path texture and image map relocation added. I left the fake stone shader in for additional reference although it's disabled.

Also, once you have added an image map, you can link it in to multiple input nodes so you only need to add each image once.  There is also a tick box on the blend shader/fractal breakup options to reverse the mask so you also only need one version of a mask image.
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 19, 2007, 04:04:04 am
 ;D Hey, I´m a woman....I am complicated *lol*

I´ll take a look at it...the easier the better....but the way I did it I learned a lot about the functions of the single layers, shaders etc., so it wasn´t useless in the end...

does this also correspond with this little problem I still have? Any solution, suggestion for that?

Aenea
Title: Re: how to....create a path on a surface layer?
Post by: bigben on April 19, 2007, 04:34:31 am
This should fix all of the problems in your TGD.
Title: Re: how to....create a path on a surface layer?
Post by: Aenea on April 19, 2007, 03:15:40 pm
Hi Bigben!

Yes it did. Thanks so much.
I reworked your tgd and everything is right now!

The theory behind I have still to understand, but I think I will learn it.... ;)

mainly I try to understand what the fake stone shader did that a normal surface layer doesn´t and the reason why you used a colour adjust shader....it´s so much to understand for a Newbie.....jesus.....

But I have a guideline to get these things done in future....THANKS THANKS THANKS!!!!!!

Aenea
Title: Re: how to....create a path on a surface layer?
Post by: bigben on April 19, 2007, 07:42:30 pm
Quote from: Aenea on April 19, 2007, 03:15:40 pm
Hi Bigben!

Yes it did. Thanks so much.
I reworked your tgd and everything is right now!

The theory behind I have still to understand, but I think I will learn it.... ;)

mainly I try to understand what the fake stone shader did that a normal surface layer doesn´t and the reason why you used a colour adjust shader....it´s so much to understand for a Newbie.....jesus.....

But I have a guideline to get these things done in future....THANKS THANKS THANKS!!!!!!

Aenea


Glad to hear you have it working.  The fake stone shader adds "fake" 3D stones rather than just a coloured surface. I disabled it in the last file I posted because it wasn't needed. I left it in just for reference on where to plug the image into.

The colour adjust shader is included partly out of habit. I use them for two reasons.
1: http://forums.planetside.co.uk/index.php?topic=864.0 (http://forums.planetside.co.uk/index.php?topic=864.0)


and 2: By adjusting the white and black levels you can change where the border appears when you're using a greyscale mask with more tonal detail.  It can also be used to "sharpen"  a mask created with a low resolution image as it works on the antialiased image that TG creates rather than the actual image.

Both of these may be  a little technical for you at the moment and you can always just leave it out.