Planetside Software Forums

General => Terragen Discussion => Topic started by: bigben on February 06, 2007, 10:27:05 PM

Title: Image masking tests (Update2)
Post by: bigben on February 06, 2007, 10:27:05 PM
Hi All

I've started documenting my image masking tests and decided to post it online as others will probably find it useful as well. It's more of a reference than a tutorial at the moment although I intend to accompany it with some additional files as I do some more tests.

http://www.path.unimelb.edu.au/~bernardk/terragen/files/image_masking_tests.pdf (http://www.path.unimelb.edu.au/~bernardk/terragen/files/image_masking_tests.pdf) (1.2Mb)


Cheers

Ben
Title: Re: Image masking tests
Post by: BPauba on February 06, 2007, 10:45:10 PM
Very cool stuff.This is already a very useful pdf! I hope you keep on building it up to a classic resource. My I ask if you could share how you got the images to be zoom friendly? Whenever I make a pdf the images are not zoom friendly! Meaning they will get pixelated very fast...

Thanks man
Title: Re: Image masking tests
Post by: bigben on February 06, 2007, 10:57:56 PM
I normally set the images to resample to 150dpi for the PDF with medium JPEG compression (Standard default setting for Acrobat now). It's a reasonable trade off between size and quality. The PDFs are also optimised for web delivery, which makes looking at larger PDFs online easier (you can go straight to page xxx without having to download all of the previous pages).

The document bookmarks are auto generated but I'll also add a table of contents once it gets bigger.

Ben
Title: Re: Image masking tests
Post by: old_blaggard on February 06, 2007, 11:49:45 PM
Interesting.  Thanks for sharing.
Title: Re: Image masking tests
Post by: Tangled-Universe on February 07, 2007, 05:19:40 AM
Hmmm...the pdf doesn't open?
I'm currently at work, working on a prehistoric machine, so maybe back at home I'll be more succesful in opening it  ;D
Title: Re: Image masking tests
Post by: king_tiger_666 on February 07, 2007, 05:32:15 AM
The PDF opens for me.. great start to the tutorial, hope to see more of it as its only a beginning...

Title: Re: Image masking tests
Post by: Will on February 07, 2007, 05:48:09 AM
neat

regards,

Will
Title: Re: Image masking tests
Post by: bigben on February 07, 2007, 05:53:48 PM
Yes it's only a start, but I'm now working on fine-tuning some of the things I've experimented with so far  and documenting it in case I forget later on.  ;)  I'll make files available on a per section basis to keep the download sizes in reasonable chunks. That way people only need to download the files for the specific section they're interested in. My next tests include:


Here's a sneak peak at an autumnal XFrog birch leaf (another update posted... forgot to unmask the stems) and the original leaf texture (after I bumped up the contrast).

Working "in situ" was a bit of a pain with render times so I just setup a correctly scaled image map to work on. This was much easier. I kept my previous colouring methods (with a few tweaks) but the shading wasn't working the way I wanted it to so I went back to the drawing board. I'll try it out on some trees tonight.
Title: Re: Image masking tests
Post by: RedSquare on February 07, 2007, 07:17:27 PM
OH WOW! That looks quite natural, be interesting to see if the major hue overwhelms the more subtle hues or not in bulk.
Title: Re: Image masking tests
Post by: bigben on February 07, 2007, 08:56:30 PM
I'll post an update after I do a normal render of some trees. After that, it's going to get tricky. In theory you want to be able to get 3 levels of detail... leaf detail, an overal hue for each tree, and variations in hue across a forest... which is the main reason I started on this approach. But that's a surfacing project and this doc is focussing on image masking ;)
Title: Re: Image masking tests
Post by: Lucio on February 08, 2007, 07:19:17 PM
Very useful, thanks for sharing bigben!
Title: Re: Image masking tests
Post by: bigben on February 08, 2007, 08:42:54 PM
Quote from: RedSquare on February 07, 2007, 07:17:27 PM
...be interesting to see if the major hue overwhelms the more subtle hues or not in bulk.

I've started on the tree and have been going through this in my mind. I usually build up my surfaces with a gradual reduction in both coverage area and intensity so in theory the major hues shouldn't get overwhelmed by the finer details. I may have to re-order the colours for each successive layer. The render times are pretty long (12 hours for 800x400, unmodified tree at highest quality) so it'll be a couple of days before I have a result to show.
Title: Re: Image masking tests
Post by: bigben on February 08, 2007, 11:55:46 PM
For those who haven't noticed I tend to "think out loud" a lot when I'm working on a project so that someone who knows better can steer me in the right/alternative direction.

I went back to my leaf surface test and tiled the image masks rather than wait for a long render of trees. It works!  :)

