Can someone tell me how (if it is possible) I can alter the color of a leafs within the same population? Fo example, I want to have some trees that are "brighter" with some trees that are "darker" as if I was moving the color slider up and down.
How are you coloring your leaves now? Is it with a .tif file? Because substituting a power fractal, in the internal network node might work but you might lose your true color.
a default shader with powerfractal as color function.....
The tree that I want to use is from the free xFrog tgo's, so it uses an image (no sure if it is tif or not). I'm just trying to avoid adding another population to get some different colors.
Try blending the image's colours with the colours of a black and white power fractall.
Quote from: Virex on January 22, 2008, 01:06:51 PM
Try blending the image's colours with the colours of a black and white power fractall.
Or convert the image texture to greyscale and use it as a colour function for a surface shader and plug whatever surfacing you want into the child input. Using different scales for powerfractals you can create variation in colours between leaves on a tree, but changing the colour of separate trees appears to be a bit trickier. (Terrain) slope and altitude masks work OK but that's not necessarily what you want. This has been one set of tests on my revisit list.
Would setting the minimum feature scale to the size of a tree do the trick?
Bunch of wind anywho, if you have 1,2,3, different leaves on your tree... Your colors are going to vary naturally from the sunlight. If your colors are all to dark or all the same. Your doing the tree wrong.
This one leaf may look 15 different ways if your sun is right.
If you need to brighten the trees but don't want to go through the headache of modifying Tiff files only to have them not load in your next render, blah, blah, go into the internal network and multi-shader and use a colour adjust node to change the leaf gamma.
If you copy the population and randomise that one's seed, you can modify the gamma on that population's leaves, and give some semblance of variation overall in the render. Remember to change the population densities so they fit the same space.
Nice, now were getting somewhere!! Trick is to be able to blend that or those pops so they look natural.. but I like it!
Quote from: Virex on January 22, 2008, 03:59:05 PM
Would setting the minimum feature scale to the size of a tree do the trick?
Thats a pretty good idea actually!
Been there, tried that. The only thing it succeeded in doing was changing the overall colour of the tree.
Quote from: bigben on January 22, 2008, 03:41:41 PM
... Using different scales for powerfractals you can create variation in colours between leaves on a tree, but changing the colour of separate trees appears to be a bit trickier. (Terrain) slope and altitude masks work OK but that's not necessarily what you want. This has been one set of tests on my revisit list.
To elaborate on this, I did actually try it. The only thing increasing the feature scale achieved was reducing the variation in colour across the tree, but each separate tree was still a similar colour. I tried a lot of different settings with very different scales and even stretching the fractal in the Y direction, but to no avail.
http://forums.planetside.co.uk/index.php?topic=730.0 (http://forums.planetside.co.uk/index.php?topic=730.0)
And my suggestion for using a greyscale image for a colour function:
http://forums.planetside.co.uk/index.php?topic=1032.msg11455#msg11455 (http://forums.planetside.co.uk/index.php?topic=1032.msg11455#msg11455)
Have you tried hooking them all up to exactly the same power fractal (possibly outside of the object)?
Besides that, how does the "Get location" function node work when placed inside a population? If it works as normal you could use it to build a function network from that.
Quote from: Virex on January 25, 2008, 05:31:09 PM
Have you tried hooking them all up to exactly the same power fractal (possibly outside of the object)?
Besides that, how does the "Get location" function node work when placed inside a population? If it works as normal you could use it to build a function network from that.
Tried constructing the surfacing as a normal surface shader (that's how I came up with the scales for the fractals of my original surface as it was quicker to run preview renders) and then connecting it to the object's internal network... no difference.
Haven't tried building something with get location yet. It may be worth a shot.
Until there is a procedural method to do this, one "brute force" way I've been getting around it is to simply load another model with slightly different colors. I used 9 separate models of slightly different colors, all with different sizes and distribution. Though its sloppy, I think having multiple models like this adds much needed variation to the mix.
Do we actually know how the locations for individual members of a population are calculated?
I have just made a test based on two basic assumptions:
- 1:- The members of a population are placed at the "Centre" points of Voronoi cells having a scale equal to the Object Spacing and using the same seed value as the population.
2:- The Voronoi cells are generated using an internal Get Position for the X and Z values are taking the Y value from the placement of the population.
What I have done is started with a Get Position, extracted the X and Z values; Rebuilt a position vector using these plus a constant equal to the Y value of the centre of the population. I have then taken this modified position and used it as the input to a Voronoi 3D Cell Scalar; Using two constants, one for scale equal to the population Object spacing and another for the seed making this equal to the population seed. I have used the result of this as the Mix Controller of a Merge Shader, which is being used to vary the colouring of the object.
I have used a duplicate of this mix setup to add colour to the terrain so that I can see the Voronoi cells.
Either my assumptions are wrong or the nodes are not set up right because THIS DOES NOT WORK ::)
I am not at all sure how clear my explanation is; so here is a screen grab of the nodes, the result and the tgd.
I know this doesn't work but posting may save someone else wasting time trying something similar :)
Mr. Lamppost, this is really nice work. Even if it doesn't work, this is a good springboard for finding something that does.
EDIT:
I see areas on the trees that ARE being effected. The colors are different than the voronoi, but you can see it nonetheless!
EDIT 2:
You could replace the voronoi with a perlin noise function for a better color gradient. I am stuck at work, so I don't have models to test, but I will hopefully give it a shot tonight when I get home.
QuoteI see areas on the trees that ARE being effected. The colors are different than the voronoi, but you can see it nonetheless!
There are two copies of the colour variation nodes, one in the internal network of the trees and one connected to a surface layer in the shaders applied to the terrain.
QuoteYou could replace the voronoi with a perlin noise function for a better color
gradient.
I have previously used both Perlin and Power Fractal driven blends to give variation to my populations. However both of these methods give a general rather than tree by tree variation, I was hoping for a way to vary the colours applied to each tree.
I can disprove one of my assumptions :(
The positioning of the individual members of a population is not related to the Y value set as the Population Centre. I tested this by making the instances visible in the preview then changing the Y value of the population and re-populating. The positions of the individual objects don't change. Theer goes one assumption.
Quotethis is a good springboard for finding something that does.
I agree that's why I posted a negative result
There is an as yet unsupported Unique Versions parameter in the population settings: Solution?
Quote from: Mr_Lamppost on January 25, 2008, 08:42:37 PM
... The positioning of the individual members of a population is not related to the Y value set as the Population Centre. I tested this by making the instances visible in the preview then changing the Y value of the population and re-populating. The positions of the individual objects don't change. Theer goes one assumption.
That would be disastrous if it was the case. For creating animations you need to move the populations with the camera to avoid populating an entire terrain with high quality objects. As it is, the placement is dependent on the density inputs which include a built random variable of some sort plus whatever density masking you use.
I don't think your test is entirely unsuccessful as there is variation of the yellow colouring in the trees which seems to follow a voronoi pattern that is very close to the surface shading. Don't forget that fractals vary in the Y direction as well so you may want to try stretching the result a lot in the Y direction. You'd need to add some extra variation to avoid those straight lines where the border of a cell bisects a tree.
I have a different test render still running, but I'll have a look at this after it's done (probably tomorrow)
One thing that would be very inforamtive would be to do a closer render of a tree that has a cell border passing through it to see if the cell border also crosses a leaf as well.
I wonder if you could not take a snap shot of the population by facing the camera down and render that out and use it as a mask but change the tree masks tonal variations in another program. Here is what i mean. Imagine if these were trees instead with variations to the tonal color placing this map in the shader stack. This noise i used is only an example as the noise should be an orthographic map mask of the trees etc. with the tonal variations.
Stopped my other test render. It was also tree-related so I can work on both at the same time. Having a look at the TGD above and redoing some older experiments to see if there are any changes after the last update.
OK. While the experiment above doesn't specifically colour individual trees it does produce large scale variation across several leaves, so in this respect it was successful... at least a step in the right direction.
I simplified the TGD a little... replacing the bottom half of the leaf shader with a blue surface layer with a red child surface using the voronoi as the child's fractal breakup. The first test render only showed blue and shades of purple/magenta... added a colour adjust shader with a white value of 0.5 as a final adjustment to the voronoi to get this.
[attachthumb=#1]
Compare this to a power fractal as the fractal breakup with a relatively large scale. (60,45,15 in this case). The same fractal was linked to a surface shader to produce a orange surface with an green child layer. Note that in this case there is no red in any of the trees, and no large scale variation that even closely resembles the terrain surface. Tweaked the PF and added a colour adjust shader to get this. This doesn't work even though it's a pretty common solution that works just fine on surfaces.
[attachthumb=#2]
The attached TGD contains both shader branches... more tinkering.
The top picture looks hopeful, BigBen. That is, if I understand what is happening. :D
QuoteThat would be disastrous if it was the case. For creating animations you need to move the populations with the camera to avoid populating an entire terrain with high quality objects. As it is, the placement is dependent on the density inputs which include a built random variable of some sort plus whatever density masking you use.
There are definitely problems with populations at the moment, I have just made a quick test sliding a small populated area across a flat terrain. I used a power fractal as a distribution mask for the population.
I had to render the frames one at a time even for this tiny population as TG crashed as soon as it tried to re-populate for the second frame.
Instances are appearing outside the population area.
This is devastating. The placement of individual instances is not consistent from frame to frame.
The way I had been imagining populations to work was that the world was filled with Voronoi cells with the same scale as the population Object Spacing. Taking a horizontal slice through this at the population Y position would give a 2D lattice of cells, the centres of which could be used to place the instances of the population prior to them being projected vertically onto the terrain. If a distribution controller is used this would control the probability that any given cell would contain an instance. There is a constant associated with each cell ( visible as the Voronoi 3D Cell Scalar), so unless the distribution controller or the seed value for the cess changed the probability of any cell containing an instance should remain constant, allowing any area to be populated without the placing of instances changing.
This is obviously not happening.
I am sure that something similar has been posted elsewhere but I couldn't find it so here is another quick test.
Voronoi 3D Diff Scalar making the displacement.
Voronoi 3D Cell Scalar clamped to the Y=0 plane used as a mix controller providing the colour variation.
If as I had hoped population instances had been placed at the centre of each cell this would have provided per object colour variation. A more complex variation function would have been needed to hide the cell boundaries but this is certainly possible.
Sorry the node network is a little messy.
I am away to work on something else ;D
Quote from: bigben on January 26, 2008, 08:46:47 AM
Compare this to a power fractal as the fractal breakup with a relatively large scale. (60,45,15 in this case). The same fractal was linked to a surface shader to produce a orange surface with an green child layer. Note that in this case there is no red in any of the trees, and no large scale variation that even closely resembles the terrain surface. Tweaked the PF and added a colour adjust shader to get this. This doesn't work even though it's a pretty common solution that works just fine on surfaces.
I attempted the same thing with a simple power fractal and no luck. Apparently, the node network approach has additional mapping information its passing to the object (in this case a tree). A simple fractal does not do this as it normally does on a surface. I wonder if Matt could chime in here on how he has objects mapped?
I believe I have the color variation method working, using Mr. Lamppost's node design. I replaced the voronoi with a perlin 3D scalar so the colors have a continous variance, and it seems to be working. Since there are 2 colors being mixed by the merge shader (controlled by the perlin 3d scalar), its possible to use the power fractals themselves (which also have 2 colors, high and low) to add even more color detail. I set the scale to the approximate object (tree) size to roughly keep each tree having its own color.
Definitely more tinkering to do though.
Many thanks Mr. Lamppost and BigBen. This is some fun stuff!
I've also been noticing some weirdness when trying to mix the two different colors. With the merge shader, it seems to want to "add" the color values regardless, creating a new color (sometimes above white or black).
If I stack the fractals, it still adds the color values.
More research to do.
EDIT: Forget this post, I figured it out. ;D
Quote from: Mr_Lamppost on January 26, 2008, 11:55:55 AM
There are definitely problems with populations at the moment, I have just made a quick test sliding a small populated area across a flat terrain. I used a power fractal as a distribution mask for the population.
I had to render the frames one at a time even for this tiny population as TG crashed as soon as it tried to re-populate for the second frame.
http://forums.planetside.co.uk/index.php?topic=954.0 (http://forums.planetside.co.uk/index.php?topic=954.0)
Quote from: Mr_Lamppost on January 26, 2008, 11:55:55 AM
This is devastating. The placement of individual instances is not consistent from frame to frame.
I haven't found this to be the case. I've constructed masks to restrict the objects to a specific distance from the camera, within the camera's FOV, and then animated both the mask and population positions without any problems. As long as you don't animate the distribution shaders the trees should appear in fixed locations.
[edit] I rechecked this as it has been a while since I ran an animation and so far I'm also getting random placement of trees. Trying to find out what was different [/edit]
Quote from: moodflow on January 26, 2008, 02:04:16 PM
I believe I have the color variation method working, using Mr. Lamppost's node design. I replaced the voronoi with a perlin 3D scalar so the colors have a continous variance, and it seems to be working. Since there are 2 colors being mixed by the merge shader (controlled by the perlin 3d scalar), its possible to use the power fractals themselves (which also have 2 colors, high and low) to add even more color detail. I set the scale to the approximate object (tree) size to roughly keep each tree having its own color.
Definitely more tinkering to do though.
... aah the joys of many heads working on the same problem in a forum... the perlin 3D scalar is the obvious connection between the two but I was too focused on either to spot it ;) The tonal variation will help to make trees at the border of masked regions look more realistic, so there is definitely plenty of scope here :) :)
The main limitation to this method is that it is possible for two trees to be placed so close together that they overlap. The only way we could create masks for individual trees is with a unique variable for each tree. The simplest I can think of is if it was possible to extract the coordinates used to position the tree and then use functions to convert this to a scalar between 0 - 1. Something for the developers?
I agree that Voronoi Cells are less than ideal for gradual blends, I was hoping for an object by object variation similar to that which can be applied to fake stones. Seeing as my assumptions about the way population instances look like being wrong Perlin or Power Fractal looks like the way to go until we figure out population placement or someone (Hint Matt), tells us. I am sure I had Power Fractal variation working a while ago, just playing around so didn't save the setup.
I am knee deep in procedural hurricane nodes at the moment, posting this while a test is rendering, but will have another look if I get the chance.
Ah the joys of parallel posting ;D
QuoteQuotehis is devastating. The placement of individual instances is not consistent from frame to frame.
I haven't found this to be the case. I've constructed masks to restrict the objects to a specific distance from the camera, within the camera's FOV, and then animated both the mask and population positions without any problems. As long as you don't animate the distribution shaders the trees should appear in fixed locations.
Constant instance placement is what I would expect and I am sure I had it working in one of the previous versions. Other than move the centre of the population I am changing nothing in that test; your guess is as good as mine why it is not working.
OK, this is placement issue is getting a bit weird but I think it's worth a separate post so as not to distract from the original subject of this thread.
http://forums.planetside.co.uk/index.php?topic=3269.msg33334 (http://forums.planetside.co.uk/index.php?topic=3269.msg33334)
Offshoot from some work I have been doing elsewhere with multiple Perlin applied here as the colour function of the leaf shader. The clours come from two Power Fractals one yellow and ochre the other cyan and sea green. Not tree by tree but I think even this rough test gives an acceptable result :)
Quote from: Mr_Lamppost on January 28, 2008, 05:52:18 PM
Offshoot from some work I have been doing elsewhere with multiple Perlin applied here as the colour function of the leaf shader. The clours come from two Power Fractals one yellow and ochre the other cyan and sea green. Not tree by tree but I think even this rough test gives an acceptable result :)
It sure does. This is a big step forward and looking great :)
When I made my autumn leaf surfaces I found it easier designing the surfaces on the terrain using the alpha mask of the leaf at the correct size, and tiled over the terrain. This gives you a much quicker render of the leaf to leaf variation, especially when tweaking the fractal scales..
I didn't understand that last one. Can you explain in a little more detail? Why would you be using a leaf alpha mask to render terrain?
--Dale--
There are two key problems with trying to create a procedural surface for leaves.
1: Positioning the camera close to a tree object when you only have a bounding box AND getting a clear enough view of the leaves is a real pain.
2: Rendering a tree at high quality takes a long time.
So instead of creating the surface on a tree object, I simply created the same surface on the terrain. The problem with that is that you need something to get a sense of scale so you can set the size parameters of the fractals. To do this I simply took the image used for the alpha mask of the leaf and and used it for the fractal break up on the surface (Plan Y, repeat X and Y) and you get a whole set of leaves showing the variation you can get on a leaf by leaf basis.
(http://forums.planetside.co.uk/index.php?action=dlattach;topic=730.0;attach=1683;image)
http://forums.planetside.co.uk/index.php?topic=730.msg6446#msg6446 (http://forums.planetside.co.uk/index.php?topic=730.msg6446#msg6446)
Once you've got the settings you want you just transfer the nodes to the internal network of the tree object.
I did wonder what you were getting at ;)