Monday, December 14, 2020

Realistic Foliage Pack 2 "Trees" for Unreal Engine

 

Realistic Foliage Pack2 “Trees” 

Available as of Christmas Day on the UE4 Marketplace. Below find some detailed support about the foliage pack. Watch the demo video here:


Also make sure and check out the  "Bushes" Foliage Pack!:

About:

This UE4 Asset Pack contains 20 individual meshes representing 5 common species of trees and 5 unique indoor plant pots. Each tree species includes 3 procedural variations allowing you to create forests or large groupings without obvious repetition.

These trees are meant to fill the gap between high poly “Cinematic” models and lower poly gaming/VR assets. All “Hero” LOD’s are less than 20K polys with most below 15K and several below 10K. These models are ideal for architectural visualization but also most game environments.

There are Demo levels for each tree and a “Library” Level containing just the core content. Note that the staging environments for the Demo Levels are for demonstration purposes only and contain a few additional assets from the UE4 Starter Content and Content Examples. Each Demo Level also contains the UE4 Mannequin for scale reference.


*A Note About Foliage Instancing with Ray Tracing: 

If you plan on using the foliage assets with a Ray Tracing version of the Unreal Engine, at this time I recommend disabling "Cast Ray Traced Shadows" on your light source if you are planning to use the trees with Foliage Instancing. This will result in the use of Cascading Shadow Maps. There have been numerous posts since the start of RTX regarding issues with Foliage Instances and it seems yet to be fully resolved.

For an in-depth explanation of the problems and solutions regarding Ray Tracing and Foliage Instanced Static Meshes, please refer to my more recent post here. It's a bit long-winded but I think it will make many things clear if you have questions.

 Be aware that the renderings below are all from ver. 4.18 (no ray tracing) in an attempt to show the "worst case scenario".
Also note that you can choose whether to set the skylight to 'Stationary" or "Moveable" and this has a dramatic effect on the appearance of the foliage. I prefer the look with the skylight set to Moveable/Dynamic but other factors may determine this for you. In many of my scenes the skylight is set to Stationary but I find this leads to shadows/shading that are too dark. You will no doubt be importing the foliage into your own scene and will set the lighting as needed there rather than inheriting the lighting scheme from any of my demo scenes.


Here are a few shots from the asset pack:

(Note: All pictures and videos in this blog can be clicked on for larger versions)









Meshes:



1.       Coconut Palm



2.       Aspen



3.       Honey Locust



4.       Schefflera (Indoor)



5.       Spruce (Including winter snow version via separate material)




6.       Pots: 5 individual models, can be used with or without a tree.



For the Spruce tree there is a separate winter Snow Material, and though the mesh is the same as the summer version this can be considered a separate tree.

LODs:

Each set of trees contains seamless LOD’s that reduce to 3D cross-hatched planes (Front, Side and Up facing) plus an ultra low poly trunk. The exception is the indoor Schefflera tree that does not reduce all the way down to the cross-hatched planes since it is not meant for foresting. All models contain 4 LOD’s except for the Spruce trees which have 5. The final LOD for the trees is typically close to 25 polys (except the Schefflera as noted).

Here is a sample video showing the typical LOD's for one of the Aspen trees in the collection:


Here is another sample video showing the LOD's on one of the pots in the collection:



 All mesh models have custom UVW channel 2 layouts for baked shadows. Here is a sample of the LOD0 layout for one of the Honey Locust trees:



Materials:

There are a total of 3 Master Materials and 26 Material Instances for the core content of the asset pack.

1 Master Material for all the trees, 1 Master Material for the final Cross-Hatched planar LOD’s and 1 generic Master Material for the plant pots.

Several other materials, notably Landscape materials, are used for each staging environment. The staging also includes slightly modified versions of materials from the Starter Content and Content Examples where needed. You are welcome to use these if you so desire but they are not integral to the trees and pots themselves.

The FoliageMaster2 Material is the master material for all the trees which then use their own Instance based on this. Except for the final, planar LOD, this is an Atlas Material. There are 2 materials for the final, planar LOD version each tree. The original Atlas Instance from the full 3D mesh version as it is used on the trunk and an Instance of a Cross-Hatch Master Material. Each Instance of the “X-Hatch” Material is unique to each mesh model to match the shape and appearance of that particular tree variation.

 

Special Material Parameters, "Sub-Color":

The FoliageMaster2 Material includes a set of sub-routines called “Sub Color”. This enables additional features for some of the trees which can benefit from some localized, per-Instance Color variations. For example, the Aspen tree colors can by randomized for Fall colors trending toward yellow and red hues. With the Palm and Spruce trees, “Sub-Color” can be set to a brown hue resulting in the appearance of dead or dying areas on some of the fronds. The areas of “Sub-Color” variation are declared using either the Mask included with the Roughness, Alpha and Mask texture (the Mask declares just the “Leaf” portions of every tree) or through the Blue Vertex Color channel which has been set in the mesh for localized regions on some of the fronds. The Sub-Color routines can also be used for controlled, per-Instance variations on any tree if desired. Though there is already a Material Function included in the MasterFoliage2 material for this, the specific color of the variation cannot be controlled by the user with that function.