[attachthumb=#2]

It'll look slightly different when it's applied to the object as a lot of the alpha masks are to simulate the object's alpha channel. From here it's just a case of scaling the  fractal breakups to set the variation to forest, tree or leaf scale.
Title: Re: Image masking tests
Post by: moodflow on February 09, 2007, 09:58:16 AM
Woah, this is some great stuff here!  Nice work.
Title: Re: Image masking tests
Post by: dhavalmistry on February 09, 2007, 10:15:47 AM
Although I got kinda lost in you node network but I have to say....WOW!!!

keep it up!

DL
Title: Re: Image masking tests
Post by: RedSquare on February 09, 2007, 07:10:15 PM
@ BigBen, hundreds of years ago I used to be a printer. Although not from the pre-press area, I can't help but think that you seem to be employing what I vaguely remember (Probably incorrectly) as under colour removal, by seemingly subtracting tint 2 from tint 1 and vice versa. In fact I'm almost sure that's what you are doing, which implys that you are a pro'.
Title: Re: Image masking tests
Post by: bigben on February 11, 2007, 06:26:01 PM
Quote from: RedSquare on February 09, 2007, 07:10:15 PM
...which implys that you are a pro'.

You haven't seen the attempts that didn't work   :D  I must confess to having a degree in scientific photography which gives me a bit of a start in understanding colour. My personal interests are in landscape photography.. hence my interest in Terragen. From my TG0.9 days it always seemed to make more sense to use the interaction between surface layers to build up the final colour rather than creating a surface layer for a specific colour. This provides a greater degree of variation although it can get a bit tricky at times. I've also had a bit of exposure to the printing industry via some friends who were graphic artists so there's probably some influence from there as well but in the end it's just high tech finger painting  ;D

There are many different ways to get to the same result with TG2 and sometimes being a TG2 noob can have its advantages because you try things that an experienced person might not expect to work.

As for my progress on this project... I spent a lot of time trying to get the variation of the surfaces to apply to the population of trees at a "tree" level.. i.e. create a shader that would only apply to some trees within the population. Unfortunately this does not appear to be possible with the exception of the altitude and slope constraints, which are of limited (but still of some) use.   I'd love someone to prove me wrong on this.

After scaling the fractal breakup didn't work I tried an image map, both internally to the tree object and externally from the "root" node. Thinking further, it's probably a good thing that the surface layer isn't coloured according to its "world" coordinates as this could create vertical stripes of colour in a tree when viewed from certain angles. The only other way I can see this working the way I want is if surface layers had the same projection controls as image maps.. i.e. a choice between Plan Y and Object UV. But for now, I think it's pretty good that we can add surfaces within a model at all.  :)

In order to create different hues of trees within a population you need a separate population of objects for each colour, although at least each tree within that population would have uniquely coloured leaves and you don't have to create additional leaf images.

I've simplified my node network, linked it into a more appropriate node in the tree object and a test render is underway.

I'll post the render and accompanying files tomorrow.
Title: Re: Image masking tests
Post by: bigben on February 12, 2007, 05:34:02 PM
Added the progress render (nearly done) and linked the additional files in the initial post.
http://forums.planetside.co.uk/index.php?topic=730.msg6169#msg6169 (http://forums.planetside.co.uk/index.php?topic=730.msg6169#msg6169)
Title: Re: Image masking tests (Update1)
Post by: old_blaggard on February 12, 2007, 05:57:51 PM
Looks great!  Thanks! *downloads*
Title: Re: Image masking tests (Update1)
Post by: ┬žardine on February 12, 2007, 11:05:41 PM
bigben, I'm very interested in what you are doing here! You've really developed this, and I'm impressed.

It's late and I've spent most of the evening getting caught up on all the new posts since I've been out this last week. But I will definitely be back here tomorrow to look over your techniques, and see what else you find out.

keep us posted!

-Sardine
Title: Re: Image masking tests (Update1)
Post by: bigben on February 12, 2007, 11:40:49 PM
Thanks for the comments.

