mask layer part 2: appearance problems

Started by Aenea, October 30, 2007, 09:39:48 AM

Previous topic - Next topic

bigben

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.

Aenea

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:


bigben

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..."

Aenea

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

bigben

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  ;)

Aenea

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

Aenea

#21
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.

bigben

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.

Aenea

#23
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

bigben

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.

Aenea

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


bigben

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.

Aenea

Oh, btw:

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