Corona Renderer Forum

General Category => Tutorials & Guides => Topic started by: Juraj on 2015-10-14, 16:09:36

Title: Vegetation shader
Post by: Juraj on 2015-10-14, 16:09:36
I posted this in my wip thread, but might as repost it here if it's ok, more people may come across it here. This is quick start into how I do my vegetation, but most of it is bit old (it desperately needs vertex colors and instance variation),
so I might learn and update it during this project and then do a full video on it.

(https://corona-renderer.com/forum/index.php?action=dlattach;topic=9837.0;attach=37345;image)


(https://corona-renderer.com/forum/index.php?action=dlattach;topic=9837.0;attach=37347;image)
Title: Re: Vegetation shader
Post by: -Ben-Battler- on 2015-10-14, 16:26:52
Thanks Juraj, this helps a lot. Seems that I have to step up on my veggy materials. :)
Title: Re: Vegetation shader
Post by: Juraj on 2015-10-14, 16:29:59
Even basics helps the most :- ) Good normal map with strong relief and saying no to "evermotion green" color (toxic level of brightness and saturation)
Title: Re: Vegetation shader
Post by: AnubisMe on 2015-10-14, 18:01:46
Thanks for sharing. I have never tried the front back map with darker and lighter shades. Will give it a try. Quick question though; what do you do for the branches? Also any recommendation for pine trees?
Title: Re: Vegetation shader
Post by: Juraj on 2015-10-14, 18:23:37
I will continue with the branches and trees :- ) But not today, need to do some client's review that suddenly came.
Title: Re: Vegetation shader
Post by: hrvojezg00 on 2015-10-15, 09:11:23
Very usefull, thanks! Ground cover is bbb I guess? Tree is made in house?
Title: Re: Vegetation shader
Post by: RolandB on 2015-10-15, 09:44:37
Thanks a lot Juraj... always a pleasure to follow your advices !
Title: Re: Vegetation shader
Post by: fellazb on 2015-10-15, 10:00:36
Hi,

This morning I saw that Evermotion is finally providing Corona models and tested the free sample of their tree collection. Must say that they did a pretty good job on the shading part. It has some good similarities of your approach and hopefully this will set a new standard. Looking forward to see your approach on barks and branches (turbosmooth, noise and\or displacement if I saw it correctly at SOA 2014 :) )
Title: Re: Vegetation shader
Post by: Juraj on 2015-10-15, 13:17:37
Very usefull, thanks! Ground cover is bbb I guess? Tree is made in house?

Yes by Bertrand, I am even writting it in the tutorial pic :- )

Hi,

This morning I saw that Evermotion is finally providing Corona models and tested the free sample of their tree collection. Must say that they did a pretty good job on the shading part. It has some good similarities of your approach and hopefully this will set a new standard. Looking forward to see your approach on barks and branches (turbosmooth, noise and\or displacement if I saw it correctly at SOA 2014 :) )

Yes that's it :- ) I will post that too. I spent some time figuring out how to effectively merge scanned mesh (not just texture) but that didn't provide any fruit yet.
Title: Re: Vegetation shader
Post by: vkiuru on 2015-10-15, 14:00:07
Appreaciate the share! Though I must say the translucent hue some of your groundcover plants have leans a bit too much to the blueish green, in my opinion :) It´s a subtle thing but it´s the sort of green that plastic plants often have. Then again it might just be a regional thing and that´s how some plants look where you live :)
Title: Re: Vegetation shader
Post by: Juraj on 2015-10-15, 14:06:25
Appreaciate the share! Though I must say the translucent hue some of your groundcover plants have leans a bit too much to the blueish green, in my opinion :) It´s a subtle thing but it´s the sort of green that plastic plants often have. Then again it might just be a regional thing and that´s how some plants look where you live :)

I don't think so.. all the translucency slots are extremely yellowish, and looking at the picture, the blue-ish tint you see is top part of leaf, reflecting blue sky/shadows. You can't even see much translucency in the groundcover at this angle. PS color-picker doesn't reveal any blue either..

