Ambient Occlusion (AO) and Texture Baking Tutorial text version - Kizari/Flagrum GitHub Wiki
Flagrum mods allow you to use _o textures for baked ambient occlusion. Ambient Occlusion aka AO is, in short, shading that occurs where two objects are very close to each other. It essentially lets us calculate how the model will throw shade on itself ahead of time, so that it doesn’t have to be rendered in real time in game. After all, this type of shading will never change.
Here we have a mod that I’ve made from scratch, so I don’t have an _o texture for it yet.
As you can see, the Occlusion0_Texture input of the material is empty. This is where our _o texture, which is the naming convention FFXV uses for baked AO textures, will go.
First we need to make sure that we have a lightmap UV. Swap over to the UV Editing tab. Make sure your .blend file was made with Blender 2.84 or newer, otherwise the UV Editing tab will in fact open the image editor. It’s because these used to be the same thing before getting separated.
You’ll find the UV Editing tab up top. If it’s not there, click the + sign to the right of the tab list and add it.
As you can see, I have two UV sets. The first is for the majority of the textures, and the second, marked LM, is the lightmap. The difference between the two is that the main UV layout allows for multiple parts of the mesh to share UV space. If things are symmetrical, for example, or when something has two sides, outer and inner, you will often have them share the same part of the texture. That’s not allowed for lightmap UVs. Every bit of the mesh needs to have its own UV space.
Sometimes, depending on how the existing UVs are laid out, you can make your lightmap UV by just clicking „Pack Islands” on them. If it doesn’t make every piece of the mesh get its own unique place though, you will have to unwrap the mesh again by hand.
As we’re going to be rendering to the lightmap, make sure it’s selected for rendering like so:
Now we move on to the Shading tab. Find it the same way you got to the UV Editing one.
As you can see I am starting with no materials on my model. Pressing +New will make a Principled shader appear like so:
With your cursor above the node editor area, press shift+a, then add a new Image Texture
Place the new node anywhere, but do not connect it to anything. Now, we will add a new texture file by pressing the New button
Adding a texture opens up this dialog. Name it however you like, and set it up like I did here. I like to bake my AO textures at a high resolution such as 4K, and then edit them to be smaller. You should be able to get all the details you need at 1k, maybe 2k for textures that encompass a whole outfit mesh.
Once added, the texture will look like this. The only setting I changed on it was Color Space. Non-Color is the proper one, although it won’t really matter if you leave this at sRGB.
Make sure your texture node is selected - see the white outline around it, and that it’s the ONLY thing that’s selected.
Our next destination is the Rendering tab. Again, you can open it up with the + if it’s not already there for you.
Press the dropdown button I highlighted here to open the list of textures in your Blend file. Then pick the texture you just made.
It should look something like this, solid black as we haven’t baked anything to it yet.
Now you need to make sure you’re on the Cycles render engine. You will find the setting for it to the top right of the screen.
Whether you should render on the CPU or GPU depends on your hardware. If one of those is significantly stronger, pick that.
AO requires a fairly high sample count, I like to go with 1024. If your machine is weaker, you can set it to something like 256 and turn Denoise on. It’s also always a good idea to try a very low sample count first just to make sure everything is working as intended, before you commit to a long render time for the final bake.
A few widgets below that you will find the Bake settings. Just copy the ones from this screenshot.
Once you’re done, press the Bake button at the top.
When the bake has started you will see a progress bar at the bottom of the window. Hovering your cursor over it will give you an estimate for how long the bake will take. This is likely to be around 10-30 minutes, depending on your hardware, sample count, texture size and amount of meshes in the scene.
Once the bake has finished, you must save your texture from the Image menu or by pressing F3.