Texture on instanced mesh very different from same mesh placed statically

While setting up a system to allow chopping trees, I noticed that the texture on my tree when it is painted as foliage is quite different than the same mesh placed statically. What gives?

The middle tree is the statically placed one, and what it should look like. All trees in view are using the same mesh.

Hi Vaelek -

Are you using a second UV channel to correctly tile your trunk texture on the tree? If so try moving that unwrap to UV0 (Channel 1) and setting up multiple Material IDs (Multi-Materials in Maya) and then reimport the tree, they should look the same.

Thank You -

Eric Ketchum

They all came from a free foliage pack. I’ll export one and check it out, though I use Blender not Maya.

The tree has the texture UV as the first channel, and a lightmap UV as the second. Looks pretty standard to me. Renders in Blender the same as the “good” middle tree in the pic.

After poking around some more, I see it is using a Material Instance with the tiling parameter overriden. This does not seem to be reflected by the static mesh, only the instance mesh. I’m not really familiar with this yet, but it seems to be the source of my issue. Any suggestions on how to make them match?

I think I may look for different foliage to test with. Through some more testing, both instanced and static are responding to the tiling, but static seems to need it reduced by a factor of 10 to achieve nearly the same look. So duplicating both the mesh and material, and using the reduced version when I replace the instance with a static version sort of works, but the texture position does not match between the two. I also noticed that there is supposed to be a sway that is only happening on the static placed version.

EDIT: I reduced the instance material to a normal material using only the diffuse and normal, and now they look identical… Rather ugly, but identical… So at least I’m on the right track…

Hi Vaelek -

Look at the Foliage or BP that is placing your Instances and see if they are using the exact same Material as your statically placed one. If not look to assign either version the Material Instance or the Material and then they should render correctly, assuming that the BP or placement method for the instances do not change a variable in the Material based on object Position or PerInstanceRandom.

You are definitely on the right track though.

Thank You

Eric Ketchum

You can see a bare bones new project with this issue here if you like. I wanted to rule out any other possible interference from the rest of my main project. Dropbox - Error.

I’m at a loss. The exact same mesh is being used statically (on the right) and via foliage (on the left), yet they don’t look the same. I’ve turned off all lightmap and shadow options and even the lighting is inconsistent between them after baking. While putting this test level together, I also noticed the trunk sway from the Material Instance has no effect on the foliage instances.

All I can figure is that either Material Instances are not fully supported on foliage, or this is a bug.

Hi Vaelek -

It was your use of Object Radius in the UV Tiling which is causing the problem. While Object Radius does get the Radius per Object in the scene, Foliage is calculated as one object and therefore getting a very large radius compared to the value returned for a single placed Static Mesh. Instead use Object Scale (which is allowed to be calculated differently in each foliage instance) in the following setup and your tiling across the Static Meshes and Foliage will be exactly the same.

Thank You -

Eric Ketchum

Thank you so much. I probably would have never figured out that issue!