The main reason for jumping on UE 4.26 was to try out the new hair stuff. Today was the day!
Long story short, after burning 4 hours trying to work out how to export Alembic and import it into UE, I did, finally, get some hair onto an NPC (the rat). And after another couple of hours tinkering, I got it looking vaguely OK.
And then I tried it in the build and it absolutely destroyed perf, so I deleted it all.
No hairy rats for you!
(Oh, and I fixed a couple of UI bugs...)
I've not hit a dead-end like this in a long, long time… But it happens.
Hair was gonna be the topic of my next vlog, so now that’s not happening I need to pivot to the next “exciting” thing on the list: Volumetric fog and particles…
The Old Forest (dunno when it becomes the New Forest, maybe in a sequel) is meant to be foggy, and the Dungeon in this location is going to be built around a similar idea.
Up to now I was leaning heavily on the post process volume to do all the lighting and palette work, but it’s obvious that’s not going to cut it. So, I ripped all that out and made a new set of materials, with a new palette, and “painted” the entire location.
My game world has a sun, a moon, and a skylight (for bounce), that are all angled, and coloured, using curves. The curves are indexed by the time of day, through a DayNightController. It’s a nice and clean system, that I’ve written about before on the blog.
If I want to create a dark and spooky forest, I’ll need to be able to blend between different Post Processing Volumes and different lighting setups.
Today I wrote a wrapper class for the post process volumes, that can reflect the volume’s blend weight, and hold a map-specific struct of curves for the lighting. I also modified the DayNightController to be able to use the current, default lighting setup, or blend between two different setups.
It works really well.
I also made a PostProcess material for the Forest’s volume, that multiplies a couple of 2D cloud textures that are rolling around on a funky sine (very very old school, but I like it) and started work on the volumetric fog.
Lots of leavers to pull, to get this looking just right, but the first pop isn’t a million miles away from where I want it.
The fog isn’t bounded, meaning it’s visible in all map locations, so I need to be able to blend it along with the lighting and post.
I extended the wrapper class from yesterday to hold fog components, and use the blend weight I was already calculating to lerp across the density values. Means my wrapper class is now badly named, but, it works like a charm!
I couldn’t get the post process material for the screen overlay to blend correctly. For some reason the sine offset into the texture sampler runs at different speeds when it’s actively blending. I tried material parameter collections and dynamic material instances, but neither worked. In the end I just removed all the Sine based UV gubbins and went with a straight UVpanner. To be honest, the shader is faster and you wouldn’t be able to tell the difference unless you stared at it for a couple of minutes (the direction would never change). I have absolutely no clue why this is happening, though.
Made some new effect instances, for impacts, that match the updated colour palette on the foliage, and made a new blend material, so I can vertex paint the ground to create a bit of a smoother blend.
The end result is pretty good:
Next week I’ll start adding the volumetric particles, and get some better lights into the map…