Neither do I live anywhere where these plants exist...
Title: Re: Vegetation shader
Post by: vkiuru on 2015-10-15, 16:40:10
Appreaciate the share! Though I must say the translucent hue some of your groundcover plants have leans a bit too much to the blueish green, in my opinion :) It´s a subtle thing but it´s the sort of green that plastic plants often have. Then again it might just be a regional thing and that´s how some plants look where you live :)

I don't think so.. all the translucency slots are extremely yellowish, and looking at the picture, the blue-ish tint you see is top part of leaf, reflecting blue sky/shadows. You can't even see much translucency in the groundcover at this angle. PS color-picker doesn't reveal any blue either..

Neither do I live anywhere where these plants exist...

I hope you don´t mind my cropping and zooming part of your render. See the plant here, with the big leaves:
(http://i.imgur.com/DYHHal0.jpg)

I did not mean it is way too much to the blueish side, but just enough and just slightly too saturated enough to look unnatural to me.
Title: Re: Vegetation shader
Post by: Juraj on 2015-10-15, 16:53:36
The translucent part has no blue tint at all... use PS color picker. Since that exact plant has very thick leaf, the translucency is more minor, and thus takes most of the color from the diffuse, rather than translucency. Which is how it should be.

Saturation yes, it's over-done, but that is post-production on my side. Went to far in 'vivid' look. It's was test merely. But the only blue is in sky reflection on top part of leaves.

(https://corona-renderer.com/forum/index.php?action=dlattach;topic=9837.0;attach=37482;image)

The attached example is quick google photo, which I didn't touch. Yet it matches the values, the images are similarly post-produced. Both Translucency are exact rgb match.

http://thumb1.shutterstock.com/display_pic_with_logo/1834214/305626814/stock-photo-green-leaves-backlit-is-nature-abstract-background-305626814.jpg

You also embedded your crop with AdobeRGB profile, while my original picture has sRGB (for which I have my monitor calibrated exactly, despite being wide gamut capable, U3014 ), so it's more saturated than should be.
Unless your browser is color-profile capable (only Mozzila as far I am aware), you're looking at my image incorrectly.
Title: Re: Vegetation shader
Post by: vkiuru on 2015-10-15, 17:50:22
You also embedded your crop with AdobeRGB profile, while my original picture has sRGB (for which I have my monitor calibrated exactly, despite being wide gamut capable, U3014 ), so it's more saturated than should be.
Unless your browser is color-profile capable (only Mozzila as far I am aware), you're looking at my image incorrectly.

That might be the case here. Damn these color profiles.. anyway, thanks for taking the time explaining and I hope to see more of your progress!
Title: Re: Vegetation shader
Post by: dubcat on 2015-11-06, 05:20:29
I just realized that I never thanked you for sharing some of that awesomesauce. Thank you Juraj, you're the man!
Title: Re: Vegetation shader
Post by: rambambulli on 2015-11-08, 08:38:07
Thank Juraj for this tutorial!!

I have a question about the refelction maps.

A lot of people use them and have great results. But they tend to recreate something that isn't there. Don't they?
As you look to leaves closely the reflection (except for small parts and veins or dried leaves) is pretty much uniform. Still we project reflection maps to create less and more reflective parts on a leaf.
It enhances the feeling of the 3d ripples and deformations of the leaves but also tend to distort the reflection of the leaf as a whole. Especially if you look from a distance.
This is even worse if the diffuse maps have highlights too.

I haven't found a better way to shade leaves though. So it is centainly not a comment on your setup! I was just wondering.


Title: Re: Vegetation shader
Post by: Juraj on 2015-11-08, 14:18:50
Yeah I completely agree there.

Imho their purpose is correct, to vary reflectivity, but glossiness map should be enough to do that. To use it further in spec slot to enhance the same effect means the map isn't strong enough, or they're indeed creating something that isn't there to boost the look.

But it's true it ideally shouldn't work that way..imho low glossiness should clamp specular reflection far more than in does currently in Corona, but I don't know
kind of math that should be. Only thing I know, is when I create material in Unreal, Marmoset, etc.. which all use GGX as well, high rougness (low glossiness), give me almost diffuse look. In Corona, it gives me slightly "shiny" look instead.

So yes, I also break my own rules, and do use reflection map, when it gives me visually nicer result. Or I often clamp reflection to lower number as I go to lower glossiness (like 0.5 for 0.5..).
It's just that I am not happy with such workflow, because I can't be sure which version is physically correct. The more you tinker with specularity in materials, the less they will work cohesively in the whole scene to plausible result. Of plausible doesn't mean visually interesting, I am not trying to stress the photorealistic aspect.
Title: Re: Vegetation shader
Post by: Ricky Johnson on 2015-11-08, 20:04:01
But it's true it ideally shouldn't work that way..imho low glossiness should clamp specular reflection far more than in does currently in Corona, but I don't know
kind of math that should be. Only thing I know, is when I create material in Unreal, Marmoset, etc.. which all use GGX as well, high rougness (low glossiness), give me almost diffuse look. In Corona, it gives me slightly "shiny" look instead.

I've been aiming to adopt this approach to materials recently - physically based, if I'm safe to call it that - but agree that it seems difficult to work with rough materials in Corona and stick to the core principles as things stand.
Materials with a low glossy value seem to attract an unrealistic amount of reflective fuzz and I'm constantly cheating on the concept to make things look right to me.
I wonder if it's self occlusion that isn't being taken into account in the shader. I'm only vaguely remembering this from reading some of that PBM information that was discussed and posted on the forum here about a year ago.
So rough materials viewed at glancing angles should be trapping and obscuring some percentage of specular reflectance. Not sure if that currently happens automatically, or even if it should much.
That's how I've been justifying lowering reflection amounts to myself anyway!

I thought it was interesting that there was the issue with dark edges appearing on rough materials when GGX was first implemented in Corona - that rays of specular reflection were being reflected back into an object.
With very rough materials at certain angles I don't understand how that was entirely incorrect, even if it was an accidental side effect of the GGX model rather than a developed abstraction of a rough surface.
Title: Re: Vegetation shader
Post by: 3dwannab on 2015-11-18, 18:38:02
Hi Juraj, thanks for this.

Instead of creating separate inverted normal maps for the bumps, check all the flips (X and Y) and its the same result. :]
Title: Re: Vegetation shader
Post by: Juraj on 2015-11-18, 18:39:28
Perfect, thanks :- ) Didn't know that.
Title: Re: Vegetation shader
Post by: maru on 2015-11-19, 11:04:31
Hi Juraj, thanks for this.

