Xfrog leave colour variation with position or altitude - Nearly working...

Started by penboack, September 16, 2012, 09:46:17 am

Previous topic - Next topic


I am trying to setup altitude and/or position colour variation for Xfrog plant leaves.
I have created a setup that works with procedural colours, but only works with image maps, for some Xfrog plants, not all.
The project I am working on has 27 populations, setup as 3 separate areas with 9 populations in each (3 species each with 3 variations). This does not make for easy, quick, or simple testing ;D so I have setup a simple scene with a basic terrain and two Xfrog tree populations.

This test scene, attached, requires the "Terragen 2 + 1300 Xfrog Plants" bundle.
Provided that you have added the folder containing the bundle to the list in Terragen 2 Preference > Library and Content > User Content Folders you should be able to open this file without missing objects and textures.

The scene has two populations of identical size and density.
The tree objects inside the population nodes are setup so that it is possible to use either Altitude or Position to vary leaf colour.
However for the purposes of this test the altitude and position functionality is not connected up, so all the Blue nodes may be ignored (they are documented in the network)!
The only change in this test from using a standard Xfrog plant setup is that the Xfrog leaf image has been moved to an Image Map that is connected, via a Surface Layer shader, to the Default shader > Colour Function.

The scene is saved with the Larch population set to render.
Open the scene file and press Cmd R (Ctrl R on Windows) to render the scene.
The Larch Population will render with black leaves.

Uncheck the Larch Population's Enable checkbox.
Set the Sweet Chestnut Population's Enable checkbox to checked.
Render the scene again.
The Sweet Chestnut population will render correctly.

Can anyone explain why this works for Sweet Chestnuts, but not Larches?
Enabling the test colour on the Larch leaves works, which suggests to me that the problem is in coming from the node "Image map - Leaf"


Hmmm...very strange. It must be the model I think because I can replace the textures of the Chestnut with the ones from the Larch but not vice versa. So it's not in your texture setup.

Somehow the Larch model does not "accept" colour input by an image map shader but I haven't found out why.


You can also do this with a (few) distribution shader(s) and a multiply color (blue node), or merge shader or color adjust shader.


Thanks for you input TU,

I'm a bit stuck with this.
The same thing happens with the Xfrog Mountain Ash trees (EU40_Sorbus_aucuparia_European_Mountain_Ash).
It should surely be possible to move the leaf image from the default shader, put it in an image shader and connect it to the default shader colour function input?

Dune I hadn't thought of using the Distribution shader, as I was immersed in Blue nodes!
Theres always a lot of ways to do things in Terragen.


Quote from: penboack on September 18, 2012, 09:59:51 am
It should surely be possible to move the leaf image from the default shader, put it in an image shader and connect it to the default shader colour function input?

It appears it can. Looking at your file it works on one model, but not on the other. So I'm not sure.

If you look closely at the leaftexture placement in the original Larch model you'll see it's pretty messed up anyway.
I think some of those models aren't properly formatted, but I can't tell exactly what or why.