Another thing I usually consider is animating anything I develop. Using these surface layers it should be possible do a reasonable simulation of the onset of autumn ... gradually fade in the yellow and follow it with the red surfaces, starting at higher altitudes and the progressing downwards... and possibly even add an opacity tweak to gradually remove the leaves and then pile snow on the branches.  (I've removed the leaves a quite a few times, but that was unintentional  :D)
Title: Re: Image masking tests
Post by: hyper1 on February 13, 2007, 10:57:34 AM
Ben,
I've been working with TG2 for quite a few months now, and I thought I understood it fairly well.   AND then you come along and one of your first projects opens up aspects of the program I didn't even consider!!! :o  My compliments and salutation.  Back a while now, I had a lengthy discussion with Matt and crew about some of the concerns you are addressing with this "experiment".  Tonal value with XFrog plants is tricky, at least if your aiming for a photographic look.  Before the ability to control the amount of light on the surface of the objects there was only one method that allowed for color or tonal adjustment.  It is the "Colour adjust" shader.  With that shader you can adjust a lot of the Gamma and tone of the object it was attached to.  But, the methods you are using has the potential of creating a greater degree of control.  I will be following this thread VERY carefully.  Thank you a lot for sharing!
Gary
Quote from: bigben on February 11, 2007, 06:26:01 PM
You haven't seen the attempts that didn't work 
There are many different ways to get to the same result with TG2 and sometimes being a TG2 noob can have its advantages because you try things that an experienced person might not expect to work.

As for my progress on this project... I spent a lot of time trying to get the variation of the surfaces to apply to the population of trees at a "tree" level.. i.e. create a shader that would only apply to some trees within the population. Unfortunately this does not appear to be possible with the exception of the altitude and slope constraints, which are of limited (but still of some) use.   I'd love someone to prove me wrong on this.

After scaling the fractal breakup didn't work I tried an image map, both internally to the tree object and externally from the "root" node. Thinking further, it's probably a good thing that the surface layer isn't coloured according to its "world" coordinates as this could create vertical stripes of colour in a tree when viewed from certain angles. The only other way I can see this working the way I want is if surface layers had the same projection controls as image maps.. i.e. a choice between Plan Y and Object UV. But for now, I think it's pretty good that we can add surfaces within a model at all.  :)

In order to create different hues of trees within a population you need a separate population of objects for each colour, although at least each tree within that population would have uniquely coloured leaves and you don't have to create additional leaf images.

I've simplified my node network, linked it into a more appropriate node in the tree object and a test render is underway.

I'll post the render and accompanying files tomorrow.
Title: Re: Image masking tests
Post by: bigben on February 13, 2007, 06:03:50 PM
Quote from: hyper1 on February 13, 2007, 10:57:34 AM
Tonal value with XFrog plants is tricky, at least if your aiming for a photographic look.  Before the ability to control the amount of light on the surface of the objects there was only one method that allowed for color or tonal adjustment.  It is the "Colour adjust" shader.  With that shader you can adjust a lot of the Gamma and tone of the object it was attached to.  But, the methods you are using has the potential of creating a greater degree of control.  I will be following this thread VERY carefully.  Thank you a lot for sharing!
Gary

Hi Gary
Having looked at the other public XFrog plants now (not just the TGOs) I think the biggest problem is that the texture images are poorly optimised in many cases. Most trees have only two textures... one of them may be well adjusted but I haven't found a tree yet that has all images well adjusted. This puts us behind the the 8 ball at the onset. Using good texture images gives a pretty realistic looking image with the default TG lighting (as you would expect).