Instead of creating separate inverted normal maps for the bumps, check all the flips (X and Y) and its the same result. :]

>tips&tricks - now! :)
https://corona-renderer.com/forum/index.php/topic,9728.msg62377.html#msg62377
Title: Re: Vegetation shader
Post by: 3dwannab on 2015-11-19, 13:02:17
Done ;)
Title: Re: Vegetation shader
Post by: Energyzer on 2017-05-24, 16:44:23
Hello guys.

Can we please revive this topic?

I'm in the process of creating some images with heavy vegetation, so i'd love if we could sort of "update" the methodology to create awesome vegetation shaders.

At the moment i'm following what Adán Martin + Juraj Talcik have shared, and i'm already getting satisfying results.

Thanks,

Title: Re: Vegetation shader
Post by: Juraj on 2017-05-25, 09:26:11
I will definitely revive it :- ) I have been playing a lot with translucency shaders and I am still confused how should ideal translucency map look (should it be bright and low fractional value ? or dark as albedo and high fractional value?).

And mostly, I still believe current translucency model doesn't behave as real-life world vegetation. Imho vegetation is unique, same way as wood anisotrophy is special and most research papers suggest fully custom BRDFs for them.
Title: Re: Vegetation shader
Post by: Jadefox on 2017-05-25, 11:27:20
I've noticed on older Evermotion models the translucency map is grey ( Vray models )
I've redone them last night as you showed in your tutorial and copied the diffuse material
into the translucency slot and WOW ! what a difference.

