Author Topic: Problem scattering trees with my different CoronaMultimap material setup.  (Read 11698 times)

2016-03-02, 11:22:51

Torsten

  • Active Users
  • **
  • Posts: 78
    • View Profile
Hi guys,

I have the following problem. I have three different tree groups. Per group there is an object of leaves, and an object of trunks. I have set a 'materialByElement' modifier for the leavesopbject, set to three id's. I use this in combination with corona multimap set to ID's, to have three different colored leaves in the total tree. I also use further in the Leaves material a corona multimap to add diffference between the trees themselve, using the instance mode.

This works like i want to, but there is a problem when i want to scatter the three trees. Corona Scatter does not seem to work with groups. But i need the trunk and the leaves as different objects, or else my leaf material setup won't work. I attached images of the tree (with modifief selected on the leaves). And a material setup of the leaves.

In a nutshell, i want to use this material setup, resulting in three different colours per tree, and having difference between the instanced trees. And i want to scatter them using Corona Scatter.

Maybe i am totally over complicating this, and maybe my question is not that clear even, but i hope someone will have some thoughtfu linsights ont his matter.

2016-03-03, 13:40:50
Reply #1

Torsten

  • Active Users
  • **
  • Posts: 78
    • View Profile
I figured it out myself.

First use MaterialByElement to give percenteges of the leaves different id's ranging from 1 till 3. than set id of bark to 4. Than attach the leaves to the bark into one object. Make surf the id's don't get altered. In material setup set first multimap for the leaves to id, with 3 different maps. Creat another multimap and use the first as input (with two of them color corrected) Set this one to instance. Volia, multimap per tree itself, and difference between the instanced trees.

2016-03-03, 14:11:21
Reply #2

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 12739
  • Marcin
    • View Profile
I'm a bit late. :)
I had almost the same idea, but tried to make it as non-destructive as possible, so I assigned ID 4 to the trunk, and then selected the leaves and used material by element modifier only on those leaves. I'm not sure if it has any advantages over your method. :)
Marcin Miodek | chaos-corona.com
3D Support Team Lead - Corona | contact us

2016-03-03, 20:35:32
Reply #3

Torsten

  • Active Users
  • **
  • Posts: 78
    • View Profile
Looks good! Thanks for taking time to look into my problem.

In a way i think i did the same trick as yours. Only i gave the id's when the leaves and the truck were still separate, and than attached them into one object.  You did the trick just with one object (never had them seperated?)  Still the result works in both cases :)
« Last Edit: 2016-03-03, 20:39:30 by Torsten »

2016-03-06, 15:52:44
Reply #4

asdecret

  • Active Users
  • **
  • Posts: 62
    • View Profile
Hello there,

I tried both of your solutions but unfortunately i ran into some trouble.  I have a collection of trees where the tree is already subdivided in mat ids where 4 is for the leaves.  I would like to apply a randomly a variation of the leaf as you succeeded but I could not find a way to properly apply the modifiers to the existing mesh with the existing material in place.  I am attaching the file with the original material to see if you help me.  Thanks in advance.

Alex
« Last Edit: 2016-03-06, 17:00:32 by romullus »

2016-03-06, 17:05:15
Reply #5

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8828
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Add RGB Multiply and CoronaMultiMap in a way like in my picture. You can change RGB Multiply to Composite map if you want.

P.S. i removed attachment from your post as i believe that this tree is from commercial collection and you have no right to distribute it. Feel free to correct me if i'm wrong.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-03-06, 17:56:18
Reply #6

PROH

  • Active Users
  • **
  • Posts: 1219
    • View Profile
Hi asdecret. Here's my attempt based on Torsten and Maru's method. Leaves are distributed as 3 sets og 3 colors. I used AEC Foliage where leaves are given material ID #4 - just as you said your trees are.

I've attached the max2014 file.

2016-03-06, 18:53:46
Reply #7

asdecret

  • Active Users
  • **
  • Posts: 62
    • View Profile
