Game Effects

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:

Heightmaps for Unreal

I’ve released 25 terrain/landscape maps for the unreal marketplace. These are intended to act as starting points for environmental projects, hopefully people will find them useful. All heightmaps are of course made in Houdini, and tend to be several miles across.

The most interesting thing about this project was creating the procedural material in unreal which textures large environments based on criterial like slope, height etc. This project is over 10 gigs of assets!

In all, this was a very fun project, and very rewarding work. I can’t wait to see what people do with these heightmaps.

Niagara Game Effects

I did a little job for a studio in Prague recently which consisted of a series of “spell” effects for a RPG. I can’t show any of those effects of course but along the way I made a number of other interesting little Niagara effects, here are a few:


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!

Vector Fields 2

While working on a release of 100+ vector fields for the Unreal community marketplace I built a few handy tools to generate vector fields from curves, surfaces etc, and to blend them with constants, noise, various forces, other vector fields and so on.

For example, here is a vector field using a spherical surface and a “pull” force to create a forcefield effect:


While this vector field uses a series of curves mixed with flow noise for a “jet exhaust” effect:

In Unreal a single cascade emitter can use these vector fields and GPU sprites to create a very broad range of looks:

So to celebrate and promote the upcoming release on the Unreal marketplace I’ve generated 10 free vector fields in .fga format for download here. Enjoy!