Does Vray and Corona differ fundamentally on this as it seems a black and white map does
not work in the translucency slot in Corona.
Title: Re: Vegetation shader
Post by: Juraj on 2017-05-25, 11:34:40
I've noticed on older Evermotion models the translucency map is grey ( Vray models )
I've redone them last night as you showed in your tutorial and copied the diffuse material
into the translucency slot and WOW ! what a difference.

Does Vray and Corona differ fundamentally on this as it seems a black and white map does
not work in the translucency slot in Corona.

The B&W map from Vray's 2sided shader would be Corona "Translucency Fraction" dictating how much light passes through. Vray takes the color from Diffuse.

Corona offers this additional "Translucency color". My understanding is that it might properly simulate subsurface scattering since the underlying innards of leaves are often more yellowish hue of green.
But I am no longer sure what should the albedo of this map be. The maps from Megascan offer some arbitrary scan of this, but calibrated for no particular BRDF model.

But I don't trust it, from many tests I did over the years, it is so much better than Vray, yet it does not behave as real leaf (I mountain bike like every day, I am obsessed about nature). I would like thinSSS that simulates the exact behavior micro-thin leaf has if it was modeled as micro shell (volume) model.
Real leaves capture the light around them, not just offer see-through when pointed against the light. This effect is nicely visible in fully overcast sky, where the difference is most noticeable. In Sun&Sky scenario, the shader works reasonably well most of the time.
Title: Re: Vegetation shader
Post by: springate on 2017-05-28, 17:15:05
Thanks for sharing such value info with us Juraj!
I wonder if the same approach suggested previously would still be good since we have pbr on corona...is there anything i should be aware of now?
Title: Re: Vegetation shader
Post by: Juraj on 2017-06-06, 12:07:21
Thanks for sharing such value info with us Juraj!
I wonder if the same approach suggested previously would still be good since we have pbr on corona...is there anything i should be aware of now?

The PBR changed just the specular response.

I previously used various tricks like 2.3 IOR and 0.4 reflection, but I now I can use 1.52 1.0 ALL the time :- ) It just made the life simpler, nothing more to it.
Title: Re: Vegetation shader
Post by: makco on 2017-06-09, 21:21:39
Juraj,

First of all thanks for sharing, I'm relatively new to Corona, so still learning a lot!
I have a question.
When i do this types of maps i thought it was better to reuse a bitmap input as many times as possible,(and modify saturation, hue and brightness for each component needed) instead of having different input versions... this way there are less bitmaps to load (so less memory) and if a different leaf is to be created, less maps to change, so the shader becomes more flexible... this I perhaps inherited from working with other node systems (Nuke, Houdini, etc)...

But is there a reason why this may be counterproductive? (other than the crossing wires that this workflow creates)

Thanks and look forward to learn more and share the little bit i can.

M.

Title: Re: Vegetation shader
Post by: Juraj on 2017-06-10, 10:40:42
No of course it's better to reuse maps with more efficient network, but I didn't use Slate when I made this tutorial :- ).

I think I should post a new one using Megascans.
Title: Re: Vegetation shader
Post by: ktulu on 2017-06-10, 11:13:34
Would love to see how you are using Megascans' Atlases for your vegetation workflow.
Title: Re: Vegetation shader
Post by: makco on 2017-06-11, 00:12:20
Thanks Juraj, that explains why the duplicates.
Title: Re: Vegetation shader
Post by: cjwidd on 2019-10-08, 22:34:37
No of course it's better to reuse maps with more efficient network, but I didn't use Slate when I made this tutorial :- ).

I think I should post a new one using Megascans.

Juraj, the breakdown you shared is extremely helpful, I cannot thank you enough - including the linear controller technique you shared in your ivy post. Thank you so much!