Thanks so much for your help it is great to count on such community.
I Will try both methods In the morning at the office and let you know.
Thank you for removing the attachment, i had not thought of it and i did not intend anything more than juste give the file to facilitate my point.  Thanks again

2016-03-07, 16:29:29
Reply #8

asdecret

  • Active Users
  • **
  • Posts: 62
    • View Profile
Hello there,
I successfully applied 3 color variations to the leaves by doing the following :
1.   Extracting the leaves (id 4) 
2.   Applying a material modifier to the leaves with 3  percentages 30% each
3.   Set up a multimap to the leaves with material id mode selected

When I try to instance the leaves to obtain 3 color variations and also variation on the instances, somehow I am not getting the result I would like.  To do this I create another multimap ( instance mode) with color corrected variations.  The last multimap is functioning but the color leave distribution is not changing from one to the other.  Thanks for your help

Alex

2016-03-07, 17:04:56
Reply #9

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8828
  • Let's move this topic, shall we?
    • View Profile
    • My Models
Not sure if that is what you want to achieve, but attching scene where every tree is instance of each other and they have leaf variation per tree as well as per forest.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2016-03-07, 17:18:10
Reply #10

PROH

  • Active Users
  • **
  • Posts: 1219
    • View Profile
Hi. I'm really not sure what the problem is, so forgive me if this doesn't make sense.

1) Is the problem regarding the last multimap (instance mode)? For testing purpose try to make bigger difference between the three maps, like: normal, very bright and very dark, and use more trees. This way it would be easier to see if it works as expected.

2) Is it a problem regarding the leaves color (mat ID)? As your setup is now, the order of red, green, blue distribution will be the same for all trees. Blue leaves will be three different shades of blue on all trees, red leaves will be three different shades of red on all trees and green leaves will be three different shades of green on all trees. If you want to change this, then make three different multi maps instead of instancing one.

Hope it helps

2016-03-07, 17:38:20
Reply #11

asdecret

  • Active Users
  • **
  • Posts: 62
    • View Profile
Thanks Proh and Romullus.
I will try the max file in the morning.
My main issue is the variation in the instances of the trees.  I am able to apply different color to the leaves and my first multimap is functioning fine I guess.  I did not know of the shade color changes you mentioned Proh.
But when I instance them the trees they leaves (object) they are the same.
I hope this clarifies my problem.  Thanks again for your help
Alex

2016-03-07, 17:42:23
Reply #12

asdecret

  • Active Users
  • **
  • Posts: 62
    • View Profile
Edit
Ultimately I would like the color distribution of the leaves to vary from one instance to another

2016-03-07, 18:40:30
Reply #13

PROH

  • Active Users
  • **
  • Posts: 1219
    • View Profile
Then make three different sets of the leaves color (the first multimap) - just as I wrote in point 2.

... or maybe romullus has another solution - haven't checked his file.

2016-03-07, 19:51:24
Reply #14

cecofuli

  • Active Users
  • **
  • Posts: 1577
    • View Profile
    • www.francescolegrenzi.com
TREE: ONE big mesh, with 5 ID

Trunk   : Polygon ID1 : Multi/Sub-Object 1: CoronaMTL
Branch : Polygon ID2 : Multi/Sub-Object 2: CoronaMTL
Leaf 1 : Polygon ID 3 : Multi/Sub-Object 3: CoronaMTL  + Diffuse CoronaMultiMap (Instance, Item 3, Mix 50) three different color
Leaf 2 : Polygon ID 4 : Multi/Sub-Object 4: CoronaMTL  + Diffuse CoronaMultiMap (Instance, Item 3, Mix 50) three different color
Leaf 3 : Polygon ID 5 : Multi/Sub-Object 5: CoronaMTL  + Diffuse CoronaMultiMap (Instance, Item 3, Mix 50) three different color

More Leaf ID: more variation
You cannot have only one ID for the leafs, if you want to have variation, with the same Tree, instanced.

« Last Edit: 2016-03-07, 21:56:34 by cecofuli »