Chroma Key and Simulations in Blender: Breaking Glass

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to this blender video the goal of this video series is to provide you with some green screen footage that you can use to practice important blender techniques in the description you can find all the details related to the green screen footage and how you can download and use it the idea is to learn some of the most interesting techniques and simulations in blender while making a real animated sequence based on a real video all exercises begin with a green screen footage as the main goal of this tutorials is to integrate a live action into a 3D environment as a result you must first deal with green screen techniques camera tracking and compositing the idea is to focus each video on a simple action performed by the actor in this way we avoid any unnecessary complexity and you can focus only on a single and specific technique so for example each video will consider a specific simulation modeling technique environment creation material and so on in this video we'll consider the destruction simulation with the physics of the rigid bodies [Music] also we will take a closer look at the techniques that are the basis for all subsequent videos in this series such as chroma key and motion tracking thus you can refer to this video for details on these techniques now we'll go over how we recorded the video and the techniques we used in blender but it will be up to you as an exercise to implement all the individual steps also keep in mind that the final rendering we show here is simply a fast preview of what can be done with this footage in order to avoid wasting too much time in preparing the example today we're diving into a fascinating concept simulating and integrating a shattering glass into live action footage we've got our actor pretending to punch an imaginary glass object in front of a green screen by the end of this tutorial we'll have a realistic 3D glass shattering Upon Our actor's punch note the speed direction and impact point of the punch this will inform the position and timing of our glass shattering simulation we shot two videos the first one is recorded with a moving camera over a gimbal this can be used to practice the camera tracking technique remember to take note of the focal length you are using this is important for the camera tracking technique then we shot a video with a still camera this can be used to add variety to the scene and focus the attention on the actor's expression we also have to think about the lighting in this case I'm going to use two direct and colored lights a front red light and a back blue one the other lights are used to illuminate the background it should be lit as evenly as possible in order to be easier to remove it in post-production however consider that we also want to frame the floor and this is General harder to illuminate indeed when we light the ground we also illuminate the actor and this can conflict with the main light of the scene so in this case we used a soft light from a big soft box this was enough to illuminate the ground without overwhelming the two main lights as you can see we also added some markers they are essential for the camera tracking technique we'll see later also consider placing some markers at a defined distance in this case the markers on the floor are positioned one meter apart this is useful to set the 3D scene at the right scale finally it could also be useful to shoot a short sequence with the video Checker this gives a useful reference for the color and white calibration now we have to remove the green background we can do that in After Effects or any compositing software you prefer import the green screen footage and create a new composition when we have a video of an entire green screen set as in this case it is not easy to have a completely uniform illumination as already mentioned before so we can't key out the green screen in a single step we have to mask different portions of the video and apply different settings for each of them so the first step is to consider different portions of the video with an obvious diversity of lighting or in relation to the material used as green screen here I duplicated the video and created four masks that correspond to the different areas of the video I want to treat separately of course the masks must match each other and be precisely aligned also remember to set the compositing mode of each layer as Alpha add this ensures that the video is properly computed at the edges of the masks otherwise we would see a line that separates the two portions now we can apply the key light filter for each portion of the footage choose a green color that best represents the average color of this specific portion of the video I generally prefer to choose it near the subject as this is the area that needs to be better keyed out Now set the view option to status this is very useful as the pixels are displayed as black gray or white depending on their transparency black means completely transparent now you have to adjust the clip black parameter until you achieve a completely black background then do the same for the clip white parameter in this case the subject must be completely white except at the edges Now set the view option as intermediate result you could also set it as final result but in this way we have greater control over the colors now apply the advanced spill suppressor filter in some cases it has to be set as Ultra if you notice a green border around the actor you also have to increase the spill range factor and the spill color correction property but we're not done yet we still have to remove some markers we can do that by creating a small mask for each of them animating its position and then setting its compositing method to subtract now we have a transparent video we could use it here in After Effects for the final compositing but I prefer another approach I want to add the footage directly inside blender we explained this technique in a video here in the channel this will give us the ability to Better Mix the real and virtual footage and we'll see this in a moment so we need to export the video with the transparency informations we can do that in two ways in general the better solution is to export the video as an image sequence for example the PNG or exr sequence this ensures the best quality however for Simplicity reasons we can also export the video as a movie but we have to choose the right format that preserves the best quality so add the composition to the render queue as a format I'm going to use the QuickTime one in the format options select the Apple prores 444 codec finally set the channels as RGB in Alpha and the color option is straight this means that the alpha channel is not multiplied with the background color okay now we have the footage we can use for the compositing the next step is to match the camera movement and blender and create the virtual scene in order to do that we have to open the motion tracking panel and import the original Green Screen footage let's also check that the frame rate of the scene is set to 25 frames per second the same value we used to shoot the video before proceeding with the tracking let's also set the camera parameters in order to match those of the real camera in this case we have to set the sensor width to 39.9 and the focal length to 28. also set the global length of the scene to match the length of the footage by pressing the set scene frames button now we can add some markers in order to track the camera movement you can do that by selecting the add button and clicking where you want to add the marker then press the track marker button below you have the tracking graph if something goes wrong the tracking process stops in this case you can try adjusting the size of the marker or changing the motion model ideally you should track at least 11 markers remember to also track some markers on the cube and on the floor when you are done open the solve panel and click on the solve camera motion if everything is fine you should get an error below than one this means that the tracking process is good otherwise you should try tracking more markers or deleting the markers with high average errors and track them again you could also try to refine the focal length or radial distortion you shouldn't refine the optical center as we need it to remain at zero otherwise we'll have some issues when matching the imported footage with the camera as we'll see in a moment now we have to say blender where is the floor you can do that by selecting three markers on the ground and clicking on the floor button you can also do that for the wall we also have to set the scale so select two markers of the floor set the distance to 1 and click on apply scale this is the reason why we place the markers on the floor one meter apart finally click on the set as background button as a result the movie clip will be placed as background of the camera and this is useful to check the accuracy of the tracking data now open the layout panel you should have the camera view in the background activate the view of The Trackers in the show overlays panel and start the timeline the virtual marker should perfectly match the real ones now we can proceed modeling our scene here I created a very simple room at the center I placed a box in a statue we want to simulate the actor to break the glass add a solidify modifier in order to add some thickness to the Box then add two lights in order to roughly match the real lights [Music] foreign then we have to create the simulation of the breaking glass in order to do that we have to define the area where we want the glass to start breaking we can do that by using the annotate pencil in the surface mode placement draw some lines where the impact occurs then open the cell fracture window select annotation pencil as the point source add some noise and increase the recursion shatter to two or three based on how many pieces you want the glass to fracture remember to also Define a collection where to add all the pieces press OK and the glass should be broken into many pieces now we have to create the simulation select all the objects in the collection and use the add active command to add the physics simulation to all the pieces if you open the physics panel each object should be set as an active rigid body I'm also going to increase the realism by calculating an accurate mass for each piece select all the objects and activate the calculate mask command select glasses material also add a plane below the glass to act as a virtual table in order to avoid the glass to fall down set the plane as passive but if you start the simulation chances are that all the pieces explode this is due to the internal interactions you can in some way avoid this by activating the split impulse property in the scene panel but this is not enough we want the pieces to start breaking only when the actor hits the glass we can do that by selecting the deactivation option this means that the simulation starts only when an external force is applied we can apply the same setting to many objects by shift-clicking on the first piece and then on the last one now click on the properties you want to activate while pressing the ALT key this allows the same property to be applied to all the selected objects now the pieces should stay at their original place next we need to create the simulation of the fracture after the glass is fractured we need to explode it in sync with the actor's punch in order to do that we can add a simple sphere that will simulate the colliding object it represents the force that will break the glass animate it in order to hit the glass at the same time as the real hand make it an active rigid body and activate the animated property in this way the manual animation we did is taken into account in the simulation the glass now breaks when the ball collides if you don't want the ball to be rendered disable its render option after we're done with the modeling it's time to texture the glass we'll create a new glass material using the Shader editor connect the glass bsdf Shader to the material output you can adjust the ior value to achieve different types of glass with our simulation set up it's time to integrate it with the live footage you can also check out the video in the description for more details about this technique first of all deactivate the video background of the camera import the green screen footage as an image plane foreign type now we want the image plane to exactly follow the movement and rotation of the camera be sure to move to the first frame shift-click the plane and then the camera so that the camera is the active object now press Ctrl or command C and copy the location and rotation the plane is placed and rotated as the camera we also have to link it to the camera so that they move and rotate the same way again shift-click the plane and the camera press Ctrl p and choose object keep transform the plane now moves in sync with the camera but it's not visible yet we have to move it in front of the camera select the plane enter the edit mode and moves it along the local z-axis until it completely fills the camera viewport you can do that by pressing the G key and the Press twice the Z key to access the local transformation now we can finally see our live footage but we are not done yet we want the plane to be placed inside the scene as the real actor so it can interact with the surrounding you can do that by simply scaling the plane [Music] and as we previously moved the plane in the edit mode its origin is placed at the camera origin in this way its physical location and scale change but in relation to the camera point of view the apparent size is always the same and we can scale it having as a reference the position of the feet we have to scale the plane just to the point where the foot starts to be clipped by the floor but unfortunately we have to do that for the entire length of the movie so basically we have to add some keyframes to the scale property of the plane and adjust its size along all the video now the real video is perfectly composited with the virtual scene and it can also receive and cast Shadows however consider that the perfect and realistic overlapping of the feet with the ground is always a challenge this is the reason why unless expressly requested I often try to add some elements in front of the feet this allows us not to waste too much time in this case I simply added a glass wall placed on the floor now we can finally export the movie for better results I suggest setting Cycles as rendering engine it is also useful to activate the denoise function finally it's a good practice to export the movie as an image sequence this ensures the best quality and the ability to resume the rendering if for some reasons the application crashes however we have an issue if we export the scene we can see the glass pieces also before they explode so we have to export the scene in two steps in the first part we deactivate the rendering option of the collection that contains the pieces in the second part we do the opposite by deactivating the visibility of the original glass and activating the visibility of the collection this is another reason why it's useful to use the image sequence as the export options in my final video I also added another scene that was shot with the still camera I also included it in the files you can download in this case the process is much simpler as usual we start by removing the background and this is easier as we have a more uniform background but we still may need to divide it in two different passes and we also have to remove the markers now we have to composite it with the virtual scene but in this case I'm not going to use the same image plane technique as before in fact here we have a static camera and it's easier to directly compose it in After Effects so first of all let's create a copy of the previous 3D scene and remove the motion tracking and Camera then add a new camera and frame the scene as the real camera you can use the real footage as a reference then export the scene now back to After Effects we can simply composite the transparent footage with the virtual scene and we are done [Music] in the next videos of the same series we'll deal with other simulations techniques but we will not go into all the details of the chroma key and Camera tracking techniques parts so refer to this video for the step-by-step guide for the green screen and Camera tracking portion of the work
Info
Channel: UnreaLab
Views: 3,766
Rating: undefined out of 5
Keywords:
Id: d5hCOO2IgNs
Channel Id: undefined
Length: 24min 2sec (1442 seconds)
Published: Sun Jul 02 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.