Difference between revisions of "Texture Usage"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "We've all experienced it, dragging lag in texture heavy virtual environments. It's no fun, and any good developer wants to carefully balance a great looking build with a quick l…")
 
Line 1: Line 1:
We've all experienced it, dragging lag in texture heavy virtual environments.  It's no fun, and any good developer wants to carefully balance a great looking build with a quick load time.  
We've all experienced it, dragging lag in texture heavy virtual environments.  It's no fun, and any good developer wants to carefully balance a great looking build with a quick load time.  
*[[Texture sizes]] broken down into actual file size.
*[[Texture sizes]] broken down into actual file size.
Keep in mind that your average Second Life user has between 128MB to 256MB of memory on their video card.  You can see that it won't take much to fill that up if you toss a bunch of large textures onto your builds.  Bottom line is, you want to use the smallest texture possible.
Transparency:  Believe it or not, a clear texture causes a hit on the viewer also.  There are two things you can do to keep this to a minimum.  Create your own transparent texture to use- the free transparent textures available in Second Life are generally 256 x 256 pixels but you can upload one that is 8 x 8 to use instead.  Simply create a new texture of 8 x 8 pixels in your graphics application, and save it with nothing else added (as a 32-bit .tga or a .png).  You now have a transparent texture that should only use 256 Bytes of memory as opposed to the 256 x 256 transparent texture available free in world that will use 256KB of memory.
The other option is to script in transparency, rather than using a texture.  Create a new empty script in your inventory, and add this to it:
<lsl>
default
{
state_entry()
{
llSetTexture("e97cf410-8e61-7005-ec06-629eba4cd1fb", ALL_SIDES);
}
}
</lsl>
Save it, then add it to the prim you want transparent.  You can then remove the script, and your prim will remain invisible.  Be warned however, that this still adds a memory hit to your build.
If you're interested in seeing just exactly what's going on behind the scenes when you teleport into an area, hit ctl+shift+3 which will open up the texture console and you can watch the textures around you being loaded into your viewer.  Hit ctl+shift+3 again to close it.

Revision as of 12:47, 9 April 2012

We've all experienced it, dragging lag in texture heavy virtual environments. It's no fun, and any good developer wants to carefully balance a great looking build with a quick load time.

Keep in mind that your average Second Life user has between 128MB to 256MB of memory on their video card. You can see that it won't take much to fill that up if you toss a bunch of large textures onto your builds. Bottom line is, you want to use the smallest texture possible. Transparency: Believe it or not, a clear texture causes a hit on the viewer also. There are two things you can do to keep this to a minimum. Create your own transparent texture to use- the free transparent textures available in Second Life are generally 256 x 256 pixels but you can upload one that is 8 x 8 to use instead. Simply create a new texture of 8 x 8 pixels in your graphics application, and save it with nothing else added (as a 32-bit .tga or a .png). You now have a transparent texture that should only use 256 Bytes of memory as opposed to the 256 x 256 transparent texture available free in world that will use 256KB of memory.

The other option is to script in transparency, rather than using a texture. Create a new empty script in your inventory, and add this to it: <lsl> default { state_entry() { llSetTexture("e97cf410-8e61-7005-ec06-629eba4cd1fb", ALL_SIDES); }

} </lsl>

Save it, then add it to the prim you want transparent. You can then remove the script, and your prim will remain invisible. Be warned however, that this still adds a memory hit to your build.

If you're interested in seeing just exactly what's going on behind the scenes when you teleport into an area, hit ctl+shift+3 which will open up the texture console and you can watch the textures around you being loaded into your viewer. Hit ctl+shift+3 again to close it.