How to use the foliage shading mode?

The foliage shading mode says it supports light transport through the object. I want to use this on tree leaves.

How do I achieve the impression of different thickness in the leaves (veins, irregularities)? Basically this: Chapter 16. Vegetation Procedural Animation and | NVIDIA Developer Section 16.2

So far I’ve tried connecting my translucency color texture to the subsurface color input but whenever I look through the leaves towards the sun, there seems to be no effect of any sort of back lighting. Im new to the advanced foliage stuff and Flax so what am I doing wrong?

I went a different direction since I have no need of actually viewing through the leaves but the effect ends up similar. What you are trying to do needs 2 Sided materials/meshes to do properly. You can also use this method for other things that have some translucency during bright lighting. Smoke and Mirrors sure but is that not what we are doing is almost all smoke and mirrors?

The following should get you what you need. This method also works with any game/rendering engine (very portable). Most of this is good texture prep. The benefit here is excellent performance improvements because of not using heavy materials (if available) for things that will be heavily used in the scene (grass, plants, trees…etc). Trees will use 2 materials…Bark and Leaf. So save where you can.

I don’t remember if Flax Materials even has a 2 Sided option. I did a quick documentation check and it has not changed and not available.

  • Soft Edges. You can use a small Gaussian Blur to the edges of the leaf texture to get a nice soft edge blend with the lighting model. Flax GI handles this very well. This works best with FXAA but TAA is fine but only noticed when up close (some TAA pixel dithering as normal with TAA). GIMP 2.10 (I am using 2.10.18 and see no reason to use any later some minor issues with later updates but are being fixed) has excellent layer filters. Much better than Photoshop in my opinion.

  • Emission. Super simple to make an emission map of your leaf texture and add that to the material input. Using the soft edge method above gives an incredible soft emission map.

  • Two sided material or set the leaf meshes to have 2 faces (simply offset by 0.001 or 0.002 in Blender). I prefer the mesh method since it gets rid of Z-Buffer issues associated with 2 Sided materials and other anomalies. It does add polys but most vegetation is low poly count and require no LOD. And yes…doing trees sucks (time consuming). :grinning_face_with_smiling_eyes: TreeIT does make excellent trees super easy though…so saving a huge amount of time making them in the first place. :wink: :smiley:

  • Flax GI is excellent and easy to get the current lighting. You will need to play around with the amount of emission that you want but it is simple to make a clamp on the values.

  • You can use an Area/Scene object to calculate the lighting values (like a Weather Controller) then distribute the appropriate value to the material (same material instance). Super fast and works well. Flax also handles this well in my set up.

Last note…the oArea is something I took from the NWN1/Aurora engine. It is the Object of each Area (Scene/Level). It handles all the things that happen in that particular area…NPCs…Variables…Dead Objects…all sorts of things. I use this to handle the Sun/Star Light (GI), Weather, Time, NPC Arrays…all sorts of things (all of this is saved to the .NET style databases). Then listeners use what oArea sends.

Wait…Olander…wtf? This is about Vegetation Lighting! Why go off on one of these tangents. :rofl:

This includes all vegetation lighting since Vegetation is in the Area/Scene/Level and needs to have some sort of value control. This also applies to wind direction (Normal Map panner direction and speed). If only static vegetation is needed then you can manually set the emission but each time you adjust the GI Lighting you will have to manually set the emission again to what you need. My opinion is to simply do the work once then it will automatically adjust as you set up the scene how you desire.

In any case. There are other methods to do this but this is by far the simplest and best performance. The visuals are excellent and only slightly noticed when very close.

Cheers
O