Planetside Software Forums

General => Terragen Discussion => Topic started by: Aenea on October 30, 2007, 09:39:48 am

Title: mask layer part 2: appearance problems
Post by: Aenea on October 30, 2007, 09:39:48 am
Hi guys (again *lol*)

After solving the previous problem, I wanted to put the mask layer on this first surface layer now.
I´m not quite sure if I am right by adding the black/white mask as child-layer (image map shader).
I did that, and put it on top before all other child surface layers follow.
So I have:
Surface Layer 1
    Image map shader
    Surface Layer 2
    Surface layer 3
    .......

but I couldn´t convince it to appear anywhere???

Do you have any ideas what I can try? Or did I do something completely wrong?

I really appreciate any advice...really....sometimes I feel lost in the try to get everything in the right order to make it appear....

If I have the mask layer, and I want to make another image (let´s see a floor) appear, I only have to use the blend by shader option, right? That´s what seem to work always.....


Thanks so much

Aenea
Title: Re: mask layer part 2: appearance problems
Post by: bigben on October 30, 2007, 06:13:13 pm
Any chance of seeing a TGD or a clip of the part you're having problems with. The image map aren't needed as long as we know which bits are for rendering and which bits are for masking.
Title: Re: mask layer part 2: appearance problems
Post by: dhavalmistry on October 30, 2007, 06:43:50 pm
I am not great on the masks but should the mask be plugged into blending shader and not into child layer??
Title: Re: mask layer part 2: appearance problems
Post by: bigben on October 30, 2007, 06:49:51 pm
It partly depends on how many nodes make up your mask, although in this case it sounds odd.
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on October 31, 2007, 03:20:31 am
´Lemme explain:

I have a Surface Layer (Layer 1) connected to the Base color.
Then I do have more surface layers as Child of this Surface Layer (Layer 1)
A part of these child surface layers are also Fake stone shaders (as child layers of the last child surface layer in this row).
What I want is an image mask on all of them so I have a space where none of the properties of all these layers appear (I want a ground for my abbey object). No colour of these layers, not the stones.

How do I do that? I posted the node network in the previous thread (mask layer).

Maybe it´s more clear now what I intend to do.

Greez
Aenea


Title: Re: mask layer part 2: appearance problems
Post by: bigben on October 31, 2007, 04:27:53 am
I'll go and have a look at the other post, but a quick answer to what I think you're doing....

If you want to mask all of the child surfaces with the same mask, simply set up your mask image and then connect it to the fractal breakup of the parent surface shader. Set the coverage to 0.5 and fractal breakup to 1.  If the masking is the wrong way around, just tick the invert breakup box.

Should you find that the fake stones are still popping up outside of the masked area, connect your mask to the bland shader of the fake stones layer as well, checking Blend by shader and invert blendshader if you inverted your breakup above.
Title: Re: mask layer part 2: appearance problems
Post by: bigben on October 31, 2007, 04:40:02 am
I think part of the problem we've had deciphering your node network image is that it appears to be stacked upside down... ie. the outputs have to go up to the next input. This makes it a little hard to see which nodes are connected to which inputs. I think my previous answer should do what you want
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on November 06, 2007, 04:04:39 am
Okay....

Thanks for your answers and I tried to do exactly that, but nothing appears yet, I try to explain what I have done:

I used the Fractal Breakup of my parent surface layer.
There I added an image map shader under
Scale: Blend by shader (blend by shader is checked)

The image shader is my mask: all black with a white spot where my stone plaster should appear later.

Then I again checked the blend by shader option and used another image map shader on this mask. An image with a pattern of my plaster stones. (blend by shader is checked again.)
To see it appear I used a pure pink picture.

Well, nothing appears....
I attached this to every fake stone shader as well....nothing.

hmmmmm.
I attached a node network with some explanations..... maybe this helps a bit...but I fear that I might have forgotten to check any box out there...like the last time.

Aenea
Title: Re: mask layer part 2: appearance problems
Post by: bigben on November 06, 2007, 04:29:34 am
If you want to email me the tgd I can have a look at it for you. There may be something minor that is stopping this from working. My email address is in my profile.
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on November 06, 2007, 04:41:10 am
ohh...that´s nice...I´ll do that......

Thanks a lot

Aenea
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on November 06, 2007, 07:13:31 am
I detected a first mistake maybe:

I placed the image wrong.

Now I used the mask layer under the parent surface layer under fractal breakup. coverage and breakup).

Going to the image shader I used the invert shader option it now appeared grey in my picture....but not the pattern I wanted to get on it with another image shader...(I used pink for it....).

If I delete the image map shader with the pattern it also works.

soooo close.....

Aenea
Title: Re: mask layer part 2: appearance problems
Post by: bigben on November 06, 2007, 08:54:21 am
Looking at your pic above, it appears that you have only one surface layer (Surface layer 05), of which everything else must be a child of this surface. All of those lines going off the edge of the image must eventually connect back to the child input of this layer. Unfortunately we can only track back one node to the first child layer (Surface layer 03). If you can post just the tgd we can at least follow the rest of the connections and probably locate the problem fairly quickly.
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on November 06, 2007, 09:47:18 am
The tgd is in the attachment.

I now see the spot on the picture where I want it (well almost....). Only fact is that it is grey...and I know that I have to put another image shader somewhere to get it work...hmmmmm.

But suddenly the terrain is very flat, my fake stones are flatter than before. Does the image or the mask have an impact in it???
Also it appears to me that the mask is still just put over everything......I also attached the last Quick Render I made with the current changes.

Okay....I think I just wait for you to take a look at it before I change more and running somewhere I don´t want to....

Thanks a lot guys!!!

Title: Re: mask layer part 2: appearance problems
Post by: bigben on November 06, 2007, 05:55:58 pm
OK, now we can see what you're doing  ;)

The attached screengrab shows the same network with a bit of rearranging to see where things were going. The groups don't fo anything. I just used them to collect things together and move them around.  I transferred the image names to their respective node names. I find this easier to locate the right image when connecting it up and help to avoid adding the same image more than once (I reconnected and then removed the duplicates ;))

The lost group will have no impact on the render at all as their outputs do not join up with the path from Base Colours to the Planet.

Surface layer 05 is masked with your image, and as everything else is a child layer of that, nothing will appear in the masked rectangle other than the Base Colours.

Surface layer 03 has no colour applied and doesn't really do anything. I'm guessing you were using it to join the surfaces with the fake stones. Think of fake stones as just another surface layer. You could connect the output of Surface layer 06 to the top fake stones shader and then delete layer 03.

All of your image maps have Through Camera as their projection. This is probably not a good idea for the stones, and makes masking surfaces around an object harder because the mask will move with the camera. Try setting them to Plan Y. For the mask image you will need to specify its size and position. I included some dummy figures, but it has the same position as the abbey object so it should be a reasonable starting point. For the stones you already have the repeat options checked, so you may just need to adjust the size.  Keep the numbers in the same proportion as your texture image.

I have no idea why the mask image is masked by Pink.jpg but there may be a reason.

The TGD I've attached has all of the surfaces linked inline. Try changing the order first or think carefully about whether a surface layer really is a child of another layer before relinking it. Hope this provides you with a starting point to get this going.

A couple of tips/suggestions:
Try thinking of the node network as the order in which things are processed, rather than the order that you want them layered. The things that you want on top should be processed last, so they should be at the bottom of the list.

When adding a node in the network view, right click on the node that will be connected to its input and then choose the type of node from the popup menu. This will keep things a bit neater ;)  You can also right click on the input triangles to automatically add and connect a node to them in one step, although you will usually want to reposition this one.
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on November 07, 2007, 06:29:04 am
Wow, that´s a lot of information....

Okay.

I think the best thing I can do is trying this from nearly the beginning. That´s what I have done now.

I sorted every kind of layer, shader etc like you have suggested (Thanks, this was the best idea ever!).

With that, I detected that some of my fake stone shaders weren´t truly connected and I changed that. I´m still fighting with some settings, as the nodes sometimes don´t go in the right place...*lol*.

I kept the fake stone shaders as child of layer 3, because I had those problems with the image maps placed on them. I read that in an older thread and it solved this problem with the misplaced image maps on it.... that´s the reason I haven´t put the fake stone shaders as normal child layers of my parent layer.

I succeeded that I now created the wanted gap between my fake stones by using the image mask not on the parent layer (Layer 5), but only on the fake stones.
The reason is, that by putting the image mask as part of the parental layer my stones went very flat and this effect troubled me a lot. I do not know how to change this effect, so I walked the easier way for me at the moment, by connecting the mask layer to every fake stone shader as blending shader.

