Tips for Optimizing Game Assets in Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] let's cover some techniques to optimize your game assets using blender we'll reduce memory usage and Computing Resources by doing so you'll be able to get more assets into your environment improve frame rates and have more creative freedom without performance constraints we'll look at topology baking and a bonus tip to get more out of your texture resolution we'll be using blender for this entire process the focus here is on optimizing assets for use in a game engine if you want to learn how to create 3D assets from scratch in blender I recommend CG cookies Press Start asset creation course let's start with our assets topology apology is the geometry and structure of our model while I model I like to keep a few topology tips in mind the first one is to localize Geometry what I mean by that is when I add additional Loops or edges for whatever the reason I try to keep that extra geometry local just to where I need it so this extra Loop for instance I can localize by getting out my knife tool and redirecting the edge flow and dissolving the extra edges with control X the second tip is to dissolve edges that don't contribute to the object silhouette for example I'm to a point where I want to apply one subdivision level on this mesh that's given me some more geometry in areas where I need it in addition to that though it's also given me extra geometry where I don't necessarily need it like these Loops here see how when I dissolve them it doesn't really alter the form or silhouette of the model if you're not sure you can always dissolve and toggle back and forth with undo and redo to see if the dissolved Edge makes a difference in the object's form the third topology tip is to break up the mesh take the TVs antenna for instance we could inset the top of the TV add some extra loops and extrude up into a new cylinder shape that's a lot of new points and edges though just for a simple antenna instead we can leave the top of the TV surface flat and just add in a new cylinder that intersects with it since we don't need to see the bottom of the cylinder we can delete that face we have less geometry now since we didn't try and blend everything together but at a slight cost one the texture space on the top of the TV is not totally utilized now since the antenna covers a section of it too if we get really close up to this intersecting geometry it might look a bit off I'll help counteract that with some ambient occlusion and the texture another example of separating the mesh for optimization is this vent at the back of the TV we want to have a lot of geometry back here but it'd be really challenging to blend from the vent to the main TV body where there's less geometry rather than try to deal with that headache I modeled it as a disconnected mesh not only is this easier but it's actually more realistic too when a manufacturer creates a TV like this they're not molding it out of one solid connected Chunk in reality it's made up of panels and different sections of various materials I should clarify that this can still be one joint object and can still be laid out in a single UV space but the mesh itself doesn't have to be connected at every vertices I hope that makes sense now we've dealt with topology it's time to turn our attention to optimizing textures we'll do that with texture baking I've UV unwrapped our model so everything is laid out in a single UV space different parts of the TV are made up of different materials while it's all right to texture with a number of different materials we want to simplify this down to one single set of baked Maps one single material will be less draw calls or less for the engine to think about when it's displaying our asset to texture I used a procedural method which is amazing to use but it's slow to render in real time and can't be exported out of blender to a game engine so we'll convert these multiple procedural materials to one single baked material baking takes all of our ingredients in this case nodes and outputs an image of the final result it's important to note that texture baking for game assets should take place after triangulation this is just a good safe practice as it ensures all of our polygons are triangulated in a controlled and predictable manner preventing vertex normals from being changed down the road so let's add a triangulate modifier and for good measure apply it if you're worried about this destructive step you can always duplicate your object and store the backup in a disabled collection to bake into one image naturally we need to add that one image now we have it we need to tell it how big this image should be I'll go ahead and make this a standard 4K map if you don't know that's 4096 pixels in each Dimension to keep things organized let's call this TV 4K base color since we want to bake the base color of all of our materials down to one single map we'll copy this image with Ctrl C and go to each material and paste it with Ctrl V when you paste the image in the next material you'll see a little number two next to the title anytime you see this in blender it's telling us that there are two users using one data set in this case there are two node networks using the same image this shared image system is how we're going to bake multiple materials into one image when we paste it again we can see it's now used by three places and so on so changes we make to one image will transfer to all of them now blender's baking system is selection sensitive so select the object we're baking the TV then in each material we need to specify what information we're baking what we can do with blender's node Wrangler add-on enabled is press Ctrl shift left click to solo a particular section of the node Network all that does is plugs that channel straight into the material output so we're just looking at the base color emitting from the object and nothing else let's solo the base color on each material so we have our object selected we have our base color information isolated now all we need to do is select the image we're baking to that's just the 4K image we created in the render properties now under the bake section set the bake type to emit we're doing that because we isolated the base color we wanted by plugging it straight into the surface output it's as if it's emitting that information so we'll bake the emit value now press bake our new baked image shows up just like a rendering in our image viewer this little star here is letting us know this image hasn't been saved yet to save it just go to image and save and choose a location this is also where you can choose the file type and the bit depth compression level and all of that good stuff for optimization I'll keep mine at 8-bit and save the image repeat this exact process for baking a normal map but instead of emit we'll actually set that bake type to normal now for our last baking optimization color Maps like the base color and normal Maps use all three red green and blue channels single Channel Maps use just one channel and can be represented in a range from black to white some examples of single Channel maps are the metallic map roughness and ambient occlusion to save on the number of maps we have a common trick in game development is something called Channel packing in Channel packing we take three single Channel maps and pack them into the red green and blue channels of a color image to do that we'll simply add a new node in each material called combined color as we can see it receives three single Channel maps and outputs one color map so solo out that node with Ctrl shift left click nothing's plugged into it yet so it should just be black for the red Channel let's plug in our materials metallic value for green let's grab the roughness and for blue go ahead and drop in the ambient occlusion do this for each of the materials this is just like we did when we baked the base color map our new map is called Channel Pack set the bake type to Emit and we're ready to go don't forget to save the image after it's been baked my last optimization tip is pretty simple but often overlooked let's open up blender's compositor check use nodes and let's take the base color map we just baked and drop it in make sure your output resolution is set to the map resolution 4096 by 4096 and the scene's color management is just set to standard we don't want to apply a color transform like filmic since our map is already baked now before the output let's slide in a filter node set that filter to Diamond sharpen the default value of one can be pretty intense so just eyeball something that gives your map a bit more of a crispy Edge without looking overly sharp I'm showing you this because oftentimes a bit of sharpening though a simple step can help you get away with lower resolution maps for example on the left we have a 4K image without sharpening and on the right we have a 2K image with sharpening amazing how a 2K image can be lower resolution but appear to be higher resolution than an unsharpened 4K image use this tip with care but it's a good one to keep in mind and that's it for my game asset optimization tips here's our final asset in blender but of course we built this with the intention of bringing it into a game engine which it's fully set up to do now if you want to use the channel packed textures we created in blender you can just use a separate color note remember metallic was red roughness green and ambient occlusion blue blender is a powerful tool there's always more to cover especially as development continues so make sure to subscribe here on CG cookie for more I'm Riley Brown and this has been three ways to optimize your game assets using blender thanks for watching and I hope to see you on a future video [Music]
Info
Channel: CG Cookie
Views: 112,686
Rating: undefined out of 5
Keywords: Blender tutorial, learn blender, CG Cookie, blender beginner, Optimizing Game Assets, game assets in blender, blender game assets, normal map baking, topology for games
Id: jFE6KhNKg8A
Channel Id: undefined
Length: 10min 27sec (627 seconds)
Published: Tue Aug 08 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.