25 : Shooting from all sides

6 minutes read

Scene setup

In this scene the characters are firing their weapons in different directions.

The bolt/slide of the weapons were not animated, because I had already joined them as a single object, and it was not worth fixing it, since it would not be very visible.

I am very happy with my Mosin animation ! Even though the bolt is not moving, it is barely visible.

Background

The background footage was recorded on Interchange at the south of the OLI store. It was then used in the Motion tracking window to import the camera movement into Blender. This time, setting the scale was easy thanks to the containers in the background.

Shadow and light catcher

Since the characters are firing their weapons, I intended for the muzzle flash to light the scene. Shadow catchers can also be used as “light catchers” : to do this, select the light source, and then deselect Object properties/Visibility/Shadow catcher.

Then, enable View layer properties/Light/Other/Shadow catcher. This will make the shadow/light catcher information available in the compositor. By multiplying it onto the render, the projected shadows will darken the background and the light will brighten the background. This process will be shown in the compositing section, but Nik Kottmann’s tutorial also explains it in-depth.

I originally modeled shadow catchers for the ground and the containers, but the light did not reach the containers, so I later removed them.

scene overview
Scene overview with the container shadow catchers, which were later removed.

Muzzle flash

Making smoke simulations is always a fun moment. Especially when you run into problems. Which is every time.

Each character has a particle-emitting mesh parented to the their weapon, made by scaling half of a UV Sphere. Field weights/Gravity is set to 0 so that the particles fly away only based on their initial velocity and direction.

mesh emitter
Particle emitter and point light parented to a character's gun.

The particle system is then used as a flow source to create the smoke system. This is similar to the explosion in the first scene.

Each character has a cubic simulation domain in parented to their gun. To enable/disable smoke emission, the particle source is moved inside/outside the simulation domain. The particles already emitted in the domain are not affected. This method avoids having to setup one particle system per shot. Refer to this post to discover other methods.

The muzzle “flash” itself is a single point source placed in the middle of the smoke, with a non-zero radius to smooth the shadows. This gave better results than trying to adjust the smoke shader. The flash is created by animating the Power setting.

Caution

I ran into problems with these simulations, because I originally duplicated the objects to apply them to other characters. However, the simulation data was always saved in the same folder for all characters, which means only one out five simulations gave me the result I wanted. To solve this, I changed the simulation data folder for each character in Physics/Cache.

cache folder settings

Casing ejection

The casing ejection was made with a small plane mesh emitting particles, which are rendered as a casing model imported from the game. The number of particles was chosen so that the particle emission approximately matched the fire rate of the weapon.

particle settings
Particle system settings.

The floor has its Physics/Collision enabled so that the particles bounce on the floor, but this does not change the orientation of the casings, which looks unrealistic. A simple way to fix this is to animate the original mesh object to make it rotate on one of its axis. This will also make the particles rotate, which is not realistic, but it is a simple way to give the impression that the casings are affected by the ground. Their initial rotation is also randomized in the particle settings.

casings
Top : particle system with random initial rotation and animated mesh object. Bottom : default particle system.

Looping animations

Each character only plays a single animation looped over the entire sequence. To do this :

Important

The graph editor’s Modifier menu is only visible when a curve is selected. If it is not visible, try selecting a curve or a keyframe. Make also sure every curve required for the loop is selected (yellow) in the panel on the left.

graph with cycles modifier

For a video explanation, refer to Woodplank’s tutorial.

Characters were animated with different frequencies based on their weapon (for example, the AK-74 is firing slower than the M4). This was rather difficult to do, as the scene is set to 23.98 fps, which does not leave a lot of freedom to make a detailed animation.

Compositing

To use the shadow/light catcher, View layer properties/Light/Other/Shadow catcher must be enabled. This adds a Shadow catcher output to the Render layers node. After placing the foreground render over the background video, multiply the resulting image by the Shadow catcher output to obtain the additional light effects.

Important

The “light catcher” effect will not show up unless this method is applied.

compositor setup