Leaves me of course with the problem that the fake stones don´t appear in that spot, but my surface shader colours still do that. I think it must be possible to change that by connecting the image mask to them also, but my first tries weren´t very succesful. But I try on. And at last of course I need another image map with a plaster pattern (that´s what I used the pink.jpg for, to see it appear, but of course it doesn´t) to appear in the now empty spot.

At the moment I also kept the mask layer in the through camera view....it´s really not the optimum, I think that some problems with the size correspond with that too. I figure that out....I just have to work a bit more with it.

The current tgd is in the attachment to get you an overview what I have changed to the previous versions.

Thanks a lot for your suggestions BigBen, it gave me a truly better insight on the node network.....and first of all: tidying up is more important than you ever think.... a good lection to learn!

Aenea

So far so good.
Title: Re: mask layer part 2: appearance problems
Post by: bigben on November 07, 2007, 03:03:52 pm
Part of the reason why your rocks went flat is due to the pink image used as a blending shader on the image mask. This lowers the overall density of the mask, and thusreduces the amount by which the surface (with all of its child layers is appplied to the terrain. To have the surface fully applied you need to have white (=1) where you want the surface to be fully applied.

To make a mask follow these steps.

Make a white image 4x4 pixels.
Create a new surface at the bottom of the network, set the colour to black and coverage to 1.
Insert an image map loading the white image you just created, Projection = PlanY, size = 200,200, and set the coordinates to the same as your ruins.
Move the camera above the ruins and look down so that you can see the entire white square. Manually set the camera's orientation to -90,0,0
Turn off shadows
Render and save the image
Open the render and crop it to the edges of the white square
Now draw you desired sitribution map over the top of this so that black is around the edges and the inner distribution is white. Cover everything!
Set the image size to ...say... 1000 x 1000 pixels and save it as greyscale tiff, lzw compressed.
Back in TG, redefine the white image you inserted at the beginning to the new mask image.
This surface + image is now your mask. Disconnect the surface from the network, move it over to where your existing mask is and then connect the surface output to your masking inputs, inverting where necessary.
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on November 08, 2007, 04:14:50 am
Wow....

okay, I have some problems with the mask you described...

When I added the white image, it was much bigger than the ruins, and putting it to the same coordinates didn´t put the white image under the ruins, it only touched one edge...., but I changed the coordinations so it fit.
Then I rendered it and saved it.
Strangely it wasn´t exactly rectangular, the view wasn´t exactly 90°, cause I was able to see parts of the sides of the walls of the ruin.
Is it correct that the ruin has also to be on the render???

I´m not quite sure if I was able to follow the next steps. I imported it in paint (I don´t have another useful program on my business pc) and then...
Do I have to cut the white with the ruin completely out? I fear I didn´t get what I have to do then (seems my English failed me this time...I´m sorry).
If I have to cut it it´s the same I could do without rendering or? So I think this isn´t what I should do.... sorry sorry.....

Can you help me again please???

Thanks so much...

Aenea

The picture I rendered looked like that:

Title: Re: mask layer part 2: appearance problems
Post by: bigben on November 08, 2007, 05:28:40 am
You're doing OK ...yes the coordinates for the abbey are on one edge so you've done OK moving it.

I'd probably make the white square a bit bigger just to give you some more room to draw... unless of course you just want to mask close to the ruins. Rather than re-render, just increase the canvas size by a fixed per

The render of the white square won't be perfectly rectangular because of variations in the terrain, and the walls won't be perfectly straight either, but that doesn't really matter. All you really need is to be able to see where the walls touch the ground (which is where your mask will be).  You might find it a bit easier if you move the camera higher up and zoom in using the camera's field of view. That will make the walls straighter.  The most important thing is that you type in the numbers for the camera's orientation so that they are exactly 90,0,0

Step 1: Crop
[attachthumb=#1]
Close enough is good enough for now. For Paint, draw a selection to fit the white square and then Edit > Copy To and save the selection as a new file.

Step 2. Draw the mask.
Open the new file and start drawing your mask with a black or white brush. As our surface layer was black, make the outside of the image black...
e.g.
[attachthumb=#2]

The swap the white image in the tgd with the new mask image and then use the surface shader as your mask.
[attachthumb=#3]

I'd suggest you get a better program for working with images. There are some good free ones around and if you wait a few hours you should see plenty of recommendations coming in  ;) ... especially once someone mentions one (The Gimp) and others will join in and say "nah... I prefer this one..."
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on November 08, 2007, 06:16:07 am
Ahhhhhhhhh, thanks 1 000 000 times BigBen.....now I got you!!!!!

I have to polish my techn English a bit *lol* , well, it isn´t really technical English, but in everyday life I rarely use, distribution, crop etc. (I SHOULD learn it, hey I´m working with a 3d program, sheeesh).

At home I use Adobe Photoshop CS2, this is fine if it comes to mask working. But well, here at work I was happy that I was able to install terragen, normally I cannot install any program because of Admin rights. But as terragen doesn´t do a deep installation....I have something to do in breaks....*lol*.

Think this should work now....I´m curious how it´ll look in the end, but the method is as simple as genious....I never thought about this to get a proper mask (well, to be honest, I only tried it for another picture in the past......).

So thanks a lot!!!!!!

Aenea
Title: Re: mask layer part 2: appearance problems
Post by: bigben on November 08, 2007, 06:40:29 am
Quote from: Aenea on November 08, 2007, 06:16:07 am
Ahhhhhhhhh, thanks 1 000 000 times BigBen.....now I got you!!!!!

I have to polish my techn English a bit *lol* ....


You're welcome... I'll just have to remember to talk with pictures more  ;)
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on November 08, 2007, 09:18:56 am
oookay, I managed to do everything exactly as you told me.
But strangely it doesn´t appear anywhere now.

Is it, because I kept the fake stones as childs of layer three and layer three as child of my parental layer (5)? Or is there another reason.

All are blend by shader and inverted.
The image map has planY and size 1000*1000. I can see it as small black white picture. Using the same coordinates as my ruins doesn´t change anything.

hmmmmm
Should I try to use the image map shader the same way as before? Without the surface layer?

Aenea
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on November 08, 2007, 09:30:30 am
okay....using the image shader only doesn´t lead to anything too.
If I use: Through camera it appears, but definitely not in the right place.
Title: Re: mask layer part 2: appearance problems
Post by: bigben on November 08, 2007, 02:38:24 pm
Troubleshooting masks:

Step 1 Confirm the mask
Add a new layer at the very end (just before the planet shader). Feed the mask surface into the child input of this surface. You should now see your mask on top of everything else. If not, then you have a problem with the mask. If it appears in the right place, then the problem is with the way you use it. (I suspect the latter)

Personally I don't often use fake stones as child layers unless they are performing some other function such as forming part of a displacement. 

If you have masked the distribution of the parent layer, then it's children will inherit the same distribution and shouldn't need a repeat of the mask. This also reduces the number of masks to check for errors.
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on November 09, 2007, 06:24:29 am
Okay.

Thanks for all the information.
I did as you suggested. Created the surface layer with the image shader as child and now it appeared in the preview....I was so irritated that it hadn´t appeared in the small window on the left side of the preview (where images are shown when you added them to shaders) that I hadn´t kept an eye on the preview window. Now that the mask is placed over all layers it appears as white spot and it was very good noticeable *lol*.

I have to make it fit to the ruins by changing the coordinates and do a quick render, but that´s okay I think, because typing in the same coordinates as the ruins leads to nothing....

Okay. If I have managed to do that I will see how the thing with the distribution works. Because at the moment all my terrain is very flat.
I added the mask layer as breakup shader to surface layer 3 (parent of fake stone shaders), but it doesn´t work....hmmm. I think the problem is that the mask layer lies over all those others and as you described it flattens the terrain.
So i tried it again with connecting the image shader map (mask layer) as breakup shader to every single fake stone shader....and THIS worked. Very interesting.

Hey...I´m almost there..... ;D
Only thing left:
When I put in an image map for the now empty spot, I got this. (see picture). It seems that it does not only cover the empty spot but also you can see a border of the same pattern on the fake stones. I used the image map shader with the pattern as fractal breakup of the surface layer, where also the image mask is added as child layer. Any idea why this happens? Do I need another mask layer?

Thanks so much for your help....it helped me a lot to get a better understanding of the layers....

Aenea
Title: Re: mask layer part 2: appearance problems
Post by: bigben on November 12, 2007, 12:04:32 am
Quote from: Aenea on November 09, 2007, 06:24:29 am
....I was so irritated that it hadn´t appeared in the small window on the left side of the preview (where images are shown when you added them to shaders) that I hadn´t kept an eye on the preview window.


This will often be the case with masks, as you may only have a smll area of white a long way from 0,0,0. This is one of the reasons I usually include a "mask preview" shader for both checking and tweaking mask settings. The mask layer to be checked is connected to the child input, and for the render I just disable the layer.

Quote from: Aenea on November 09, 2007, 06:24:29 am
...I added the mask layer as breakup shader to surface layer 3 (parent of fake stone shaders), but it doesn´t work....hmmm. I think the problem is that the mask layer lies over all those others and as you described it flattens the terrain.
So i tried it again with connecting the image shader map (mask layer) as breakup shader to every single fake stone shader....and THIS worked. Very interesting.


And this is one of the main reasons I don't use fake stone shaders as child layers much. It has also been my experience that a fake stone layer added as a child layer does not properly inherit the distribution of the parent layer. For this reason I just connect them on their own and set the distribution of each fake stone layer individually.

Quote from: Aenea on November 09, 2007, 06:24:29 am
... Only thing left:
When I put in an image map for the now empty spot, I got this. (see picture). It seems that it does not only cover the empty spot but also you can see a border of the same pattern on the fake stones. I used the image map shader with the pattern as fractal breakup of the surface layer, where also the image mask is added as child layer. Any idea why this happens? Do I need another mask layer?


There's a couple of things to take into account here.
1: Fake stones aren't stones... they're fake.  i.e. they are just fancy displacements. If you then add an additional surface layer that extends over the fake stones, it will cover them. ... Insert the image map for the empty space before ALL of the masked areas.... and then you don't have to mask it at all. (simple is good)

2: Masks for fake stones only control the density, which is not entirely the same as distribution. It controls distribution because a density of 0 = no fake stones, but an adjacent area of non 0 density may place a stone over the edge of the mask, so you have to expect a small amount of overlap.

3: The default image map has smoothing of the image turned on. Anti-aliasing will smooth the image out, creating areas of intermediate tones around the edges of the image pixels. To make a mask sharper without turning smoothing off (which may look pixellated) you can increase the contrast of the mask by connecting the image map to a colour adjust shader using identical values for black and white levels. You can use this to make very fine adjustments to the border of the mask.  The amount of smoothing will depend on the resolution of the image. The higher the mask resolution, the more defined the mask detail.
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on November 13, 2007, 03:14:43 am
Thanks for those tips.....

QuoteThere's a couple of things to take into account here.
1: Fake stones aren't stones... they're fake.  i.e. they are just fancy displacements. If you then add an additional surface layer that extends over the fake stones, it will cover them. ... Insert the image map for the empty space before ALL of the masked areas.... and then you don't have to mask it at all. (simple is good)


*lol* You want to know what´s more easy? I stumbled over that option and I don´t know how....it was just one of these bright moments *lol*

Under effects:
As the image mask layer is a black white image and the black is on the outside, my eyes fell on this neat option "create transparency"
I just checked it without changing anything of the presets...

and what happened?
Well...no more overlay...... ;D

I´m not sure at the moment if it has disadvantages, but so far with a quick render I couldn´t detect any.....

I of course will try to find out about this colour adjust shader option....I´ve seen it somewhere together with the placing of object populations etc (to make sure trees appear in the right place....). This is an interesting option.....

Thanks so much for your help.....this was definitely a big step in getting me to understand the working of layers.....

Aenea

Title: Re: mask layer part 2: appearance problems
Post by: bigben on November 14, 2007, 12:05:18 am
Quote from: Aenea on November 13, 2007, 03:14:43 am
I of course will try to find out about this colour adjust shader option....I´ve seen it somewhere together with the placing of object populations etc (to make sure trees appear in the right place....). This is an interesting option.....


Another thing I've also found since then for masking with images is to go into the Colour tab of the image map and Check "Data is Linear" This removes the additional gamma correction applied to the image which usually leads to unexpected results, especially if you're planning the final mask/population density on the greyscale values in the image.
Title: Re: mask layer part 2: appearance problems
Post by: Aenea on November 15, 2007, 08:50:04 am
Oh, btw:

Here´s the current status of work....after all those corrections: