After looking at the fire levels in Tomb Raider, I thought fire in unreal 4 would be a good place to start with my practical work. I’d like to have a showreel of the most common fx needed as quickly as possible. I used a digital tutors tutorial, along with the Unreal 4 documentation to make this. Smoke Material The first task I did was create the material for the smoke. Generally, materials drive the look of an effect, whereas the cascade particle system drives its behavior. I created what is known as a PMask, a .tga texture that uses different images on the red, green and blue channels. I used masking and the cloud rendering filter to create this, as I was going for a realistic look.
The material set up for the primary smoke involved panning two versions of the blue channel over the top of each other, one appearing smaller due to altered texture coordinates. Each variant of the texture was multiplied by a constant number so that one would have greater contrast and therefore stand out more.
The wisps were multiplied by very small numbers to make them barley visible, and then stretched in V whilst panning to give a ripple type effect.
To combine these elements, I multiplied the primary and secondary smoke, and added the wisps to it. I then interpolated this with a constant (to quickly change intensity if needed) and the opacity set up. The opacity is where the red and green channels come into use. I multiplied them together, then added this to the alpha in the lerp. This created a soft radial gradient with a smoke texture.
Too add more realism to the material, I added depth fading and camera-based depth fading. What this means is that when the camera passes though the smoke it will not pop in and out of the view but fade based on position of the camera. It will also fade out when intersecting with objects. I used the UE4 documentation for this, as the tutorial was for UDK, and the methods are slightly different. I connected a SphereMask to a constant (set to 0 to make the material fully transparent) and the PixelDepth. The sphere mask draws a sphere around the object, and will mask out when the player is not inside it. As this means that the material is only viewable within the SphereMask, I added a OneMinus to invert it.
The depth fade for intersecting is a lot easier – just one node!
To finish it all off I multiplied the camera based depth fade with depth fade and the alpha of vertex colour (later switched to particle colour to give more control in cascade) which was hooked into the opacity of the material. I then multiplied the smoke with the rgb of vertex colour and then with a constant for quick changes. This was hooked into the emissive colour. The material is an additive type, so this allows it to blend with its surroundings as if using an add function, which is really nice for the nature of smoke.
I added some basic values for initial velocity, size, etc, and moved into the curve editor for colour and size over life. This was the first time I have used curves for animation so it was very interesting. I gave the smoke a brown base colour, moving into a white at the top.
I also had it fade out near the top to give the idea that it was rising and dissipating into the air. After that, I made it emit from a cylinder location to give it a better shape at the bottom, and added rotation and orbit modules to give a free flowing, turbulent look.
I then added a second emitter, a duplicate of the first, which I could modify to become the inner smoke.
The size of these particles was bigger, the emitter was moved to the center of the effect and the velocity, rotation and orbit were taken down, to create a more dense patch of smoke in the middle.
Fire and Ember Particle Emitters
The fire material was created using a subUV (spritesheet) texture from digital tutors. It went though the stages of a flame from its small start to its big middle to its small death. I used a power and multiplied and added it to itself and various constants to get a glow on the typically brightest parts of a fire.
I got rid of the PSA square mode and added a subUV module, so that cascade would recognise the texture type. By letting it know that this is an 8×8 grid, cascade was able to find each image.
This did not need quite as much tweaking as the smoke texture. I used the size by life to start off large and die out small at the end, as a fire does. I also added a rotation rate and orbit to again add some randomness and turbulence to the effect to make it seem more natural.
After this I added the sparks and heat distortion. I used unreal’s default shaders for both of these – I would like to make my own at some point. The sparks were emitted from a cylinder larger than the fire and moved up so that they appeared to be coming from the trail end of the fire. They were given a small orbit.
The heat distortion effect was largely the same as the sparks, but started lower down. This had to move with the fire in order to give the impression that the heat from the fire is distorting the player’s view of the world.
To make sure that the effect ran smoothly, I used a couple of optimisation techniques. The first was LODs. I set two levels of detail, one being the original effect, when the player is within 1024 unreal units of the effect, and the other being a less intensive version for when they are further away. This was a copy of the original effect, but every emitter has its rate cut in two to lessen the number of particles that the system has to deal with.
The second technique was the bounding. This is generated automatically to keep the particles within a certain boundary. As you can see below, the box was far far too big, so I took this down. Particles outside of it will be killed, again reducing the number that will be drawn.
This is the final effect. I’m happy with it but if I want to be a professional in this field I need to critique my work heavily so I can get to a good level. I think that the smoke would make a lovely steam effect, but that’s not what I was trying to do!!! It needs to be more opaque, have stronger contrast with areas of white coming though more and have more turbulent, less wispy movement. The embers need to come though more, as they look good up close but can barley be seen from further away. This could be achieved by making them bigger or pushing up the rgb values in the material to make them very emissive.
Look at how this can be integrated into an environment or how changing its style can be achieved, depending on where I want to go with the project. Could possibly do both to help me figure out my direction. I want to learn about creating my own subUV textures, and more about matinee since I had so much trouble getting a decent recording of it. I would like to create my own spark and heat distortion materials. I could possibly compare this with the low poly fire I made for Seek, thinking about how each work within their respective styles.