QGIS User 0036 - QGIS and Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this episode we are going to turn this into this [Applause] so this video started when i posted this image on twitter and i got quite a few comments on it and the questions about how i did it so i'm not claiming to be an expert on blender the software i used but i will try to create a simple to follow tutorial on the process i used to create this and the software blender it is free software it's a 3d software that can do a lot of things and that is one of the problems with with it actually because if you are not familiar with the software it can be quite scary when you open it the first time so the aim for me is to keep this as simple as possible and as straightforward as possible so as long as you follow the steps i described you will hopefully end up with a similar result blender can be downloaded for windows mac linux and it's even available on steam so i will be using 2.93 and hopefully that will be reasonably similar to what you will be using but but first we will start with qgis for this to work i will need some form of background map that will be used to be draped over the terrain and i will also need some form of elevation data and i have a global data set with not too high resolution but i can work with that because i don't need geodata i need imagery and if i resample this data it will look nice enough for the purposes i've also calculated the statistics so it's an updated canvas which gives me all range from black to white in in the view i could use this map canvas to export it to image imagery or images by going to project and export map to image that would probably be good enough um actually that will be good enough why don't i you do that i will do that so hopefully i can set a pixel size here let's try that and save that i've done this a couple of times before so i will just replace my previous image images replace it yes let's see if that worked no it didn't i need to [Music] do something else so [Music] let me try that again so let me keep near to that and increase the resolution to 300 draw active decorations manual annotations up and down no i don't need that i don't need that i don't need that i'm going to draw on canvas calculate from it yep let's see what happens elevation save yes let's see what happens that's much more like it okay let's do it that way so i have my elevation layer and without panning or zooming anything i'm switching to my map layer and exporting that as well with the same settings 300 nothing there is needed save map save yes let's see what that looks like uh not super high resolution but it will be good enough for these tests um if you want it to be a better quality you can probably and i will probably do that now as well bear with me export to image at 300 last time let's do 600. map high quality and that was not that was really fast yep that was not good i don't know why that happened let's try that again export map change that first thousand thousand and then three hundred six hundred ah get it got it that shouldn't be a problem yeah so so the actual pixel size um doesn't really matter that much it's the aspect ratio that needs to be the same between the elevation layer and the map layer and let's see if that looks okay yes it does and now we have much more detail so that can be useful okay so i'm done in kyogees and now we need to open blender let's put that on the main screen like that so this if you haven't used blender before this can be a bit overwhelming but i will try to boil down the essentials for this process so first of all you need to be able to navigate this 3d view and you do that with a scroll wheel on the mouse so if you press it down you will orbit around like this if you hold shift down when you do that you will pan around and if you hold control down you will scroll l or zoom uh you can also zoom by simply scrolling on the mouse wheel but that will depending on your mouse be a bit more in steps like this if you don't have a mouse or you are using a laptop this will not work but you can use the tools here up in the right so if you put your mouse cursor on top of this xyz symbol and press down you will be able to rotate it if you press down on the uh magnifying glass you will be able to zoom and the same if you put it on the hand you will be able to pan here is also a camera symbol and the camera is this object here oops like that so by pressing this or zero on the numpad you will be shown the view from the camera's perspective and if you press it again you will go back so this will be quite helpful later on because this is the view that will be rendered when you render your image as a final result uh let's see yep and we have i will keep the camera the cube here i don't need that so select it which means you have this outline and press delete this is a light source and i don't need that either so delete it however i will need some form of plane and to add a plane you press shift a and add a mesh in the form of a plane like that this is a really simple polygon with four vertices one in each corner and to convert this to a topography you need a lot more polygons so to achieve that we need to go into something that is called edit mode right now we are in object mode as you see here so we need to change to edit mode and you can do that here or you can just press tab to switch between object mode and edit mode so when you are in edit mode everything should be selected and we need to increase the number of polygons and we do that by subdividing this surface and you can do that by just holding your mouse cursor above the object right click and subdivide that will go from one to four polygons like this and we need to repeat that a number of times and you can do it by right click subdivide or you can press shift r to repeat so one click two and you need to repeat this a number of times so that you get a sufficient number of polygons um i think i will try that many you can always go back to edit mode and add more subdivisions later but go back to object mode and now we have our plane subdivided to apply the elevation to this plane we need to use a modifier and modifiers can be found here to the right so it's this tool panel with a wrench it's called modifier properties so for the plane we need to add a modifier and uh to deform this plane we need to use a displace modifier and you can control the displacement manually by the strength right now i will just keep it at let's say 0.3 so it's slightly above but anyway but we need a texture to control this displacement and to create that texture or add that texture we can do that on the texture tab here but we need to create it first so just press new here in the displacement modifier settings and that will create a texture by the name texture let's rename that to elevation and to go here to the texture settings or texture properties you can use this button to the right here show texture in texture tab but you can jump back and forth between the settings here so you are in the modifier tab and the texture tab so the texture for elevation should be an image and let's open and that it pictures elevation like that and immediately you see it will displace the oops the plane like this it may not be enough resolution uh but we can work with that uh later first let's see it's a bit too high so um just move down the strength that's still a much too high but for this demonstration purposes i think that will be nice enough so i will add more subdivisions let's go into edit mode so select the plane you can do that here or in the 3d view and press tab and right click and subdivide once more press tab again and now it's a bit more nice however we can use a modifier to subdivide as well so let's add a modifier that is a subdivision surface modifier and that need to be placed on top of the displaced modifier so that the subdivision is done first than the displacement you can change the number of subdivisions here and there's a difference between what is shown in the viewport and what is shown in a render so if i increase that to two that will introduce some artifacts but we can maybe change that with a shader so in the 3d view in object mode right click and select shade smooth [Music] that might be okay if we decrease it to one we can work with that we have the settings here i will probably leave it at one both for the viewport and render for now and we'll see later when i add the texture how it looks so the shader shade smooth if you don't like it you can remove it by shade flat instead so shade flat shade smooth so let's add the texture and the map texture draped over this needs a material and to add a material to this object the plane we go to the materials tab and add a new material it should be the default principle bsdf surface and instead of a color as base color we click the dot here and select image texture then we can go to open and here we can open our map and i'll i'll use the high quality one see what happens nothing happens well that's because this view is in solid mode and here up in the right corner of the 3d view you have the solid mode this button this is a texture preview mode so if i click that you get a preview of the texture like that but if you want it to be rendered properly close to the final result you need to go into rendered render preview mode and since i deleted the light source previously the scene will be unlit so that will be the next step to add lighting lighting can be done in multiple ways um the way i will show you now is looks really good uh and you have a lot of control over a scene like this but it will require a change in the render engine so if you go to the render properties you will see that the render engine is set to eevee as default and we need to change that to cycles eevee is really fast but it takes a lot of shortcuts and cycles is much better at shadows and ambient occlusion and such so and for the the lighting style i've selected it requires cycles however it will be a bit more taxing on the computer so you may need to lower your expectations for the render results or render speed or change your settings a bit if you have a slower computer but if you have a reasonably fast computer this will be not be a problem so to add lighting we go to the world properties and here you have uh color settings and like before we don't want to use a color we want to use something else so press the button or the dot next to color and here you select sky texture and that will generate um or simulate a sun and sky settings so you get sun size so if you go very small you will get sharper edges on the shadows because the sun or light source is really small if you go up to a larger size the shadow shadows will be much softer but the sun isn't this big so i will stay stick at let's say one i can select that field and press one degree that is big enough and will give me some softness in the shadows the intensity of the sun it's a bit bright so let's reduce that also we have the strength can reduce that and i've found that quite low values give the best result we also have sun elevation so right now it's at 15 degrees and if we increase that the sun will be higher and the shadows will be shorter and if we go the other way the shadows will be really long but i will stay at let's say 17 degrees um the sun rotation right now it's coming from the north and the sun rarely comes from the north so i want to try to have my sun in the west so the shadows will be to the east so i will move the sun to something like 60 degrees maybe it's still north ish but since this is a computer simulation total reality is not really necessary let's put it at 70. i think that looks quite good and you can also play with altitude and these three settings here if you increase the air settings it will make it redder or yet more yellow i don't know why or what this setting setting does but you can play with these settings um some to get the result you desire and the closer to one you are the more realistic the light seems i think that's reasonable enough so you remember the camera the camera view is the default one or view is the same as before but if you want this as the camera view there's a shortcut for that and that is pressing ctrl alt and 0 on the numpad that will switch to camera view and move the camera to the current view but you may still want to change the view in the rendered image and to do that you need to open the settings in the 3d view and that's this small arrow up here in the corner so if you click there you will get these settings and in the view tab you have a check box that says camera to view if you check that you can now pan around inside the camera view which essentially moves the camera you can also zoom and pan and so on so that might be a good view for this image maybe so we can try that and to render that view you go to render and render image you can also press f12 and this may take some time the more cores you have the faster it will be i wonder what resolution i'm rendering at i will stop this hopefully blender won't crash oh uh the render settings are in the render properties here uh and uh dude no it's this one output properties here i can change the aspect ratio of the image and i can change the percentage so if i want to just quickly render a test i can use 50 so let me press f12 now hopefully this will be quicker the more course you have on in your cpu the the faster this will be and you can also set up a blender to use a graphics card that will also perhaps make it faster and this will hopefully be okay yep i think that's quite okay now you can play with the settings so you can go to the modifiers and change subdivisions or the elevation you can go to the materials uh or the textures let's see this place and where do we have the material no the world settings and so you can play with the lighting so it may be less intense and then go down in strength as well i'll uncheck the camera to view so i can rotate to another view as you saw there are black parts here and that is because the plane isn't bigger than it is so i can fix that by adding another plane so shift a plane and then we scale that and there's a scale tool here you can also press s on the keyboard s and just make it big press the mouse button again and i can move it down by pressing using this tool move or g on the keyboard so g and lock it to the z direction by pressing z and then down and let's have it about there and there we go back to activate the camera view zoom out maybe i want an instagram format so then it will be 1080 by 1080 yep enter and well that might be nice so uh i think i'll stop there and render this out in 100 100 and wrap this up so hopefully this has given you enough information so you can do this yourself and by generating elevation images and a map image and it doesn't have to be openstreetmap it can be anything it can be a satellite layer or or whatever you want and you can play around with the light the amount the strength of the displacement and you can animate the 3d scene into a movie you can add 3d objects that you create yourself or that you import from some form of source from the internet and yeah blender is extremely powerful and you can do really a lot with it so hopefully this will help you get started with blender but as i started with i'm in no way an expert on this so i have followed a lot of youtube uh instructions in order to get this for but as long as i can keep it simple and just add the plane and the the modifiers i've shown you and uh textures like this it it's reasonably easy to do this whenever i need it yeah that is all see you next time [Applause] [Music] [Applause] [Music] you
Info
Channel: Klas Karlsson
Views: 25,024
Rating: undefined out of 5
Keywords:
Id: AJJNX243k9E
Channel Id: undefined
Length: 34min 7sec (2047 seconds)
Published: Mon Oct 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.