Download

Three questions about two sided material lighting, shadow proxies and terrain layer height blending

O mighty gods of Egy,~Unreal, I beseech thee, grand me peace for my questions!
I have started trying to create my own Aspen Farmland biome, Pallas’s Cats included, but I have ran into a few things I can’t seem to figure out or get google to instantly solve all of my problems;

Number one! The Two Sided Foliage system;
e151cea0fcb7144835e1266bb04a1f37c12a0461.jpeg

I have set the Scattering Color to red to illustrate my conundrum better, what are the best practices to create proper lighting for a tuft of grass? Whatever I do, it seems I always end up having the scattering be on all random sides of my model, which looks even worse when I paint them in mass;

I have tried inverting the polygon’s facing normal in various patterns, all facing the same way, all facing out, in, spherical normals, single normal facing up, but I can’t seem to solve this in any other way than simply having real polygons on the backside…Though then it seems I broke the Scatter feature of the Two Sided Foliage shader as it seems to need a double sided material to work…

Number Two! How can I exclude my grass from light mass computations? I painted 140k instances and Lightmass ain’t getting past Zero percent on preview mode.

Number Three! For performance, want to create a simple solid model to cast shadows instead of having my alpha card dense tree do the real shadow casting, is there a way to add an invisible mesh that casts shadows?
I tried adding Two meshes, one without shadows, one one with shadows and with the “Hidden in game” flag set, it seems the shadows disappear when I enter game mode regardless if I have them set to render.

And finally, Number Four! What are the best practices for creating height maps for Unreal, that work with terrain layer heightmap blend, here is how my height maps look like~
f0ba05a64b963ed946f6eb0b728ece6cba3f778f.jpeg

But my results are depressing:
931c02ad084f269bfd62701cbb8fe00335abb77b.jpeg

Sorry for the question humble bundle pack, I wasn’t sure if I should make separate threads for all of them, but since they are all Rendering related, I thought this would be okay.
Thanks in advance;
-M

  1. Two sided foliage shading works generally like that.
    If the normal faces the light, you will see base color mostly. If the normal faces away from the light, you will see subsurface color mostly. Due to some simplifications, it is cheaper to render than subsurface shading model and grass is a good candidate to use it. Generally, the issue you are showing, is dealt with by a combination of measures. Using averaged normal’s on grass clusters and a subsurface color, that is not that much different from base color is usually enough.

There are some more advanced tweaks that require shader files editing, that can be done.

  1. If you are using landscape grass system for your grass, each landscape grass type has a tickbox called Use Landscape Lightmap. Enabling it will force grass to use landscape lightmap instead of baking its own.
    Generally, enabling lightmapping on every grass instance in your world will be pretty bad performance /bake time wise. Use dynamic shadows for grass.

  2. There is nothing UE4-specific in authoring heightmaps. Your is fine. If you are using heightblend for landscape, you might want to give it a bit more contrast.

Thank you for the quick and useful reply, it looks much better now, actually it turns out that despite me averaging the grass normals to a sphere, I was failing to import them in Unreal, I noticed when I tried to average them to just 0,0,1…
Using the grass system like a normal person works too, I was actually painting the grass using the Foliage system…
Now all that’s left is to figure out why my terrain won’t blend.
I did try to increase the contrast, I am using a cheapContrast, set to 0.14, but it doesn’t seem to help.

The contrast just makes the line sharper, which is strange because on the Unreal Documentations wiki pages, on the Height Blend page, they show this beautiful height blended set of textures, like down at “Landscape Layer Blend Types”