(NEW!) Large Scale Oceans in Blender with FOAM!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone a couple of years ago i made a tutorial on how to create large-scale oceans in blender and a lot has changed over the last couple of years in blender a lot of cool new features that make life a whole lot easier so i thought i'd just do an updated version for you guys today here's the new and improved version that we'll be making today if you look carefully you can see we have foam in there as well which has been a hotly requested feature from this tutorial i'm not going to stretch this intro out too much you guys have waited long enough let's get into it so we just got the default scene here i don't really need this light so i'm going to go x and delete uh we'll keep the camera and the cube in the old setup we used to kind of make a plane and then put subdivision and blah blah in this new setup we don't really need to bother with all that stuff anymore and i'll show you why so just select any old object the cube will do and then we're just going to go into modifier add modify ocean and then let's zoom out a little bit this time we're going to leave this geometry here on generate the big change that's happened since the last time i did this tutorial was the addition here of the two resolution settings so now we have one called viewport and one called render and the reason they have this now is because it used to be that as you added resolution the entire look of the ocean would change but now you can see as i turn this up what happens is the overall look stays the same you just get more detail added so that makes life a whole lot easier so we no longer have to worry about the adding a plane and doing the displace and all the subdivision surface and all that sort of stuff on the preview plane here we can just roll with just the ocean modifier so another advantage of this new resolution system is that we can have separate resolutions for the viewport and the render so that means that you can keep the viewport resolution low and then have this render setting turned up you know it could be up to like 32 64 something like that and this render setting will only affect the bake or the actual render of the ocean so while these are the parameters here we can sort of quite easily adjust you know and the animation we can see kind of in real time but then when we bake we get the higher res version which takes a lot longer to generate so i'm going to do a little bit of scene management here first i'm just going to get this first like initial plane here i'm going to rename it with f2 and call it ocean swell here where it says view layer i'm going to rename this to render and then with the ocean swell object selected i'm going to push m create a new collection and call this ocean bake and hit enter so now we have the cameras just in the standard collection we have ocean bay collection with ocean swell object underneath it one thing also be good to do is just right click and go shade smooth and before we start tinkering with the settings here another thing it's probably a good idea to do is kind of add a reference object for size right because you've got a bunch of numbers here you know size spatial size all this kind of stuff that are kind of in meters but to get a real kind of reference of how big that is let's put something in there that's kind of a real world scale now if you have a boat object that's modeled into real world scale please feel free to drop that in here but i'm just going to use a cube so shift a add a cube and just kind of make it sort of like i know nothing about boats so this is going to be like i just looked up some measurements like of a 30 foot boat so i think 30 foot means 30 30 feet long which is about 10 meters so let's say along the y-axis the green one here let's call that 10 meters long and then we can kind of adjust the rest of these to be sort of boat like measurements so let's just call it like 4 by 3 and then just g and z and let's just move it up on the z axis a bit so it kind of just sits a little bit in the ocean like so and by the way this panel on the right here you just use n to show and hide that now because we're using this one little patch of ocean we're going to end up with tiling because we're just going to tile it over the surface of the ocean to kind of get the you know the ocean sort of stretching out to the horizon so the trick is we've got to try and break up this tiling uh in the previous tutorial i showed you a technique where you kind of just use a noise to mask out a couple of different versions of the same ocean but in this one what we're going to do is we're going to layer it on top of each other so we're going to start with an overall swell layer and then we're going to add a layer on top the kind of detailed waves so we're going to start off the resolution for this one i'm going to put it to 32 viewport we can keep at i don't know like 12 or something will probably be fine if that's too slow for your machine when you hit play later on you can turn that down there's not a lot of detail in this pass we're going to set this spatial size up to 300. and see this is where our size reference really comes into play so we can sort of see a bit better you know how big of a patch of ocean we're looking at here versus kind of a standard sort of boat size now for this we want to just get like big old sort of rolling swell um so i found good setting for that is if you open up the wave section here we're going to set the wind velocity down to 8.3 and basically wind velocity i mean it's a lot easier to adjust now you can see what's going on i might even just turn this resolution up a little bit more but you see as you turn the velocity up the waves kind of get smoothed off right but then as you turn them down they kind of get a bit more kind of spiky this also works with this alignment factor so for swell we want it to be fairly aligned aligned just means like as you can see as you add it in you get a lot more kind of directionness i suppose it's not really a word but if i turn up the scale here so we can see it a bit more you can see that the waves kind of go from a bit sort of directionless into this more sort of directional style of wave and that's exactly what we want for a swell so i found you don't want to go full to one because it looks a bit too robotic but we might just set this down to sort of point for around something like that now to get a better idea of what this is doing as well let's take the opportunity now to animate the time now unfortunately you can't put a driver in here if you've been using blender for a while you might know what drivers are it would be a good automated way that we could animate this time but that does not work with the baking so i've come up with a kind of easier way to do this with animation but that it won't sort of restrict you to like us you know whatever frame range that you animate to so first let's just push the left arrow button and you can that'll take you to frame zero and then let's set our time here to frame zero and then you can click this little uh button to the right here of time little sort of dot and that will put a keyframe in here and if we have our ocean selected you can see we've got a little keyframe here in yellow usually if you want this to kind of go in real time like like a one time speed kind of thing what you'd want to do is go have a look at what your frame rate is here and then set your next keyframe so we go if it's 24 frames a second we go to frame 24 we go back to the ocean modifier and we set the time to one and then we set another keyframe there like that so that means at frame 24 it's one second or you know 24 frames per second so that's a good starting point but i found with this new setup as well it can feel a little bit fast so you kind of do have to sort of artificially slow it down so at the moment though what you'll notice if you gonna go to frame 24 it just stops so we don't want that obviously so let's make a graph editor so we can just drag up from the bottom corner there go to graph editor and this is our animation here you can zoom around with the standard blender hotkeys now if we select both of these keyframes here you can see for one thing is that they kind of got this smoothing effect by default so we don't want this because you don't want the ocean to kind of start off slow and then speed up and then slow down again so push the t key set this to linear and now you'll see it's a straight line now the problem of it stopping after frame 24 we can easily fix by pushing the n key to go into this sort of side panel here make sure that you click on where it says time ocean on the left and that will bring up some new sort of controls here if you don't already see these let's just drag this out a little bit and you've got like a modifiers thing which is kind of like the modifiers you have you know on geometry but you can add a modifier to your animation so we're going to add this modifier called cycles and this has nothing to do with the rendering cycles this is just like cycles of animation so you can see it's got these settings repeat motion um before and after we want to set this to repeat with offset for the before and repeat with offset for the after and now you can see if we zoom out we've only got these two keyframes here but then our animation continues on after our last keyframe so now i can just drag from this corner here and close this down and now if you push space to play you can see this is how fast our animation is going and as you can see it feels a bit fast for a swell kind of motion but we'll fix that in a second we'll just finish off the settings here we've got this damp damping damping kind of stops extra sort of directions happening if we put this up to one you get like this really kind of robotic looking ocean so we probably want this we can put it down a little bit i suppose like that's that's fine you want it just a bit of break up into the motion that's what damping does if we drop that right down to zero you sort of lose all the directionality of it so let's put this back up to i don't know like something like that we'll do so just a little side note when i originally recorded this tutorial i forgot to mention this direction here so you probably want to set this to something other than zero like something like 20 degrees should be good um but yeah the rest of this tutorial is set to zero so either way it'll still look okay but like you know setting this to something other than zero will look better i might just turn the wind up a little bit more let's see what we got it's not bad choppiness i'll probably want to turn this down a bit because the actual swell is usually not so choppy something like that will do and then scale probably just drop that down back down to one on the scale and yeah you might be thinking oh it's a bit subtle you can't really see it but that's that's a boat right don't forget that's a boat and that's a pretty there's a fairly sizable swell so i think that'll kind of work for us really well so before i forget let's just save and you've got shift left arrow will always take you back to the first frame usually space bar on the default settings in blender space bar is played okay cool one last thing we want to change here is the smallest wave because this is a more of a swell we don't want it to have like lots of little details on it if you turn this up to the 32 you can see there's a lot of detail in here and so we'll turn this smallest wave down to 0.2 to kind of get rid of that detail a bit you may be thinking uh why don't i just render with less resolution because the problem with that is that you actually get kind of pixel artifacts in your render if you do that it's a bit of a pain unfortunately but i generally find probably 32 is is a good sort of minimum you might want to go a little bit less depends on how close or far you're going to get from your ocean let's just turn our viewport back down to 12 and so that's how our swell is looking that's pretty good and now that we've got all the settings working nicely let's do that final tweak with the speed that i was talking about before so what you can do with the ocean swell object selected you'll see these two keyframes down in the bottom here that we created earlier if you want to speed things up you need to drag this keyframe closer to zero or if you want to slow things down like we do you need to drag it away from zero and so because of i'd say looking at this we probably want to just halve the speed of it and so we're taking you know basically this keyframe here is on frame 24 we pull it up to somewhere like frame 50 and then that'll halve the speed of it as you can see now let's do our first bake you probably don't want to bake the full 250 frames by default let's make this 150 um and then we can open up this bake thing here make sure that the bake end here is also whatever 150 and then you're going to find you want to make a folder somewhere on your drive because you're going to have two of these ocean setups so make a folder somewhere and we'll call this one ocean swell after the name of the object and then select that folder go accept hit ctrl s to save again because this can stuff up sometimes it's a render after all it can take a long time because we're doing pretty high resolution so then hit bake ocean to bake it out okay now that that first bake is done let's work on the second layer of ocean that we're going to add on top to do that let's just shift d and duplicate our ocean swell push escape to drop it back where it was we'll need to go into our little filters menu here for the outliner and turn on the viewport filter what i found is even if the um if the visibility is off for this one but the viewport flag is still on it'll still calculate this ocean swell even though we can't see it so we just want to i'll just drag across all of them to turn them all off just to be safe click the new one that we just made and we're going to call this ocean detail so this one is going to be like all of the small little detailed waves that we're going to have over the whole ocean so we want to set our spatial size here to 100. now if we zoom in here we're going to set this smallest wave down to zero because we don't want to cull out any detail at all uh we'll set the choppiness to two let's turn down our wind velocity to three and that's going to give us a lot more sort of detail in the waves and we'll turn our alignment down a bit as well because we're getting a bit of you know a bit too much alignment here so we're just going to turn this down to say 0.2 and then damping as well we're going to turn this down to zero and so so you can see we have a bit more of a general kind of a wave motion here i might just turn the scale down as well let's go point three and again don't forget this is your size of a kind of fairly large fishing boat here so you don't want these waves to be too large and what we're going to do for this render is we're going to turn it right up to 64. now this is going to be pretty slow to run you can turn it down if you want i think in the last one we did the highest resolution we did was like 40. so you can turn it down to 40 if this is taking too long and again it really depends on how close you're going to get to the ocean if you're going to be getting sort of as close as we are here then you probably do want this to be 64. and especially if you're going to use foam which we will talk about so to get a better idea of what the final result is going to look like we need to turn up our viewport resolution as well let's set that to like 32 yeah so you can start to see and see as i press play now it's pretty slow what you've got to be careful of is um as you turn up the resolution as well if you've got your choppiness up fairly high you can get these kind of overlap sort of shapes here so it is always good because it's a long bake check it at full resolution and this will take a little while to generate yeah and so as you can see this is just a good way to check what your final settings look like so as you can see here probably the choppiness is probably a bit too much what i might do is just turn this back down because we can still kind of see the effect happening here and then we can just turn this down maybe try 1.8 yeah i'm almost 1.7 okay that's looking a bit better so let's talk a little bit about foam now in the last tutorial i didn't add the foam because to be honest the effect straight out of blender is not great and i'll show you why here if you look at the actual bake that you get out of blender you can see that the sort of foam that gets left behind from the waves just looks like just raw pixels there's no blurring anti-aliasing and stuff like that and so when you actually use it in your render it's really hard to hide that so a way around it is you could just turn off the foam fade effect which i'll show you in a second um and then you can take this foam pass into like another compositing software like um you know probably nuke or after effects or something like that and do a trail effect on it i don't know what it's called in after effects it's something similar like that blended compositor doesn't do it unfortunately it doesn't have like a trail effect and i wasn't going to show the whole extra compositing software thing because you know that's a whole tutorial uh on its own knowing all that if you're happy to still go ahead with some foam let's just turn it on before we adjust these settings let's make a shader for the ocean because then we can actually see uh you know in real time what the foam uh is doing um so drag up from the corner again turn this into a shader editor hopefully if you've used the default cube you should have a material here if not you can just hit this plus button to create a new shader because that's what you'll see here let's give it a name called ocean preview and for this one we just want to turn our roughness down to zero let's switch here to our material preview mode which is this uh beach ball icon let's just turn our base color down to black um this is just a preview shader this hdr here this kind of second from the end there's a pretty good one for viewing the ocean it's got a nice kind of sky in it cool so that's looking pretty oceany so then what we to see the foam what we need to do is go shift a um i usually just use this search function and i usually actually assign a shortcut which you can just do with the right click menu um because i find that a lot easier let's start let's try assign a shortcut we'll do uh control shift a like and so then you can just like type in attribute is the node we're after um or if you want to find it from the menu um i can't remember where anything is in the menu anymore because i use the search input yes input attribute okay drop that down and you'll see here we have this name here and if you roll out the foam here you've got this option here called data layer and so this is your name that you want to look for so let's just type foam in there and then we put the same name in here foam and then we can take i think either the color or the factor will work let's try color yep there we go by default what the foam does is it looks at like how sharp the mesh is so that's kind of basically controlled a lot by the choppiness if we turned this down to like 0.5 we'd lose like all that foam so let's turn that back up but as you can see there's a lot of foam here it doesn't look very natural so you can use this other parameter here called coverage and what you want to do is actually turn this down so you can go below zero so let's try like minus one and as you can see there's a lot less foam we're just getting the kind of tips of the waves here and that's what we're after because what will happen is these white areas will generate foam like on every frame so you do want them to be fairly small um otherwise you're going to quickly fill your ocean with foam and so then the other foam setting here that you want to play with is this foam fade this is kind of i guess the parameter is kind of like how long the foam is going to last so i mean the defaults are not bad i might turn it up a little bit just go to 1.2 we can give that a bash see what happens uh and so with that we're all set to go last step is we're just going to set this path because it's still pointing to our ocean swell we don't want to overwrite that so let's just click the fold icon you can see our ocean swirl bake is sitting here and then let's just go up a folder and we'll make a new one called ocean detail double click the folder click accept and definitely right now ctrl s and save your file because this process at this kind of resolution 64 is going to take a while so hit the bake button and go get a copy so before we go on i just want to talk about a bug you may encounter while you're baking there's a couple of bugs that were kind of introduced in 2.90 one of them is that if you hit the delete bake button sometimes it just won't work so you'll hit it and nothing will happen if you if that happens to you just go up into any one of these parameters here in waves so say like direction change the value on it and then kind of change it back and you'll notice the bake ocean button is now showing again the other bug that happens is sometimes when you hit the bake ocean button it doesn't actually bake so let's try it and see what happens okay so it's working this time but essentially if you hit this bake ocean button and you don't see the ocean simulation progress bar pop up down the bottom here then you've hit that bug so what you'll need to do is just save a scene then just do control n and do new scene and then just reopen it and then once you do that you should be able to hit the bake ocean button and it should work okay now let's get into some rendering you'll remember at the beginning of the video we ma we renamed the view layer up here to render that's because we're going to use this as our kind of rendering layer and we're going to move all of this ocean generation stuff into its own layer so it's easy to kind of switch back and forth between the two so to make a new layer you hit this little paper icon here just go new and let's call this one generate now if we go back into our render layer that we made before what we can do is just turn off this ocean bake collection and so that will just disable it completely it means it's not generating the ocean if we push you know if we drag through the frames but we can always just if we want to generate a new ocean we can switch back to this generate layer and everything is in here while we're in this generate layer let's stop it from actually rendering because we don't ever want to render this layer um so if you just go into the layers panel here and click use for rendering to turn it off if you just go back into the render layer you'll see it's enabled and the generate one is disabled so that's what we want to do now that we're in this new render layer here you can kind of see this little sort of highlight around the collection icon here that means it's your current collections so any new objects that you make will end up in this collection if it's not this current collection all you need to do is just click it to make it the current collection now we're going to go shift a and add circle push f9 to bring up the settings for the circle we'll keep the vertices at 32 we'll set the radius to 200 and we want to set this fill type to triangle fan and let's push f2 and rename this ocean and while we're at it let's rename our cube here we'll call it boat ref for boat reference with the ocean object selected we're going to right click go shade smooth and let's zoom out a little bit here and you probably will hit a point as you're zooming out where the circle starts to disappear this is just your clipping plane in the viewport so if you push n go into view and then where it says clip start and end set the end to like ten thousand just add like an extra zero in there and to get rid of that and so then just going to tab into edit mode press 2 to go into edge select then alt click the outside edge press e to extrude and you'll get this extrusion here press escape so it drops it back down where it was and then we're just going to go s for scale and type 10 press enter and we tab to go back out of edit mode we look at the item tab here it says 4000 by 4 thousand you can go larger of course feel free to but we're just going to stick with that for the time being now tab back into edit mode and you'll see also we're getting a bit of kind of flickering in the viewport this is again the clipping plane basically if you turn the end up really high uh you you sort of decrease the amount of accuracy it has to kind of work out depth in the viewport so a way around that is just to turn up your clip start as well could just try point one uh yeah that's a bit better maybe just one yeah there we go one has cleaned it up and so then we can just do with tab into edit mode make sure you're in edge select number two press ctrl r and then if you have a mouse wheel you can use the mouse wheel up and down to add more divisions i'm using page up and page down i don't know why it's not showing up in the keyboard shortcut view but yeah so page up page down is another way to do this and then just push enter try and get something that sort of looks like the kind of regular-ish sort of squares like that will do what i might also do is just this inner circle here i might actually make it just a bit smaller so you can alt click that edge to select just that ring here scale it down a bit more like with the s key and then ctrl r again and add a couple more divisions in here like so because that that the triangles in here can render a little bit differently to the squares and the rest of the disk so that's just a little warning just keep that in mind okay so let's tab to go back out of edit mode so we go shift a and add an empty plane axes f2 to rename this and call it texture placement i did this in the last tutorial and then i forgot to show you guys what it does so we'll this time we will actually use it while we've got it selected let's just turn the size of it up don't scale it you don't want to scale it for this you just want to turn the size up because this is just a display thing here um so let's make it like 30 because we're going to want to sort of select it easier later and let's go into our render settings we're going to switch our render engine to cycles use gpu if you've got a decent gpu set your feature set to experimental and then that will enable the subdivision settings here we can turn this dicing rate up to like two uh i might turn the viewport down a bit to four uh these will just these are just quality settings so the lower the the number here the higher the quality we need it fairly high quality for the render um the viewport we needed a bit better quality than the default so we'll just run with that this off screen scale you want to turn that up to like 10 that just means that there's outside of the camera's view there's less detail because when you're rendering it you don't need the full detail outside of you know what the camera can see but you still need something there for the reflections and so on uh max subdivisions we can leave this well you can leave it at 12. i might just turn it up to 16. this is just like a sort of a safety cap on the amount of subdivisions that it can do um but yeah anything from 12 to 16 should be good for that and then select the ocean object again and we're going to add a couple of subdivision modifiers we'll just go one you can leave this on the default this is just to kind of help add a bit more detail into the mesh before it gets subdivided for the render again which is the second subdivision surface that we add and then we're going to turn this onto adaptive and you can see here final resolution 2 viewport 4 like what we said before let's do a quick save in the last tutorial i supplied a custom hdri for you guys to use for the sky and the lighting and so on i'll put a link to that in the comments again for this tutorial and so you can use that if you like but what we're going to do for this one is let's just again split up the window here and we'll go into shader editor go into world push n to get rid of that side panel but this time i'm going to add a sky texture so if you go texture sky texture drop that in here hook the color into the background and we'll just leave that as is for the time being we'll come back and tweak these but these this sky texture actually generates like a pretty nice sky setup so leave it on nishita and we'll look at all the different settings when we get into the rendering so switch this back into object make sure you have the ocean object selected here if it hasn't got a material again you can just hit the new button and get the default one here let's just set our base color down to black in the last video as well i talked about the index of refraction in every other renderer i've ever used index of refraction controls not just the transparency but also the reflectiveness of the surface but it turns out blender is a bit different we can just set this anyway but just keep in mind that this index of refraction only affects if you have a transparent object so we'll set it to 1.33 which is the io of water if we want the specular to be set as the same value as what water would be this one actually ends up as 0.25 and the difference is very subtle but you know you might as well do it uh roughness will turn this down to zero i might just rename this to ocean so we're just going to add a standard image texture um we want also a vector displacement i think that's in let's just search for it ctrl shift a if you've set that hotkey or if you haven't just to control shift a click search vector displacement drop that down over here because it's going to plug into that with our image texture selected let's do ctrl t to create these two mapping nodes if control t doesn't work for you you need to enable the node wrangler add-on i use it in all my videos so just go and enable it it makes life a whole lot easier in this mapping node here we want to set this to texture we're going to connect the object into the vector this object here we want it to be this texture placement object and because this is as well we want to set the scale to the same size as we set as our spatial size in the ocean modifier so for the swell that was 300 you can just set them all to 300 and so for the location you do minus half of that scale so -150 you just need to do it in x and y and then in the image texture let's click open and then you just need to go and find the ocean swell bake that you generated and here it is all of these guys that is called disp so press a to select them all select open image and you should see it should to say frames 150 here and then let's hook that into the displacement so for the displacement we want to set this to world space and then what we need to do little trick so you need to switch some of the channels of the displacement you do that with a separate rgb and a combine rgb so color goes into here red into red green into blue and blue into green so we're just swapping the blue and green channels and then that goes into our vector on the displacement and then that displacement goes into displacement here on the material output now let's just give that a little save because we're about to do a render but one thing before we do the render is make sure the ocean object is selected go into the shader settings here scroll all the way down until you see the settings here roll that out and you'll see here where it says displacement you want to set this to i mean displacement only is the best quality but also the slowest um displacement and bump is kind of an in between i'm going to set this to displacement only and then we can we can test it later see what happens i mean if you can render displacement only try out and then switch it to displacement and bump and see if there's a difference you know you know in time or in look and let's get our camera set up i usually use this menu which is on this tilde back tick slash whatever key to change my views so you just use that guy and then you can pick view camera and then you want to go press n lock camera to view in the view setting and then you can drag this out and we can just kind of you know frame up our boat like so and then just make sure to turn this lock camera back off again otherwise if you try and navigate out of the camera view you'll actually end up moving the camera and let's switch this to rendered mode and see what we get so zed brings up this cool little menu and you just go up here to rendered okay good start you'll see the ocean doesn't seem to go very far this is again that clipping problem we have the same problem in the camera as we do in the viewport it's set it ridiculously low here so again you can turn this up to like 10 000 just to make sure you get like the entire ocean and i might just adjust the camera again just tilt this up a bit i might just rotate it over to this direction here because i'm trying to see if we can see the tiling and i'll actually pull back a little bit one thing to know is if you start adjusting this camera because the displacement gets calculated on the camera view you need to kind of switch out to solid mode and then back into rendered mode to actually get it to recalculate the camera view here um so you can see there's kind of a little bit of tiling i guess that might be tiling there but still looks pretty good like that's not terrible now texture placement remember this guy basically you can use this to move the position and scale of the whole ocean texture like separate to the actual object so that means you know say for instance where we've zoomed back out here and we're like oh you know what the disc is a bit too small now because we're kind of seeing this curvature you can actually just scale the disc up and if i let go you'll see the ocean didn't change so that's one advantage right so you don't have to worry about you know the scale of the object also affecting the look of the ocean because it's locked to this texture placement object not the ocean object so it's looking cool but you know it needs more detail obviously so that's where our other displacement map comes in so to add the second ocean bake that we did i'm going to let's make this big i'm going to select all three of these shift d to duplicate and we can just drag them down here and then pick the ocean detail bake that we did here because we have two image sequences in here if you scroll down you'll see that there's also the foam what you want to do is just select that first frame up the top here scroll down shift select the last frame uh open image or you can just select one frame and just go open image and then you'll have to just in here where it says frames you'll have to type 150. so either way will work just make sure if you see if this goes into single image just make it image sequence and that will enable this frame setting so you can change that now you'll remember the other one was a bit smaller it was a 100 scale and so then this location needs to be minus 50. we keep it tied to this texture object i mean you can just use the same node here if you like and then delete this guy and so you've always you always know they're both using the same object so after that what we're going to want is a mix rgb and we're going to take our swell and our detail and in fact let's name them same same key uh the f2 key rename so you just select the node f2 and this is detail i mean you don't have to go and name everything in your node network but just stuff that's not maybe too obvious what it is it's good to just get in there and name it because this is just says disp and this says disp who knows which one's which so in this mix node turn the factor up to one and then we're going to add them together cool all right and then let's grab this thing here bring it down here and then just plug out the out of the ad into this setup here control space makes windows big if you're wondering so that's we can just get out of that do another save and let's switch into rendered mode and see what happens now looking at the render here you can see looks like some kind of render errors going on here all this kind of black stuff if you see render errors in this setup first thing i would do is go switch back into solid mode push tab to go into edit mode and see like how much geometric detail you can see in the viewport because blender needs to kind of take this detail and then refine it and refine it if there's not enough detail to start with you can end up with some errors so looking at this for one i mentioned that being near the center here where you see all these triangles can end up looking a bit weird like you're not rendering the same as the rest so in the camera viewport you can just if you're in edit mode edge selection mode and then alt click this edge around where the triangles are and then just s and scale it down and then you'll see here we've got a big gap of like these big polygons here so if we just ctrl r add a bunch of divisions here and you might need to do this in stages so you know this looks like a good amount of divisions for the back here and then we just do control r again add a couple more as we get closer to the area uh that we're sort of focusing on and now if we switch to rendered view and let's just tab out of edit mode and all the blackness has gone away okay let's animate the camera i tried to come up with some new camera move from the last time but um you know what the old one was pretty good so let's just do that again what i might do first is just in the camera settings go to uh where is it viewport display set this size up to like 50 so you can see it a bit better like it just makes things a bit easier with the scene scale that we're working with um alt g to reset the transform alt r to reset the rotation um there it is under the ocean there let's go rx90 gz and move it up a little bit uh so i might just do some viewport splitting here let's split the bottom up here i'm going to turn this into a graph editor and then i'm just going to split these two here might push t to get rid of that toolbar and then this one is just going to be our camera view like so we can turn off this navigation um we can also switch this into material preview mode and so in here let's do gy move that back a bit something like so might get it a bit gz get it a bit closer to the ocean and this is where this material preview comes in handy because it makes it a bit easier to see how close you are to the ocean and we're gonna go rx rotate this down like so if we look in the side view let's do it a bit more push i and set location and rotation keyframe at frame one here and then go to your last frame gy let's move it along something like so and then rx and rotate that up to about so far so the ocean uses up about two-thirds of the view you can hold down shift to kind of slow down that rotation as well so just drop that in like so press i location rotation so you can hit space bar to play and we can see well for one you can see it's sort of speeding up and slowing down so let's fix that you want to just with your pointer over the graph editor push a to select everything t and then go linear and that will just make sure that our animation is linear so no speeding up and slowing down so we got the only animation we're using here is y location and x rotation so we can turn the others off with the eyeballs and let's just pick the y location push home and then you can sort of see our path here i think it might be going a bit fast but actually you know what let's do the rotation first again push home we might just sort of scale that like so and we want to just grab this keyframe and push gx to kind of move it over to the left so it sort of finishes rotating about halfway through the animation and in fact these two keyframes just select those two push t and we're going to switch these back to bezier select this bottom keyframe here rotate that up like so so it'll smoothly move up to the final rotation like so and just like last time i might do a little bit of a kind of overshoot animation so go to about sort of halfway between the this keyframe and the last animation you can push i and just hit rotation to get another keyframe and then just do gy and kind of move this well actually what we might do is select this keyframe go g y and move it up a bit so that it kind of well not that much just make it very very subtle so something like that looks good another tip is if you want to kind of slow down the speed that the camera is traveling just pick your y location here i think i'm just going to grab this last keyframe here and i'll bring it down a bit so something like this kind of speed i think looks pretty good let's do a save now go to the end position here change your graph editor into a shader editor and then switch it to the world and we're going to do a little bit of adjustment on this sky just to kind of position our sun nicely so if you go into rendered mode probably looking a bit bright so one thing you can do is turn down the strength of this sky we can put in like a 0.2 that works pretty well we have a controls here for sun rotation and sun elevation now i think we're looking straight at where the sun is let me just pull this down a bit so elevation is obviously the height of the sun over the horizon so as you drop that down you get more of a sort of sunrise kind of look i mean that's kind of cool like that but let's just put our sun kind of about there three degrees elevation and just rotate it off to the side a little bit like so i mean obviously like you can see the sun is pretty small in real life this would kind of glow a lot more the tutorial is already kind of getting a bit long so i'm not going to go into any kind of compositing this time but generally you'd want to get in there with a glow and kind of make that a bit bigger if you don't want to have that like tiny little sun in here for for this tutorial feel free to just move it off to the side like so so last step here is the foam um this is kind of an optional extra like i said before you could just render the ocean as it is now but you know i've got lots of people commenting saying they wanted foam and you know i've already given you guys my opinion on it so let's just do the foam okay so select your ocean again we're going to switch this back to object here in the shader editor i might just switch this to solid mode so that it's not slowing us down drag this up a little bit so i might just control space to make this a bit bigger let's shift d to duplicate this principled bsdf uh let's add another shader and we want a mix shader and so the original kind of water shader is going to go in the top and then our this is going to be our foam is going to go in the bottom like so and then this needs to plug into the surface to replace the water in our subsurface here we're going to set this to like 0.2 our radius we're going to set all of these to one and then the roughness will put up to 0.2 and then let's add in another image texture node so you can do your control shift a type image texture or of course you can find it in the menu here i click open so navigate into your ocean detail folder and then find the foam texture here we'll just click the first image and click open and then we'll just set this to image sequence and tell it however many frames so 150 in this case and this kind of needs to be mapped the same way as our detail so luckily we named it before here it is detail and i might just grab these two and move them up here grab these guys and move them down just to make life a little bit easier so do something like that because we're going to take this mapping here and plug that in to the vector of our foam because these need to be the same and let's plug this foam straight into the mix into the factor on our mix shader uh one last thing just make sure this base color is turned up to white and let's control space go back into our viewport here and then go into rendered mode and you can see here is our foam and like i mentioned you know you've got unfortunately just a lot of kind of just dots everywhere which are those individual sort of pixels even at this like really high resolution that we've done this foam format you can kind of see the pixelation and stuff like that i might just try and break it up a little bit with some noise just to kind of improve the look of it so let's we'll turn this back off onto solid mode ctrl shift a add a noise texture ctrl t to get a mapping setup and ctrl shift click the noise texture and we'll get a preview of that noise so um we'll go back to rendered mode and in fact what you could do is just go into material preview mode instead um so this will show up at our texture uh the scale because this is based on the entire size of the ocean we want to turn this right up to like 50 000 and so you get a nice kind of very small sort of noise like so i might just give it a bit more detail turn this up to four and control space again let's just pull all this out of the way and let's just create a math node drop that down plug in our foam color into the top the noise texture into the bottom set this to multiply and we'll plug that into our factor but one last thing we'll do as well is just to get a bit more contrast in the noise we can drop down a map range drop it on to you can see the the noodles kind of highlight as i drag it over them so drop it on to the one coming out of the noise texture into the multiply so from minimum to not 0.3 from maximum to not 0.5 and if you ctrl shift click on this to have a look at it you can see it's like you got a bit more contrast here with the black and white and one last thing just to give it a bit more kind of height i'm going to turn this foam into a bit of a bump map as well so you can just drop down a bump node plug in your noise texture uh into the height and so then this normal is going to plug into the normal on our foam let's name this so we know what it is so we want another one of these bumps down here on the ocean itself and we're going to hook in from the multiply node here into height and then that normal is going to go into the normal here of our ocean so we got the foam up here ocean down here we can rename this one as well and so the strength on this bump here we want it to be 0.1 and then the strength up here on this bump here for the foam we want this to be 0.2 and one last thing let's just control shift click on this mix shader just to set it as the default shader again to get rid of that viewer node control space and one more thing we want to turn this boat off in the render so we can just drag across both of these just to turn that off and go into our camera view and let's have a look in rendered mode zoom in a little bit you can see you know it's still a bit better it's not great you still got a lot of dottiness and stuff like that but at least now it's kind of looking a little bit more frothy and then hopefully as you know we're kind of moving over the surface quickly you know you won't notice it too much so one final thing before we hit the render button let's just adjust our render settings so i'd recommend turning on motion blur if you do that you're going to have to probably turn up these render samples a bit maybe something like 5 12 will probably be enough so what that's left to do is just hit that render button and you're all done so that's it for this time thanks for watching uh you know if you like what you see like subscribe all that jazz uh and also i wanted to put out a call to everyone to if there's something you want to see a tutorial you want to see in blender something you're struggling with or whatever please drop a comment down below and i'll look at doing a tutorial for you um also check out my instagram i've been doing a lot of kind of weird artwork i suppose again to try and come up with different ideas for um for tutorials for you guys so please go check that out and give me a follow if you like what you see and i'll catch you next time
Info
Channel: Dylan Neill
Views: 29,744
Rating: undefined out of 5
Keywords:
Id: n8PSS5HqC-Q
Channel Id: undefined
Length: 50min 59sec (3059 seconds)
Published: Sat Aug 14 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.