Realistic Rubik's Cube Creation and Animation (Blender Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone this is ryan king so over a year ago i created a tutorial on how to make a photorealistic rubik's cube and then i also showed you how to animate the cube now i made that tutorial over a year ago and since then i've gotten a lot better at making tutorials and so i decided to redo the tutorial so in this tutorial i'm going to show you how to create a photorealistic rubik's cube like this one here and we're even going to be adding some surface imperfections so if you look right here in the reflections of the cube you can see that there are even some fingerprint textures we're going to be adding that in as well to make it even more photorealistic and then i'm also going to show you how to animate the rubik's cube so that you can make an animation of the rubik's cube being solved before we get started there's a few resources online that i'm going to be using to make the tutorial so i'm going to be using this fingerprint 002 and this is on cc0 textures.com so we're going to be using this for the fingerprints on the rubik's cube and i'm just going to be downloading the 4k jpeg so link is in the description if you'd like to download this you don't have to it's totally optional but if you want even more photorealistic rubik's cube then this will really help and then to get some really realistic lighting i'm going to be downloading this cayley interior and this is on hdri haven so i'm going to be downloading the 1k version link is in the description if you'd like to download this hdri to get some very realistic lighting now just a few more things before we get started if you have a real rubik's cube model it'd be a great idea to go ahead and get it and that way you can look at it while you're modeling the rubik's cube to make it even more realistic and this is a classic rubik's cube with all the classic colors and it's three by three so this is what i'm going to be creating in this tutorial but even if you don't have a rubik's cube then you can go online and look for some reference images as well also i'm trying to make blender tutorials and blender content for a living so if you'd like to help support what i do and also get the project files for my tutorials then you can do that over on my gumroad store and my patreon page the links are in the video description and one last thing before we start i want to thank this video's sponsor sketchfab sketchfab is an awesome 3d model site where you can preview 3d models in your browser you can even view them in ar vr or on a phone or tablet they also have a 3d model store where you can purchase models and assets you can even apply to sell your own models on the platform check out sketchfab with the links in the description alright now here we are in a new scene in blender now if you want to see the buttons that i'm pressing my screencast keys are right down here in the corner and you can see what buttons i'm pressing so the first thing we're going to do is just double tap a to select everything and then we'll press x and delete we're now going to press shift a and i'm going to add a cube because you can't use the default cube you have to delete it and then add a new cube it's just what we do all right i'm going to tab into edit mode and first what i'm going to do is i'm just going to model one of the cubes and then we will array that over once we've created one of the cubes now this one cube it's the same on both sides as well as up and down so what i'm going to do is delete this side of the cube and also the bottom and this side and then we can just use one corner and then we can mirror that over so that we don't have to model as much and we can just work with one corner so to do that i'm going to press ctrl r to add a loop cut and i'm going to left click and then right click so that this loop cut gets placed back in the center of the scene so in edit mode i'm going to press ctrl r and then i'm going to hover my mouse over here until you can see the yellow line and i'm going to left click and then right click so that it hops back to the center of the cube i'm going to do the same thing over here so ctrl r left click and right click and then the same thing over here ctrl r left click and then right click so now what i want to do is delete everything except this little corner and then we'll add the mirror modifier so i'm first going to select this vertices and then hold down the shift key and select all the vertices around it so that we just have this corner of the cube selected now to delete everything else i'm going to press ctrl i and that will invert the selection then i can just press x and delete vertices so now we can tab back into object mode and go right over here to the modifiers panel i'm going to click on add modifier and we are going to add the mirror modifier and now what we want to turn on is the x and the y and the z and that way it's going to mirror it on all the axes and our cube is back and if we tab into edit mode you can see that we just have the corner of the cube but when we edit this side all the other sides are going to be edited now if i double tap a to select everything and press g to grab you can see that the cube isn't connected it's just kind of sitting there so to connect it you can click on this clipping and then when you press g to grab it's going to move the whole thing i can just press escape though because i don't want to move it let's tab back into object mode now and if you look at a rubik's cube the edges are just a little bit smooth so what i want to do is i want to add a bevel to these edges so i'm going to click on add modifier and i'm going to add a bevel modifier now the segments here i'm going to turn this up to four i think that looks pretty good and then we'll also shade this object smooth so just go object and then click on shade smooth now this amount value if you turn this up or turn it down you can see that it's going to change the size of the bevel so just look at your reference and remember this isn't the entire rubik's cube it's just one of the cubes and just look at your reference and try to get it as close as you can i think i'm just going to make mine a little bit bigger probably something like that so just get it to whatever you like so now i need to apply this because when i go in here and when i edit the cube i don't want it to be adding bevels to all of my edits i just want the bevels to be along the sides here so i'm going to click right here on the drop down and then click on apply and now if we tab into edit mode you can see that the bevel has been applied so now what i want to do is i want to inset this face and then we can make this the color and then everything else is going to be black so these faces right here these are going to be the different colors on the side of the rubik's cube now before i add that in i want to make this a very photorealistic rubik's cube so if you look really close up you can see there's actually a little bit of an indent that goes in and then comes back out before there's the color it's almost like there's a separate piece that's connected which is the color so what i want to do is i want to inset this and then just make a little indent right in there and then it comes out before we have the face so what i'll do is i'll press three or click right here and that's going to go to the face select then i can select this face and then hold down the shift key and select this face and this face and also real quick before i forget we should probably save this blender file so that if blender crashes we won't lose anything so i'm just going to go file and then click on save as i'm just going to save this as rubik's cube tutorial somewhere on my computer and just click on save as all right so now i want to in set these faces and then make that little crease there in the rubik's cube so to do this i'm going to press i so i is the shortcut key for insetting a face now you can see that when we inset that it's not really being connected to the mirror you can see right here where my mouse is it's not really connecting so what i want to do is i want to press b and that's going to turn on this boundary setting so you can see right here it says boundary off and b boundary on so what you need to do is just press b and you can see now it says boundary off and now this is going to be connected to the mirror so that is great so what we need to do is we just need to scale this down and again look at your reference and just scale it down to the size that you think is good probably somewhere right there and i'm just going to click to place that alright so that is great now what i want to do is i want to extrude those faces back in and then we will scale it down again and then extrude them back up so to make this easier i'm just going to press one on the numpad to go to front view and i'll press z move my mouse over and let go it should go into wireframe so to do this i'm going to press alt e now when you press alt e it's going to bring up this menu and i want to extrude the faces along the normals and that way whichever way the faces are facing that's the way that it's going to be extruded so if you click extrude faces along normals now you can see that it's only going to move in or out so up and down for this one and then back and forth for the others so now what i want to do is just bring this down and then click to place that now if you want to redo this just press ctrl z an easier way to do this is to press one on the numpad for side view and then press z move your mouse over and let go to go into wireframe and you can just zoom in and then again just make sure those are selected and press alt e click on extrude faces along normals and then you can just bring them all down they're all going to come into the center so i don't want it to bring it in very far just about that far so i'll just click to place that and you can see how far down this is so you can see that's just kind of going down now what i want to do is inset the faces again and then i'll extrude them back out so just make sure they're still all selected and i'm going to press i to inset again and then i just want to bring it down a tiny little bit and remember press b if you need to i want the boundary to be off so that they connect and then just click to place that so if i zoom in here you can see it's just very very small that's how much we inset the face so i'll press one on the numpad again for side view z to go into wireframe and now i just want to extrude these back up so again we're going to press alt e click on extrude faces along normals and then just move your mouse up you can also hold down the shift key as you drag to make your movements more sensitive and then just click when it's just about at the top here if it's a little bit under a little bit over that's okay just as long as it's very close so we can go back into solid view now and tab back into object mode and i'm actually going to just go to object and shade this flat so that you can see what i did so you can see here if i tap into edit mode we just have that little crease right in there kind of that indent and that's going to make it more photorealistic so i will just shade this object smooth again and now what i want to do is i want to add a subdivision surface modifier to smooth out the rubik's cube so the shortcut key is ctrl 2 you can also click right here and click on add modifier and then click on subdivision surface now you can see there's viewport levels and render levels the viewport i want to turn down to one and that way it's going to be less laggy in the view but then when we render it it's actually going to be rendered at two levels of subdivision so it'll be smoother now you can see that because it's being smoothed out because we have that subsurf modifier this right here it's kind of coming down really weird and that's not really the shape of the rubik's cube so i want to add some loop cuts to define the shapes better so i'm going to tab into edit mode and i want to add some loop cuts right here and here and here so i'm going to press ctrl r again and then hover your mouse right over here but before you click i'm going to scroll my mouse wheel out and that's going to make two then i can left click and then right click so it hops it back to the center so i'm going to do the same thing ctrl r scroll my mouse out so there's two and then i'm going to left click and then right click so let's do the same thing down here so ctrl r scroll out and then left click and then right click so now if we tab back into object mode you can see this is a lot smoother and when it renders it's going to be even smoother because the levels are going to be set to 2 but that is really great and if you look at your rubik's cube that looks pretty realistic now if you zoom in here you can see that there are a few other places that i want to sharpen up because right here this right here is a little bit smooth and it's not very sharp i want to sharpen up both of these edges so that they're a lot sharper and there's more of a crease there so this is a little bit fiddly but i'll show you the best way to do it so to see this better i'm going to click on this button right here it looks like a computer monitor and what that's going to do is going to hide the subdivision surface from our view but it's still there now what i'm going to do is i'm going to tab into edit mode and just zoom way in here so see this little lip right here i want to add a loop cut right in there so that this edge right here this edge that's sharper so what i'm going to do is press ctrl r click and add a loop cut and then drag it out just a little bit i don't want it to be touching the other one but just a little bit more towards it and then just click again to place that so now i can move over here and i want to do the same thing so ctrl r click drag over a little bit and then click to place that and now if i go back into object mode and i turn this on so that we can see the subserve now this edge is actually a lot more sharp you can see that that right there is a lot sharper so that's really great so let's do the same thing so if you need to be able to see it better it's a little bit hard to see so if you want to you can just turn this off and then that way you can't see the subdivision surface ctrl r click drag up and then click to place that and then again here ctrl r click drag up and then click to place that so let's do the same thing down here so i'll just navigate over here i'm going to press ctrl r click bring it up front a little bit and then click to place that and then just one more control r click drag over and then click to place that so i can turn on the subdivision surface and if you zoom out now you can see that that edge is a lot more sharp alright so now i'm going to set up some basic lighting and then we can do our materials so let's just press ctrl s again to save our project now to set up the lighting i'm going to go right here to the world and you can really set up whatever lighting you want you could press shift a and add some lights here whatever you want to do but what i'm going to do is add in that hdri that i talked about at the beginning of the tutorial and that's going to make very realistic lighting so i'm going to click right here on this yellow thing right here and then i'm going to click on environment texture and then we can just click on open to open that hdri and then here is the hdri that i'm going to be using again link is in the description if you'd like to download it i'm just going to double tap on it to add it in now if i press z and move my mouse up to go into rendered mode you can see that it's added in the hdri and now we have some very realistic lighting and we have reflections and everything around on this rubik's cube so that will help to make it look much more photorealistic i'll press z and go back into solid view now there is one more thing that i want to do with the lighting to make it look even more realistic i want to turn on filmic blender and that way the lighting will be even more realistic so i'm going to click right up here on the render properties and i'm going to go down here to color management if i just scroll down the view transform just make sure this is set to filmic and that's actually going to make the lighting more photorealistic and then the look here if you want to you can see that everything kind of looks slightly grayed out so if you change the look to high contrast that's just going to pop out the colors make everything a little bit more saturated and look a little bit nicer all right so that is great so let's go over now to the material tab and then i'm just gonna click on new to add a new material and then the preview the material i'll press z move my mouse down to go into the material preview so we can preview the materials as we create them so this material right here i'm going to click on it and i'm going to call it black because it's going to be the black shiny parts in between the colors on the rubik's cube now the base color right here i'm going to turn this all the way to pure black and now you can see it's black and then i want to add in that fingerprint texture so to add that in i'm going to go right over here to the shading tab so that we can work with blender's nodes so if you just pull this up and bring this over you can see here is the principal bsdf shader and this is the shader that it's using so here is the black color now what i want to do is take the fingerprint texture and plug it into this roughness value so that it'll tell it that where the fingerprints are that's going to be a little bit less rough and then where there's not fingerprints it's going to be more shiny and that will make it more photorealistic so to do that i'm going to press shift a and i'm going to search for an image texture just drop the image texture right here and then we can click on open to open up the image all right and then link is in the description again if you'd like to download the fingerprint texture so once you download it you're just going to have to extract the zip file and then when you open up the folder there's going to be all these different textures right here now we only want to use this roughness map so i'm just going to click on this and then just double click on it to open it up so now we have the fingerprint 0 2 roughness so what i want to do is i want to plug this color here up to the roughness and then that way it'll use that map as our roughness map now one really important thing that we need to do because this isn't being plugged into the color and it's not affecting the color at all this color space here we need to turn this to non-color data so that it will work properly and now you can see if i just drag this down you can see that it looks like there's fingerprints on our rubik's cube and that is really great now you may have noticed that like it's mirroring it on the other sides that's because we have the mirror modifier on so once we create the entire rubik's cube we're going to re-uv unwrap the rubik's cube and project the fingerprint texture onto the rubik's cube so it's more realistic because right now you can see it's kind of mirroring but we will fix that all right now if you go into rendered mode and bring this over so that you can see the reflections you can see that where there isn't any fingerprint texture it's very very shiny and then where the fingerprint texture is it's a little bit rough what i want to do is i want to tell it how shiny i want the rubik's cube to be so to do that i'm going to just bring this out and i'm going to press shift a and i'm going to click on the search here and i'm going to search for a color ramp i'm just going to click on color ramp and i'll just drop it right in here in between the connection of the color and the roughness so now we can do is see this little black tab here if we click right here on this color we can start to turn this up and you can see what it's doing when we turn this value up the shiny parts the parts where there's no fingerprints that's gonna make it more and more rough so you can just change that to whatever you want so kind of right here where there's no fingerprints if you turn this up it'll be more and more rough i still want it to be pretty shiny but just not quite that shiny so something like that is probably pretty good just kind of a dark gray then this white value if you click on this now and then click on the color if you start to turn this down it's going to make the fingerprints more and more shiny so if you want to make the fingerprints very very subtle you can turn them down and now you can't even see the fingerprints but if you turn it up it's going to make them more and more rough really try to get this right because what we're going to do later on is we're going to duplicate this material and then make it all the other colors and that way it's going to have the fingerprint texture on all the different colors and if you want to go ahead and change it later on you're going to have to go individually to all the colors and change these values so just get it right that looks totally fine so that is great so let's go back into the layout right here so now what i want to do is i want to add all the materials to the different sides of the cube so let's go ahead and do that so i'm going to tab into edit mode and to see this a little bit better i think i'll press z move my mouse over to go back into solid view now again if you click right over here on the modifiers it's probably better if you just click on this little button to hide the subdivision surface from the view and that way we can see the object a little bit better so now let's click over on the materials and i want to add in the first material which is going to be the white and i'm going to put the white on the very top and you can use whatever colors you want but i'm going to be creating a classic rubik's cube so i'm going to be using these classic colors on this rubik's cube so what i want to do first is i want to select all the faces that i want to have the white color on so what i want to do is press 3 for the face select or just click right up here then i'll press b for the box select and i'm just going to drag out and select all of these faces now i also want the inside of the lip to be white as well and because we added the loop cut in there there is two loops of faces so i'm going to hold down the shift key so i can select multiple faces and then i'm also going to hold down the alt key so that we can select loops then what i'm going to do if you zoom away in here i'm going to holding down the alt and shift key select this and then also select this so now you can see if you press g to grab you can see that we have those faces on top as well as the faces on the side i'll just press escape to bring that back to the center there so what i'm going to do is click on this plus here to add a new material in this object then instead of clicking on new i want to click on the black color because i still want to use the roughness map that we have so now i've added the black so there's two black materials now to duplicate this material and make it separate i'm going to click on this little file icon right here and this will duplicate the material but still keep all the settings so i'm going to click on this and now you can see it says black001 i'm going to click to rename this and i'm going to call this white so what i want to do is this base color i want to turn this all the way up to white so i'm just going to click right here and i'll just drag up and make it pure white and then i need to actually assign the white color to our selection so to do that make sure that's still selected and then click on assign now if you press z and move your mouse down to go into the material preview you can see that wherever it was selected we assigned it to that face and now that is white so now we just need to do the same thing for all the other sides so this is slightly repetitive but it won't take very long we just have to get through it so i'm going to tab back into edit mode press a to deselect everything and then i'm just going to press b and box select this side and i'm looking at my real rubik's cube and this is going to be blue so now that we've selected all those faces i'm just going to zoom in here and you can see that i need to select the loops as well so i'm going to hold down the shift and alt key and just select this loop and this loop oops wrong one i'm just going to press ctrl z to do that there we go so we just have those selected now what i'm going to do is do the same thing so i'm going to click on plus right here again add the black material because i want to use the roughness texture then click on this file icon to duplicate the material and this one we're going to call blue now i want to assign it to our selection so just click on assign and now that is the blue color but it doesn't look any different because we need to change the base color so the base color i'm going to turn all the way up to white and then i'm going to turn it up to a blue color not too dark but not too light just something like that maybe slightly on the darker side and there we go so if i tap back into object mode you can see what we've done so let's do the same thing so on this side this is going to be red so i'm going to tab into edit mode press a to deselect everything b for the box select and i'll just select these faces and then i'll just zoom in here and hold down the shift and alt key and select this loop and this loop and then i'll click on plus here to add a new material click on the drop down and we're going to click on the black material and then we're going to click on this file icon to duplicate the material and we're going to call this one red and then make sure this is still selected and we're going to click on a sign to assign it to those faces and then the base color i need to make this all the way up to red so i'll just click over here on the rgb and then this r here i'm just going to turn this all the way up so it's fully red so we've done three of the sides now but when you look over here you can see that because we're using the mirror modifier it's blue on the other side so we're going to have to apply the mirror modifier before we do the other colors so let's tab back into object mode i'm going to go right over here to the material panel so now i need to apply this mirror modifier but before i apply it i want to just duplicate this and keep it as a backup just in case something goes wrong and we need to go back to it it's just a good thing to do before we apply our mirror modifier so what i'm going to do is just with this selected i'm going to press shift d and then just press escape and that way it'll hop it back to its default position now what i want to do is i want to move it to a separate collection and these are collections right here i want to move it to a separate collection and then hide the collection and that way it's just kind of sitting there in the background but it's hidden and then if we want to come back to it we can just in case so with that other one selected i'm going to press the m key and then you can see this is the collection that's currently in i want to make a new collection so i'm going to click on new collection and i'm going to call this backup and then just click on ok now you can see here there's this backup collection and the cube's in it and then there's also the regular collection so this backup here i don't want to see it so i'm just going to click on this check mark here to deselect it and now we just have this one cube so now we can just click right over here and then click on apply and then i'll just press ctrl s to save the blender file so if you tab into edit mode now you can see that the mirror modifier has been applied and now we can add the other materials so over here on this other side the color is green so what we can do actually is we can go right here to the materials and we can just tell blender to select the blue material so what you do is just click on the blue and then instead of clicking on a sign we're going to click on select and that way it's going to select anything that's blue so you can see it selected this and this so i want to make this green so what i'll just do is deselect this side and then we can just make this side green so i'll press z move my mouse over to go into wireframe and then i'll press b for the box select and this time instead of just clicking and dragging to select i want to deselect so i'm going to click with my middle mouse wheel and then just bring this out and then let go and now it's deselected that side and this side is the only one selected so now we'll just do the same exact thing so i'm going to click on the plus icon we're going to click on this and then click on the black material we're going to duplicate it by clicking on the file icon and then we're going to call this green and then this is still selected so we need to click on assign and then we'll just turn this to a green color so i'm going to turn this all the way up and then turn it to a bright green and then on my rubik's cube the green color is a little bit darker so i'll just make it a little bit darker to something like that all right there we go so now we have done four sides so we still need to do this side so on my rubik's cube this side is orange so i'm going to tab into edit mode and you can see this is already red so i'll just press a to deselect i'm going to click on the red and then i'm going to click on select and now it selects all of the red faces i'll press z to go into wireframe b for the box select and i'll click with my middle mouse drag this one and then let go so now this one is the only one selected then i'll do the same thing so i'm going to click on the plus right here we're going to go right here and click on the black one and then i want to duplicate it so i'll click on the file icon to duplicate it and then this one i'm going to call this orange then i can click on assign to assign it to those faces and then i'll just click on this and then i'll just make it a nice orange color and turn the brightness all the way up alright so we've done almost all the sides here let's go down to the bottom and the bottom one which is opposite from the white one this one is yellow and this is the last one we need to do so again one more time let's do this again tap into edit mode a to deselect everything we're going to click on the white and then click on select z to go into wireframe move your mouse over when you press z to go into wireframe and then i'll press b and box select this but i'm gonna hold down with my middle mouse wheel as i do this to deselect and then go back into the material preview i'm gonna click on the plus icon click on the drop down click on the black one we're going to duplicate it with this button and then i'm going to call this yellow if i can spell that right yellow and then click on a sign and then we're going to turn this all the way up and turn it to a nice yellow color all right there we go so now we have all the sides of our rubik's cube and then if you want to click back over here and click on this button that way we can see the rubik's cube with the subsurfan and that looks really great the viewport levels i am going to turn this down to one so that it will be less laggy later on all right so that is great so now what we need to do is we need to add an array modifier to array this out and kind of duplicate it and then we can make three of them so that we have a three by three rubik's cube so i'm going to click right over here to add modifier and i'm going to click on the array modifier and you can see what it does is just erase this object over now the count here i want to change this to 3 because i want this to be a 3x3 so now what i want to do is i want to array the cubes that are already arrayed so to do that i'm just going to click on this thing right here and this thing right here it's these little arrows and that'll just minimize the modifiers i'll click on add modifier and we're going to add another array now this one you can see it's arraying it out on the x-axis because there's this little red line here i want to array it out this way so they factor i'm going to change that to 0 and then the y i'm going to turn that to 1 and that way it's going to array on the y-axis which is this green line right here now the count i want to turn that to three and that is great so now we just need to array it one more time so i'll just minimize this click on add modifier we're going to add another array and again the default is that it erase it on the x-axis so this thing right here i'm going to turn this to zero and then the z-axis i'm going to turn this to one so i raise it up and then the count again i'll turn to three there we go that is really looking like a rubik's cube now so now we need to do is we need to apply these array modifiers so that we can actually animate the rubik's cube and rotate it around and also we still need to uv unwrap them because you can see right here they're all the same the fingerprints are exactly the same so we'll need to uv unwrap this so we need to apply the array modifier now again i want to duplicate this so that just in case if something goes wrong and we need to come back to this we can so i'm going to press shift d then click on escape and then i'll press m to move it to the new collection and i'm going to click on the backup and that way it just adds it to the backup collection but the backup collection is hidden so we can't see it all right just click on the rubik's cube and now i need to apply these arrays so i'm going to click on this one click on apply click on the drop down click on apply and then click on the drop down and click on apply so now when we tab into edit mode you can see that it's all applied that is really great so now we can do is we can re-uv unwrap this so that the fingerprints aren't the same on every cube so to do that i'm going to tab into edit mode and i'll press 1 for front view and then i'll press z and move my mouse over and let go to go into wireframe now what i'm going to do is i'm going to press b for the box select and i'm just going to click and drag and i'm going to just select this side so that just these are selected if i zoom in here you can see i don't want to select any of these in the center just the ones on the side here and then i want to do the same thing for the other side so i'm going to press b for the box select just click and drag and just select these ones actually i want to select these ones too there we go so now i want to press 3 on the numpad and that's going to go to the side view and i just want to project the fingerprint texture right onto the side of the rubik's cube so to do that just kind of zoom in so you can see the entire rubik's cube i'm going to press u and then i'm going to click on project from view and that way it's just going to project it right onto the cube just like that so now without zooming out or anything i'm going to press a to deselect and then i'll press b and i'm going to do the same thing for these two sides and then we'll uv unwrap them as well so i'm going to just box select this side press b again box select this side oop didn't get all of it there we go i'm going to press 1 now and that'll go to the front view and then i'll press u project from view that's just going to project it right there i'll press a to deselect everything and now we just need to do the top face and the bottom face so i'll press b for the box select click and drag there we go b for the box select click and drag and then i'll press 7 for top view 7 on the numpad and i'll press u and i'm going to project from view all right if we tab back into object mode now and go into the material preview and kind of just go over so that you can see the reflections that is looking really great so you can see that now the fingerprints are all different they're all randomized and it looks a lot more photorealistic now we need to actually change the size of the fingerprints because i think those fingerprints are actually a little bit too small because if i look at my thumb or my finger and then i also look at the rubik's cube my finger is covering up pretty much one entire square of the rubik's cube but you can see there's quite a few fingerprints inside these squares so let's go ahead and change that so what i'm going to do is i'm going to go over here to uv editing so that we can preview our uv editing and you can see here's our finger texture and then if we double tap a here is our uv layout now we can scale this but before we scale it i want to click right over here on the modifier properties just click on this to open it and i actually want to turn this off so that we can't see it because if we try to scale it right now you can see that it's like really really laggy i wouldn't suggest scaling it before you turn this off so just click on this to turn it off and now you can press s to scale it and you can see that's a lot better so if we go into the material preview just kind of go over to the side you can tab back into object mode if you need to i want to scale this down so that one of these squares is about the size of one fingerprint so i'm going to scale it down you could even press g to grab and kind of move it over and don't worry if it goes out of the texture because this texture is tileable so where this texture ends it'll come back over here so just move this around and i want to get it about the size of one finger on one of those squares right there so just scale this to whatever you think is good you can change it to whatever looks good to you let's click on this button now so that we can preview that again and we'll go back into rendered mode and just kind of look where it's really reflective it might be better if you just go into the material preview but you can see that now that is the correct size and i think that's pretty good all right let's go back into the layout now and then again i'll press ctrl s to save our project all right and now we can set this up so that you can pose it if you want to and then also you can do animation with this if you want to so to set this up for animation i'm going to press n and i'm going to open up this panel right here and i'm going to go to item so what we need to do over here on the transform is we need to change this rotation mode now if you leave this at the default you're going to have this problem right here it's really weird so what you need to do is change this rotation mode to quaternion so i believe that's how you pronounce it quaternion wxyz so just change it to quaternion and that way we won't have any issues and when you animate it it's going to look like this so that is a lot better that's what you want it to look like all right so that is really important make sure you do that and i'll press n to close that all right so before we actually get started with the animation you can see that if i tab into edit mode this is still one object and we need these to be separate objects so in edit mode i'm going to press a to select everything and then i'll press p and i'm going to separate this by loose parts and that way where the vertices are disconnected it'll make that a separate object so that way if i click on loose parts tab back into object mode i can select these and you can see that every cube is its own object and that is what we want now one more thing before we start animating this the origin point we need the origin point to be in the very center of the rubik's cube the origin point is that little orange dot right there we want the origin point of all these objects to be in the very center of the rubik's cube so to do that i'm going to click on this and then i'll press h to hide it it's still there but it's just hidden from our view and then i'll click on this center one right here now what i'm going to do is i'm going to tab into edit mode and double tap a to make sure everything is selected and then i'm going to press shift s now we want to click on this one here which is cursor to selected so what that's going to do is going to take this 3d cursor and it's going to center it to the center of what we have selected so again just make sure everything is selected cursor 2 is selected and now that cursor there is in the center so i'll tab back into object mode and then i'll press alt h to unhide that cube now i'm going to double tap a to make sure everything is selected and we want the origin point to be in the very center so what we can do is we can click on object set origin and i'm going to click on origin to 3d cursor so now you can see if you select these and rotate them or whatever you do the origin point is in the very center of the rubik's cube and all of these separate cubes are in the very center so that is exactly what we want now an easy way to start posing this is if you click on this button right here what that's going to do is going to toggle the x-ray and now when i press b for the box select it's going to select all of the objects that are going through it so if i turn this off and press b for the box select you can see it's only going to select the front ones the ones that are in the very front of my selection and that way we can just press a b for the box select and select this side and it's going to select all the ones going through it so now we can just start to pose this so we can press r to rotate and we need to press x on the x axis and then you can type in nine to zero and enter to rotate that over so there we go you can just start to pose it now now i actually want to animate it if you just want to pose it you could just press b for the box select and then what you could also do is you could rotate this and just rotate it manually and that way there's just going to be a little bit of randomness and it'll look like somebody has been playing with the rubik's cube because a rubik's cube isn't perfectly straight if you look at it usually someone's been playing with it and it's just like slightly tilted so you could just do that and then again b for the box select and then go to the side view and then rotate this over and just kind of do the same thing so you could select multiple ones here rotate that over and you can see what i'm doing because i'm not rotating it quite all the way over you can see it's just giving it a little bit of randomness and that just makes it look even more photorealistic now i'm just going to control z that because i don't want to do this i want to animate the rubik's cube just one really quick thing that i forgot to add into the video if you've rotated your cube and you want to bring it back to the default what you can do is you can press a and just make sure that the entire cube is selected and then you can press alt r and what that's going to do is going to clear the rotation values so before you can see we've rotated this cube if you press alt r that'll clear the rotation values and now the cube is back to its default setup now you may have noticed something here if i just select this side and if i just start to rotate this on the x-axis and then just click you can see that right here you can actually see the color now this isn't actually realistic because on a real rubik's cube if i look at this it's actually just flat there's no color there so i'm going to show you an easy way to make those insides flat so this is just give even more realism if you don't want to do this totally optional but if you want even more realism you can do this so it's actually pretty easy to do i'm going to select everything and then i'll tab into edit mode and that's going to go into the multi-object editing and then this thing is turned on i need to turn this off so we're out of x-ray mode so what i want to do is all of the colors except the black one but all the other colors that are inside the cube i want to turn those to black so what i can do is i can press l with my mouse hovered over one of the colors and you can see it's going to select all the linked vertices we don't want it to do that so what i'm going to do is click right here and instead of selecting everything that's selected to those vertices i'm going to click on material and what that's going to do is going to select only the materials that are connected to where we pressed l so if you hover your mouse over the green press l you can see because that's set to material it's only going to select the green so just press l and then move over lll i'm just continuing to tap l and moving my mouse i'm just going to go along all the faces so it shouldn't take too long to do pretty easy just pressing l we're just going to select all these all right we're almost done here just selecting all those and then the last one here the red one all right so now we've selected all of the outer faces with the colors so everything else on the cube everything else i want to be the black color so to make this all black i'm going to press ctrl i and that's going to invert the selection so now everything else is selected so now if we go to the materials just scroll up here click on the black and then click on assign we'll tab back into object mode now and now if you just box select some of these and then we'll go back out here and then i'll go to the material preview and start to rotate this so r and x and rotate it over now if you look right here you can see that that's all black so that is even more realistic all right so we now have a very photorealistic rubik's cube let's go ahead and animate it so i'm just going to bring the timeline up so what i'm going to do is press z for the wireframe just press b to box select this side and then i'll go back into the material preview so what i need to do is i need to start by adding in a keyframe for all these objects so i'm going to press i and i'm going to insert rotation now we don't have to manually add keyframes every single time so what i'm going to do is click right here and that's going to turn the auto key and that way when we rotate something it's automatically going to add a keyframe so now i can go over to maybe frame 20 go to wherever you want and i'm going to press r to rotate x on the x axis and i'm going to type in 9 0 and enter so it's rotated over by 90 degrees and you can see that it's automatically added a keyframe that little diamond thing right there that is a keyframe so now what i need to do is just move a couple frames over because you can kind of have issues if it starts to move over on the same exact keyframe so i just like to move over like two keyframes over and then i can rotate this side so i'm gonna press z for the wireframe b for box select just select this side so now what i need to do before i rotate this is i need to insert keyframes onto these because they don't all have keyframes so i'm going to press i insert rotation and then i can go to maybe frame 45. let's go to frame 50 actually and then i'm going to press r to rotate y on the y-axis because this one is on the y-axis and then you could type in 90. you could also type in negative 90. so negative 90 that way it's going to rotate backwards also you could type in like 180 if you want to rotate all the way down so that's what i'm gonna do just press enter and now you can see check it out so if you just play through this you can see that now the rubik's cube is rotating and that looks really great all right so let's just animate this a little bit more and then i'm also going to show you how to reverse it so if you want the rubik's cube to be unsolved and you want to solve itself i'll show you how to do that it's really easy to do so let's do the same thing so this time i'm going to rotate the top one so let me just select everything so i can see the keyframes i'm just going to move two keyframes over so to frame 52 i'll deselect everything and then if you want to you could also turn on the x-ray and then i'll just box select the top ones all right that is what we want so then i'm going to press i insert rotation and then i'll move to maybe frame 70 and i'll press r to rotate c on the z axis because this one is up and down and i'm going to type in negative 90 and enter and now we can just play through that really great there we go super cool and then i think i'll do that one more time so i'm just going to i think i'll just select um these two just like that we can rotate both of these over if we want to and then again i'll just go like two frames over press i and insert rotation and then we can just go to frame 90 and i'll just press r to rotate x on the x-axis actually y on the y-axis and then i'll type in 90 maybe negative 90 and then enter all right let's just check this out there we go very very cool looking really nice alright so if you want to reverse this so that it actually solves itself what you're going to need to do is press a to select everything and i'm actually going to click on this to turn this off because we're done uh animating now so i'm just going to turn this off so to reverse this it's really easy to do just make sure all of the objects are selected and then double tap a in the timeline to make sure all of the diamonds are selected so all those keyframes double tap a and just make sure they're yellow now what i want to do is i want to flip them or reverse them so i'm going to press s to scale the keyframes and then i'm going to type in negative 1 enter and it's really important that you type in negative one enter so it reverses the keyframes so now they are the exact opposite now to move these back to the front uh just make sure they're still all selected and i can press g to grab and we're just gonna move this to the starting so now if you play this you can see that the cube is unsolved and it now solves itself all right so now we're just going to render this out to a final image and i'll do a little bit of compositing and then i'll also show you how to render this out to a finished animation so we need to add a camera so i'll press shift a and i'm just going to go down here to camera and then i'm just going to move to wherever i want the camera to be and i'll press ctrl alt numpad 0 another way the camera is going to be exactly where we are now i can press g to move the camera around and then i can also press g and double tap z if i want to move the camera in and out all right let's just go into render mode to see how this is looking in the camera view i'm going to press b and box select the camera so that it only renders what's in the camera now the background i actually want that to be transparent and then in the compositor we can just add a color you can do that if you want or you could also add a ground or put it in a scene or whatever you want to do but to make it transparent i'm going to click right here on the little like file icon actually it's right up here on the render properties and then right down here on film i'm going to click on transparent and that way the background will be transparent and then i think i want to see a little bit more reflection so i'm going to actually add the camera right over here just so that we can see a little bit more reflection all right now i'm also going to turn on motion blur right here turn on motion blur and that way when it's animating and it's kind of rotating there will be just a little bit of blur and it will make it look even more realistic and then one more thing to make it even more realistic you can add a depth of field so to add a depth of field i first need to add an object that the camera can focus on so i'm going to press shift a and i'm going to add an empty and i'm just going to add a plain axis if you press g to grab move this down these are just objects that are invisible to the camera so the camera actually won't see them in the render and i'm just going to place this empty kind of at the front of the rubik's cube now what i can do is i can select the camera and then go down here to the camera settings and i'm going to turn on depth of field and then i'm going to click on the little dropper right here to select an object and i'm going to click on the empty object and then i'll go into the camera view and i'll just go into wireframe now if this f-stop here if you turn this down you can see that the edges here are going to start to blur a little bit and what that'll do is it'll make the rubik's cube look like it's kind of small so there's a strong depth of field so just change this to whatever you want the bigger the number is the less blurry it's going to be i think i'll just change this to a 0.3 because i want this to be a little bit blurry and then one more preference that i have that you could do if you want to the focal length here i actually think this looks a little bit better if it's a little bit higher up so maybe just turn this up to like 70 and that way things will just be a little more flat but i just think it makes it look a little bit nicer totally optional you don't have to do that if you don't want to but i just think that turning the focal length up a little bit makes it look a little bit nicer alright so let's just play through our animation make sure it looks all good if you want to animate the camera you could do that but that is pretty good so let's go over to the render properties i'm just going to render this out by 1920 by 1080 so that's great now over here on the other render properties the render right here um it's rendering with 100 samples that's totally fine i'll just render it with 100 samples and then if you want to make your scene render a little bit faster if you click over here on the light paths if you turn these down blender is going to be able to render a little bit faster now i don't want to turn them all down because it'll be less realistic because it won't be able to calculate as many of like the reflections and things but the total i'll turn to two the diffuse i'll turn to two the glossy also turn to two and then the transparency we don't have any transparency so i'm gonna turn that to zero transmission i can turn to zero indirect light i can turn that to zero and then also the filter gloss can turn to zero and then also the caustics the reflective and refractive caustics i can turn that off and turning all those things off will make blender render faster because it doesn't have to calculate as many of the light pads all right let's just go file and save again and i'm first just going to render a final image so i'll just press f12 to render this out all right and it finished so now let's do a little bit compositing and then i'll show you how to do the animation so i'm going to click right over here on the compositing tab i'm going to click on use nodes now i have the node wrangler add-on turned on so what i can do is i can press ctrl and shift and click to add a viewer node and that way we can see the image in the background you can also just press shift a and search for a viewer node and then add that in so you can see that there's a little bit of noise right here and i want to smooth that out so what i'm going to do is press shift a and i'm going to search for the d noise node and just drop that right here and then i'll just plug this image right up to the viewer and that which is going to add a denoise and just smooth that out and you can see that looks a lot better now if you want to make a background i'm just going to press shift a and i'm going to search for an alpha over node and i will drop the alpha and over node right here and then this image we need to wire this up to the bottom one and then the top one that's going to be what's in the background so just make whatever background color you want i think i'll just make like a blue color something like that that is fine for what i'm doing alright so there is our rubik's cube render you could also render it out from different views so like if you want to render it out when it's solved you could kind of bring it over here and then render it again and you can see on the timeline because we moved it over it's rendering out the solved cube alright so that is great now to save this image you can press f11 and then here is our final image you may need to click up here and click on the viewer node to preview the final image and then you can click on image and then click on save as and then just save this image to your computer so now i'm going to show you how to render out the animation so i'm going to go back to layout here and i'll just press escape so that we can see the render so if i just scrub through this you can see the animation ends like over here so what i'm going to do is i'm going to end the animation at frame 110 so you can see there is this end frame right here right now it's set to 250. if i just change this to 110 now you can see that it kind of gets grayed out and there's only frames 1 to 110 so these are all the frames that we're going to need so now what we need to do is we need to render this out as an image sequence and then export it together as a video file in blender's video editor so to do this i'm going to click right over here on the file icon and you can see that right here there is an output and we need to set an output for our images so i'm going to click on this file icon right here and then in the tutorial folder i'm going to click on this to make a new folder and i'm going to call it rendered images and i'll just go inside this rendered image folder and then click on accept so now when i render all these images they're going to be rendered out as png images into that folder also if you wanted to you could change this to like a jpeg i'm just going to use pngs so now just go file and save again and then you're going to press ctrl f12 or click on render and then click on render animation and then it's going to render all the frames and hopefully this won't take your computer too long now if this is taking your computer a little long to render there's a few things you can do one thing that you can do is you can render this in the ev render engine now that won't be quite as realistic but it will be a lot faster because ev is a real time render engine whereas cycles is a ray traced render engine cycles is more realistic but ev would be a lot faster another thing you could do is you could turn down the resolution and that way these image size is going to be smaller and then also a really big thing is this sampling right here if it's taking too long to render you could definitely turn down the render samples um just turn this down to maybe like a 50 or something or just play around with it and get it to how you like if you turn down the render samples the image won't look quite as nice but it will render faster so if you need to play around with those settings that will help to speed up render times uh i am almost done though this is almost done we're on the last frame all right and we have finished so i'm gonna go file and save this again and now i'm gonna go file and i'm just gonna click on new and i'm just gonna click on general because i just want to open up a new blender file alright so we are in a new scene in blender now now what i'm going to do is scroll over here and click on the video editing tab now if you don't see this tab you can click on plus and then go to video editing and then click on video editing so what we need to do is we just need to add the images together as an image sequence and then we can export that to a video so here's blender's video editor i'm just going to press shift a and i'm going to go down here to image sequence and then click on this and then just locate to where your computer saved all the images here are all of the images i'm just going to press a to select all the images and then click on add image strip now if we play this we can actually see the image and that looks really cool so you can see like the reflections there and the fingerprints that is quite realistic and also because we turn on motion blur that looks very realistic uh so that is really great so let's just export this to a final video now the end frame we set this to 110 so on the end frame right here we need to set this to 110 so that it ends at the correct time and then we just need to do some render settings so the resolution was 1920 by 1080 so we need to make sure this is the same so if you rendered it with a different resolution just change this to the correct resolution and then right down here the output i'm just going to save this onto my desktop you could click right here to save it to somewhere on your computer and then the file format i don't want this to be png because that is an image i want to change this to ffmpeg video now there's a few different settings that i like to do within the ffmpeg video so the encoding right here the container i like to use mpeg-4 and then the video right here i like to use 8.264 and then just medium quality and good that's totally fine now if you want to add an audio you can when i use audio i like to use aac but because i'm not using any audio i can just turn this to no audio but if you have like some music and sound effects or something i would just use the aac and then if you want to save this video editing file you can totally do that and then go render and then click on render animation and this should be pretty quick because it's just exporting all the frames together alright so that's the tutorial that is the finished rubik's cube and also here's the animation that created thank you for watching the tutorial i hope that it was easy to follow along and i hope you enjoyed the video i'm trying to make blender tutorials for a living so if you'd like to support what i do as well as get the project files for my tutorials then the best place to do that is over on my gumroad store or my patreon page the links are in the description but again thank you so much for watching and i will see you in a future tutorial
Info
Channel: Ryan King Art
Views: 8,269
Rating: undefined out of 5
Keywords: Ryan King Art, Blender Tutorial, Blender, Ryan King, Tutorial, Rubik's Cube, Animation
Id: KIuH7zxHfPQ
Channel Id: undefined
Length: 53min 7sec (3187 seconds)
Published: Sat May 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.