This experiment is at the extreme end of what can be done. Used more subtley it could also be used to provide some extra variation in natural leaf colour to increase the realism.  This is probably more practical than replacing the entire leaf texture with TG surfaces which is pretty tricky (although possibly not for someone more experienced in surfacing). The fact that it can be done at all in TG is pretty cool  :)
Title: Re: Image masking tests (Update2)
Post by: bigben on February 13, 2007, 08:17:23 PM
Added a test looking at mask image resolution and the impact of anti-aliasing in TG2. Definitely worth checking if you create image masks for surfaces with fine detail.
Title: Re: Image masking tests (Update2)
Post by: hyper1 on February 14, 2007, 10:25:03 AM
Ben,
Thanks for all of your efforts!  I believe I'll be trying your method of tinting, perhaps today.  My problem is dealing with tropical grasses.  From the photos I've obtained the grasses in tropical regions go through their growth cycle on a continual basis.  This means I'll need greens, tans, even grays.  Ideally, they will have a very random nature.  Even having multiple populations would not produce the variation in nature. 
Gary
Quote from: bigben on February 13, 2007, 08:17:23 PM
Added a test looking at mask image resolution and the impact of anti-aliasing in TG2. Definitely worth checking if you create image masks for surfaces with fine detail.


  • Extracted PDF page (http://www.path.unimelb.edu.au/~bernardk/terragen/files/mask_resolution.pdf)
  • TGD and test masks (http://www.path.unimelb.edu.au/~bernardk/terragen/files/mask_resolution_test.zip) (39kb)
Title: Re: Image masking tests (Update2)
Post by: bigben on February 15, 2007, 05:07:37 PM
Grass may actually be a little easier. Using this method, you can distribute your required colours through the population of leaves. While the overall colour of the populations when viewed from a distance won't vary, up close each population will be unique. You can also use slope and height constraints to restrict specific colours to specific populations e.g. more dead grass on higher areas or steeper slopes. This will help to show variations in terrain as well and can look reasonable realistic.
Title: Re: Image masking tests (Update2)
Post by: garcia on February 15, 2007, 06:54:22 PM
Great work Ben :)
Title: Re: Image masking tests (Update2)
Post by: ┬žardine on February 15, 2007, 11:15:21 PM
I've had a little time for reading and no time for rendering/testing so I havn't been able to look into this. :-\

I was wondering if we are able to get the slope direction an individual object in a population is located on. My thought is that with the slope coordinates we would be given an other option to vary the color distribution. (A real life example of this is the brighter colors in fall on the sun-ward side of a hill)

This of course would require the use of functions to build this, but would be possible assuming we are able to somehow get the slope of each object.

Title: Re: Image masking tests (Update2)
Post by: Mandrake on February 16, 2007, 07:28:35 PM
Big Ben, I've been following this thread because I have questions that very closely follow your work, but on a much smaller scale, or so I hope.
http://www.ashundar.com/pfs.php?m=view&v=1418-021407a.jpg
I've been asking about how to lay this forest (or not so much) of pines and at the same time use object constraints.
It seems your the only one that could answer this.
I've done this ter. in World Machine and have the bmp output.
Is this what I use to limit the PINES, ? Do I inverse the bmp in photoshop and work from there? Any help you have on Object Constraints would be greatly appreciated
Title: Re: Image masking tests (Update2)
Post by: Oshyan on February 18, 2007, 03:10:43 PM
Mandrake, this thread is generally referring to adjusting textures of objects (potentially in a population), not object distribution. But what you want to do is fairly simple. It's off-topic here but since you may look here for the solution I'll post the brief and exact steps. If you want to continue the discussion I'll split the thread.

First of course you want a basic scene. I've loaded the default scene and generated the base heightfield. You also want to add a simple population, of course. I've used one of the XFrog TGO free bundle plants for this example because they're easy to work with and produce good results. By default the population should be set to "Sit on terrain" and be referencing the "Compute terrain" shader. This should make objects sit properly on your terrain unless you perform significant displacement in your Shaders group.

Next you'll want to move your population onto the terrain (I've set position to 5000,0,5000 so it's in the center of my terrain) and then increase size for illustrative purposes - 10,000x10,000 should be good. Now your population should be the same size as your terrain. Finally you'll want to increase spacing so you don't get a huge population - remember this is just for example's sake. So set your object spacing to 50.

Now the actual distribution adjustment steps:

1. Turn on Preview instances and Populate to see what your population distribution is like now. I've moved my camera up to a high vantage point and I can see an even coverage.
2. Go to your Population settings on the Distribution tab. Check the Use Density Shader box at the bottom then click the "..." button on the far right. On the menu that pops up choose "Create New Shader->Colour Shader->Distribution shader v4". It will fill in the name of the new shader in the box to the left.
3. Now click the same "..." button again and select "Go to Distribution Shader v4 01". This will bring up a settings box for the new Distribution Shader.
4. Go to the Altitude Constraints tab. Turn on Limit maximum altitude and set it to 500 (meters).
5. Go back to your Populator settings and click Populate again. If you have maintained your high camera view you should now see the peaks of mountains are bare, without populated objects. Your Density shader is now controlling placement of your objects!

From there you should be able to do just about anything you want. You can turn on slope constraints, adjust the height constraints, or even attach an Image Map or Default shader instead of the Distribution Shader v4 used in this example. But for basic height and slope constraints this is the way to go and it's quite easy.

I hope that helps.

- Oshyan
Title: Re: Image masking tests (Update2)
Post by: pixelpusher636 on May 14, 2022, 02:16:15 PM
I don't suppose anyone still has the treasure files at the end of these broken links?

This looks like an interesting way to get color variations. 
Title: Re: Image masking tests (Update2)
Post by: Dune on May 15, 2022, 10:11:05 AM
It's from 2007 (even before my time), so it's pretty outdated info. There are better ways of color variation in populations possible now, so I wouldn't bother..
Title: Re: Image masking tests (Update2)
Post by: pixelpusher636 on May 15, 2022, 10:38:25 AM
Quote from: Dune on May 15, 2022, 10:11:05 AMIt's from 2007 (even before my time), so it's pretty outdated info. There are better ways of color variation in populations possible now, so I wouldn't bother..
Thanks Dune. As I typed that, I was wondering if that method was obsolete given the time stamp. Thanks for clearing this up.