When using Sub-Color on any of the trees, be aware that the final Cross-Hatch LOD does NOT have any Blue painted vertices and so localized sub-colors declared using the Blue Vertex Channel checkbox will not translate over. When use of the Blue Vertex Channel is disabled, the effect uses the Mask texture to apply the effect to all the “leaf” portions of the trees in both the full 3D LOD’s and the Cross-hatched LOD. Just make sure and set the sub-color parameters identical across both Materials.

Below are a few examples of the kind of variation that can be achieved using the "Sub-Color" property:

A sample palm frond with no "Sub-Color" material property variation

The same frond with "Sub-Color" variation configured using the blue vertex channel in the mesh

The Spruce trees with no Sub-Color variation applied

The same spruce trees with Sub-Color variation applied using the blue vertex channel

The same trees again with Sub-Color applied via the default Mask texture (blue vertex unchecked)

The Spruce trees with modified Sub-Color making Blue Spruces



A normal summertime Aspen forest scene

The same Aspen forest using Sub-Colors to mimic a fall season scene



Here is an external link to a detailed video explanation (with audio descriptions) of the Material "Sub-Color" parameters and how they work:

Video: RealisticTrees_SubColor Parameters Explained


Wind:

Wind is supported in the FoliageMaster2 Material on all the trees through the Red Vertex Color Channel with parameters for Size, Speed and Strength.

Here is a demo video on the Wind Parameters as used in the collection:



Collision:

Collision is supported using the Simple primitives method provided for in UE4. All the trees have Capsule collision around the trunk allowing you to move through the leaves.

Inside the red outline you can see the green Capsule collision primitive shaped to encompass just the trunk on this Spruce tree

Another Simple Collision using 2 capsules to best match the trunk of one of the Palm trees



Material Parameters Exposed:

Diffuse – Texture, Tint, Output, Color Variation per Instance

Emissive – Amount

Normals – Texture, Intensity, Flip Green

Roughness – Texture, Invert, Intensity

Specular – Amount

Sub-Surface – Intensity

Wind – Size, Speed, Strength

“Sub-Color” – (See above) localized random variation per instance

 

Textures:

All Atlas textures are at 4K resolution. Cross-hatched 3D planar version textures are 1K except for 2 of the layouts which happen to fit nicely into a 1024 x 512 texture size.

The “RAM” texture contains separate channels for “Roughness” – Red, “Alpha” –Green, and a “Mask” (used by the color variation Material Functions) – Blue. This setup allows a single master material to be used for all the trees regardless of their unique requirements.

Here are some examples of the "RAM" texture used on the Aspen trees in the Atlas material:


Red Channel mask used for Roughness

Green Channel mask used for Alpha cutout

Blue Channel mask used to control color variation on only the leaves


A similar mask texture is used on the final, LOD3 Cross-hatched Material but Roughness has been replaced by an additional mask used to make adjustments to the Up-facing plane on the cross-hatched planes that make up the canopy of the tree on this ultra-low poly LOD version of the mesh.




Honey Locust Tree. The Final LOD Cross-Hatched Texture Mask ("MAM") 



A breakdown of the Mask channels for the Honey Locust Tree Cross-Hatched Final LOD texture seen above:

Cross-Hatched Final LOD Texture mask: Red Channel = Up-facing Polygon Mask

Cross-Hatched Final LOD Texture mask: Green Channel = Alpha Mask

Cross-Hatched Final LOD Texture mask: Blue Channel = Leaves Only Mask


Providing a separate Up Facing mask allows you to control this polygon independently of the rest. Facing upwards, it often receives a bit more light intensity the the rest. With a separate mask you can adjust this polygon to match the rest of the tree in any given lighting scenario. The separate Blue Channel is used by the Sub-Color routines where needed so that only the "Leaf" portions of the tree are affected by custom color adjustments, not the trunks and branches.

I'll also note here that the Normal texture map for these final, cross-hatched LOD's has been rendered from the "Render to Texture_LevelBP" setup in the Engine Content folder. This produces a World Space Normal texture map that needs to be converted (in the Master X-Hatch Material) to Local coordinates. Hence the Normal texture maps for the planar tree versions look different than you might expect.

There are a total of 99 textures. 82 are unique to the core foliage asset pack content and 17 are from the UE4 Starter or Example Content and are merely for the staging environments and are not integral to the core foliage.

 

Monday, May 11, 2020

UE4 Marketplace Foliage Asset Pack - "Bushes"

Some further technical details on content in the new "Bushes" foliage asset pack on the Unreal Engine Marketplace. As the Marketplace description says, there are 7 species of bushes, each with 3 procedural variations for a total of 21 individual models.
The species included in the pack are:
Russian Sage, Rose Bush (w/flower color customization options), Evergreen Hedges, Spartan Juniper, Compact Pfitzer Juniper, Cotoneaster w/berries and Mature Lilac.

