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).
TreeIT does make excellent trees super easy though…so saving a huge amount of time making them in the first place.
![:smiley: :smiley:](https://forum.flaxengine.com/images/emoji/twitter/smiley.png?v=10)
-
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: :rofl:](https://forum.flaxengine.com/images/emoji/twitter/rofl.png?v=10)
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