Unreal

NPR Final Touches

All the bells and whistles – Ambient Occlusion, Depth fading, Image Adjustment, etc. Highlights can now be dialated or eroded. Support for separate outlines of normals. Presets and clean menus. I think this shader is about done.

 

NPR Shading Continued

I’m continuing to refine the NonPhotoRealistic (NPR) sketch post-process in Unreal. This is using completely different methods now, I’ve changed the method of convolution edge detection for outlines, and am using world-aligned sketch texturing in the shadow and highlight regions.

The background is also given a custom color and texture. The light source is defined through any number of unreal lights.

There is now support for sketchy highlights and varying line colors, and much better response to light. Ideally the post process would support variation in outline width, although I don’t have a good method for that yet.

There are options to use procedural line, dot and crosshatching for a more comic/newsprint look.

The results are very solid and smooth in motion, with no temporal swimming or distractions. I see this shader being ideal for architectural stylization and general NPR usage. 

To get a more chalk-like effect with ink outlines I take this post process and combine it with an NPR painterly process which applies brushstrokes on the image in world space. Here’s the result:

Vector Fields in Niagara

The use of vector fields to set particle velocity is pretty well documented when one is using cascade, but Niagara is still something of a mystery for many users.
 
Vector fields are indeed supported, using the same .fga format, and their capabilities in Niagara are extended in a number of key ways. In Cascade a vector field can only influence velocity directly, but in Niagra support is built in to just as easily use the field to drive acceleration, which can result in a much smoother and more natural motion.
Niagara Vector Fields
 
Furthermore, Niagara’s open approach to, well, everything, allows users to dig in and perform much more advanced effects. With custom modules and a bit of hacking it’s possible to blend between multiple vector fields for instance, or use a vector field to control any attribute such as size or rotation of particles. Epic and Unreal have provided us a playground with a ton of potential.
Niagara Vector Field Stack
 
Here’s an example which barely scratches the surface, but should be enough to get anyone reading a head start into using vector fields in Niagara. In this very straightforward effect a vector field is used to break up the usually spherical shape of a bunch of particles emitted from a sphere by varying their velocities. The result is a more irregular, jagged blast of particles which looks much more natural than a simple firework, and for almost no extra effort.
 
All that was done was to place two pre-made modules in the “particle update” region.
 
The “Sample Vector Field” module specifies the vector field to be used (in this case one of hundreds which I am releasing on Unreal Marketplace, but note there are free vector fields both in Niagara and here on this site). It also has some very nice advanced options allowing you to scale and transform the vector field, fade out the influence by distance and so on.
 
Then the “Apply Vector Field” follows immediately and applies a considerable amount of velocity to the particles every frame. Bang, a nice irregular shaped explosion. That’s really it.
 
To control the effect to a greater degree I took things one (small) step further and created a custom module. I had some particles which were slowing almost to a stop, so I first wrote a simple logic which kills any particle below a user-defined minimum velocity. This however killed some slow particles at the beginning of the explosion I liked, so I added a factor which accumulates a value proportional to the particle’s age (Particles.AccumulatedDeltaTime thanks to a GDC presentation 2018) and used that to specify a user time threshold after which particles could be killed. Here’s a look at the graph:
Niagara Custom Module
 
I could have just as easily tweaked the vector field’s falloff to free up the offending particles, but this custom module is now saved and ready to go any time I need it. SWEET.
 
Niagara looks daunting at first, but it’s really very logical and straightforward, and allows for very deep customization. Vector fields are supported nicely, and have far greater potential under Niagara than the simple implementation in cascade. So don’t hesitate, dive in!