A sample video can be found on YouTube here:
DAS Foliage Pack Vol.1 Sample Video

Also make sure and check out the new "Trees" Foliage Pack!:
DAS Foliage Pack Vol 2 "Trees"

Within each model is a series of LOD's. Typically 4 but some of the Evergreen Bushes have 5. The final LOD for most models is a 3D cross-hatched set of planes totaling 6 polygons. Below is a series of screen captures from a Juniper model showing the LODs and their associated information from the UE4 Static Mesh Editor. The progression starts with LOD0 and progresses to LOD3:





Most models start well under 10K polys for the hero model with some only several thousand polys.
All the DAS foliage models are created to some degree from our custom "Tree Creator" maxscript, now in version 7. This script has been in constant development for over 5 years.  Below is a  sample of the dialog:
Over the last few years I have been using the script to create foliage for a number projects. It came to my attention during these projects that there was a lack of "bush" models available through the marketplace and that even some of the excellent Speedtree Library models were too specific to match the given landscaping plans. The models I have released are intended both for games as well as architectural visualizations.

Below is screen shot from the "Library" level in the foliage pack project showing a breakdown of the specific models included:

In this next screen capture, I have included the shader network for the Bushes Master Material. It uses 3 textures: 1 for Diffuse (Albedo), 1 for Masks (including Alpha transparency) and a Normal map. You'll see the parameters exposed by this material in a capture of the Material Instance settings below that.



I hope this gives you a better idea of what we're trying to achieve with this first library collection. Thanks!

Sunday, May 10, 2020

Coming Soon

Coming soon will be a foliage library of 7 species of bushes for Unreal Engine available on the Unreal Engine Marketplace. I'll be posting detailed information about the content here along with some background, going into a little more depth than the marketplace descriptions. For now, enjoy these teaser shots.Stay tuned!











Saturday, January 14, 2017

3ds Max 2017 Command Panel Docking Change

Well, this might seem like a small bug, and frankly it is, but I am always bothered when historical workflows and functionality are apparently abandoned for no reason. Such seems to be the case with the Command Panel in release 2017. I don't know of this is a permanent removal (on purpose) or just a 2017 bug with the UI changes in 2017.
Now a lot of coding work has been done under the hood for 2017 and I welcome  new conventions and some changes but I'm mystified by this one. Perhaps it is just my particular installation and I will check several others to verify, but the un-docking feature of the Command Panel has changed in 2017. I remember when this feature was new in release 3 of Max and it was such a welcome option, especially for those of us using multiple monitors, being able to drag the Command Panel off to a 2nd monitor and have all that much more real estate for your main viewport.
In 2017, a big new feature is of course proper scaling of the UI on Ultra High Definition monitors. 2016 and prior releases struggled with the ability to display the UI on 4K monitors (or higher if you're out there) rendering the software useless really.
Anyway, to get to the point, I always floated the Command Panel by grabbing the UPPER LEFT corner and tearing it off. Sometimes that little, special location could be tough to nail down (you know that little floating cursor icon you need to get), but this was the convention I always used. Now you could also tear off the Command Panel by grabbing the right hand edge but I don"t think I ever saw anyone do that. Of course you could minimize the Command Panel to a simple "bar" on the right by right-clicking once you got the "Floater" icon with the mouse but I never needed to do that since I could tear the entire Panel off to a 2nd  monitor. Honestly, I kinda forgot about the right side of the Panel and the minimize option. But now, as of max 2017, you cannot access that special little upper left corner spot and get the "floater" cursor. It's just not there. You have to grab on the right side of the Command Panel to tear it off. Below are a few screen caps to show what I mean.
I spent an hour this morning researching this (call me an idiot) thinking it was a custom UI change or some sort of Workspace issue I needed to adjust, but it seems the upper left corner option is just gone now for floating the Command Panel. I only point it out in case someone else is wondering why they can't tear off their Command Panel in 2017 as I first did. We're talking 16 releases where this has been a common convention and now changed. I have not seen a single comment about it so apparently this little removal hasn't been worth noting. Oh well....






Monday, March 14, 2016

Quickly Zoom to Selected Objects Material in Slate

One of the things I've wanted to be able to do for a long time in the Slate Material Editor  is quickly find the material assigned to the selected object in my scene and have it be the focus in the SME view window. Of course you can use the eye dropper or scroll through the list of scene materials and drag it into the view, but come on, that's too hard. As it turns out there is a shortcut. Well, kind of. You have to assign a shortcut key, but the task is an option in the Customize Menu as found below:


The customize option is found under the "Medit Tools" category called: "Edit Selected Object's Material". Assign a custom hotkey and you're set. I think I chose Ctrl+Shift+S. Anyway, this option brings the material of the currently selected object up in the SME and centers the view around it.