Join Craig Barr for an in-depth discussion in this video Optimizing textures and materials for VR, part of Virtual & Augmented Reality for 3D Weekly.
- [Narrator] Let's take a look at a few tips for optimizing textures and materials for virtual reality projects and workflows. Some of the basic ones that we want to keep in mind when we're building a project for virtual reality is to keep our materials overall light. And what I mean by that is keep them simple. Keep them basic. And that may be that it is a basic material with something like a diffuse or a normal map or whatever texture's plugged into it. That's a simple, more basic material setup.
Really what we want to do here is avoid costly expressions or functions, things that can really bog down any kind of calculation or add to the overall project in calculations of what's happening with those materials. So, keep them light. If you need to use some expressions, try to adhere to the real basic ones, things like add, subtract, multiply. Those are really simple expressions that don't bog down the overall cost or overall calculation of things within a scene.
As well, we want to avoid transparency as best we can. Now, I know that that's not possible all the time. Sometimes it may be a bit of a change in the design plan overall to do this, but transparency can be very expensive. If you think about the basics of what's happening with transparency, if you have an opaque object, there is the object that it sees, is the opaque object. But if that object is transparent, it has to calculate and draw that object as transparent and every other object that it sees through that object behind that object that happens to be transparent.
And it gets more complicated if you have objects that are also transparent behind that transparent object. So, do yourself a favor and try to keep things opaque. Avoid transparency the best you can, and you'll really be able to save a lot within your scene there as well. Another plain and simple thing here when it comes to optimizing textures and materials for VR workflows, work high and save low. What I mean there is working high when it comes to textures. So, work in big, high resolutions, bigger than you need, really, so you can get all that detail you need in there and take advantage of all the great image editing tools out there to create the art that you want.
But then of course, you have the ability to save a lower, smaller resolution or smaller file size when you need to do that. And as well, what we want to do is keep the textures to the power of two. Well, what is that? The power of two is simply the same number in the X and Y or the same number that you would see in both dimensions, so, for example, a 1024 by 1024 texture or 2048 by 2048 or a 4K map at 4096 by 4096.
This is something that game engines are built to calculate quickly and efficiently and very easily. Doing something like a 1024 by 2048 texture, for example, can cause issues. Or if you get into really weird math like something that doesn't equate, something that is off, 600 by 492 or something. This is where you can get into issues of bogging down calculations when it comes to textures and the materials that utilize those textures.
So, keep that in mind. Work with the power of two all the time. Sounds simple, but there are times where the textures are not and it creates problems overall in the VR setup. Working with different formats, things like a PNG, for example. This is a really good format to work with. It's high resolution, supports an alpha channel, and it saves as a good size as well. And what I mean by a good size is it's quite efficient in the way it packs up. It's not huge or bloated or overall quite big.
So PNG is a really excellent option when it comes to preserving the quality that you need and if you need an alpha map in there or an alpha channel in there. But you also want to keep in mind the overall size. All of these textures can get quite large. So, keeping in mind the size of the textures, the file sizes, is always something that's a good practice. Speaking on file size and overall quality, TGA can provide excellent quality. High resolution, it supports an alpha channel. But often the file sizes can get very large.
So this is where PNG, I think, has an advantage over it, although you'll see TGA used quite often still in a lot of workflows. Something to avoid is stay away from things that are already compressed, things like JPG, for example. There's no sense in working with something that's compressed where you have the ability and the power of a game engine, something like Unity or Unreal where it can take care of the compression for you. It can also take care of the actual resolution of the texture for you.
So, avoid using compressed texture formats. Let the engine compress for you. Have your high resolution image and bring it in and let the engine use its compression algorithms to compress and bring those textures down to something that's optimized for that engine. Unity, for example, utilizes its own compression system much like Unreal would as well. So if you're working with nice high resolution textures, yeah, it might bog up the directory a bit of where you're storing those, but you can utilize the compression factor of the engine to optimize that texture in file size and resolution for your virtual reality project.
So there's some quick, simple tips and tricks for keeping in mind things for textures and materials when you're working on your virtual reality projects.
Skill Level Intermediate
Q: Why can't I earn a Certificate of Completion for this course?
A: We publish a new tutorial or tutorials for this course on a regular basis. We are unable to offer a Certificate of Completion because it is an ever-evolving course that is not designed to be completed. Check back often for new movies.