I would also love to see a Megascans version if you are so inclined, it would be a great opportunity to study your approach.
Title: Re: Vegetation shader
Post by: Juraj on 2019-10-12, 13:09:59
The Ivy tutorial did use Megascan maps :- ).
Title: Re: Vegetation shader
Post by: cjwidd on 2019-10-12, 18:55:41
Yeah I made a mistake, I didn't realize Megascans textures were used in the ivy breakdown until I reviewed the post more carefully.

sry mods
Title: Re: Vegetation shader
Post by: maxdaiber on 2020-01-03, 15:19:40
The Ivy tutorial did use Megascan maps :- ).

Hei Juraj, where is that tutorial?

I am a bit confused currently with my vegetation shaders.
Title: Re: Vegetation shader
Post by: cjwidd on 2020-01-03, 17:09:49
You can find a breakdown of the vegetation shader here (https://corona-renderer.com/forum/index.php?topic=9837.0)
Title: Re: Vegetation shader
Post by: GeorgeK on 2020-01-08, 10:38:05
great job on this
Title: Re: Vegetation shader
Post by: STHA on 2020-01-14, 12:02:20
Hi,
Is this is still a valid method, considering that the vegetation shader provided with Corona Materials is very simple. I tried both methods and did not notice much of a difference hence the question. I understand the response may be, if it works why ask or it depends on the foilage type?. :)

I think Juraj your method is employing the Vray doublesided? method which I roughly recall, but last I used vray was 6 years ago.

Just asking.

Thanks for the help.
Title: Re: Vegetation shader
Post by: Juraj on 2020-01-14, 12:07:50
I am bit confused.. what "both" methods ? I do not use Vray Doublesided MTL, I use CoronaMTL.

I merely added "two-sided" maps to make different color/glossiness for plants.

Otherwise, nothing has changed :- ). But now you can do a lot of cool things like randomize color by elements.
Title: Re: Vegetation shader
Post by: STHA on 2020-01-14, 13:13:54
Both methods

1. ) Your method is Front/Back Map


2. ) Corona Materials method provided by Corona.
https://corona-renderer.com/stuff/helpdesk/leaves/config.jpg (https://corona-renderer.com/stuff/helpdesk/leaves/config.jpg)

 https://coronarenderer.freshdesk.com/support/solutions/articles/5000515643-how-to-create-realistic-leaf-or-grass-material-

I meant your method is similar to the vray2sided mtl. Maybe its the same thing. This is what I recall using before I migrated to Corona then ended up using the basic corona method shown in 2.

I just wanted to know whether there is a drastic difference between these two methods or rather is the difference that noticable. Perhaps it might be according to the light or distance from camera.

Ofcourse its up to user preference. but if your method is superior then Corona mtl should be updated so we use the best method. :)

okay I re-read your comment. You wanted a better variation or realism showing two different tonal ranges of the leaf. Got it.

Thanks


Title: Re: Vegetation shader
Post by: Juraj on 2020-01-14, 14:46:37
OK ;- ).

1) Vray 2Sided Material was just Vray's translucency. You didn't have to populate the second slot with anything. If you didn't, it was exactly the same as Corona's translucency.

2) My setup is absolutely identical to one linked from Corona's help. I also use single translucency map and value. This simulates what happens "inside" the leaf and the color inside is the same.

3) I added different Diffuse and Glossiness maps to back and front part of leaf. It has nothing to do with translucency. Leaves look different from front side and back side. Nothing to do with translucency or color variation among leaves.
    Here is photography: Front part is darker, more saturated and glossier/shinier.

(https://thumbs.dreamstime.com/z/back-front-side-bird-paradise-leaves-white-background-97436374.jpg)

4) Outside of this, it's possible to do lot more advanced stuff like using CoronaMultiMaterial to randomize any parameter (Diffuse, Translucency, Gloss, etc..) to make each leaf look different (younger, older,...).
5) It's possible to go even more advanced than that by using Vertex Color Gradient generated by Tree pograms (like SpeedTree or GrowFX),  that you will multiply on top of (Diffuse, Translucency or Gloss) to make sure than brighter younger leaves are on end of trees, and older are inside.

But the basic setup is always the same and there are no different methods. Just one.