Thursday, August 23, 2018

Simple Performance Tricks Anyone Can Do When Building

Two Three Simple Tips to Increase FPS and Reduce Lag in a Sim.


A lot of the tips I give on building and optimization can get a bit technical but I wanted to share two simple tricks anyone with even the most basic modding skills can do to make a sim where people can enjoy higher framerates and less lag.

1. Turn all alpha textures from "blended" to "masked".


Use ctrl+alt+t to reveal all objects in a scene with alpha textures. As long as you have Advanced Lighting Model (Aka: ALM or Deferred Rendering) enabled, "blended" alpha textures show up red, "masked" alpha textures show up blue. If you have ALM off, all alpha textures just show up red, which makes it harder to tell masked from blended at a glance, but you can still use this trick. (It's just a little more work!)


As you can see in this example, even a lot of the solid building walls with no windows or anything have an unused alpha channel and it was left in blended mode. Blended is a big strain on rendering, simply getting rid of all of the blended alpha, save a few water and light effects, will result in a noticeable FPS increase on most computers. Plus, most of the texture glitches people experience in SL, from weird lighting behaviour to the infamous "alpha sorting bug" are all due to blended alpha. Get rid of the blended alpha and you get rid of the bugs.

How do you do this? Simply edit the object, selecting the appropriate faces if necessary, and in the Texture tab change "Alpha Blending" to "Alpha Masking".


This will turn your texture completely solid, but don't panic, all you need to do is change the "Mask Cutoff" from 0 to 100, then increase or decrease the cutoff value until the texture looks how you like it. For most textures like those in the example, you can usually just leave it at 100, it's only those with feathered edges where you may need to mess with the cutoff value to get the best result.


2. Put building interiors into skyboxes.

Often, most of the detail in a sim is in the building interiors. Whether you're talking castles, office buildings, or people's homes.


Do you really need to see all of that from the sidewalk? Move it to a skybox placed well out of draw distance and you've greatly reduced the amount of content your visitors need to render all at once.

How do people get inside the building?

 Simply put a teleporter inside the door. If you have a premium account you can create a sim experience so that people can open a door and walk right in to instantly, almost seamlessly, transition to the building interior. Don't have access to an experience? The "Anywhere Door" from Curio Obscura is a popular alternative predating experiences.

You can find lots of building facades on the marketplace, too. From fantasy to urban to sci-fi. They're often very light on Land Impact. Otherwise you can use the buildings you have now, simply set the windows from blended to "no alpha" and instead make them shiny and reflective. Using skyboxes for building interiors also makes building a sim a lot easier, as you're no longer constrained by the ground level landscape, or even the exterior size and shape of your building. This allows you to be a lot more creative.

And, of course, there's room for exceptions. The rare foyer or small building that is open to the outside world can remain and you've still managed to move most of the sim's content out of draw distance, making your sim load and render much faster.

Does putting interiors into skyboxes mean I need to rez two copies of every building?

Not necessarily. Here are two ways I approach it:


  • Use a faux exterior building (a building with no insides), these are usually very light on LI. Then I build the skybox independent of the exterior. Either from scratch or using skyboxes I find on the marketplace. Sometimes I use multiple skyboxes and link them via door teleporters.
  • Use a building constructed so that you can basically take it apart. Some buildings will let you remove a significant amount of exterior/interior, allowing you to rez a ground version and a skybox version of the same building at a reduced LI cost.
The first option is easier, I think, so I'd suggest that to most people. But the latter option allows you to utilize buildings you may already have.


Some of us want to be able to see our neighbors, landscape, roads, etc when we look outside our windows!

Fair enough. The reality is nothing is free, you pay not only with your framerates, but the framerates of everyone around you. So keep that in mind. However, this does not mean you can never enjoy a good landscape view from inside your home!

You can have a foyer or even a room with an exterior deck that are at ground level, with the rest of the building interior in skyboxes. And certain types of buildings you may want entirely on ground level (like a small gas station or coffee shop with indoor and outdoor seating). The idea is that the majority of the sim's building interiors are separated to their own skyboxes so that the sim as a whole is easier to load and render.

For those skybox interiors I sometimes just turn the interior windows solid and apply a glow to suggest lighting coming in from outside. (Projected lights from one direction of windows can add a lot of ambience to a room!) Other times I create a tiny window diorama, which can be as simple as a screenshot applied to a curved face (like the inside of half a hollow cylinder) that extends past the window enough that you can't see the edges from inside, or as detailed as a surrounding landscape object around the skybox and set it up to look similar to the actual surroundings, just simplified and often using forced perspective tricks.

 Penny! Bad builder cow! You forgot a super easy tip!

I did, I'm sorry! Here's one more!

3. Set Physics to "None" on objects that don't need physics!


 Ok, so a good build needs physics, otherwise your visitors will fall through the floor! But not everything in a build needs physics!


Here's a great example! A shelf full of decorative beverage bottles in a club/bar scene. The shelf itself is physical, so you can't walk through it, but the bottles on the shelves have physics set to "None" to save sim resources. This means the sim has to do fewer physics calculations. Where it's most helpful is items on the floor/ground. Tiny stones, small plants, a stray pizza box or pile of clothing, set objects like these to have no physics and you'll see less lag in your sim.*

 *If you're sharing a sim with others your mileage may vary. I have a mainland spot, too, and I know how bad things can get if your neighbors aren't aware of how their resource use is affecting everyone else in the sim! But this kind of lag reduction has to start somewhere! Do it with your own builds and share the tips from this article with others!

 Keep in mind, these suggestions aren't hard rules you must follow at all times, just guidelines to help make a sim better for yourself and everyone else who lives in, or visits the sim.

The important thing, as always, is to have fun. Happy building, everyone!